Cell layer addition mesh modifier. More...
Public Member Functions | |
TypeName ("layerAdditionRemoval") | |
Runtime type information. More... | |
layerAdditionRemoval (const word &name, const label index, const polyTopoChanger &ptc, const word &zoneName, const scalar minThickness, const scalar maxThickness, const Switch thicknessFromVolume=true) | |
Construct from components. More... | |
layerAdditionRemoval (const word &name, const dictionary &dict, const label index, const polyTopoChanger &ptc) | |
Construct from dictionary. More... | |
virtual | ~layerAdditionRemoval () |
Destructor. More... | |
virtual bool | changeTopology () const |
Check for topology change. More... | |
virtual void | setRefinement (polyTopoChange &) const |
Insert the layer addition/removal instructions. More... | |
virtual void | modifyMotionPoints (pointField &motionPoints) const |
Modify motion points to comply with the topological change. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Force recalculation of locally stored data on topological change. More... | |
scalar | minLayerThickness () const |
Return min layer thickness which triggers removal. More... | |
void | setMinLayerThickness (const scalar t) const |
Set min layer thickness which triggers removal. More... | |
scalar | maxLayerThickness () const |
Return max layer thickness which triggers removal. More... | |
void | setMaxLayerThickness (const scalar t) const |
Set max layer thickness which triggers removal. More... | |
virtual void | write (Ostream &) const |
Write. More... | |
virtual void | writeDict (Ostream &) const |
Write dictionary. More... | |
![]() | |
TypeName ("meshModifier") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, polyMeshModifier, dictionary,(const word &name, const dictionary &dict, const label index, const polyTopoChanger &mme),(name, dict, index, mme)) | |
polyMeshModifier (const word &name, const label index, const polyTopoChanger &mme, const bool act) | |
Construct from components. More... | |
virtual | ~polyMeshModifier () |
Destructor. More... | |
const word & | name () const |
Return name of this modifier. More... | |
label | index () const |
Return the index of this modifier. More... | |
const polyTopoChanger & | topoChanger () const |
Return reference to morph engine. More... | |
const Switch & | active () const |
void | enable () const |
Activate mesh modifier. More... | |
void | disable () const |
Activate mesh modifier. More... | |
Private Member Functions | |
layerAdditionRemoval (const layerAdditionRemoval &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const layerAdditionRemoval &) |
Disallow default bitwise assignment. More... | |
void | checkDefinition () |
Check validity of construction data. More... | |
bool | validCollapse () const |
Check for valid layer. More... | |
bool | setLayerPairing () const |
Set layer pairing. Return true if a valid layer exists. More... | |
const labelList & | pointsPairing () const |
Return points pairing in a layer (not automatic!) More... | |
const labelList & | facesPairing () const |
Return faces pairing in a layer (not automatic!) More... | |
tmp< vectorField > | extrusionDir () const |
Calculate the offset to the next layer. More... | |
void | addCellLayer (polyTopoChange &) const |
Add a layer of cells. More... | |
void | removeCellLayer (polyTopoChange &) const |
Remove a layer of cells. More... | |
void | clearAddressing () const |
Clear addressing. More... | |
Static Private Member Functions | |
static scalar | readOldThickness (const dictionary &) |
Optionally read old thickness. More... | |
Private Attributes | |
faceZoneID | faceZoneID_ |
Master face zone ID. More... | |
scalar | minLayerThickness_ |
Min thickness of extrusion layer. Triggers layer removal. More... | |
scalar | maxLayerThickness_ |
Max thickness of extrusion layer. Triggers layer addition. More... | |
const bool | thicknessFromVolume_ |
Switch to calculate thickness as volume/area. More... | |
scalar | oldLayerThickness_ |
Layer thickness from previous step. More... | |
labelList * | pointsPairingPtr_ |
Point pairing. More... | |
labelList * | facesPairingPtr_ |
Face pairing. More... | |
label | triggerRemoval_ |
Layer removal trigger time index. More... | |
label | triggerAddition_ |
Layer addition trigger time index. More... | |
Static Private Attributes | |
static const scalar | addDelta_ = 0.3 |
Thickness insertion fraction for the pre-motion. More... | |
static const scalar | removeDelta_ = 0.1 |
Thickness removal fraction for the cell collapse. More... | |
Additional Inherited Members | |
![]() | |
static autoPtr< polyMeshModifier > | New (const word &name, const dictionary &dict, const label index, const polyTopoChanger &mme) |
Select constructed from dictionary. More... | |
Cell layer addition mesh modifier.
Definition at line 52 of file layerAdditionRemoval.H.
|
private |
Disallow default bitwise copy construct.
layerAdditionRemoval | ( | const word & | name, |
const label | index, | ||
const polyTopoChanger & | ptc, | ||
const word & | zoneName, | ||
const scalar | minThickness, | ||
const scalar | maxThickness, | ||
const Switch | thicknessFromVolume = true |
||
) |
Construct from components.
Definition at line 136 of file layerAdditionRemoval.C.
layerAdditionRemoval | ( | const word & | name, |
const dictionary & | dict, | ||
const label | index, | ||
const polyTopoChanger & | ptc | ||
) |
Construct from dictionary.
Definition at line 162 of file layerAdditionRemoval.C.
|
virtual |
Destructor.
Definition at line 189 of file layerAdditionRemoval.C.
|
private |
Disallow default bitwise assignment.
|
private |
Check validity of construction data.
Definition at line 57 of file layerAdditionRemoval.C.
References Foam::abort(), DynamicID::active(), Foam::endl(), layerAdditionRemoval::faceZoneID_, polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, DynamicID::index(), layerAdditionRemoval::maxLayerThickness_, polyTopoChanger::mesh(), layerAdditionRemoval::minLayerThickness_, DynamicID::name(), polyMeshModifier::name(), Foam::nl, Foam::Pout, Foam::reduce(), and polyMeshModifier::topoChanger().
|
private |
Check for valid layer.
Definition at line 39 of file removeCellLayer.C.
References Foam::endl(), layerAdditionRemoval::facesPairing(), layerAdditionRemoval::faceZoneID_, forAll, DynamicID::index(), mesh, polyTopoChanger::mesh(), polyMeshModifier::name(), Foam::Pout, Foam::returnReduce(), and polyMeshModifier::topoChanger().
|
private |
Set layer pairing. Return true if a valid layer exists.
Definition at line 38 of file setLayerPairing.C.
References Foam::abort(), cells, layerAdditionRemoval::clearAddressing(), Foam::endl(), layerAdditionRemoval::facesPairingPtr_, layerAdditionRemoval::faceZoneID_, Foam::FatalError, FatalErrorInFunction, face::flip(), forAll, oppositeFace::found(), DynamicID::index(), oppositeFace::masterIndex(), mesh, polyTopoChanger::mesh(), Foam::nl, oppositeFace::oppositeIndex(), layerAdditionRemoval::pointsPairingPtr_, Foam::Pout, Foam::reduce(), List::size(), and polyMeshModifier::topoChanger().
Referenced by layerAdditionRemoval::extrusionDir().
|
private |
Return points pairing in a layer (not automatic!)
Definition at line 186 of file setLayerPairing.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::name().
Referenced by layerAdditionRemoval::extrusionDir().
|
private |
Return faces pairing in a layer (not automatic!)
Definition at line 198 of file setLayerPairing.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::name().
Referenced by layerAdditionRemoval::validCollapse().
|
private |
Calculate the offset to the next layer.
Definition at line 38 of file addCellLayer.C.
References Foam::endl(), layerAdditionRemoval::faceZoneID_, forAll, DynamicID::index(), mesh, polyTopoChanger::mesh(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), layerAdditionRemoval::minLayerThickness_, Foam::constant::atomic::mp, polyMeshModifier::name(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointNormals(), points, layerAdditionRemoval::pointsPairing(), Foam::Pout, layerAdditionRemoval::setLayerPairing(), and polyMeshModifier::topoChanger().
|
private |
Add a layer of cells.
Definition at line 87 of file addCellLayer.C.
References Foam::abort(), polyMesh::boundaryMesh(), cells, primitiveMesh::cells(), polyMesh::cellZones(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), primitiveMesh::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), primitiveMesh::edges(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), primitiveMesh::facesPerCell_, polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, forAll, HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::constant::atomic::mp, Foam::name(), PrimitivePatch< Face, FaceList, PointField, PointType >::nInternalEdges(), points, polyMesh::points(), Foam::Pout, Foam::help::reverseFace(), polyTopoChange::setAction(), List::size(), HashTable::toc(), polyBoundaryMesh::whichPatch(), and ZoneMesh::whichZone().
|
private |
Remove a layer of cells.
Definition at line 89 of file removeCellLayer.C.
References polyMesh::boundaryMesh(), cells, primitiveMesh::cells(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), primitiveMesh::facesPerCell_, primitiveMesh::facesPerPoint_, polyMesh::faceZones(), face::flip(), faceZone::flipMap(), forAll, forAllConstIter(), HashTable::found(), HashSet< Key, Hash >::insert(), primitiveMesh::isInternalFace(), Foam::max(), mesh, Foam::min(), Foam::name(), primitiveMesh::nInternalFaces(), Foam::nl, primitiveMesh::pointFaces(), Foam::Pout, polyTopoChange::setAction(), List::size(), HashTable::toc(), faceZone::whichFace(), polyBoundaryMesh::whichPatch(), and ZoneMesh::whichZone().
|
private |
Clear addressing.
Definition at line 107 of file layerAdditionRemoval.C.
References Foam::deleteDemandDrivenData(), Foam::endl(), Foam::nl, and Foam::Pout.
Referenced by layerAdditionRemoval::setLayerPairing().
|
staticprivate |
Optionally read old thickness.
Definition at line 99 of file layerAdditionRemoval.C.
References dict, and dictionary::lookupOrDefault().
TypeName | ( | "layerAdditionRemoval" | ) |
Runtime type information.
|
virtual |
Check for topology change.
Implements polyMeshModifier.
Definition at line 197 of file layerAdditionRemoval.C.
References Foam::abort(), primitiveMesh::cells(), primitiveMesh::cellVolumes(), Foam::e, cell::edges(), Foam::endl(), primitiveMesh::faceAreas(), polyMesh::faces(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), faceZone::masterCells(), Foam::max(), mesh, Foam::min(), Foam::name(), Foam::nl, polyMesh::points(), Foam::Pout, Foam::reduce(), List::size(), fvMesh::time(), and TimeState::timeIndex().
|
virtual |
Insert the layer addition/removal instructions.
into the topological change
Implements polyMeshModifier.
Definition at line 395 of file layerAdditionRemoval.C.
References Foam::endl(), mesh, Foam::name(), Foam::Pout, and timeIndex.
|
virtual |
Modify motion points to comply with the topological change.
Implements polyMeshModifier.
Definition at line 214 of file setLayerPairing.C.
References Foam::endl(), Foam::name(), and Foam::Pout.
|
virtual |
Force recalculation of locally stored data on topological change.
Implements polyMeshModifier.
Definition at line 434 of file layerAdditionRemoval.C.
References Foam::endl(), mesh, Foam::name(), and Foam::Pout.
|
inline |
Return min layer thickness which triggers removal.
Definition at line 196 of file layerAdditionRemoval.H.
References layerAdditionRemoval::minLayerThickness_.
void setMinLayerThickness | ( | const scalar | t | ) | const |
Set min layer thickness which triggers removal.
Definition at line 459 of file layerAdditionRemoval.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Return max layer thickness which triggers removal.
Definition at line 205 of file layerAdditionRemoval.H.
References layerAdditionRemoval::maxLayerThickness_.
void setMaxLayerThickness | ( | const scalar | t | ) | const |
Set max layer thickness which triggers removal.
Definition at line 472 of file layerAdditionRemoval.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
virtual |
Write.
Implements polyMeshModifier.
Definition at line 485 of file layerAdditionRemoval.C.
References Foam::endl(), Foam::name(), Foam::nl, and Foam::type().
|
virtual |
Write dictionary.
Implements polyMeshModifier.
Definition at line 497 of file layerAdditionRemoval.C.
References token::BEGIN_BLOCK, token::END_BLOCK, token::END_STATEMENT, Foam::endl(), Foam::name(), Foam::nl, and Foam::type().
|
private |
Master face zone ID.
Definition at line 59 of file layerAdditionRemoval.H.
Referenced by layerAdditionRemoval::checkDefinition(), layerAdditionRemoval::extrusionDir(), layerAdditionRemoval::setLayerPairing(), and layerAdditionRemoval::validCollapse().
|
mutableprivate |
Min thickness of extrusion layer. Triggers layer removal.
Definition at line 62 of file layerAdditionRemoval.H.
Referenced by layerAdditionRemoval::checkDefinition(), layerAdditionRemoval::extrusionDir(), and layerAdditionRemoval::minLayerThickness().
|
mutableprivate |
Max thickness of extrusion layer. Triggers layer addition.
Definition at line 65 of file layerAdditionRemoval.H.
Referenced by layerAdditionRemoval::checkDefinition(), and layerAdditionRemoval::maxLayerThickness().
|
private |
Switch to calculate thickness as volume/area.
If false, thickness calculated from edges
Definition at line 69 of file layerAdditionRemoval.H.
|
mutableprivate |
Layer thickness from previous step.
Used to decide whether to add or remove layers
Definition at line 73 of file layerAdditionRemoval.H.
|
mutableprivate |
Point pairing.
Definition at line 76 of file layerAdditionRemoval.H.
Referenced by layerAdditionRemoval::setLayerPairing().
|
mutableprivate |
Face pairing.
Definition at line 79 of file layerAdditionRemoval.H.
Referenced by layerAdditionRemoval::setLayerPairing().
|
mutableprivate |
Layer removal trigger time index.
Definition at line 82 of file layerAdditionRemoval.H.
|
mutableprivate |
Layer addition trigger time index.
Definition at line 85 of file layerAdditionRemoval.H.
|
staticprivate |
Thickness insertion fraction for the pre-motion.
Definition at line 136 of file layerAdditionRemoval.H.
|
staticprivate |
Thickness removal fraction for the cell collapse.
Note: the cell will be collapsed to this relative thickness before the layer is removed.
Definition at line 141 of file layerAdditionRemoval.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.