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_
82 maxAllowedDisplacement_.reset
84 new scalar(
dict.
get<scalar>(
"maxAllowedDisplacement"))
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
Return raw points.
A class for handling words, derived from Foam::string.
virtual labelList getActiveDesignVariables() const
Return active design variables.
A class for managing temporary objects.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Type gAverage(const FieldField< Field, Type > &f)
const labelList & getPatchIDs()
Return patchIDs.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
static autoPtr< optMeshMovement > New(fvMesh &mesh, const dictionary &dict, const labelList &patchIDs)
tmp< scalarField > nonOrthogonality() const
Return cell non-orthogonality.
virtual void storeDesignVariables()
tmp< scalarField > skewness() const
Return cell skewness.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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
Whether maxAllowedDisplacement has been set.
autoPtr< displacementMethod > & returnDisplacementMethod()
Return displacementMethod.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setCorrection(const scalarField &correction)
Set design variable correction.
scalar getMaxAllowedDisplacement() const
Get maxAllowedDisplacement, is set.
static autoPtr< displacementMethod > New(fvMesh &mesh, const labelList &patchIDs)
Return a reference to the selected turbulence model.
void writeMeshQualityMetrics()
Write mesh quality metrics.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)
virtual void resetDesignVariables()
Reset to starting point of line search.
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimless
Dimensionless.