From bc8de81718b347cf16a5606f64a142edf956f0d5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 14 Sep 2009 16:00:58 +0200 Subject: [PATCH 01/21] snappyHexMesh/Allrun - fit comments in 80-cols and add #!/bin/sh --- tutorials/mesh/snappyHexMesh/Allrun | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tutorials/mesh/snappyHexMesh/Allrun b/tutorials/mesh/snappyHexMesh/Allrun index 13813aeae7..90979fcb05 100755 --- a/tutorials/mesh/snappyHexMesh/Allrun +++ b/tutorials/mesh/snappyHexMesh/Allrun @@ -1,2 +1,9 @@ -# These cases are links to solver test cases and are run when the Allrun scripts of those solvers are run. -# This empty Allrun script avoids the meshing of theses cases to be run twice. +#!/bin/sh + +exit 0 + +# These cases are links to solver test cases and are run when the Allrun +# scripts of those solvers are run. + +# This dummy Allrun script avoids meshing these cases twice. + From 7c9b7192b4f68c47dde2a718aa70a4e8d3dbc3cd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 14 Sep 2009 16:45:59 +0200 Subject: [PATCH 02/21] drop -lfiniteVolume requirement from expandDictionary --- .../utilities/miscellaneous/expandDictionary/Make/options | 7 ++----- .../utilities/miscellaneous/foamInfoExec/Make/options | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applications/utilities/miscellaneous/expandDictionary/Make/options b/applications/utilities/miscellaneous/expandDictionary/Make/options index fa15f12452..18e6fe47af 100644 --- a/applications/utilities/miscellaneous/expandDictionary/Make/options +++ b/applications/utilities/miscellaneous/expandDictionary/Make/options @@ -1,5 +1,2 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -lfiniteVolume +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/utilities/miscellaneous/foamInfoExec/Make/options b/applications/utilities/miscellaneous/foamInfoExec/Make/options index e69de29bb2..18e6fe47af 100644 --- a/applications/utilities/miscellaneous/foamInfoExec/Make/options +++ b/applications/utilities/miscellaneous/foamInfoExec/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = */ +/* EXE_LIBS = */ From 6fc500d68d5c92515b4eb371c0fa8ef1e85a1e4e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 16 Sep 2009 19:46:58 +0200 Subject: [PATCH 03/21] blockMesh: move classes into separate library --- .../mesh/generation/blockMesh/Make/files | 28 ------------------- .../mesh/generation/blockMesh/Make/options | 3 +- src/meshing/Allwmake | 7 +++++ src/meshing/blockMesh/Make/options | 7 +++++ .../meshing/blockMesh/block}/block.C | 0 .../meshing/blockMesh/block}/block.H | 0 .../meshing/blockMesh/block}/blockBoundary.C | 0 .../meshing/blockMesh/block}/blockCells.C | 0 .../meshing/blockMesh/block}/blockList.H | 0 .../meshing/blockMesh/block}/blockPoints.C | 0 .../blockDescriptor}/blockDescriptor.C | 0 .../blockDescriptor}/blockDescriptor.H | 0 .../blockMesh/blockDescriptor}/setEdge.C | 0 .../meshing/blockMesh}/blockMesh/blockMesh.C | 0 .../meshing/blockMesh}/blockMesh/blockMesh.H | 0 .../blockMesh}/blockMesh/checkBlockMesh.C | 0 .../blockMesh}/blockMesh/createBlockOffsets.C | 0 .../blockMesh}/blockMesh/createCells.C | 0 .../blockMesh}/blockMesh/createMergeList.C | 0 .../blockMesh}/blockMesh/createPatches.C | 0 .../blockMesh}/blockMesh/createPoints.C | 0 .../blockMesh}/blockMesh/createTopology.C | 0 .../meshing}/blockMesh/curvedEdges/BSpline.C | 0 .../meshing}/blockMesh/curvedEdges/BSpline.H | 0 .../meshing}/blockMesh/curvedEdges/arcEdge.C | 0 .../meshing}/blockMesh/curvedEdges/arcEdge.H | 0 .../blockMesh/curvedEdges/curvedEdge.C | 0 .../blockMesh/curvedEdges/curvedEdge.H | 0 .../blockMesh/curvedEdges}/curvedEdgeList.H | 0 .../blockMesh/curvedEdges/lineDivide.C | 0 .../blockMesh/curvedEdges/lineDivide.H | 0 .../meshing}/blockMesh/curvedEdges/lineEdge.C | 0 .../meshing}/blockMesh/curvedEdges/lineEdge.H | 0 .../meshing}/blockMesh/curvedEdges/polyLine.C | 0 .../meshing}/blockMesh/curvedEdges/polyLine.H | 0 .../blockMesh/curvedEdges/polyLineEdge.C | 0 .../blockMesh/curvedEdges/polyLineEdge.H | 0 .../blockMesh/curvedEdges/polySplineEdge.C | 0 .../blockMesh/curvedEdges/polySplineEdge.H | 0 .../blockMesh/curvedEdges/simpleSplineEdge.C | 0 .../blockMesh/curvedEdges/simpleSplineEdge.H | 0 .../meshing}/blockMesh/curvedEdges/spline.C | 0 .../meshing}/blockMesh/curvedEdges/spline.H | 0 43 files changed, 16 insertions(+), 29 deletions(-) create mode 100755 src/meshing/Allwmake create mode 100644 src/meshing/blockMesh/Make/options rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/block.C (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/block.H (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/blockBoundary.C (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/blockCells.C (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/blockList.H (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/block}/blockPoints.C (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/blockDescriptor}/blockDescriptor.C (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/blockDescriptor}/blockDescriptor.H (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/blockDescriptor}/setEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/blockMesh.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/blockMesh.H (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/checkBlockMesh.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createBlockOffsets.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createCells.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createMergeList.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createPatches.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createPoints.C (100%) rename {applications/utilities/mesh/generation => src/meshing/blockMesh}/blockMesh/createTopology.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/BSpline.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/BSpline.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/arcEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/arcEdge.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/curvedEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/curvedEdge.H (100%) rename {applications/utilities/mesh/generation/blockMesh => src/meshing/blockMesh/curvedEdges}/curvedEdgeList.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/lineDivide.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/lineDivide.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/lineEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/lineEdge.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polyLine.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polyLine.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polyLineEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polyLineEdge.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polySplineEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/polySplineEdge.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/simpleSplineEdge.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/simpleSplineEdge.H (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/spline.C (100%) rename {applications/utilities/mesh/generation => src/meshing}/blockMesh/curvedEdges/spline.H (100%) diff --git a/applications/utilities/mesh/generation/blockMesh/Make/files b/applications/utilities/mesh/generation/blockMesh/Make/files index 81f5f36749..74840e9732 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/files +++ b/applications/utilities/mesh/generation/blockMesh/Make/files @@ -1,31 +1,3 @@ -curvedEdges = curvedEdges - -$(curvedEdges)/curvedEdge.C -$(curvedEdges)/lineEdge.C -$(curvedEdges)/polyLine.C -$(curvedEdges)/polyLineEdge.C -$(curvedEdges)/arcEdge.C -$(curvedEdges)/spline.C -$(curvedEdges)/BSpline.C -$(curvedEdges)/simpleSplineEdge.C -$(curvedEdges)/polySplineEdge.C -$(curvedEdges)/lineDivide.C - -blockMesh.C -blockDescriptor.C -setEdge.C -block.C -createTopology.C -checkBlockMesh.C -createBlockOffsets.C -createMergeList.C -createPoints.C -createCells.C -createPatches.C -blockPoints.C -blockCells.C -blockBoundary.C - blockMeshApp.C EXE = $(FOAM_APPBIN)/blockMesh diff --git a/applications/utilities/mesh/generation/blockMesh/Make/options b/applications/utilities/mesh/generation/blockMesh/Make/options index a5b85e4298..abb7181f13 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/options +++ b/applications/utilities/mesh/generation/blockMesh/Make/options @@ -1,8 +1,9 @@ EXE_INC = \ - -I$(curvedEdges) \ + -I$(LIB_SRC)/meshing/blockMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ + -lblockMesh \ -lmeshTools \ -ldynamicMesh diff --git a/src/meshing/Allwmake b/src/meshing/Allwmake new file mode 100755 index 0000000000..06493bb893 --- /dev/null +++ b/src/meshing/Allwmake @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wmake libso blockMesh + +# ----------------------------------------------------------------- end-of-file diff --git a/src/meshing/blockMesh/Make/options b/src/meshing/blockMesh/Make/options new file mode 100644 index 0000000000..1618ab57ec --- /dev/null +++ b/src/meshing/blockMesh/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude + +LIB_LIBS = \ + -lmeshTools \ + -ldynamicMesh diff --git a/applications/utilities/mesh/generation/blockMesh/block.C b/src/meshing/blockMesh/block/block.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/block.C rename to src/meshing/blockMesh/block/block.C diff --git a/applications/utilities/mesh/generation/blockMesh/block.H b/src/meshing/blockMesh/block/block.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/block.H rename to src/meshing/blockMesh/block/block.H diff --git a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C b/src/meshing/blockMesh/block/blockBoundary.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockBoundary.C rename to src/meshing/blockMesh/block/blockBoundary.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockCells.C b/src/meshing/blockMesh/block/blockCells.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockCells.C rename to src/meshing/blockMesh/block/blockCells.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockList.H b/src/meshing/blockMesh/block/blockList.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockList.H rename to src/meshing/blockMesh/block/blockList.H diff --git a/applications/utilities/mesh/generation/blockMesh/blockPoints.C b/src/meshing/blockMesh/block/blockPoints.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockPoints.C rename to src/meshing/blockMesh/block/blockPoints.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.C b/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockDescriptor.C rename to src/meshing/blockMesh/blockDescriptor/blockDescriptor.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockDescriptor.H b/src/meshing/blockMesh/blockDescriptor/blockDescriptor.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockDescriptor.H rename to src/meshing/blockMesh/blockDescriptor/blockDescriptor.H diff --git a/applications/utilities/mesh/generation/blockMesh/setEdge.C b/src/meshing/blockMesh/blockDescriptor/setEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/setEdge.C rename to src/meshing/blockMesh/blockDescriptor/setEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.C b/src/meshing/blockMesh/blockMesh/blockMesh.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockMesh.C rename to src/meshing/blockMesh/blockMesh/blockMesh.C diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.H b/src/meshing/blockMesh/blockMesh/blockMesh.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/blockMesh.H rename to src/meshing/blockMesh/blockMesh/blockMesh.H diff --git a/applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C b/src/meshing/blockMesh/blockMesh/checkBlockMesh.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C rename to src/meshing/blockMesh/blockMesh/checkBlockMesh.C diff --git a/applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C b/src/meshing/blockMesh/blockMesh/createBlockOffsets.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C rename to src/meshing/blockMesh/blockMesh/createBlockOffsets.C diff --git a/applications/utilities/mesh/generation/blockMesh/createCells.C b/src/meshing/blockMesh/blockMesh/createCells.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createCells.C rename to src/meshing/blockMesh/blockMesh/createCells.C diff --git a/applications/utilities/mesh/generation/blockMesh/createMergeList.C b/src/meshing/blockMesh/blockMesh/createMergeList.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createMergeList.C rename to src/meshing/blockMesh/blockMesh/createMergeList.C diff --git a/applications/utilities/mesh/generation/blockMesh/createPatches.C b/src/meshing/blockMesh/blockMesh/createPatches.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createPatches.C rename to src/meshing/blockMesh/blockMesh/createPatches.C diff --git a/applications/utilities/mesh/generation/blockMesh/createPoints.C b/src/meshing/blockMesh/blockMesh/createPoints.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createPoints.C rename to src/meshing/blockMesh/blockMesh/createPoints.C diff --git a/applications/utilities/mesh/generation/blockMesh/createTopology.C b/src/meshing/blockMesh/blockMesh/createTopology.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/createTopology.C rename to src/meshing/blockMesh/blockMesh/createTopology.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/BSpline.C b/src/meshing/blockMesh/curvedEdges/BSpline.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/BSpline.C rename to src/meshing/blockMesh/curvedEdges/BSpline.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/BSpline.H b/src/meshing/blockMesh/curvedEdges/BSpline.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/BSpline.H rename to src/meshing/blockMesh/curvedEdges/BSpline.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C b/src/meshing/blockMesh/curvedEdges/arcEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C rename to src/meshing/blockMesh/curvedEdges/arcEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.H b/src/meshing/blockMesh/curvedEdges/arcEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.H rename to src/meshing/blockMesh/curvedEdges/arcEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C b/src/meshing/blockMesh/curvedEdges/curvedEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.C rename to src/meshing/blockMesh/curvedEdges/curvedEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.H b/src/meshing/blockMesh/curvedEdges/curvedEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/curvedEdge.H rename to src/meshing/blockMesh/curvedEdges/curvedEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdgeList.H b/src/meshing/blockMesh/curvedEdges/curvedEdgeList.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdgeList.H rename to src/meshing/blockMesh/curvedEdges/curvedEdgeList.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/lineDivide.C b/src/meshing/blockMesh/curvedEdges/lineDivide.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/lineDivide.C rename to src/meshing/blockMesh/curvedEdges/lineDivide.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/lineDivide.H b/src/meshing/blockMesh/curvedEdges/lineDivide.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/lineDivide.H rename to src/meshing/blockMesh/curvedEdges/lineDivide.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/lineEdge.C b/src/meshing/blockMesh/curvedEdges/lineEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/lineEdge.C rename to src/meshing/blockMesh/curvedEdges/lineEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/lineEdge.H b/src/meshing/blockMesh/curvedEdges/lineEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/lineEdge.H rename to src/meshing/blockMesh/curvedEdges/lineEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLine.C b/src/meshing/blockMesh/curvedEdges/polyLine.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLine.C rename to src/meshing/blockMesh/curvedEdges/polyLine.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLine.H b/src/meshing/blockMesh/curvedEdges/polyLine.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLine.H rename to src/meshing/blockMesh/curvedEdges/polyLine.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLineEdge.C b/src/meshing/blockMesh/curvedEdges/polyLineEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLineEdge.C rename to src/meshing/blockMesh/curvedEdges/polyLineEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLineEdge.H b/src/meshing/blockMesh/curvedEdges/polyLineEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polyLineEdge.H rename to src/meshing/blockMesh/curvedEdges/polyLineEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polySplineEdge.C b/src/meshing/blockMesh/curvedEdges/polySplineEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polySplineEdge.C rename to src/meshing/blockMesh/curvedEdges/polySplineEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/polySplineEdge.H b/src/meshing/blockMesh/curvedEdges/polySplineEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/polySplineEdge.H rename to src/meshing/blockMesh/curvedEdges/polySplineEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/simpleSplineEdge.C b/src/meshing/blockMesh/curvedEdges/simpleSplineEdge.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/simpleSplineEdge.C rename to src/meshing/blockMesh/curvedEdges/simpleSplineEdge.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/simpleSplineEdge.H b/src/meshing/blockMesh/curvedEdges/simpleSplineEdge.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/simpleSplineEdge.H rename to src/meshing/blockMesh/curvedEdges/simpleSplineEdge.H diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/spline.C b/src/meshing/blockMesh/curvedEdges/spline.C similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/spline.C rename to src/meshing/blockMesh/curvedEdges/spline.C diff --git a/applications/utilities/mesh/generation/blockMesh/curvedEdges/spline.H b/src/meshing/blockMesh/curvedEdges/spline.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/curvedEdges/spline.H rename to src/meshing/blockMesh/curvedEdges/spline.H From dd093e0a376fb2f8f8758d2a8bfc172cce22cc36 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 16 Sep 2009 20:22:56 +0200 Subject: [PATCH 04/21] blockMesh: rationalize file names/contents --- .../mesh/generation/blockMesh/blockMeshApp.C | 7 +- src/meshing/blockMesh/Make/files | 27 ++ src/meshing/blockMesh/block/block.C | 78 ++--- src/meshing/blockMesh/block/block.H | 62 ++-- src/meshing/blockMesh/block/blockBoundary.C | 209 -------------- src/meshing/blockMesh/block/blockCells.C | 65 ----- .../block/{blockPoints.C => blockCreate.C} | 272 ++++++++++++++++-- src/meshing/blockMesh/block/blockList.H | 6 +- .../blockDescriptor/blockDescriptor.C | 225 +++++++++------ .../blockDescriptor/blockDescriptor.H | 87 +++--- .../{setEdge.C => blockDescriptorEdges.C} | 133 +++++---- src/meshing/blockMesh/blockMesh/blockMesh.C | 13 +- src/meshing/blockMesh/blockMesh/blockMesh.H | 21 +- .../{createCells.C => blockMeshCells.C} | 25 +- .../{checkBlockMesh.C => blockMeshCheck.C} | 107 ++++++- ...createMergeList.C => blockMeshMergeList.C} | 8 +- ...reateBlockOffsets.C => blockMeshOffsets.C} | 25 +- .../{createPatches.C => blockMeshPatches.C} | 11 +- .../{createPoints.C => blockMeshPoints.C} | 15 +- .../{createTopology.C => blockMeshTopology.C} | 189 +++--------- src/meshing/blockMesh/curvedEdges/BSpline.C | 29 +- src/meshing/blockMesh/curvedEdges/BSpline.H | 2 +- src/meshing/blockMesh/curvedEdges/arcEdge.C | 23 +- src/meshing/blockMesh/curvedEdges/arcEdge.H | 3 +- .../blockMesh/curvedEdges/curvedEdge.C | 53 ++-- .../blockMesh/curvedEdges/curvedEdge.H | 34 ++- .../blockMesh/curvedEdges/lineDivide.C | 23 +- .../blockMesh/curvedEdges/lineDivide.H | 4 +- src/meshing/blockMesh/curvedEdges/lineEdge.C | 36 +-- src/meshing/blockMesh/curvedEdges/lineEdge.H | 5 +- src/meshing/blockMesh/curvedEdges/polyLine.C | 22 +- src/meshing/blockMesh/curvedEdges/polyLine.H | 9 +- .../blockMesh/curvedEdges/polyLineEdge.C | 36 +-- .../blockMesh/curvedEdges/polyLineEdge.H | 6 +- .../blockMesh/curvedEdges/polySplineEdge.C | 2 - .../blockMesh/curvedEdges/polySplineEdge.H | 8 +- .../blockMesh/curvedEdges/simpleSplineEdge.C | 34 +-- .../blockMesh/curvedEdges/simpleSplineEdge.H | 9 +- src/meshing/blockMesh/curvedEdges/spline.C | 64 ++--- src/meshing/blockMesh/curvedEdges/spline.H | 8 +- 40 files changed, 961 insertions(+), 1034 deletions(-) create mode 100644 src/meshing/blockMesh/Make/files delete mode 100644 src/meshing/blockMesh/block/blockBoundary.C delete mode 100644 src/meshing/blockMesh/block/blockCells.C rename src/meshing/blockMesh/block/{blockPoints.C => blockCreate.C} (50%) rename src/meshing/blockMesh/blockDescriptor/{setEdge.C => blockDescriptorEdges.C} (53%) rename src/meshing/blockMesh/blockMesh/{createCells.C => blockMeshCells.C} (75%) rename src/meshing/blockMesh/blockMesh/{checkBlockMesh.C => blockMeshCheck.C} (65%) rename src/meshing/blockMesh/blockMesh/{createMergeList.C => blockMeshMergeList.C} (99%) rename src/meshing/blockMesh/blockMesh/{createBlockOffsets.C => blockMeshOffsets.C} (78%) rename src/meshing/blockMesh/blockMesh/{createPatches.C => blockMeshPatches.C} (97%) rename src/meshing/blockMesh/blockMesh/{createPoints.C => blockMeshPoints.C} (88%) rename src/meshing/blockMesh/blockMesh/{createTopology.C => blockMeshTopology.C} (60%) diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index b4bd379d75..73c1e783c0 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -146,8 +146,8 @@ int main(int argc, char *argv[]) << exit(FatalError); } - Info<< nl << "Creating block mesh from\n " - << meshDictIoPtr->objectPath() << nl << endl; + Info<< "Creating block mesh from\n " + << meshDictIoPtr->objectPath() << endl; IOdictionary meshDict(meshDictIoPtr()); blockMesh blocks(meshDict); @@ -195,8 +195,7 @@ int main(int argc, char *argv[]) } - - Info<< nl << "Creating mesh from block mesh" << endl; + Info<< nl << "Creating polyMesh from blockMesh" << endl; wordList patchNames = blocks.patchNames(); wordList patchTypes = blocks.patchTypes(); diff --git a/src/meshing/blockMesh/Make/files b/src/meshing/blockMesh/Make/files new file mode 100644 index 0000000000..ca3f2670d7 --- /dev/null +++ b/src/meshing/blockMesh/Make/files @@ -0,0 +1,27 @@ +curvedEdges/curvedEdge.C +curvedEdges/lineEdge.C +curvedEdges/polyLine.C +curvedEdges/polyLineEdge.C +curvedEdges/arcEdge.C +curvedEdges/spline.C +curvedEdges/BSpline.C +curvedEdges/simpleSplineEdge.C +curvedEdges/polySplineEdge.C +curvedEdges/lineDivide.C + +blockDescriptor/blockDescriptor.C +blockDescriptor/blockDescriptorEdges.C + +block/block.C +block/blockCreate.C + +blockMesh/blockMesh.C +blockMesh/blockMeshCells.C +blockMesh/blockMeshPatches.C +blockMesh/blockMeshPoints.C +blockMesh/blockMeshTopology.C +blockMesh/blockMeshCheck.C +blockMesh/blockMeshOffsets.C +blockMesh/blockMeshMergeList.C + +LIB = $(FOAM_LIBBIN)/libblockMesh diff --git a/src/meshing/blockMesh/block/block.C b/src/meshing/blockMesh/block/block.C index 4ec1e67434..d8093d3389 100644 --- a/src/meshing/blockMesh/block/block.C +++ b/src/meshing/blockMesh/block/block.C @@ -22,73 +22,56 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "error.H" #include "block.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - - -label block::vtxLabel(label a, label b, label c) -{ - return (a + b*(blockDef_.n().x() + 1) - + c*(blockDef_.n().x() + 1)*(blockDef_.n().y() + 1)); -} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from description -block::block(const blockDescriptor& definition) +Foam::block::block +( + const pointField& blockMeshPoints, + const curvedEdgeList& edges, + Istream& is +) : - blockDef_(definition), - vertices_ - ( - ((blockDef_.n().x() + 1)*(blockDef_.n().y() + 1)*(blockDef_.n().z() + 1)) - ), - cells_ - ( - (blockDef_.n().x()*blockDef_.n().y()*blockDef_.n().z()) - ), + blockDef_(blockMeshPoints, edges, is), + vertices_(blockDef_.nPoints()), + cells_(blockDef_.nCells()), boundaryPatches_(6) { - // create points - blockPoints(); + createPrimitives(); +} - // generate internal cells - blockCells(); - // generate boundary patches - blockBoundary(); +Foam::block::block(const blockDescriptor& definition) +: + blockDef_(definition), + vertices_(blockDef_.nPoints()), + cells_(blockDef_.nCells()), + boundaryPatches_(6) +{ + createPrimitives(); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -const blockDescriptor& block::blockDef() const -{ - return blockDef_; -} - -const pointField& block::points() const +const Foam::pointField& Foam::block::points() const { return vertices_; } -const labelListList& block::cells() const + +const Foam::labelListList& Foam::block::cells() const { return cells_; } -const labelListListList& block::boundaryPatches() const + +const Foam::labelListListList& Foam::block::boundaryPatches() const { return boundaryPatches_; } @@ -96,19 +79,14 @@ const labelListListList& block::boundaryPatches() const // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // -Ostream& operator<<(Ostream& os, const block& b) +Foam::Ostream& Foam::operator<<(Ostream& os, const block& b) { - os << b.vertices_ << nl - << b.cells_ << nl - << b.boundaryPatches_ << endl; + os << b.points() << nl + << b.cells() << nl + << b.boundaryPatches() << endl; return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // - diff --git a/src/meshing/blockMesh/block/block.H b/src/meshing/blockMesh/block/block.H index bbec4f0811..557e6a05f4 100644 --- a/src/meshing/blockMesh/block/block.H +++ b/src/meshing/blockMesh/block/block.H @@ -26,11 +26,12 @@ Class Foam::block Description - creates a single block of cells from point coordinates, - numbers of cells in each direction and expansion ratio + Creates a single block of cells from point coordinates, numbers of + cells in each direction and an expansion ratio. SourceFiles block.C + blockCreate.C \*---------------------------------------------------------------------------*/ @@ -58,35 +59,55 @@ class block { // Private data - //- block definition + //- Block definition blockDescriptor blockDef_; - //- list of vertices + //- List of vertices pointField vertices_; - //- list of cells + //- List of cells labelListList cells_; - //- boundary patches + //- Boundary patches labelListListList boundaryPatches_; - // private member functions + // Private Member Functions - label vtxLabel(label i, label j, label k); + //- Vertex label offset for a particular i,j,k position + label vtxLabel(label i, label j, label k) const; - void blockPoints(); + //- Creates vertices for cells filling the block. + void createPoints(); - void blockCells(); + //- Creates cells for the block. + void createCells(); - void blockBoundary(); + //- Creates boundary patches for the block + void createBoundary(); + //- Creates vertices, cells, boundary patches for the block + void createPrimitives(); + + //- Disallow default bitwise copy construct + block(const block&); + + //- Disallow default bitwise assignment + void operator=(const block&); public: // Constructors - //- Construct from the block definition + //- Construct from components with Istream + block + ( + const pointField& blockMeshPoints, + const curvedEdgeList&, + Istream& + ); + + //- Construct from a block definition block(const blockDescriptor&); //- Clone @@ -101,9 +122,16 @@ public: // Access - const blockDescriptor& blockDef() const; + //- Return the block definition + inline const blockDescriptor& blockDef() const + { + return blockDef_; + } + const pointField& points() const; + const labelListList& cells() const; + const labelListListList& boundaryPatches() const; @@ -112,14 +140,6 @@ public: friend Ostream& operator<<(Ostream&, const block&); }; - -inline Istream& operator>>(Istream& is, block*) -{ - notImplemented("Istream& operator>>(Istream& is, block*)"); - return is; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/meshing/blockMesh/block/blockBoundary.C b/src/meshing/blockMesh/block/blockBoundary.C deleted file mode 100644 index 8086aeea54..0000000000 --- a/src/meshing/blockMesh/block/blockBoundary.C +++ /dev/null @@ -1,209 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates boundary patches for the block - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockBoundary() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - // x-direction - - label wallLabel = 0; - label wallCellLabel = 0; - - // x-min - boundaryPatches_[wallLabel].setSize(nj*nk); - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(0, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(0, j, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(0, j + 1, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(0, j + 1, k); - - // update the counter - wallCellLabel++; - } - } - - // x-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(nj*nk); - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(ni, j, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(ni, j+1, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(ni, j+1, k+1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(ni, j, k+1); - - // update the counter - wallCellLabel++; - } - } - - // y-direction - - // y-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, 0, k); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, 0, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, 0, k + 1); - - // update the counter - wallCellLabel++; - } - } - - // y-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nk); - - for (label i = 0; i <= ni - 1; i++) - { - for (label k = 0; k <= nk - 1; k++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, nj, k); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, nj, k + 1); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, nj, k); - - // update the counter - wallCellLabel++; - } - } - - // z-direction - - // z-min - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, 0); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, 0); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i + 1, j, 0); - - // update the counter - wallCellLabel++; - } - } - - // z-max - wallLabel++; - wallCellLabel = 0; - - boundaryPatches_[wallLabel].setSize(ni*nj); - - for (label i = 0; i <= ni - 1; i++) - { - for (label j = 0; j <= nj - 1; j++) - { - boundaryPatches_[wallLabel][wallCellLabel].setSize(4); - - // set the points - boundaryPatches_[wallLabel][wallCellLabel][0] = - vtxLabel(i, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][1] = - vtxLabel(i + 1, j, nk); - boundaryPatches_[wallLabel][wallCellLabel][2] = - vtxLabel(i + 1, j + 1, nk); - boundaryPatches_[wallLabel][wallCellLabel][3] = - vtxLabel(i, j + 1, nk); - - // update the counter - wallCellLabel++; - } - } -} - -// ************************************************************************* // diff --git a/src/meshing/blockMesh/block/blockCells.C b/src/meshing/blockMesh/block/blockCells.C deleted file mode 100644 index acecc71700..0000000000 --- a/src/meshing/blockMesh/block/blockCells.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - private member of block. Creates cells for the block. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "block.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::block::blockCells() -{ - label ni = blockDef_.n().x(); - label nj = blockDef_.n().y(); - label nk = blockDef_.n().z(); - - label cellNo = 0; - - for (label k = 0; k <= nk - 1; k++) - { - for (label j = 0; j <= nj - 1; j++) - { - for (label i = 0; i <= ni - 1; i++) - { - cells_[cellNo].setSize(8); - - cells_[cellNo][0] = vtxLabel(i, j, k); - cells_[cellNo][1] = vtxLabel(i+1, j, k); - cells_[cellNo][2] = vtxLabel(i+1, j+1, k); - cells_[cellNo][3] = vtxLabel(i, j+1, k); - cells_[cellNo][4] = vtxLabel(i, j, k+1); - cells_[cellNo][5] = vtxLabel(i+1, j, k+1); - cells_[cellNo][6] = vtxLabel(i+1, j+1, k+1); - cells_[cellNo][7] = vtxLabel(i, j+1, k+1); - cellNo++; - } - } - } -} - -// ************************************************************************* // diff --git a/src/meshing/blockMesh/block/blockPoints.C b/src/meshing/blockMesh/block/blockCreate.C similarity index 50% rename from src/meshing/blockMesh/block/blockPoints.C rename to src/meshing/blockMesh/block/blockCreate.C index f3026ccad0..15e2d28386 100644 --- a/src/meshing/blockMesh/block/blockPoints.C +++ b/src/meshing/blockMesh/block/blockCreate.C @@ -22,32 +22,42 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - private member of block. Creates vertices for cells filling the block. - \*---------------------------------------------------------------------------*/ #include "error.H" #include "block.H" + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::block::blockPoints() +Foam::label Foam::block::vtxLabel(label i, label j, label k) const +{ + return + ( + i + + j*(blockDef_.meshDensity().x() + 1) + + k*(blockDef_.meshDensity().x() + 1) * (blockDef_.meshDensity().y() + 1) + ); +} + + +void Foam::block::createPoints() { // set local variables for mesh specification - const label ni = blockDef_.n().x(); - const label nj = blockDef_.n().y(); - const label nk = blockDef_.n().z(); + const label ni = blockDef_.meshDensity().x(); + const label nj = blockDef_.meshDensity().y(); + const label nk = blockDef_.meshDensity().z(); - const point p000 = blockDef_.points()[blockDef_.blockShape()[0]]; - const point p100 = blockDef_.points()[blockDef_.blockShape()[1]]; - const point p110 = blockDef_.points()[blockDef_.blockShape()[2]]; - const point p010 = blockDef_.points()[blockDef_.blockShape()[3]]; + const point& p000 = blockDef_.blockPoint(0); + const point& p100 = blockDef_.blockPoint(1); + const point& p110 = blockDef_.blockPoint(2); + const point& p010 = blockDef_.blockPoint(3); + + const point& p001 = blockDef_.blockPoint(4); + const point& p101 = blockDef_.blockPoint(5); + const point& p111 = blockDef_.blockPoint(6); + const point& p011 = blockDef_.blockPoint(7); - const point p001 = blockDef_.points()[blockDef_.blockShape()[4]]; - const point p101 = blockDef_.points()[blockDef_.blockShape()[5]]; - const point p111 = blockDef_.points()[blockDef_.blockShape()[6]]; - const point p011 = blockDef_.points()[blockDef_.blockShape()[7]]; // list of edge point and weighting factors const List >& p = blockDef_.blockEdgePoints(); @@ -80,7 +90,8 @@ void Foam::block::blockPoints() vector edgez4 = p010 + (p011 - p010)*w[11][k]; // calculate the importance factors for all edges - // x - direction + + // x-direction scalar impx1 = ( (1.0 - w[0][i])*(1.0 - w[4][j])*(1.0 - w[8][k]) @@ -113,7 +124,7 @@ void Foam::block::blockPoints() impx4 /= magImpx; - // y - direction + // y-direction scalar impy1 = ( (1.0 - w[4][j])*(1.0 - w[0][i])*(1.0 - w[8][k]) @@ -145,7 +156,7 @@ void Foam::block::blockPoints() impy4 /= magImpy; - // z - direction + // z-direction scalar impz1 = ( (1.0 - w[8][k])*(1.0 - w[0][i])*(1.0 - w[4][j]) @@ -195,19 +206,19 @@ void Foam::block::blockPoints() // multiply by the importance factor - // x - direction + // x-direction edgex1 *= impx1; edgex2 *= impx2; edgex3 *= impx3; edgex4 *= impx4; - // y - direction + // y-direction edgey1 *= impy1; edgey2 *= impy2; edgey3 *= impy3; edgey4 *= impy4; - // z - direction + // z-direction edgez1 *= impz1; edgez2 *= impz2; edgez3 *= impz3; @@ -229,4 +240,223 @@ void Foam::block::blockPoints() } } + +void Foam::block::createCells() +{ + const label ni = blockDef_.meshDensity().x(); + const label nj = blockDef_.meshDensity().y(); + const label nk = blockDef_.meshDensity().z(); + + label cellNo = 0; + + for (label k = 0; k <= nk - 1; k++) + { + for (label j = 0; j <= nj - 1; j++) + { + for (label i = 0; i <= ni - 1; i++) + { + cells_[cellNo].setSize(8); + + cells_[cellNo][0] = vtxLabel(i, j, k); + cells_[cellNo][1] = vtxLabel(i+1, j, k); + cells_[cellNo][2] = vtxLabel(i+1, j+1, k); + cells_[cellNo][3] = vtxLabel(i, j+1, k); + cells_[cellNo][4] = vtxLabel(i, j, k+1); + cells_[cellNo][5] = vtxLabel(i+1, j, k+1); + cells_[cellNo][6] = vtxLabel(i+1, j+1, k+1); + cells_[cellNo][7] = vtxLabel(i, j+1, k+1); + cellNo++; + } + } + } +} + + +void Foam::block::createBoundary() +{ + const label ni = blockDef_.meshDensity().x(); + const label nj = blockDef_.meshDensity().y(); + const label nk = blockDef_.meshDensity().z(); + + // x-direction + + label wallLabel = 0; + label wallCellLabel = 0; + + // x-min + boundaryPatches_[wallLabel].setSize(nj*nk); + for (label k = 0; k <= nk - 1; k++) + { + for (label j = 0; j <= nj - 1; j++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(0, j, k); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(0, j, k + 1); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(0, j + 1, k + 1); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(0, j + 1, k); + + // update the counter + wallCellLabel++; + } + } + + // x-max + wallLabel++; + wallCellLabel = 0; + + boundaryPatches_[wallLabel].setSize(nj*nk); + + for (label k = 0; k <= nk - 1; k++) + { + for (label j = 0; j <= nj - 1; j++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(ni, j, k); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(ni, j+1, k); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(ni, j+1, k+1); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(ni, j, k+1); + + // update the counter + wallCellLabel++; + } + } + + // y-direction + + // y-min + wallLabel++; + wallCellLabel = 0; + + boundaryPatches_[wallLabel].setSize(ni*nk); + for (label i = 0; i <= ni - 1; i++) + { + for (label k = 0; k <= nk - 1; k++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(i, 0, k); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(i + 1, 0, k); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(i + 1, 0, k + 1); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(i, 0, k + 1); + + // update the counter + wallCellLabel++; + } + } + + // y-max + wallLabel++; + wallCellLabel = 0; + + boundaryPatches_[wallLabel].setSize(ni*nk); + + for (label i = 0; i <= ni - 1; i++) + { + for (label k = 0; k <= nk - 1; k++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(i, nj, k); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(i, nj, k + 1); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(i + 1, nj, k + 1); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(i + 1, nj, k); + + // update the counter + wallCellLabel++; + } + } + + // z-direction + + // z-min + wallLabel++; + wallCellLabel = 0; + + boundaryPatches_[wallLabel].setSize(ni*nj); + + for (label i = 0; i <= ni - 1; i++) + { + for (label j = 0; j <= nj - 1; j++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(i, j, 0); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(i, j + 1, 0); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(i + 1, j + 1, 0); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(i + 1, j, 0); + + // update the counter + wallCellLabel++; + } + } + + // z-max + wallLabel++; + wallCellLabel = 0; + + boundaryPatches_[wallLabel].setSize(ni*nj); + + for (label i = 0; i <= ni - 1; i++) + { + for (label j = 0; j <= nj - 1; j++) + { + boundaryPatches_[wallLabel][wallCellLabel].setSize(4); + + // set the points + boundaryPatches_[wallLabel][wallCellLabel][0] = + vtxLabel(i, j, nk); + boundaryPatches_[wallLabel][wallCellLabel][1] = + vtxLabel(i + 1, j, nk); + boundaryPatches_[wallLabel][wallCellLabel][2] = + vtxLabel(i + 1, j + 1, nk); + boundaryPatches_[wallLabel][wallCellLabel][3] = + vtxLabel(i, j + 1, nk); + + // update the counter + wallCellLabel++; + } + } +} + + +void Foam::block::createPrimitives() +{ + // create points + createPoints(); + + // generate internal cells + createCells(); + + // generate boundary patches + createBoundary(); +} + + // ************************************************************************* // diff --git a/src/meshing/blockMesh/block/blockList.H b/src/meshing/blockMesh/block/blockList.H index 7e6a49a24a..e17f16db80 100644 --- a/src/meshing/blockMesh/block/blockList.H +++ b/src/meshing/blockMesh/block/blockList.H @@ -22,13 +22,11 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass +Typedef Foam::blockList Description - -SourceFiles - blockList.C + A PtrList of blocks \*---------------------------------------------------------------------------*/ diff --git a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C b/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C index 7d40c4d7cb..7551cc6459 100644 --- a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C +++ b/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C @@ -22,63 +22,29 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "error.H" - #include "blockDescriptor.H" -#include "scalarList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void blockDescriptor::makeBlockEdges() -{ - // for all edges check the list of curved edges. If the edge is curved, - // add it to the list. If the edge is not found, create is as a line - - setEdge(0, 0, 1, n_.x()); - setEdge(1, 3, 2, n_.x()); - setEdge(2, 7, 6, n_.x()); - setEdge(3, 4, 5, n_.x()); - - setEdge(4, 0, 3, n_.y()); - setEdge(5, 1, 2, n_.y()); - setEdge(6, 5, 6, n_.y()); - setEdge(7, 4, 7, n_.y()); - - setEdge(8, 0, 4, n_.z()); - setEdge(9, 1, 5, n_.z()); - setEdge(10, 2, 6, n_.z()); - setEdge(11, 3, 7, n_.z()); -} - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// from components -blockDescriptor::blockDescriptor +Foam::blockDescriptor::blockDescriptor ( const cellShape& bshape, const pointField& blockMeshPoints, const curvedEdgeList& edges, - const Vector