Skip to content
Snippets Groups Projects
Commit 096b9dc5 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

TUT: add parallel version for various squareBend cases

- adjust commented-out evaluation to avoid warnings.

  With code like this
  ```
  #if 0
  nxin    #eval{ round($nxin / 5) };
  #endif
  ```

  The handling of the "#if 0 / #endif" clause uses the plain ISstream
  parser to tokenize. This means that the "round(" is parsed as a word
  with a mismatched closing ')', whereas the "#eval" parser will slurp
  everything in until the closing brace and send it off as a string
  to the expression parser.
parent a3d90ae9
Branches
Tags
No related merge requests found
Showing
with 116 additions and 77 deletions
...@@ -3,10 +3,8 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,10 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase cleanCase0
rm -f constant/polyMesh/boundary rm -f constant/polyMesh/boundary
rm -f constant/polyMesh/zoneID rm -f constant/polyMesh/zoneID
rm -rf 0
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase cleanCase
......
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase cleanCase
rm constant/polyMesh/boundary
rm -f constant/polyMesh/boundary
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
runApplication blockMesh runApplication blockMesh
runApplication extrudeMesh runApplication extrudeMesh
......
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
#------------------------------------------------------------------------------
...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
restore0Dir ./Allrun.pre
runApplication blockMesh
runApplication topoSet
runApplication $(getApplication) runApplication $(getApplication)
......
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase0 ./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase0 restore0Dir
rm -rf constant/triSurface runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 | | \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com | | \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 }; ...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 }; xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 }; zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) }; nxin #eval{ round ($nxin / 5) };
nxout #eval{ round($nxout / 5) }; nxout #eval{ round ($nxout / 5) };
nz #eval{ round($nz / 5) }; nz #eval{ round ($nz / 5) };
#endif #endif
zmin #eval{ -$zmax }; zmin #eval{ -$zmax };
......
...@@ -3,30 +3,7 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,30 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
restore0Dir ./Allrun.pre
cp -rf \
"$FOAM_TUTORIALS"/resources/geometry/squareBend \
constant/triSurface
runApplication blockMesh
# Extract some faces for sampling
runApplication surfaceMeshExtract \
-patches inlet -time 0 \
constant/triSurface/inlet_sample0.obj
# Recentre and inflate
runApplication surfaceTransformPoints \
-recentre \
-scale 3.5 \
constant/triSurface/inlet_sample0.obj \
constant/triSurface/inlet_sample1.obj
# Finer mesh
runApplication surfaceRefineRedGreen \
constant/triSurface/inlet_sample1.obj \
constant/triSurface/oversized_sample.obj
runApplication $(getApplication) runApplication $(getApplication)
......
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
cp -rf \
"$FOAM_TUTORIALS"/resources/geometry/squareBend \
constant/triSurface
runApplication blockMesh
# Extract some faces for sampling
runApplication surfaceMeshExtract \
-patches inlet -time 0 \
constant/triSurface/inlet_sample0.obj
# Recentre and inflate
runApplication surfaceTransformPoints \
-recentre \
-scale 3.5 \
constant/triSurface/inlet_sample0.obj \
constant/triSurface/inlet_sample1.obj
# Finer mesh
runApplication surfaceRefineRedGreen \
constant/triSurface/inlet_sample1.obj \
constant/triSurface/oversized_sample.obj
#------------------------------------------------------------------------------
...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
restore0Dir ./Allrun.pre
runApplication blockMesh
runApplication topoSet
runApplication $(getApplication) runApplication $(getApplication)
......
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase0 restore0Dir
rm -rf constant/triSurface runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 | | \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com | | \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 }; ...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 }; xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 }; zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) }; nxin #eval{ round ($nxin / 5) };
nxout #eval{ round($nxout / 5) }; nxout #eval{ round ($nxout / 5) };
nz #eval{ round($nz / 5) }; nz #eval{ round ($nz / 5) };
#endif #endif
zmin #eval{ -$zmax }; zmin #eval{ -$zmax };
......
...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
restore0Dir ./Allrun.pre
runApplication blockMesh
runApplication topoSet
runApplication $(getApplication) runApplication $(getApplication)
......
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------
#!/bin/sh #!/bin/sh
cd "${0%/*}" || exit # Run from this directory cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase0 restore0Dir
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 | | \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com | | \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 }; ...@@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 }; xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 }; zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) }; nxin #eval{ round ($nxin / 5) };
nxout #eval{ round($nxout / 5) }; nxout #eval{ round ($nxout / 5) };
nz #eval{ round($nz / 5) }; nz #eval{ round ($nz / 5) };
#endif #endif
zmin #eval{ -$zmax }; zmin #eval{ -$zmax };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment