Skip to content

Commit

Permalink
Merge pull request firemodels#1911 from gforney/master
Browse files Browse the repository at this point in the history
improvements to 'u' shortcut , take out fed computations
  • Loading branch information
gforney authored May 21, 2024
2 parents c391dd6 + d5a6683 commit 54d70af
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 99 deletions.
8 changes: 4 additions & 4 deletions Manuals/SMV_User_Guide/SMV_User_Guide.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
\documentclass[11pt,twoside]{book}

\newcommand{\feda}{\input smv_ug_fed1.tex}
\newcommand{\fedb}{\input smv_ug_fed2.tex}
%\newcommand{\feda}{}
%\newcommand{\fedb}{}
%\newcommand{\feda}{\input smv_ug_fed1.tex}
%\newcommand{\fedb}{\input smv_ug_fed2.tex}
\newcommand{\feda}{}
\newcommand{\fedb}{}

\newcommand{\utilchap}{\section}
\newcommand{\utilsect}{\subsection}
Expand Down
15 changes: 9 additions & 6 deletions Manuals/SMV_Verification_Guide/SMV_Verification_Guide.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
\documentclass[11pt,twoside]{book}

\newcommand{\feda}{\input smv_vg_fed1.tex}
%\newcommand{\feda}{}
%\newcommand{\feda}{\input smv_vg_fed1.tex}
%\newcommand{\fedb}{\section{fed\_test}\fdsinput{fed_test.fds}}
%\newcommand{\fedc}{\section{fed\_test}\fdsinput{fed_test.ssf}}
\newcommand{\feda}{}
\newcommand{\fedb}{}
\newcommand{\fedc}{}


\UseRawInputEncoding

Expand Down Expand Up @@ -1714,8 +1719,7 @@ \section{colorconv}
\label{FDScolorconv}
\fdsinput{colorconv.fds}

\section{fed\_test}
\fdsinput{fed_test.fds}
\fedb

\section{plume5c}
\label{FDSplume5c}
Expand Down Expand Up @@ -1760,8 +1764,7 @@ \section{colorconv}
\label{SSFcolorconv}
\fdsinput{colorconv.ssf}

\section{fed\_test}
\fdsinput{fed_test.ssf}
\fedc

\section{plume5c}
\label{SSFplume5c}
Expand Down
12 changes: 10 additions & 2 deletions Source/smokeview/getdatabounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,16 @@ void BoundsUpdateSetup(int file_type){
char **sorted_filenames;

ninfo = GetNinfo(file_type);
globalboundsinfo = GetGlobalBoundsinfo(file_type);
sorted_filenames = GetSortedFilenames(file_type);
if(file_type == BOUND_PLOT3D){
FREEMEMORY(plot3dglobalboundsinfo);
FREEMEMORY(sorted_plot3d_filenames);
globalboundsinfo = NULL;
sorted_filenames = NULL;
}
else{
globalboundsinfo = GetGlobalBoundsinfo(file_type);
sorted_filenames = GetSortedFilenames(file_type);
}

if(sorted_filenames == NULL){
NewMemory((void **)&sorted_filenames, ninfo * sizeof(char *));
Expand Down
24 changes: 12 additions & 12 deletions Source/smokeview/glui_bounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ void bounds_dialog::CB(int var){

// quantity radio button
case BOUND_VAL_TYPE:
if(all_boundsi == NULL)break;
if(all_bounds == NULL)break;
valtype_save = bounds.set_valtype;
memcpy(&bounds, all_boundsi, sizeof(cpp_boundsdata));
bounds.set_valtype = valtype_save;
Expand Down Expand Up @@ -819,7 +819,7 @@ void bounds_dialog::CB(int var){
case BOUND_VALMIN:
bounds.valmin[BOUND_SET_MIN] = bounds.glui_valmin;
bounds.set_valmin = BOUND_SET_MIN;
memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(all_bounds != NULL)memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(RADIO_set_valmin!=NULL)RADIO_set_valmin->set_int_val(BOUND_SET_MIN);
if(InResearchMode()!=research_mode_cpp){
SetResearchMode(1-research_mode_cpp);
Expand All @@ -828,7 +828,7 @@ void bounds_dialog::CB(int var){
case BOUND_VALMAX:
bounds.valmax[BOUND_SET_MAX] = bounds.glui_valmax;
bounds.set_valmax = BOUND_SET_MAX;
memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(all_bounds != NULL)memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(RADIO_set_valmax!=NULL)RADIO_set_valmax->set_int_val(BOUND_SET_MAX);
if(InResearchMode()!=research_mode_cpp){
SetResearchMode(1-research_mode_cpp);
Expand All @@ -837,17 +837,17 @@ void bounds_dialog::CB(int var){

// min/max radio buttons
case BOUND_SETVALMIN:
bounds.glui_valmin = all_boundsi->valmin[bounds.set_valmin];
if(all_bounds != NULL)bounds.glui_valmin = all_boundsi->valmin[bounds.set_valmin];
if(EDIT_valmin!=NULL)EDIT_valmin->set_float_val(bounds.glui_valmin);
memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(all_bounds != NULL)memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(InResearchMode()!=research_mode_cpp){
SetResearchMode(1-research_mode_cpp);
}
break;
case BOUND_SETVALMAX:
bounds.glui_valmax = all_boundsi->valmax[bounds.set_valmax];
if(all_bounds != NULL)bounds.glui_valmax = all_boundsi->valmax[bounds.set_valmax];
if(EDIT_valmax!=NULL)EDIT_valmax->set_float_val(bounds.glui_valmax);
memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(all_bounds != NULL)memcpy(all_boundsi, &bounds, sizeof(cpp_boundsdata));
if(InResearchMode()!=research_mode_cpp){
SetResearchMode(1-research_mode_cpp);
}
Expand All @@ -873,15 +873,15 @@ void bounds_dialog::CB(int var){

// chop dialog boxes
case BOUND_CHOPMIN:
all_boundsi->chopmin = bounds.chopmin;
if(all_bounds != NULL)all_boundsi->chopmin = bounds.chopmin;
update_chop_colors = 1;
break;
case BOUND_CHOPMAX:
all_boundsi->chopmax = bounds.chopmax;
if(all_bounds != NULL)all_boundsi->chopmax = bounds.chopmax;
update_chop_colors = 1;
break;
case BOUND_SETCHOPMIN:
all_boundsi->set_chopmin = bounds.set_chopmin;
if(all_bounds != NULL)all_boundsi->set_chopmin = bounds.set_chopmin;
if(EDIT_chopmin!=NULL){
if(bounds.set_chopmin==1){
EDIT_chopmin->enable();
Expand All @@ -893,7 +893,7 @@ void bounds_dialog::CB(int var){
update_chop_colors = 1;
break;
case BOUND_SETCHOPMAX:
all_boundsi->set_chopmax = bounds.set_chopmax;
if(all_bounds != NULL)all_boundsi->set_chopmax = bounds.set_chopmax;
if(EDIT_chopmax!=NULL){
if(bounds.set_chopmax==1){
EDIT_chopmax->enable();
Expand All @@ -907,7 +907,7 @@ void bounds_dialog::CB(int var){

// keep data checkbox
case BOUND_CACHE_DATA:
{
if(all_bounds != NULL){
int i;

for(i = 0; i<nall_bounds; i++){
Expand Down
9 changes: 8 additions & 1 deletion Source/smokeview/lua_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3384,6 +3384,7 @@ int LuaSetBoundzipstep(lua_State *L) {
return 1;
}

#ifdef pp_FED
int LuaSetFed(lua_State *L) {
int v = lua_tonumber(L, 1);
int return_code = SetFed(v);
Expand All @@ -3397,7 +3398,7 @@ int LuaSetFedcolorbar(lua_State *L) {
lua_pushnumber(L, return_code);
return 1;
}

#endif
int LuaSetIsozipstep(lua_State *L) {
int v = lua_tonumber(L, 1);
int return_code = SetIsozipstep(v);
Expand All @@ -3412,12 +3413,14 @@ int LuaSetNopart(lua_State *L) {
return 1;
}

#ifdef pp_FED
int LuaSetShowfedarea(lua_State *L) {
int v = lua_tonumber(L, 1);
int return_code = SetShowfedarea(v);
lua_pushnumber(L, return_code);
return 1;
}
#endif

int LuaSetSliceaverage(lua_State *L) {
int flag = lua_tonumber(L, 1);
Expand Down Expand Up @@ -5352,11 +5355,15 @@ static luaL_Reg const SMVLIB[] = {
{"set_windowheight", LuaSetWindowheight},

{"set_boundzipstep", LuaSetBoundzipstep},
#ifdef pp_FED
{"set_fed", LuaSetFed},
{"set_fedcolorbar", LuaSetFedcolorbar},
#endif
{"set_isozipstep", LuaSetIsozipstep},
{"set_nopart", LuaSetNopart},
#ifdef pp_FED
{"set_showfedarea", LuaSetShowfedarea},
#endif
{"set_sliceaverage", LuaSetSliceaverage},
{"set_slicedataout", LuaSetSlicedataout},
{"set_slicezipstep", LuaSetSlicezipstep},
Expand Down
8 changes: 5 additions & 3 deletions Source/smokeview/menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -3510,8 +3510,10 @@ void LoadUnloadMenu(int value){
break;
}
}
int plot3d_loaded = 0;
for(i=0;i<nplot3dinfo;i++){
if(plot3dinfo[i].loaded==1){
plot3d_loaded = 1;
ReadPlot3D(plot3dinfo[i].file,i,LOAD,&errorcode);
}
}
Expand Down Expand Up @@ -3574,9 +3576,9 @@ void LoadUnloadMenu(int value){
}
if(update_readiso_geom_wrapup == UPDATE_ISO_ALL_NOW)ReadIsoGeomWrapup(BACKGROUND);
update_readiso_geom_wrapup = UPDATE_ISO_OFF;
UpdateSMVDynamic(smv_filename);
// plotstate=DYNAMIC_PLOTS;
// visParticles=1;

// reload .smv file only if a plot3d file is loaded
if(plot3d_loaded==1)UpdateSMVDynamic(smv_filename);

//*** reload csv data

Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define pp_SELECT_PART // option to select a particle and show its tag
//#define pp_PARTBOUND_MULTI // compute particle bounds in the background
//#define pp_LUA // turn on LUA option
#define pp_FED // used to isolate fed code
//#define pp_FED // used to isolate fed code
#define pp_SLICE_MULTI // load slice files in parallel
//#define pp_SMOKE_MULTI // load 3d smoke in parallel
//#define pp_SMOKE16 // load 16 bit smoke files
Expand Down
4 changes: 4 additions & 0 deletions Source/smokeview/readsmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,11 +1182,15 @@ ventdata *GetCloseVent(meshdata *ventmesh, int ivent){
/// @brief Re-read an *.smv file to read any updates.
/// @param file The path to the *.smv file.
void UpdateSMVDynamic(char *file){
INIT_PRINT_TIMER(smv_timer1);
ReadSMVDynamic(file);
PRINT_TIMER(smv_timer1, "ReadSMVDynamic");
INIT_PRINT_TIMER(smv_timer2);
UpdatePlot3dMenuLabels();
InitPlot3dTimeList();
UpdateTimes();
GetGlobalPlot3DBounds();
PRINT_TIMER(smv_timer2, "UpdateSMVDynamic wrapup");
}
/* ------------------ ReadSMVDynamic ------------------------ */

Expand Down
2 changes: 2 additions & 0 deletions Source/smvq/smvq.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ int SetGlobalFilenames(const char *fdsprefix) {
STRCAT(ffmpeg_command_filename, ".sh");
#endif
}
#ifdef pp_FED
if (fed_filename == NULL) {
STRCPY(fed_filename_base, fdsprefix);
STRCAT(fed_filename_base, ".fed_smv");
fed_filename =
GetFileName(smokeview_scratchdir, fed_filename_base, NOT_FORCE_IN_DIR);
}
#endif
if (stop_filename == NULL) {
NewMemory((void **)&stop_filename,
(unsigned int)(len_casename + strlen(".stop") + 1));
Expand Down
4 changes: 2 additions & 2 deletions Utilities/Scripts/startXserver.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
lockfile=/tmp/startXlock
PAUSE=1
XVFB=Xvfb
GETNEWPORT ()
{
while [ -e $lockfile ] ; do
Expand All @@ -17,9 +19,7 @@ GETNEWPORT ()
}

if [ "`uname`" != "Darwin" ]; then
PAUSE=1
echo "setting up graphics environment (pausing $PAUSE s)"
XVFB=Xvfb
GETNEWPORT
$XVFB :$display_port -fp /usr/share/X11/fonts/misc -screen 0 1280x1024x24 &
export SMV_ID=$!
Expand Down
62 changes: 0 additions & 62 deletions Verification/Visualization/thouse5.ssf
Original file line number Diff line number Diff line change
Expand Up @@ -562,68 +562,6 @@ PLOT3DPROPS
RENDERONCE
thouse5_plot3d_iso2

// render fed iso file

LABEL
render fed iso file

UNLOADALL
LOADINIFILE
thouse5.ini
LOADISO
Fractional effective dose: 0.3, 1.0, 3.0
SETVIEWPOINT
external
SETTIMEVAL
5.000000
RENDERONCE
thouse5_fed_iso_005
SETTIMEVAL
10.000000
RENDERONCE
thouse5_fed_iso_010
SETTIMEVAL
30.000000
RENDERONCE
thouse5_fed_iso_030
SETTIMEVAL
60.000000
RENDERONCE
thouse5_fed_iso_060
LOADINIFILE
thouse5.ini

// render fed slice file

LABEL
render fed slice file

UNLOADALL
LOADINIFILE
thouse5_fed.ini
SCENECLIP
1
LOADSLCF
PBY=1.6 QUANTITY='Fractional effective dose'
SETTIMEVAL
5.0
SETVIEWPOINT
upy
RENDERONCE
thouse5_fed_z1p5_slice_005
SETTIMEVAL
10.000000
RENDERONCE
thouse5_fed_z1p5_slice_010
SETTIMEVAL
30.000000
RENDERONCE
thouse5_fed_z1p5_slice_030
SETTIMEVAL
60.000000
RENDERONCE
thouse5_fed_z1p5_slice_060

// render chopped slice file (ceiling jet)

LABEL
Expand Down
5 changes: 0 additions & 5 deletions Verification/scripts/LITE_Cases.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#!/bin/bash
FED=1

$QFDS -d Visualization plume5c.fds
$QFDS -p 2 -d Visualization thouse5.fds
$QFDS -d Visualization cell_test.fds
if [ "$FED" != "" ]; then
$QFDS -d Visualization fed_test.fds
fi
$QFDS -d Visualization smokex010.fds
$QFDS -d Visualization smokex020.fds
$QFDS -d Visualization smokex040.fds
Expand Down
1 change: 0 additions & 1 deletion Verification/scripts/SMV_Cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $QFDS -d Visualization colorbar.fds
$QFDS -d Visualization colorbar2.fds
$QFDS -d Visualization colorconv.fds
$QFDS -d Visualization color_geom.fds
$QFDS -d Visualization fed_test.fds
$QFDS -d Visualization hvac_comp.fds
$QFDS -d Visualization -p 8 -n 8 mplume5c8.fds
$QFDS -d Visualization objects_dynamic.fds
Expand Down

0 comments on commit 54d70af

Please sign in to comment.