43 volBSplinesBase::volBSplinesBase
50 activeDesignVariables_(0)
65 ).
subDict(
"volumetricBSplinesMotionSolverCoeffs")
69 volume_.resize(NURBSdict.size());
73 for (
const entry& dEntry : NURBSdict)
82 volume_[iBox].writeParamCoordinates();
94 const label start(3*startCpID[boxI]);
98 if (isActiveVar[varI])
136 return volume_[iNURB].getControlPoints();
157 nCPs += volume_[iNURB].getControlPoints().size();
166 return volume_.size();
178 startID[iNURB] +
volume_[iNURB].getControlPoints().size();
188 for (label iBox = 0; iBox < startCPID.size() - 1 ; ++iBox)
190 if (cpI >= startCPID[iBox] || cpI < startCPID[iBox + 1])
197 <<
"Invalid control point ID " << cpI <<
endl 215 scalar maxDisplacement(0);
216 label pastControlPoints(0);
219 const label nb(volume_[iNURB].getControlPoints().size());
223 forAll(localControlPointsMovement, iCPM)
225 localControlPointsMovement[iCPM] =
226 controlPointsMovement[pastControlPoints + iCPM];
229 maxDisplacement =
max 232 volume_[iNURB].computeMaxBoundaryDisplacement
234 localControlPointsMovement,
239 pastControlPoints += nb;
242 return maxDisplacement;
251 label pastControlPoints(0);
254 const label nb(volume_[iNURB].getControlPoints().size());
258 forAll(localControlPointsMovement, iCPM)
260 localControlPointsMovement[iCPM] =
261 controlPointsMovement[pastControlPoints + iCPM];
264 volume_[iNURB].boundControlPointMovement(localControlPointsMovement);
267 forAll(localControlPointsMovement, iCPM)
269 controlPointsMovement[pastControlPoints + iCPM] =
270 localControlPointsMovement[iCPM];
273 pastControlPoints += nb;
283 label pastControlPoints(0);
286 const label nb(volume_[iNURB].getControlPoints().size());
290 forAll(localControlPointsMovement, iCPM)
292 localControlPointsMovement[iCPM] =
293 controlPointsMovement[pastControlPoints + iCPM];
298 volume_[iNURB].getControlPoints()
299 + localControlPointsMovement
302 volume_[iNURB].setControlPoints(newCps);
304 pastControlPoints += nb;
313 box.writeCps(
"cpsBsplines" + mesh_.time().timeName());
const NURBS3DVolume & box(const label boxI) const
Get const reference to a specific box.
void moveControlPoints(const vectorField &controlPointsMovement)
Move control points. No effect on mesh.
virtual void updateMesh(const mapPolyMesh &)
Dummy function required by MeshObject.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void writeControlPoints() const
Write control points to constant and optimisation folders.
labelList activeDesignVariables_
Active design variables numbering for all boxes.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const vectorField & getControlPoints(const label &iNURB) const
Get reference to control points.
label getNumberOfBoxes() const
Get number of boxes.
NURBS3DVolume & boxRef(const label boxI)
Get non-const reference to a specific box.
Ignore writing from objectRegistry::writeObject()
const Time & time() const
Return the top-level database.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
static autoPtr< NURBS3DVolume > New(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors=true)
Return a reference to the selected NURBS model.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
vectorField getAllControlPoints() const
Get control points from all boxes.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
void setSize(const label n)
Alias for resize()
Reading required, file watched for runTime modification.
labelList getStartCpID() const
Get start CP ID for each box.
const PtrList< NURBS3DVolume > & boxes() const
Get const reference to the vol. B-splines boxes.
void boundControlPointMovement(vectorField &controlPointsMovement) const
Bound control points movement.
const word & constant() const noexcept
Return constant name.
defineTypeNameAndDebug(combustionModel, 0)
label getTotalControlPointsNumber() const
Get cumulative number of control points from all boxes.
PtrList< NURBS3DVolume > & boxesRef()
Get non-const reference to the vol. B-splines boxes.
const fvMesh & mesh() const
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.
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual bool movePoints()
Dummy function required by MeshObject.
List< label > labelList
A List of labels.
label findBoxID(const label cpI) const
Find box of certain control point.
PtrList< NURBS3DVolume > volume_
List with volumetric B-splines boxes.
Defines the attributes of an object for which implicit objectRegistry management is supported...
List< bool > boolList
A List of bools.
A keyword and a list of tokens is an 'entry'.
scalar computeMaxBoundaryDisplacement(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved)
Get max boundary displacement for a given control-points movement.
const labelList & getActiveDesignVariables() const
Get active 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)