Go to the documentation of this file.
47 if (!maxAllowedDisplacement_)
50 <<
"maxAllowedDisplacement requested but not set" <<
nl
54 return maxAllowedDisplacement_();
60 Foam::optMeshMovement::optMeshMovement
67 maxAllowedDisplacement_(nullptr),
74 writeMeshQualityMetrics_
76 dict.getOrDefault(
"writeMeshQualityMetrics", false)
80 if (
dict.found(
"maxAllowedDisplacement"))
82 maxAllowedDisplacement_.
reset
84 new scalar(
dict.get<scalar>(
"maxAllowedDisplacement"))
95 const dictionary&
dict,
99 const word modelType(
dict.
get<word>(
"type"));
101 Info<<
"optMeshMovement type : " << modelType <<
endl;
103 auto* ctorPtr = dictionaryConstructorTable(modelType);
112 *dictionaryConstructorTablePtr_
131 displMethodPtr_->update();
134 mesh_.checkMesh(
true);
137 writeMeshQualityMetrics();
144 return displMethodPtr_;
156 if (writeMeshQualityMetrics_)
161 Info<<
"Average, Max cell non - orthogonality "
163 <<
" " <<
gMax(cellNonOrtho()) <<
endl;
164 Info<<
"Average, Max cell skewness " <<
gAverage(cellSkewness())
165 <<
" " <<
gMax(cellSkewness()) <<
endl;
168 createZeroFieldPtr<scalar>(mesh_,
"nonOrtho",
dimless)
172 createZeroFieldPtr<scalar>(mesh_,
"skewness",
dimless)
174 nonOrthoPtr().primitiveFieldRef() = cellNonOrtho();
175 skewnessPtr().primitiveFieldRef() = cellSkewness();
176 nonOrthoPtr().write();
177 skewnessPtr().write();
184 pointsInit_ = mesh_.points();
190 Info<<
"optMeshMovement:: resetting mesh points" <<
endl;
191 mesh_.movePoints(pointsInit_);
197 return maxAllowedDisplacement_.valid();
List< label > labelList
A List of labels.
virtual const pointField & points() const
A class for handling words, derived from Foam::string.
virtual labelList getActiveDesignVariables() const
A class for managing temporary objects.
Abstract base class for displacement methods, which are a set or wrapper classes allowing to change t...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Type gAverage(const FieldField< Field, Type > &f)
const labelList & getPatchIDs()
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
static autoPtr< optMeshMovement > New(fvMesh &mesh, const dictionary &dict, const labelList &patchIDs)
tmp< scalarField > nonOrthogonality() const
virtual void storeDesignVariables()
tmp< scalarField > skewness() const
Ostream & endl(Ostream &os)
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Class calculates cell quality measures.
bool maxAllowedDisplacementSet() const
autoPtr< displacementMethod > & returnDisplacementMethod()
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Generic templated field type.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
void reset(autoPtr< T > &&other) noexcept
#define FatalErrorInFunction
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setCorrection(const scalarField &correction)
scalar getMaxAllowedDisplacement() const
static autoPtr< displacementMethod > New(fvMesh &mesh, const labelList &patchIDs)
void writeMeshQualityMetrics()
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Abstract base class for translating an update of the design variables into mesh movement.
defineTypeNameAndDebug(combustionModel, 0)
virtual void resetDesignVariables()
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimless