Skip to content

Commit 4e5eb91

Browse files
authored
Merge pull request #2604 from gforney/smoke
force update of smoke/fire opacities after a files are loaded
2 parents e69be0a + d307a00 commit 4e5eb91

8 files changed

Lines changed: 167 additions & 22 deletions

File tree

Source/smokeview/IOsmoke.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,7 @@ void SmokeWrapup(void){
19211921
smoke_render_option = RENDER_SLICE;
19221922
have_fire = HaveFireLoaded();
19231923
have_smoke = HaveSootLoaded();
1924+
update_smoke_opacity = 1;
19241925
ForceIdle();
19251926
}
19261927

Source/smokeview/smokeviewvars.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ SVEXTERN int SVDECL(agl_offset_actual, 1);
216216
SVEXTERN int SVDECL(texture_showall, 0);
217217
SVEXTERN int SVDECL(texture_hideall, 0);
218218
SVEXTERN int SVDECL(force_gray_smoke, 1);
219+
SVEXTERN int SVDECL(update_smoke_opacity, 0);
219220
SVEXTERN int SVDECL(verbose_output, 0);
220221
SVEXTERN float SVDECL(glui_mass_extinct,8700.0), SVDECL(glui_mass_extinct_save,8700.0);
221222
SVEXTERN float glui_mass_extinct_default;

Source/smokeview/update.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,10 @@ void UpdateShowScene(void){
20432043
GLUIDeviceCB(DEVICE_TIMEAVERAGE);
20442044
END_SHOW_UPDATE(update_device_timeaverage);
20452045
}
2046+
if(update_smoke_opacity == 1){
2047+
update_smoke_opacity = 0;
2048+
GLUISmoke3dCB(FIRE_HALFDEPTH);
2049+
}
20462050
if(global_scase.update_smoke_alphas==1){
20472051
SHOW_UPDATE(update_smoke_alphas);
20482052
global_scase.update_smoke_alphas = 0;

Verification/scripts/FDS_Cases.bat

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
@echo off
2+
set exe=%1
3+
set option=%2
4+
setlocal
5+
6+
cd ..\..\..\fds\Verification
7+
set verdir=%CD%
8+
9+
cd ..\..\smv\Verification
10+
set smvverdir=%CD%
11+
12+
cd %verdir%
13+
14+
set run=call :runit %exe% %option%
15+
16+
17+
%run% Adaptive_Mesh_Refinement random_meshes
18+
%run% Aerosols propane_flame_deposition
19+
%run% Complex_Geometry geom_simple
20+
%run% Complex_Geometry geom_obst
21+
%run% Complex_Geometry geom_sphere1a
22+
%run% Complex_Geometry geom_sphere1c
23+
%run% Complex_Geometry geom_sphere1e
24+
%run% Complex_Geometry geom_sphere3b
25+
%run% Complex_Geometry geom_sphere3d
26+
%run% Complex_Geometry geom_sphere3f
27+
%run% Complex_Geometry geom_sphere1b
28+
%run% Complex_Geometry geom_sphere1d
29+
%run% Complex_Geometry geom_sphere1f
30+
%run% Complex_Geometry geom_sphere3a
31+
%run% Complex_Geometry geom_sphere3c
32+
%run% Complex_Geometry geom_sphere3e
33+
%run% Complex_Geometry geom_terrain
34+
%run% Complex_Geometry geom_texture
35+
%run% Complex_Geometry geom_texture2
36+
%run% Complex_Geometry geom_texture3a
37+
%run% Complex_Geometry geom_texture3b
38+
%run% Complex_Geometry geom_texture4a
39+
%run% Complex_Geometry geom_texture4b
40+
%run% Complex_Geometry sphere_radiate
41+
%run% Complex_Geometry sphere_helium_conserve_3meshes
42+
%run% Complex_Geometry cone_1mesh
43+
%run% Complex_Geometry t34_scaling
44+
%run% Controls activate_vents
45+
%run% Detectors beam_detector
46+
%run% Detectors objects_static
47+
%run% Detectors objects_dynamic
48+
%run% Fires couch
49+
%run% Flowfields helium_2d_isothermal
50+
%run% Flowfields symmetry_test
51+
%run% Flowfields symmetry_test_2
52+
%run% Flowfields symmetry_test_mpi
53+
%run% Flowfields jet_fan
54+
%run% Flowfields velocity_bc_test
55+
%run% Heat_Transfer checkerboard
56+
%run% Heat_Transfer ht3d_demo
57+
%run% Heat_Transfer ht3d_ibeam
58+
%run% Heat_Transfer ht3d_network
59+
%run% HVAC HVAC_mass_conservation
60+
%run% HVAC HVAC_energy_pressure
61+
%run% HVAC leak_test_2
62+
%run% Miscellaneous pyramid
63+
%run% Miscellaneous obst_multi
64+
%run% Miscellaneous obst_sphere
65+
%run% Miscellaneous obst_cylinder
66+
%run% Miscellaneous obst_cone
67+
%run% Miscellaneous obst_rotbox
68+
%run% NS_Analytical_Solution ns2d_64
69+
%run% Pressure_Effects pressure_boundary
70+
%run% Pressure_Solver dancing_eddies_embed
71+
%run% Pressure_Solver dancing_eddies_tight
72+
%run% Scalar_Analytical_Solution move_slug
73+
%run% Scalar_Analytical_Solution move_slug_fl1
74+
%run% Scalar_Analytical_Solution shunn3_256
75+
%run% Scalar_Analytical_Solution soborot_charm_square_wave_64
76+
%run% Sprinklers_and_Sprays cascade
77+
%run% Turbulence csmag_64
78+
%run% Turbulence dsmag_64
79+
%run% WUI Bova_1a
80+
%run% WUI Bova_1b
81+
%run% WUI Bova_4a
82+
%run% WUI level_set_fuel_model_1
83+
84+
goto eof
85+
86+
:runit
87+
set prog=%1
88+
set option=%2
89+
set casedir=%3
90+
set input=%4
91+
92+
cd %verdir%\%casedir%
93+
if %option% == fds timeout /t 2 /nobreak & start "%input%" cmd /c "%smvverdir%\scripts\background.bat %prog% %input%.fds"
94+
if %option% == smv %prog% -runscript %input%
95+
exit /b
96+
97+
:eof
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
setlocal
3+
4+
set CURDIR=%CD%
5+
cd ..\..\..
6+
set GITROOT=%CD%
7+
8+
set SMVBASE=smokeview_win.exe
9+
set SMVDIR=%GITROOT%\smv\Build\smokeview\intel_win
10+
set SMVEXE=%SMVDIR%\%SMVBASE%
11+
if exist %SMVEXE% goto skip1
12+
cd %SMVDIR%
13+
call make_smokeview
14+
:skip1
15+
16+
::erase %GITROOT%\smv\Manuals\SMV_User_Guide\SCRIPT_FIGURES\*.png
17+
::erase %GITROOT%\smv\Manuals\SMV_Verification_Guide\SCRIPT_FIGURES\*.png
18+
19+
cd %CURDIR%
20+
call FDS_Cases %SMVEXE% smv
21+
cd %CURDIR%
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
setlocal
3+
4+
set CURDIR=%CD%
5+
cd ..\..\..
6+
set GITROOT=%CD%
7+
8+
set FDSBASE=fds_impi_intel_win.exe
9+
set FDSDIR=%GITROOT%\fds\Build\impi_intel_win
10+
set FDSEXE=%FDSDIR%\%FDSBASE%
11+
if exist %FDSEXE% goto skip1
12+
cd %FDSDIR%
13+
call make_fds
14+
:skip1
15+
16+
call fdsinit > Nul 2>&1
17+
cd %CURDIR%
18+
call FDS_Cases %FDSEXE% fds
19+
20+
cd %GITROOT%\fds
21+
git describe > %CURDIR%\fds_revision.txt
22+
23+
cd %CURDIR%
24+
%FDSEXE% > fds.out 2>&1
25+
set GREP=%GITROOT%\smv\Verification\scripts\bin\grep
26+
set GAWK=%GITROOT%\smv\Verification\scripts\bin\gawk
27+
type fds.out | %GREP% Revision | %GREP% -v Date | %GAWK% "{print $3}" > %CURDIR%\fds_version.txt
28+
29+
cd %CURDIR%
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
@echo off
22
setlocal ENABLEDELAYEDEXPANSION
33

4-
REM ==== CONFIG ====
5-
REM %1 = max CPU load threshold (e.g. 30)
6-
REM %2... = command + args to run
7-
8-
set "THRESHOLD=70"
4+
set "MAX_INSTANCES=5"
5+
set "PROCESS_NAME=fds_impi_intel_win.exe"
96

107
if "%~1"=="" (
118
echo Error: No command specified
@@ -15,35 +12,30 @@ if "%~1"=="" (
1512
REM Build command string
1613
set "CMD=%*"
1714

18-
echo Waiting for CPU load to drop below %THRESHOLD%%%...
15+
echo Waiting until %MAX_INSTANCES% or fewer instances of %PROCESS_NAME% are running...
1916
echo Command to run: %CMD%
2017
echo.
2118

2219
:CHECK
23-
REM Query CPU load
24-
for /f "skip=1 tokens=*" %%A in ('wmic cpu get loadpercentage') do (
25-
if not "%%A"=="" (
26-
set "LOAD=%%A"
27-
goto :GOTLOAD
20+
set COUNT=0
21+
22+
REM Count running instances
23+
for /f "skip=3 tokens=1" %%A in ('tasklist /FI "IMAGENAME eq %PROCESS_NAME%"') do (
24+
if /I "%%A"=="%PROCESS_NAME%" (
25+
set /a COUNT+=1
2826
)
2927
)
3028

31-
:GOTLOAD
32-
REM Trim spaces
33-
set "LOAD=%LOAD: =%"
34-
35-
if "%LOAD%"=="" goto :CHECK
36-
37-
echo Current CPU Load: %LOAD%%%
29+
echo Current %PROCESS_NAME% instances: !COUNT!
3830

39-
if %LOAD% LSS %THRESHOLD% (
31+
if !COUNT! LEQ %MAX_INSTANCES% (
4032
echo.
41-
echo CPU load is below threshold. Running command...
33+
echo Instance count is within limit. Running command...
4234
echo.
4335
call %CMD%
4436
exit /b %ERRORLEVEL%
4537
)
4638

4739
REM Wait 5 seconds and try again
4840
timeout /t 5 /nobreak >nul
49-
goto :CHECK
41+
goto :CHECK

scripts/fds_smv_env.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:: ---- log entry date ----
44

5-
set smvlogdate="30-Mar-2026"
5+
set smvlogdate="29-Apr-2026"
66

77
:: ---- hostnames ----
88

0 commit comments

Comments
 (0)