Given a displacement moves the mesh by scaling the displacement back until there are no more mesh errors. More...
Static Public Member Functions | |
static void | setDisplacementPatchFields (const labelList &patchIDs, pointVectorField &pointDisplacement) |
static void | setDisplacement (const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement) |
static bool | checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false) |
static bool | checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, labelHashSet &wrongFaces, const bool dryRun=false) |
static bool | checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces, const bool dryRun=false) |
static bool | checkMesh (const bool report, const dictionary &dict, const polyMeshGeometry &, const pointField &, const labelList &checkFaces, labelHashSet &wrongFaces, const bool dryRun=false) |
static bool | checkMesh (const bool report, const dictionary &dict, const polyMeshGeometry &, const pointField &, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces, const bool dryRun=false) |
template<class Type > | |
static Type | get (const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt, const Type &defaultValue=Zero) |
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh errors.
Holds displacement field (read upon construction since need boundary conditions) and scaling factor and optional patch number on which to scale back displacement.
E.g.
// Construct iterative mesh mover. motionSmoother meshMover(mesh, labelList(1, patchi)); // Set desired displacement: meshMover.displacement() = .. for (label iter = 0; iter < maxIter; iter++) { if (meshMover.scaleMesh(true)) { Info<< "Successfully moved mesh" << endl; return true; } }
Definition at line 96 of file motionSmootherAlgo.H.
motionSmootherAlgo | ( | polyMesh & | mesh, |
pointMesh & | pMesh, | ||
indirectPrimitivePatch & | pp, | ||
pointVectorField & | displacement, | ||
pointScalarField & | scale, | ||
pointField & | oldPoints, | ||
const labelList & | adaptPatchIDs, | ||
const dictionary & | paramDict, | ||
const bool | dryRun = false |
||
) |
Definition at line 319 of file motionSmootherAlgo.C.
~motionSmootherAlgo | ( | ) |
Definition at line 348 of file motionSmootherAlgo.C.
ClassName | ( | "motionSmootherAlgo" | ) |
const Foam::polyMesh & mesh | ( | ) | const |
Definition at line 354 of file motionSmootherAlgo.C.
const Foam::pointMesh & pMesh | ( | ) | const |
Definition at line 360 of file motionSmootherAlgo.C.
Referenced by snappySnapDriver::smoothDisplacement().
const Foam::indirectPrimitivePatch & patch | ( | ) | const |
Definition at line 366 of file motionSmootherAlgo.C.
Referenced by snappySnapDriver::smoothDisplacement().
const Foam::labelList & adaptPatchIDs | ( | ) | const |
Definition at line 372 of file motionSmootherAlgo.C.
const Foam::dictionary & paramDict | ( | ) | const |
Definition at line 378 of file motionSmootherAlgo.C.
|
inline |
Definition at line 335 of file motionSmootherAlgo.H.
Referenced by snappySnapDriver::preSmoothPatch().
|
inline |
Definition at line 341 of file motionSmootherAlgo.H.
void correct | ( | ) |
Definition at line 384 of file motionSmootherAlgo.C.
Referenced by snappySnapDriver::doSnap(), and snappySnapDriver::preSmoothPatch().
|
static |
Definition at line 397 of file motionSmootherAlgo.C.
References GeometricField::boundaryFieldRef(), pointConstraints::constrainCorners(), GeometricField::Boundary::evaluate(), forAll, init(), MeshObject< pointMesh, UpdateableMeshObject, pointConstraints >::New(), and UPstream::scheduled.
void setDisplacementPatchFields | ( | ) |
Definition at line 454 of file motionSmootherAlgo.C.
|
static |
Definition at line 461 of file motionSmootherAlgo.C.
References globalMeshData::coupledPatch(), IOobject::db(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, polyMesh::globalData(), Foam::mag(), mesh, PrimitivePatch< FaceList, PointField >::meshPoints(), OFstream::name(), primitiveMesh::nPoints(), IOobject::path(), polyMesh::points(), Foam::Pout, syncTools::syncPointList(), bitSet::test(), Foam::meshTools::writeOBJ(), VectorSpace< Vector< scalar >, scalar, 3 >::zero, and Foam::Zero.
Referenced by snappyLayerDriver::addLayers(), snappySnapDriver::doSnap(), and snappySnapDriver::preSmoothPatch().
void setDisplacement | ( | pointField & | patchDisp | ) |
Definition at line 555 of file motionSmootherAlgo.C.
void correctBoundaryConditions | ( | pointVectorField & | displacement | ) | const |
Definition at line 563 of file motionSmootherAlgo.C.
References UPstream::blocking, GeometricField::boundaryFieldRef(), pointConstraints::constrainCorners(), GeometricField::Boundary::evaluate(), forAll, init(), MeshObject< pointMesh, UpdateableMeshObject, pointConstraints >::New(), syncTools::syncPointList(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.
void modifyMotionPoints | ( | pointField & | newPoints | ) | const |
Definition at line 630 of file motionSmootherAlgo.C.
References twoDPointCorrector::correctPoints(), Foam::expressions::patchExpr::debug, Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::Info, MeshObject< polyMesh, UpdateableMeshObject, twoDPointCorrector >::New(), twoDPointCorrector::normalEdgeIndices(), twoDPointCorrector::planeNormal(), Foam::Pout, twoDPointCorrector::required(), and WarningInFunction.
Foam::tmp< Foam::pointField > curPoints | ( | ) | const |
Definition at line 742 of file motionSmootherAlgo.C.
References pointMesh::boundary(), correctBoundaryConditions(), Foam::expressions::patchExpr::debug, Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::isA(), pointBoundaryMesh::mesh(), IOobject::NO_READ, IOobject::NO_WRITE, Foam::Pout, GeometricField::primitiveField(), tmp::ref(), List::setSize(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.
Foam::scalar setErrorReduction | ( | const scalar | errorReduction | ) |
Definition at line 691 of file motionSmootherAlgo.C.
Referenced by snappySnapDriver::preSmoothPatch(), and snappySnapDriver::scaleMesh().
Definition at line 705 of file motionSmootherAlgo.C.
Referenced by snappySnapDriver::preSmoothPatch(), and snappySnapDriver::scaleMesh().
bool scaleMesh | ( | labelList & | checkFaces, |
const List< labelPair > & | baffles, | ||
const bool | smoothMesh = true , |
||
const label | nAllow = 0 |
||
) |
Definition at line 723 of file motionSmootherAlgo.C.
bool scaleMesh | ( | labelList & | checkFaces, |
const List< labelPair > & | baffles, | ||
const dictionary & | paramDict, | ||
const dictionary & | meshQualityDict, | ||
const bool | smoothMesh = true , |
||
const label | nAllow = 0 |
||
) |
Definition at line 816 of file motionSmootherAlgo.C.
References coupled(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, coupledPolyPatch::forwardT(), Foam::gMax(), Foam::gMin(), Foam::Info, HashSet::insert(), Foam::mag(), patchIdentifier::name(), Foam::nl, coupledPolyPatch::parallel(), patches, Foam::Pout, keyType::REGEX_RECURSIVE, Foam::returnReduce(), coupledPolyPatch::separated(), pointSet::sync(), faceSet::sync(), syncTools::syncPointList(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.
void movePoints | ( | ) |
Definition at line 681 of file motionSmootherAlgo.C.
void updateMesh | ( | ) |
Definition at line 1026 of file motionSmootherAlgo.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, syncTools::getMasterEdges(), IOobject::name(), Foam::nl, and patches.
|
static |
Definition at line 455 of file motionSmootherAlgoCheck.C.
References dict, Foam::identity(), and mesh.
Referenced by snappyLayerDriver::doLayers(), snappySnapDriver::doSnap(), and meshRefinement::splitFacesUndo().
|
static |
Definition at line 29 of file motionSmootherAlgoCheck.C.
|
static |
Definition at line 52 of file motionSmootherAlgoCheck.C.
References error::clear(), dict, Foam::endl(), Foam::FatalError, Foam::FatalIOError, Foam::Info, IOWarningInFunction, mesh, error::message(), Foam::nl, Foam::returnReduce(), and Foam::setw().
|
static |
Definition at line 475 of file motionSmootherAlgoCheck.C.
|
static |
Definition at line 502 of file motionSmootherAlgoCheck.C.
References polyMeshGeometry::cellCentres(), polyMeshGeometry::checkCellDeterminant(), polyMeshGeometry::checkFaceAngles(), polyMeshGeometry::checkFaceArea(), polyMeshGeometry::checkFaceDotProduct(), polyMeshGeometry::checkFaceFlatness(), polyMeshGeometry::checkFacePyramids(), polyMeshGeometry::checkFaceTets(), polyMeshGeometry::checkFaceTwist(), polyMeshGeometry::checkFaceWeights(), polyMeshGeometry::checkTriangleTwist(), polyMeshGeometry::checkVolRatio(), error::clear(), dict, Foam::endl(), polyMeshGeometry::faceAreas(), polyMeshGeometry::faceCentres(), Foam::FatalError, Foam::FatalIOError, Foam::Info, polyMeshGeometry::mesh(), error::message(), Foam::nl, Foam::Perr, points, Foam::returnReduce(), and Foam::setw().
void smooth | ( | const GeometricField< Type, pointPatchField, pointMesh > & | fld, |
const scalarField & | edgeWeight, | ||
GeometricField< Type, pointPatchField, pointMesh > & | newFld | ||
) | const |
Definition at line 226 of file motionSmootherAlgoTemplates.C.
References pointConstraints::constrain(), fld, forAll, and MeshObject< pointMesh, UpdateableMeshObject, pointConstraints >::New().
Referenced by snappySnapDriver::smoothDisplacement().
|
static |
Definition at line 288 of file motionSmootherAlgoTemplates.C.
References dict, Foam::endl(), Foam::FatalIOError, dictionary::name(), and dictionary::readEntry().
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > avg | ( | const GeometricField< Type, pointPatchField, pointMesh > & | fld, |
const scalarField & | edgeWeight | ||
) | const |
Definition at line 135 of file motionSmootherAlgoTemplates.C.
References pointConstraints::constrain(), Foam::constant::electromagnetic::e, primitiveMesh::edges(), fld, forAll, Foam::mag(), mesh, Foam::New(), MeshObject< pointMesh, UpdateableMeshObject, pointConstraints >::New(), IOobject::NO_READ, IOobject::NO_WRITE, primitiveMesh::nPoints(), syncTools::syncPointList(), and Foam::Zero.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.