42 optMeshMovementVolumetricBSplines,
55 const label nControlPoints(
correction.size()/3);
58 for (label iCP = 0; iCP < nControlPoints; ++iCP)
72 Foam::optMeshMovementVolumetricBSplines::optMeshMovementVolumetricBSplines
84 cpsInit_(volBSplinesBase_.getNumberOfBoxes())
92 boxes[boxI].getControlPoints().size()
94 cpsInit_[boxI] = boxes[boxI].getControlPoints();
104 vectorField cpMovement = controlPointMovement(correction_);
107 displMethodPtr_->setControlField(cpMovement);
120 cpsInit_[boxI] = boxes[boxI].getControlPoints();
131 <<
"optMeshMovementVolumetricBSplines:: resetting control points" 134 PtrList<NURBS3DVolume>& boxes = volBSplinesBase_.boxesRef();
137 boxes[boxI].setControlPoints(cpsInit_[boxI]);
148 const scalar maxDisplacement
150 volBSplinesBase_.computeMaxBoundaryDisplacement
157 Info<<
"maxAllowedDisplacement/maxDisplacement of boundary\t" 158 << getMaxAllowedDisplacement() <<
"/" << maxDisplacement <<
endl;
159 scalar eta = getMaxAllowedDisplacement() / maxDisplacement;
169 return volBSplinesBase_.getActiveDesignVariables();
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
virtual void storeDesignVariables()
Store design variables and mesh, to act as the starting point of line search.
const labelList patchIDs(pbm.patchSet(polyPatchNames, false, true).sortedToc())
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Abstract base class for translating an update of the design variables into mesh movement.
vectorField controlPointMovement(const scalarField &correction)
virtual void resetDesignVariables()
Reset to starting point of line search.
volBSplinesBase & volBSplinesBase_
Reference to underlaying volumetric B-Splines morpher.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
virtual labelList getActiveDesignVariables() const
Return active design variables.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
virtual void storeDesignVariables()
Store design variables and mesh, to act as the starting point of line search.
void setSize(const label n)
Alias for resize()
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void moveMesh()
Calculates surface mesh movement.
virtual void resetDesignVariables()
Reset to starting point of line search.
List< vectorField > cpsInit_
Backup of initial control points. Useful for line-search.
#define DebugInfo
Report an information message using Foam::Info.
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
virtual scalar computeEta(const scalarField &correction)
Compute eta value based on max displacement.
PtrList< NURBS3DVolume > & boxesRef()
Get non-const reference to the vol. B-splines boxes.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
autoPtr< displacementMethod > displMethodPtr_
Mesh movement engine and interface for applying mesh movement boundary conditions.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual void moveMesh()
Calculates mesh movemnt based on the correction of the design variables.
Class constructing a number of volumetric B-Splines boxes, read from dynamicMeshDict. Useful for various sensitivities and optMeshMovement classes.
static constexpr const zero Zero
Global zero (0)