From 8393e34d65eec6740bb1f203c7e70e35a60c203a Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Wed, 24 Jan 2018 10:53:46 +0100 Subject: [PATCH] Added compilation instructions with respective fixes for following classes: 1. dynamicPolyRefinementFvMesh 2. refinementSelection 3. fieldBoundsRefinement --- src/dynamicMesh/topoChangerFvMesh/Make/files | 4 ++++ .../dynamicPolyRefinementFvMesh.C | 21 +++++++++---------- .../dynamicPolyRefinementFvMesh.H | 1 + .../fieldBoundsRefinement.C | 18 ++++++++-------- .../fieldBoundsRefinement.H | 7 +++++-- .../refinementSelection/refinementSelection.H | 4 ++-- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/dynamicMesh/topoChangerFvMesh/Make/files b/src/dynamicMesh/topoChangerFvMesh/Make/files index 151654c9f..24b9524b0 100644 --- a/src/dynamicMesh/topoChangerFvMesh/Make/files +++ b/src/dynamicMesh/topoChangerFvMesh/Make/files @@ -11,4 +11,8 @@ mixerFvMesh/mixerFvMesh.C multiMixerFvMesh/mixerRotor.C multiMixerFvMesh/multiMixerFvMesh.C +dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C +dynamicPolyRefinementFvMesh/refinementSelection/refinementSelection/refinementSelection.C +dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.C + LIB = $(FOAM_LIBBIN)/libtopoChangerFvMesh diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C index 9eee3187e..582de4e53 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C @@ -54,9 +54,9 @@ void Foam::dynamicPolyRefinementFvMesh::readDict() if (refineInterval_ < 1) { FatalErrorIn("dynamicPolyRefinementFvMesh::readDict()") - << "Illegal refineInterval found: " << refineInterval << nl + << "Illegal refineInterval found: " << refineInterval_ << nl << "The refineInterval controls the refinement/unrefinement" - << " trigerring within a certain time step and should be > 0". + << " trigerring within a certain time step and should be > 0" << exit(FatalError); } } @@ -64,9 +64,12 @@ void Foam::dynamicPolyRefinementFvMesh::readDict() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh(const IOobject& io) +Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh +( + const IOobject& io +) : - dynamicFvMesh(io), + topoChangerFvMesh(io), refinementDict_ ( IOdictionary @@ -110,13 +113,13 @@ dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh(const IOobject& io) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -dynamicPolyRefinementFvMesh::~dynamicPolyRefinementFvMesh() +Foam::dynamicPolyRefinementFvMesh::~dynamicPolyRefinementFvMesh() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool dynamicPolyRefinementFvMesh::update() +bool Foam::dynamicPolyRefinementFvMesh::update() { // Re-read the data from dictionary for on-the-fly changes readDict(); @@ -127,7 +130,7 @@ bool dynamicPolyRefinementFvMesh::update() if ( time().timeIndex() > 0 - && time().timeIndex() % refineInterval == 0 + && time().timeIndex() % refineInterval_ == 0 ) { // Get reference to polyhedralRefinement polyMeshModifier @@ -179,8 +182,4 @@ bool dynamicPolyRefinementFvMesh::update() } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.H b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.H index 659272221..21c7511bf 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.H +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.H @@ -42,6 +42,7 @@ Notes #define dynamicPolyRefinementFvMesh_H #include "topoChangerFvMesh.H" +#include "refinementSelection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.C b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.C index 92edf8dd7..be15ce15d 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.C +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.C @@ -57,13 +57,13 @@ Foam::fieldBoundsRefinement::fieldBoundsRefinement const dictionary& dict ) : - refinementSelection_(mesh, dict), + refinementSelection(mesh, dict), fieldName_(coeffDict().lookup("fieldName")), lowerBound_(readScalar(coeffDict().lookup("lowerBound"))), upperBound_(readScalar(coeffDict().lookup("upperBound"))), cellPointCellSmoothing_ ( - coeffDict.lookupOrDefault("cellPointCellSmothing", false) + coeffDict().lookupOrDefault("cellPointCellSmothing", false) ) {} @@ -121,18 +121,18 @@ Foam::fieldBoundsRefinement::refinementCellCandidates() const // Get current cell value const scalar& cellValue = vfIn[cellI]; - if (cellValue > lowerBound && cellValue < upperBound) + if (cellValue > lowerBound_ && cellValue < upperBound_) { // Cell value is within the bounds, append cell for potential // refinement - refinementCandidates.append(cellI]; + refinementCandidates.append(cellI); } } // Print out some information - Info<< "Selection algorithm " << typeName() << " selected " + Info<< "Selection algorithm " << type() << " selected " << refinementCandidates.size() << " cells as refinement candidates." - << endl + << endl; // Return the list in the Xfer container to prevent copying return refinementCandidates.xfer(); @@ -164,7 +164,7 @@ Foam::fieldBoundsRefinement::unrefinementPointCandidates() const // Get point value const scalar pointValue = pFieldIn[pointI]; - if (pointValue > upperBound || pointValue < lowerBound) + if (pointValue > upperBound_ || pointValue < lowerBound_) { // Point value is outside of bounds, append point for potential // unrefinement @@ -173,10 +173,10 @@ Foam::fieldBoundsRefinement::unrefinementPointCandidates() const } // Print out some information - Info<< "Selection algorithm " << typeName() << " selected " + Info<< "Selection algorithm " << type() << " selected " << unrefinementCandidates.size() << " split points as unrefinement candidates." - << endl + << endl; // Return the list in the Xfer container to prevent copying return unrefinementCandidates.xfer(); diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.H b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.H index 00051a3c2..750f1453f 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.H +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBoundsRefinement.H @@ -42,6 +42,7 @@ Author #define fieldBoundsRefinement_H #include "refinementSelection.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,6 +54,8 @@ namespace Foam \*---------------------------------------------------------------------------*/ class fieldBoundsRefinement +: + public refinementSelection { // Private data @@ -100,10 +103,10 @@ public: // Selection of refinement/unrefinement candidates //- Return transferable list of cells to refine - const Xfer refinementCellCandidates() const; + virtual Xfer refinementCellCandidates() const; //- Return transferable list of split points to unrefine - const Xfer unrefinementPointCandidates() const; + virtual Xfer unrefinementPointCandidates() const; }; diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/refinementSelection/refinementSelection.H b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/refinementSelection/refinementSelection.H index 017b474ef..13757f308 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/refinementSelection/refinementSelection.H +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/refinementSelection/refinementSelection/refinementSelection.H @@ -155,10 +155,10 @@ public: // Selection of refinement/unrefinement candidates //- Return transferable list of refinement cell candidates - const Xfer refinementCellCandidates() const = 0; + virtual Xfer refinementCellCandidates() const = 0; //- Return transferable list of unrefinement split point candidates - const Xfer unrefinementPointCandidates() const = 0; + virtual Xfer unrefinementPointCandidates() const = 0; };