diff --git a/applications/utilities/mesh/generation/cv2DMesh/Make/options b/applications/utilities/mesh/generation/cv2DMesh/Make/options index 82659091b6..cd2a9a5107 100755 --- a/applications/utilities/mesh/generation/cv2DMesh/Make/options +++ b/applications/utilities/mesh/generation/cv2DMesh/Make/options @@ -10,7 +10,6 @@ EXE_INC = \ ${EXE_NDEBUG} \ ${CGAL_INC} \ -I$(FOAM_APP)/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/lnInclude \ - -I$(FOAM_APP)/utilities/mesh/generation/extrude/extrudeModel/lnInclude \ -IconformalVoronoi2DMesh/lnInclude \ -I$(FOAM_APP)/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ @@ -18,6 +17,7 @@ EXE_INC = \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/mesh/extrudeModel/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude EXE_LIBS = \ diff --git a/applications/utilities/mesh/generation/extrude/Allwclean b/applications/utilities/mesh/generation/extrude/Allwclean index c1c94a806b..253b4b4d6d 100755 --- a/applications/utilities/mesh/generation/extrude/Allwclean +++ b/applications/utilities/mesh/generation/extrude/Allwclean @@ -2,7 +2,6 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wclean libso extrudeModel wclean extrudeMesh wclean extrudeToRegionMesh diff --git a/applications/utilities/mesh/generation/extrude/Allwmake b/applications/utilities/mesh/generation/extrude/Allwmake index 5f09893321..3fd3d2314a 100755 --- a/applications/utilities/mesh/generation/extrude/Allwmake +++ b/applications/utilities/mesh/generation/extrude/Allwmake @@ -2,10 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso extrudeModel wmake extrudeMesh - -wmake libso extrudeToRegionMesh/createShellMesh wmake extrudeToRegionMesh diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options index 3445b811ea..94b355be3c 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options @@ -1,10 +1,10 @@ EXE_INC = \ -IextrudedMesh \ - -I../extrudeModel/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/mesh/extrudeModel/lnInclude EXE_LIBS = \ -lfiniteVolume \ diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options index 5732f9761d..9a1bd9942c 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options @@ -1,13 +1,11 @@ EXE_INC = \ - -I../extrudeModel/lnInclude \ - -IcreateShellMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/mesh/extrudeModel/lnInclude EXE_LIBS = \ - -lextrudeModel \ - -lcreateShellMesh \ -lfiniteVolume \ -lmeshTools \ - -ldynamicMesh + -ldynamicMesh \ + -lextrudeModel diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Make/options b/applications/utilities/mesh/generation/extrude2DMesh/Make/options index 8adfe67b36..3be2f34c18 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude2DMesh/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -Iextrude2DMesh/lnInclude \ - -I../extrude/extrudeModel/lnInclude + -I$(LIB_SRC)/mesh/extrudeModel/lnInclude EXE_LIBS = \ -lsurfMesh \ diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options index 8ace7c50da..f1db60d53f 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options @@ -4,7 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ - -I$(FOAM_APP)/utilities/mesh/generation/extrude/extrudeModel/lnInclude + -I$(LIB_SRC)/mesh/extrudeModel/lnInclude LIB_LIBS = \ -lmeshTools \ diff --git a/src/Allwmake b/src/Allwmake index c4cbe16c95..a61c7a2e3e 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -52,6 +52,8 @@ wmake $makeType conversion wmake $makeType sampling +wmake $makeType mesh/extrudeModel + wmake $makeType dynamicMesh wmake $makeType dynamicFvMesh wmake $makeType topoChangerFvMesh diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C index 50eb2fb96c..0b770b7daa 100644 --- a/src/OpenFOAM/matrices/solution/solution.C +++ b/src/OpenFOAM/matrices/solution/solution.C @@ -130,6 +130,7 @@ Foam::solution::solution obr, ( obr.readOpt() == IOobject::MUST_READ + || obr.readOpt() == IOobject::READ_IF_PRESENT ? IOobject::MUST_READ_IF_MODIFIED : obr.readOpt() ), @@ -148,6 +149,7 @@ Foam::solution::solution ( readOpt() == IOobject::MUST_READ || readOpt() == IOobject::MUST_READ_IF_MODIFIED + || (readOpt() == IOobject::READ_IF_PRESENT && headerOk()) ) { read(solutionDict()); diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index ab13b34444..d5670fa331 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -132,6 +132,84 @@ Foam::polyBoundaryMesh::polyBoundaryMesh {} +Foam::polyBoundaryMesh::polyBoundaryMesh +( + const IOobject& io, + const polyMesh& pm, + const polyPatchList& ppl +) +: + polyPatchList(), + regIOobject(io), + mesh_(pm) +{ + if + ( + (this->readOpt() == IOobject::READ_IF_PRESENT && this->headerOk()) + || this->readOpt() == IOobject::MUST_READ + || this->readOpt() == IOobject::MUST_READ_IF_MODIFIED + ) + { + + if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) + { + WarningIn + ( + "polyBoundaryMesh::polyBoundaryMesh\n" + "(\n" + " const IOobject&,\n" + " const polyMesh&\n" + " const polyPatchList&\n" + ")" + ) << "Specified IOobject::MUST_READ_IF_MODIFIED but class" + << " does not support automatic rereading." + << endl; + } + + polyPatchList& patches = *this; + + // Read polyPatchList + Istream& is = readStream(typeName); + + PtrList patchEntries(is); + patches.setSize(patchEntries.size()); + + forAll(patches, patchI) + { + patches.set + ( + patchI, + polyPatch::New + ( + patchEntries[patchI].keyword(), + patchEntries[patchI].dict(), + patchI, + *this + ) + ); + } + + // Check state of IOstream + is.check + ( + "polyBoundaryMesh::polyBoundaryMesh" + "(const IOobject&, const polyMesh&, const polyPatchList&)" + ); + + close(); + } + else + { + polyPatchList& patches = *this; + patches.setSize(ppl.size()); + forAll (patches, patchI) + { + patches.set(patchI, ppl[patchI].clone(*this).ptr()); + } + } +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::polyBoundaryMesh::~polyBoundaryMesh() diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index 62d6f4a5e1..999b3815bf 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -119,6 +119,14 @@ public: const label size ); + //- Construct given polyPatchList + polyBoundaryMesh + ( + const IOobject&, + const polyMesh&, + const polyPatchList& + ); + //- Destructor ~polyBoundaryMesh(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 8877cdafcf..7a470bc9ff 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -338,7 +338,7 @@ Foam::polyMesh::polyMesh instance(), meshSubDir, *this, - IOobject::NO_READ, + io.readOpt(), IOobject::AUTO_WRITE ), points @@ -351,7 +351,7 @@ Foam::polyMesh::polyMesh instance(), meshSubDir, *this, - IOobject::NO_READ, + io.readOpt(), IOobject::AUTO_WRITE ), faces @@ -364,7 +364,7 @@ Foam::polyMesh::polyMesh instance(), meshSubDir, *this, - IOobject::NO_READ, + io.readOpt(), IOobject::AUTO_WRITE ), owner @@ -377,7 +377,7 @@ Foam::polyMesh::polyMesh instance(), meshSubDir, *this, - IOobject::NO_READ, + io.readOpt(), IOobject::AUTO_WRITE ), neighbour @@ -391,11 +391,11 @@ Foam::polyMesh::polyMesh instance(), meshSubDir, *this, - IOobject::NO_READ, + io.readOpt(), IOobject::AUTO_WRITE ), *this, - 0 + polyPatchList() ), bounds_(points_, syncPar), geometricD_(Vector