47 if (!maxAllowedDisplacement_)
50 <<
"maxAllowedDisplacement requested but not set" <<
nl
54 return maxAllowedDisplacement_();
67 maxAllowedDisplacement_(nullptr),
74 writeMeshQualityMetrics_
76 dict.getOrDefault(
"writeMeshQualityMetrics", false)
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();
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
Class calculates cell quality measures.
tmp< scalarField > nonOrthogonality() const
Return cell non-orthogonality.
tmp< scalarField > skewness() const
Return cell skewness.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Abstract base class for displacement methods, which are a set or wrapper classes allowing to change t...
Mesh data needed to do the Finite Volume discretisation.
Abstract base class for translating an update of the design variables into mesh movement.
virtual void resetDesignVariables()
Reset to starting point of line search.
void setCorrection(const scalarField &correction)
Set design variable correction.
virtual labelList getActiveDesignVariables() const
Return active design variables.
const labelList & getPatchIDs()
Return patchIDs.
bool maxAllowedDisplacementSet() const
Whether maxAllowedDisplacement has been set.
scalar getMaxAllowedDisplacement() const
Get maxAllowedDisplacement, is set.
void writeMeshQualityMetrics()
Write mesh quality metrics.
autoPtr< displacementMethod > & returnDisplacementMethod()
Return displacementMethod.
virtual void storeDesignVariables()
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gAverage(const FieldField< Field, Type > &f)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gMax(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.