@echo off
setlocal EnableDelayedExpansion
rem Don't remove the two jump line after than the next line [set NL=^]
set NL=^
rem "name" and "dirout" are named according to the testcase
set name=Casein
set dirout=%name%_out
set diroutdata=%dirout%\data
rem "executables" are renamed and called from their directory
set dirbin=../../../bin/windows
set gencase="%dirbin%/GenCase_win64.exe"
set dualsphysicscpu="%dirbin%/DualSPHysics5.0CPU_win64.exe"
set dualsphysicsgpu="%dirbin%/DualSPHysics5.0_win64.exe"
set boundaryvtk="%dirbin%/BoundaryVTK_win64.exe"
set partvtk="%dirbin%/PartVTK_win64.exe"
set partvtkout="%dirbin%/PartVTKOut_win64.exe"
set measuretool="%dirbin%/MeasureTool_win64.exe"
set computeforces="%dirbin%/ComputeForces_win64.exe"
set isosurface="%dirbin%/IsoSurface_win64.exe"
set flowtool="%dirbin%/FlowTool_win64.exe"
set floatinginfo="%dirbin%/FloatingInfo_win64.exe"
:menu
:run
rem "dirout" to store results is removed if it already exists
if exist %dirout% rd /s /q %dirout%
rem CODES are executed according the selected parameters of execution in this testcase
%gencase% %name%_Def %dirout%/%name% -save:all
if not "%ERRORLEVEL%" == "0" goto fail
%dualsphysicscpu% -cpu %dirout%/%name% %dirout% -dirdataout data -svres
if not "%ERRORLEVEL%" == "0" goto fail
:postprocessing
rem Executes PartVTK4 to create VTK files with particles.
set dirout2=%dirout%\particles
%partvtk% -dirin %diroutdata% -savevtk %dirout2%/PartFluid -onlytype:-all,+fluid
if not "%ERRORLEVEL%" == "0" goto fail
%partvtk% -dirin %diroutdata% -savevtk %dirout2%/PartFloating -onlytype:-all,+floating
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes PartVTKOut4 to create VTK files with excluded particles.
%partvtkout% -dirin %diroutdata% -savevtk %dirout2%/PartFluidOut -SaveResume %dirout2%/_ResumeFluidOut
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes MeasureTool4 to create VTK files with velocity and a CSV file with velocity at each simulation time.
set dirout2=%dirout%\measuretool
%measuretool% -dirin %diroutdata% -points CaseDambreak_PointsVelocity.txt -onlytype:-all,+fluid -vars:-all,+vel.x,+vel.m -savevtk %dirout2%/PointsVelocity -savecsv %dirout2%/_PointsVelocity
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes MeasureTool4 to create VTK files with incorrect pressure and a CSV file with value at each simulation time.
%measuretool% -dirin %diroutdata% -points CaseDambreak_PointsPressure_Incorrect.txt -onlytype:-all,+fluid -vars:-all,+press,+kcorr -kcusedummy:0 -kclimit:0.5 -savevtk %dirout2%/PointsPressure_Incorrect -savecsv %dirout2%/_PointsPressure_Incorrect
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes MeasureTool4 to create VTK files with correct pressure and a CSV file with value at each simulation time.
%measuretool% -dirin %diroutdata% -points CaseDambreak_PointsPressure_Correct.txt -onlytype:-all,+fluid -vars:-all,+press,+kcorr -kcusedummy:0 -kclimit:0.5 -savevtk %dirout2%/PointsPressure_Correct -savecsv %dirout2%/_PointsPressure_Correct
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes ComputeForces to create a CSV file with force at each simulation time.
set dirout2=%dirout%\forces
%computeforces% -dirin %diroutdata% -onlymk:21 -savecsv %dirout2%/_ForceBuilding
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes IsoSurface4 to create VTK files with surface fluid and slices of surface.
set dirout2=%dirout%\surface
set planesy="-slicevec:0:0.1:0:0:1:0 -slicevec:0:0.2:0:0:1:0 -slicevec:0:0.3:0:0:1:0 -slicevec:0:0.4:0:0:1:0 -slicevec:0:0.5:0:0:1:0 -slicevec:0:0.6:0:0:1:0"
set planesx="-slicevec:0.1:0:0:1:0:0 -slicevec:0.2:0:0:1:0:0 -slicevec:0.3:0:0:1:0:0 -slicevec:0.4:0:0:1:0:0 -slicevec:0.5:0:0:1:0:0 -slicevec:0.6:0:0:1:0:0 -slicevec:0.7:0:0:1:0:0 -slicevec:0.8:0:0:1:0:0 -slicevec:0.9:0:0:1:0:0 -slicevec:1.0:0:0:1:0:0"
set planesd="-slice3pt:0:0:0:1:0.7:0:1:0.7:1"
%isosurface% -dirin %diroutdata% -saveiso %dirout2%/Surface -vars:-all,vel,rhop,idp,type -saveslice %dirout2%/Slices %planesy% %planesx% %planesd%
if not "%ERRORLEVEL%" == "0" goto fail
set dirout2=%dirout%\floatinginfo
%floatinginfo% -dirin %diroutdata% -onlymk:61 -savedata %dirout2%/FloatingMotion
if not "%ERRORLEVEL%" == "0" goto fail
rem Executes FlowTool4 to create VTK files with particles assigned to different zones and a CSV file with information of each zone.
set dirout2=%dirout%\flow
%flowtool% -dirin %diroutdata% -fileboxes CaseDambreak_FileBoxes.txt -savecsv %dirout2%/_ResultFlow.csv -savevtk %dirout2%/Boxes.vtk
if not "%ERRORLEVEL%" == "0" goto fail
:success
echo All done
goto end
:fail
echo Execution aborted.
:end
pause
|