diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H index 3ef4a22261aea55f2c3f7a5f08953802deb7bf62..ecbcbe277a53c4de78e62cd8f0f1721faf003ad9 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H @@ -899,6 +899,10 @@ public: //- Clear geometry void clearGeom(); + //- Clear cell-based geometry only + // Use with care! currently used by cyclicACMI + void clearCellGeom(); + //- Clear topological data void clearAddressing(); diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C index 2efd5cb861766ca8553aafb0b58b484e917a0e93..bf19ed1ffe48de92cadbfca2c573839e535dcf94 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshClear.C @@ -140,6 +140,20 @@ void Foam::primitiveMesh::clearGeom() } +void Foam::primitiveMesh::clearCellGeom() +{ + if (debug) + { + Pout<< "primitiveMesh::clearCellGeom() : " + << "clearing cell centres and volumes" + << endl; + } + + deleteDemandDrivenData(cellCentresPtr_); + deleteDemandDrivenData(cellVolumesPtr_); +} + + void Foam::primitiveMesh::clearAddressing() { if (debug) diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C index 51d558a1fb9ae57423cead0c32bf0344fc4632d3..a8b43d2b36bad27055845194b18e4fb080c8b2cc 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C @@ -60,6 +60,12 @@ namespace Foam interfaceTrackingFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + interfaceTrackingFvMesh, + doInit + ); } @@ -1553,9 +1559,13 @@ void Foam::interfaceTrackingFvMesh::correctContactLinePointNormals() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::interfaceTrackingFvMesh::interfaceTrackingFvMesh(const IOobject& io) +Foam::interfaceTrackingFvMesh::interfaceTrackingFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicMotionSolverFvMesh(io), + dynamicMotionSolverFvMesh(io, doInit), aMeshPtr_(new faMesh(*this)), fsPatchIndex_(-1), fixedFreeSurfacePatches_ diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H index 45bf37cf601c49ca057984f9692477a6ef4fe881..784ecff18a8186c80af1f8179014bfd14b6e3837 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb. + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -250,7 +251,7 @@ public: // Constructors //- Construct from IOobject - interfaceTrackingFvMesh(const IOobject& io); + interfaceTrackingFvMesh(const IOobject& io, const bool doInit=true); //- Construct from components without boundary. // Boundary is added using addFvPatches() member function diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C index d72616b9ae4fef563faa04007aa9af0ddb75f44f..fbca19423744b95c7ba67a633ec94c9dade3268d 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,6 +34,7 @@ namespace Foam { defineTypeNameAndDebug(dynamicFvMesh, 0); defineRunTimeSelectionTable(dynamicFvMesh, IOobject); + defineRunTimeSelectionTable(dynamicFvMesh, doInit); } @@ -74,12 +75,29 @@ void Foam::dynamicFvMesh::readDict() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io) +Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io, const bool doInit) : - fvMesh(io), - timeControl_(io.time(), "update") + fvMesh(io, doInit), + timeControl_(io.time(), "update") // assume has no side effects { + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicFvMesh::init(const bool doInit) +{ + if (doInit) + { + fvMesh::init(doInit); + } + readDict(); + + // Assume something changed + return true; } diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H index c59bdbd23ca20f6d22563786700c262e95320052..8622bb0ecb9b16518dcab927de9f9be71b15fcb6 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -100,11 +100,23 @@ public: (io) ); + declareRunTimeSelectionTable + ( + autoPtr, + dynamicFvMesh, + doInit, + ( + const IOobject& io, + const bool doInit + ), + (io, doInit) + ); + // Constructors //- Construct from an IOobject - explicit dynamicFvMesh(const IOobject& io); //, const bool doInit=true); + explicit dynamicFvMesh(const IOobject& io, const bool doInit=true); //- Construct from components without boundary. // Boundary is added using addFvPatches() member function @@ -139,11 +151,7 @@ public: //- Select, construct and return the dynamicFvMesh // If the constant/dynamicMeshDict does not exist // a staticFvMesh is returned - static autoPtr<dynamicFvMesh> New - ( - const IOobject& io //, - //const bool doInit=true - ); + static autoPtr<dynamicFvMesh> New(const IOobject& io); //- Select, construct and return the dynamicFvMesh @@ -152,8 +160,7 @@ public: static autoPtr<dynamicFvMesh> New ( const argList& args, - const Time& runTime //, - //const bool doInit=true + const Time& runTime ); @@ -164,7 +171,7 @@ public: // Member Functions //- Initialise all non-demand-driven data - //virtual bool init(const bool doInit); + virtual bool init(const bool doInit); //- Is mesh dynamic virtual bool dynamic() const diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index c1c8e7409dc8cde0e9d667670f2b5d268fd83b21..482ff63e4c0d03f3e5e1434fa462b1d8ab21ac30 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,6 +72,24 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io) << exit(FatalError); } + auto doInitCstrIter = doInitConstructorTablePtr_->cfind(modelType); + + if (doInitCstrIter.found()) + { + DebugInfo + << "Constructing dynamicFvMesh with explicit initialisation" + << endl; + + // Two-step constructor + // 1. Construct mesh, do not initialise + autoPtr<dynamicFvMesh> meshPtr(doInitCstrIter()(io, false)); + + // 2. Initialise parents and itself + meshPtr().init(true); + + return meshPtr; + } + auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) @@ -88,7 +106,16 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io) return autoPtr<dynamicFvMesh>(cstrIter()(io)); } - return autoPtr<dynamicFvMesh>(new staticFvMesh(io)); + DebugInfo + << "Constructing staticFvMesh with explicit initialisation" << endl; + + // 1. Construct mesh, do not initialise + autoPtr<dynamicFvMesh> meshPtr(new staticFvMesh(io, false)); + + // 2. Initialise parents and itself + meshPtr().init(true); + + return meshPtr; } diff --git a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C index cae8c5c2a0210831368bbe2340e501db0659b287..90f4cd729c8ffcbce4ad668a6468bb1ba6a55d12 100644 --- a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C +++ b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,14 +37,19 @@ namespace Foam { defineTypeNameAndDebug(dynamicInkJetFvMesh, 0); addToRunTimeSelectionTable(dynamicFvMesh, dynamicInkJetFvMesh, IOobject); + addToRunTimeSelectionTable(dynamicFvMesh, dynamicInkJetFvMesh, doInit); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::dynamicInkJetFvMesh::dynamicInkJetFvMesh(const IOobject& io) +Foam::dynamicInkJetFvMesh::dynamicInkJetFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicFvMesh(io), + dynamicFvMesh(io, doInit), dynamicMeshCoeffs_ ( IOdictionary diff --git a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.H b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.H index 530b8fc025aff914f811d63edd164c1295cb5143..fffc44a51ee3c46ca9838a70809ac0d47c0a2bf1 100644 --- a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.H +++ b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -88,7 +89,7 @@ public: // Constructors //- Construct from IOobject - dynamicInkJetFvMesh(const IOobject& io); + dynamicInkJetFvMesh(const IOobject& io, const bool doInit=true); //- Destructor diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C index 5b7a90cddc85ae66857042fc5c54bb5347372998..2e4ea6752c7a59d66d0ff38a0d7e5e9f13857b27 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C +++ b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,16 +42,43 @@ namespace Foam dynamicMotionSolverFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + dynamicMotionSolverFvMesh, + doInit + ); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh(const IOobject& io) +Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicFvMesh(io), - motionPtr_(motionSolver::New(*this)) -{} + dynamicFvMesh(io, doInit), + motionPtr_(nullptr) +{ + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicMotionSolverFvMesh::init(const bool doInit) +{ + if (doInit) + { + dynamicFvMesh::init(doInit); + } + + motionPtr_ = motionSolver::New(*this); + return true; +} Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.H b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.H index 2192a010e7d72213d9ca78e655c3f88d8fa89a44..ba8e1aca12729853ca15ae417ba499c36a6cec2e 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.H +++ b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -77,7 +78,7 @@ public: // Constructors //- Construct from IOobject - dynamicMotionSolverFvMesh(const IOobject& io); + dynamicMotionSolverFvMesh(const IOobject& io, bool syncPar=true); //- Construct from components without boundary. // Boundary is added using addFvPatches() member function @@ -98,6 +99,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Return the motionSolver const motionSolver& motion() const; diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C index e431a39536d6a900d3cae632a116fea67eeb0235..a2debb0e24fe3216cff15e8609dc6e25fde1b728 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C +++ b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C @@ -49,6 +49,12 @@ namespace Foam dynamicMotionSolverFvMeshAMI, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + dynamicMotionSolverFvMeshAMI, + doInit + ); } @@ -56,12 +62,29 @@ namespace Foam Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI ( - const IOobject& io + const IOobject& io, + const bool doInit ) : - dynamicFvMesh(io), - motionPtr_(motionSolver::New(*this)) -{} + dynamicFvMesh(io, doInit) +{ + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicMotionSolverFvMeshAMI::init(const bool doInit) +{ + if (doInit) + { + dynamicFvMesh::init(doInit); + } + + motionPtr_ = motionSolver::New(*this); + return true; +} Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.H b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.H index e21f5623ed7df6416380459ef8b6470b6ebb42f0..074805ad790a9066e9684f8c6bc96572a5a23bda 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.H +++ b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.H @@ -81,7 +81,11 @@ public: // Constructors //- Construct from IOobject - dynamicMotionSolverFvMeshAMI(const IOobject& io); + dynamicMotionSolverFvMeshAMI + ( + const IOobject& io, + const bool doInit=true + ); //- Construct from components without boundary. // Boundary is added using addFvPatches() member function @@ -102,6 +106,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Return the motionSolver const motionSolver& motion() const; diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C index f9b0c7ba67c98d078e57a8b6b32b80cbfaeab1b0..725b90e8454b0f2da784179d771be27660d6ceb9 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C +++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,6 +43,12 @@ namespace Foam dynamicMotionSolverListFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + dynamicMotionSolverListFvMesh, + doInit + ); } @@ -50,12 +56,27 @@ namespace Foam Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh ( - const IOobject& io + const IOobject& io, + const bool doInit ) : - dynamicFvMesh(io), + dynamicFvMesh(io, doInit), motionSolvers_() { + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicMotionSolverListFvMesh::init(const bool doInit) +{ + if (doInit) + { + dynamicFvMesh::init(doInit); + } + IOobject ioDict ( "dynamicMeshDict", @@ -104,6 +125,9 @@ Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh motionSolvers_.setSize(1); motionSolvers_.set(i++, motionSolver::New(*this)); } + + // Assume something changed + return true; } diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H index e44f5132b17bf39372c43e1abbdda9f727ac956e..edefc5dc16f191d0e628d16d4cc2eb69d8704e3e 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H +++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -82,7 +83,11 @@ public: // Constructors //- Construct from IOobject - dynamicMotionSolverListFvMesh(const IOobject& io); + dynamicMotionSolverListFvMesh + ( + const IOobject& io, + const bool doInit=true + ); //- Destructor @@ -91,6 +96,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Dummy update function which does not change the mesh virtual bool update(); }; diff --git a/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.C b/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.C index 1cdaac56436824b90c1c1ac608a449d9a81c138b..ae1916ab2049356bf682dfbbab1e8f762f0d6eb7 100644 --- a/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.C +++ b/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,6 +42,12 @@ namespace Foam dynamicMultiMotionSolverFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + dynamicMultiMotionSolverFvMesh, + doInit + ); } @@ -49,17 +55,32 @@ namespace Foam Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh ( - const IOobject& io + const IOobject& io, + const bool doInit ) : - dynamicFvMesh(io) + dynamicFvMesh(io, doInit) +{ + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicMultiMotionSolverFvMesh::init(const bool doInit) { + if (doInit) + { + dynamicFvMesh::init(doInit); + } + IOdictionary dynDict ( IOobject ( "dynamicMeshDict", - io.time().constant(), + time().constant(), *this, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, @@ -139,6 +160,9 @@ Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh zoneIDs_.setSize(zonei); motionPtr_.setSize(zonei); pointIDs_.setSize(zonei); + + // Assume changed ... + return true; } diff --git a/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.H b/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.H index 4efc26afbe8ab9eac86b8be4368f24c93af87b18..7e3f82df33cf63992f065bc84db0584651c68acd 100644 --- a/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.H +++ b/src/dynamicFvMesh/dynamicMultiMotionSolverFvMesh/dynamicMultiMotionSolverFvMesh.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -87,7 +87,11 @@ public: // Constructors //- Construct from IOobject - explicit dynamicMultiMotionSolverFvMesh(const IOobject& io); + explicit dynamicMultiMotionSolverFvMesh + ( + const IOobject& io, + const bool doInit=true + ); //- Destructor @@ -96,6 +100,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Update the mesh for both mesh motion and topology change virtual bool update(); }; diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index b4a35aab64ce9cb00a83a705d8565b18370fa3f7..3db9be82a68bd9bb32e3471711c0d6057ab565e9 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -44,6 +44,7 @@ namespace Foam { defineTypeNameAndDebug(dynamicRefineFvMesh, 0); addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, IOobject); + addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, doInit); } // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -1014,14 +1015,33 @@ void Foam::dynamicRefineFvMesh::checkEightAnchorPoints // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io) +Foam::dynamicRefineFvMesh::dynamicRefineFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicFvMesh(io), - meshCutter_(*this), - protectedCell_(nCells()), - nRefinementIterations_(0), - dumpLevel_(false) + dynamicFvMesh(io, doInit), + meshCutter_(*this) { + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicRefineFvMesh::init(const bool doInit) +{ + if (doInit) + { + dynamicFvMesh::init(doInit); + } + + protectedCell_.setSize(nCells()); + nRefinementIterations_ = 0; + dumpLevel_ = false; + // Read static part of dictionary readDict(); @@ -1175,6 +1195,8 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io) protectedCells.write(); } + + return true; } diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H index 795a541bd43bf0a6465a292b80ff3bead9e6afed..7025f7aaada555c6922a787f091699173c7c1362 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H @@ -228,7 +228,11 @@ public: // Constructors //- Construct from IOobject - explicit dynamicRefineFvMesh(const IOobject& io); + explicit dynamicRefineFvMesh + ( + const IOobject& io, + const bool doInit=true + ); //- Destructor @@ -237,6 +241,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Direct access to the refinement engine const hexRef8& meshCutter() const { diff --git a/src/dynamicFvMesh/include/createDynamicFvMesh.H b/src/dynamicFvMesh/include/createDynamicFvMesh.H index d447d12dd6d4ed8afb0e6e71ec2ac76ab285b90b..543bcbfe34fd146bbe985797858952d14be460b9 100644 --- a/src/dynamicFvMesh/include/createDynamicFvMesh.H +++ b/src/dynamicFvMesh/include/createDynamicFvMesh.H @@ -1,9 +1,6 @@ Info<< "Create mesh for time = " << runTime.timeName() << nl << endl; -autoPtr<dynamicFvMesh> meshPtr(dynamicFvMesh::New(args, runTime));//, false)); +autoPtr<dynamicFvMesh> meshPtr(dynamicFvMesh::New(args, runTime)); dynamicFvMesh& mesh = meshPtr(); - -// initialise all (lower levels and current) -mesh.init(true); diff --git a/src/dynamicFvMesh/staticFvMesh/staticFvMesh.C b/src/dynamicFvMesh/staticFvMesh/staticFvMesh.C index 7522a5bf25ee420d58f23a53913b168b3bdc1ed8..5dbffcf322c839143c17b8363661412a274fc160 100644 --- a/src/dynamicFvMesh/staticFvMesh/staticFvMesh.C +++ b/src/dynamicFvMesh/staticFvMesh/staticFvMesh.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,14 +35,15 @@ namespace Foam { defineTypeNameAndDebug(staticFvMesh, 0); addToRunTimeSelectionTable(dynamicFvMesh, staticFvMesh, IOobject); + addToRunTimeSelectionTable(dynamicFvMesh, staticFvMesh, doInit); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::staticFvMesh::staticFvMesh(const IOobject& io) +Foam::staticFvMesh::staticFvMesh(const IOobject& io, const bool doInit) : - dynamicFvMesh(io) + dynamicFvMesh(io, doInit) {} diff --git a/src/dynamicFvMesh/staticFvMesh/staticFvMesh.H b/src/dynamicFvMesh/staticFvMesh/staticFvMesh.H index acbd62338f8f2255e2e2547fd6001fe4aff3221b..e182d24c34e4eaa5aad84272bf6b733d6daec9f2 100644 --- a/src/dynamicFvMesh/staticFvMesh/staticFvMesh.H +++ b/src/dynamicFvMesh/staticFvMesh/staticFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -70,7 +71,7 @@ public: // Constructors //- Construct from IOobject - staticFvMesh(const IOobject& io); + staticFvMesh(const IOobject& io, const bool doInit=true); //- Construct from components without boundary. // Boundary is added using addFvPatches() member function diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index d93a7e5c48f4425fc570b1c91a7be5f32e1072a6..7a8de07dd3f9f3f4a1b785946cc9422ccb33ccc5 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -278,10 +278,6 @@ bool Foam::fvMesh::init(const bool doInit) // Intialise my data polyMesh::init(doInit); - - // All addressing needs to be updated - // deleteDemandDrivenData(lduPtr_); - clearAddressing(true); } // Check the existence of the cell volumes and read if present @@ -345,7 +341,9 @@ bool Foam::fvMesh::init(const bool doInit) moving(true); } - return false; + + // Assume something changed + return true; } @@ -932,7 +930,8 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p) void Foam::fvMesh::updateGeom() { - // Let surfaceInterpolation handle geometry calculation + // Let surfaceInterpolation handle geometry calculation. Note: this does + // lower levels updateGeom surfaceInterpolation::updateGeom(); } diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index f14f27582804e050a2f543833c14fa9977feb7c9..b7c63b027146c2c619d426640910f32a36c12429 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C @@ -288,24 +288,27 @@ void Foam::cyclicACMIPolyPatch::resetAMI(const UList<point>& points) const { DebugPout << "cyclicACMIPolyPatch::resetAMI : clearing cellCentres" - << " for " << name() << " and " << nonOverlapPatch.name() - << endl; - - WarningInFunction - << "The mesh already has cellCentres calculated when" - << " resetting ACMI " << name() << "." << nl - << "This is a problem since ACMI adapts the face areas" - << " (to close cells) so this has" << nl - << "to be done before cell centre calculation." << nl - << "This can happen if e.g. the cyclicACMI is after" - << " any processor patches in the boundary." << endl; - const_cast<polyMesh&>(mesh).primitiveMesh::clearGeom(); + << " for " << name() << " and " << nonOverlapPatch.name() << nl + << "The mesh already has cellCentres calculated when" + << " resetting ACMI " << name() << "." << nl + << "This is a problem since ACMI adapts the face areas" + << " (to close cells) so this has" << nl + << "to be done before cell centre calculation." << nl + << "This can happen if e.g. the cyclicACMI is after" + << " any processor patches in the boundary." << endl; + + const_cast<polyMesh&>(mesh).primitiveMesh::clearCellGeom(); } - - // Trigger re-building of faceAreas - (void)mesh.faceAreas(); - + // At this point we want face geometry but not cell geometry since we want + // correct the face area on duplicate baffles before calculating the cell + // centres and volumes. + if (!mesh.hasFaceAreas()) + { + FatalErrorInFunction + << "primitiveMesh must already have face geometry" + << abort(FatalError); + } // Calculate the AMI using partial face-area-weighted. This leaves // the weights as fractions of local areas (sum(weights) = 1 means @@ -423,9 +426,13 @@ void Foam::cyclicACMIPolyPatch::initMovePoints DebugPout<< "cyclicACMIPolyPatch::initMovePoints : " << name() << endl; // Note: calculates transformation and triggers face centre calculation - // - Note: resetAMI called by cyclicAMIPolyPatch::initMovePoints cyclicAMIPolyPatch::initMovePoints(pBufs, p); + if (!createAMIFaces_ && canResetAMI()) + { + resetAMI(); + } + scalePatchFaceAreas(); } diff --git a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C index 89013e02d846ca6502e19ddd44c219635f8e666e..8d1df08a541ad67f8099921713ba2cdea47eca0b 100644 --- a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C +++ b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C @@ -38,6 +38,7 @@ namespace Foam { defineTypeNameAndDebug(dynamicOversetFvMesh, 0); addToRunTimeSelectionTable(dynamicFvMesh, dynamicOversetFvMesh, IOobject); + addToRunTimeSelectionTable(dynamicFvMesh, dynamicOversetFvMesh, doInit); } @@ -526,13 +527,35 @@ void Foam::dynamicOversetFvMesh::writeAgglomeration // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::dynamicOversetFvMesh::dynamicOversetFvMesh(const IOobject& io) +Foam::dynamicOversetFvMesh::dynamicOversetFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicMotionSolverListFvMesh(io), - active_(false) + dynamicMotionSolverListFvMesh(io, doInit) +{ + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicOversetFvMesh::init(const bool doInit) { + if (doInit) + { + dynamicMotionSolverListFvMesh::init(doInit); + } + + active_ = false; + // Load stencil (but do not update) (void)Stencil::New(*this, false); + + // Assume something changed + return true; } diff --git a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H index 2a528b5bb62fb2f2247ace31a47ca23e602e896e..0e9e343b114bf148415dd0ae4f784a2469de5fce 100644 --- a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H +++ b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H @@ -186,7 +186,7 @@ public: // Constructors //- Construct from IOobject - dynamicOversetFvMesh(const IOobject& io); + dynamicOversetFvMesh(const IOobject& io, const bool doInit=true); //- Destructor @@ -344,6 +344,9 @@ public: } + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Update the mesh for both mesh motion and topology change virtual bool update(); diff --git a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C index 1dab5568ca3e2d60c453ca82e475cdff6ffd90d8..46f5cd86d8337cbb529d7eface91e2cb5062b35f 100644 --- a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C +++ b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.C @@ -45,6 +45,12 @@ namespace Foam dynamicMotionSolverTopoFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + dynamicMotionSolverTopoFvMesh, + doInit + ); } @@ -52,12 +58,31 @@ namespace Foam Foam::dynamicMotionSolverTopoFvMesh::dynamicMotionSolverTopoFvMesh ( - const IOobject& io + const IOobject& io, + const bool doInit ) : - topoChangerFvMesh(io), - motionPtr_(motionSolver::New(*this)) -{} + topoChangerFvMesh(io, doInit) +{ + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::dynamicMotionSolverTopoFvMesh::init(const bool doInit) +{ + if (doInit) + { + topoChangerFvMesh::init(doInit); + } + + motionPtr_ = motionSolver::New(*this); + + // Assume something changed + return true; +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.H b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.H index ac2eb4c040b971c234dc7b97babb4ba0f0e0cf1f..76bfe46f4424e647fd5ed4ba64ce502b6cfa887a 100644 --- a/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.H +++ b/src/topoChangerFvMesh/dynamicMotionSolverTopoFvMesh/dynamicMotionSolverTopoFvMesh.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd + Copyright (C) 2016-2020 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,7 +85,11 @@ public: // Constructors //- Construct from database - explicit dynamicMotionSolverTopoFvMesh(const IOobject& io); + explicit dynamicMotionSolverTopoFvMesh + ( + const IOobject& io, + const bool doInit=true + ); //- Destructor @@ -94,6 +98,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Update the mesh for both mesh motion and topology change virtual bool update(); }; diff --git a/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C b/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C index 58014383c70670a757ab35311436ddf155ba7f8b..6bdc46baf51b94a1282c4b560c01d044c565653b 100644 --- a/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C +++ b/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C @@ -49,6 +49,12 @@ namespace Foam movingConeTopoFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + topoChangerFvMesh, + movingConeTopoFvMesh, + doInit + ); } @@ -238,9 +244,13 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io) +Foam::movingConeTopoFvMesh::movingConeTopoFvMesh +( + const IOobject& io, + const bool doInit +) : - topoChangerFvMesh(io), + topoChangerFvMesh(io, doInit), motionDict_ ( IOdictionary @@ -255,17 +265,30 @@ Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io) false ) ).optionalSubDict(typeName + "Coeffs") - ), - motionVelAmplitude_(motionDict_.get<vector>("motionVelAmplitude")), - motionVelPeriod_(motionDict_.get<scalar>("motionVelPeriod")), - curMotionVel_ - ( - motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_) - ), - leftEdge_(motionDict_.get<scalar>("leftEdge")), - curLeft_(motionDict_.get<scalar>("leftObstacleEdge")), - curRight_(motionDict_.get<scalar>("rightObstacleEdge")) + ) { + if (doInit) + { + init(false); // do not initialise lower levels + } +} + + +bool Foam::movingConeTopoFvMesh::init(const bool doInit) +{ + if (doInit) + { + topoChangerFvMesh::init(doInit); + } + + motionVelAmplitude_ = motionDict_.get<vector>("motionVelAmplitude"); + motionVelPeriod_ = motionDict_.get<scalar>("motionVelPeriod"); + curMotionVel_ = + motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_); + leftEdge_ = motionDict_.get<scalar>("leftEdge"); + curLeft_ = motionDict_.get<scalar>("leftObstacleEdge"); + curRight_ = motionDict_.get<scalar>("rightObstacleEdge"); + Pout<< "Initial time:" << time().value() << " Initial curMotionVel_:" << curMotionVel_ << endl; @@ -294,6 +317,9 @@ Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io) curLeft_, curRight_ ); + + // Assume something changed + return true; } diff --git a/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.H b/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.H index a67b252c34f779995d04810ae329cf92cb71639c..ea228dab0b38b978068a9e2a706262be7ebf0f88 100644 --- a/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.H +++ b/src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -113,7 +114,11 @@ public: // Constructors //- Construct from database - explicit movingConeTopoFvMesh(const IOobject& io); + explicit movingConeTopoFvMesh + ( + const IOobject& io, + const bool doInit = true + ); //- Destructor @@ -122,6 +127,9 @@ public: // Member Functions + //- Initialise all non-demand-driven data + virtual bool init(const bool doInit); + //- Update the mesh for both mesh motion and topology change virtual bool update(); }; diff --git a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C index 6a19f964e23b04dc45a2e90ea116b9973b2ee2e9..9c2dae87361e7d824e2b9bdc8f40f45583da38f9 100644 --- a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C +++ b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.C @@ -43,15 +43,25 @@ namespace Foam rawTopoChangerFvMesh, IOobject ); + addToRunTimeSelectionTable + ( + topoChangerFvMesh, + rawTopoChangerFvMesh, + doInit + ); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components -Foam::rawTopoChangerFvMesh::rawTopoChangerFvMesh(const IOobject& io) +Foam::rawTopoChangerFvMesh::rawTopoChangerFvMesh +( + const IOobject& io, + const bool doInit +) : - topoChangerFvMesh(io) + topoChangerFvMesh(io, doInit) {} diff --git a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H index 0c77799d3c366210ea8faa769d9bf1f5f1f84781..2cc7c9b526a99c01b93097ae7cad2cb3c93ba11d 100644 --- a/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H +++ b/src/topoChangerFvMesh/rawTopoChangerFvMesh/rawTopoChangerFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -87,7 +88,11 @@ public: // Constructors //- Construct from database - explicit rawTopoChangerFvMesh(const IOobject& io); + explicit rawTopoChangerFvMesh + ( + const IOobject& io, + const bool doInit=true + ); //- Destructor virtual ~rawTopoChangerFvMesh(); diff --git a/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.C b/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.C index f21b2df088fdab4473d088c5e0006e0d37ced004..6d5fe61905497e04e28065725e8ba7447ce3cae5 100644 --- a/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.C +++ b/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,9 +39,13 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::topoChangerFvMesh::topoChangerFvMesh(const IOobject& io) +Foam::topoChangerFvMesh::topoChangerFvMesh +( + const IOobject& io, + const bool doInit +) : - dynamicFvMesh(io), + dynamicFvMesh(io, doInit), topoChanger_(*this) {} diff --git a/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.H b/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.H index 9faf31f7aba6e062a7a9afa885328dd833901235..4c19ee32ece1eb74dbed878115f7281dfef3b199 100644 --- a/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.H +++ b/src/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,7 +80,7 @@ public: // Constructors //- Construct from objectRegistry, and read/write options - explicit topoChangerFvMesh(const IOobject& io); + explicit topoChangerFvMesh(const IOobject& io, const bool doInit=true); //- Destructor