50 activeDesignVariables_(0)
65 ).
subDict(
"volumetricBSplinesMotionSolverCoeffs")
73 for (
const word& boxName : controlBoxes)
75 if (NURBSdict.
isDict(boxName))
87 volume_[iBox].writeParamCoordinates();
99 const label start(3*startCpID[boxI]);
100 const boolList& isActiveVar =
volume_[boxI].getActiveDesignVariables();
103 if (isActiveVar[varI])
141 return volume_[iNURB].getControlPoints();
162 nCPs += volume_[iNURB].getControlPoints().size();
171 return volume_.size();
183 startID[iNURB] +
volume_[iNURB].getControlPoints().size();
193 for (label iBox = 0; iBox < startCPID.
size() - 1 ; ++iBox)
195 if (cpI >= startCPID[iBox] || cpI < startCPID[iBox + 1])
202 <<
"Invalid control point ID " << cpI <<
endl
220 scalar maxDisplacement(0);
221 label pastControlPoints(0);
224 const label nb(volume_[iNURB].getControlPoints().size());
228 forAll(localControlPointsMovement, iCPM)
230 localControlPointsMovement[iCPM] =
231 controlPointsMovement[pastControlPoints + iCPM];
234 maxDisplacement =
max
237 volume_[iNURB].computeMaxBoundaryDisplacement
239 localControlPointsMovement,
244 pastControlPoints += nb;
247 return maxDisplacement;
256 label pastControlPoints(0);
259 const label nb(volume_[iNURB].getControlPoints().size());
263 forAll(localControlPointsMovement, iCPM)
265 localControlPointsMovement[iCPM] =
266 controlPointsMovement[pastControlPoints + iCPM];
269 volume_[iNURB].boundControlPointMovement(localControlPointsMovement);
272 forAll(localControlPointsMovement, iCPM)
274 controlPointsMovement[pastControlPoints + iCPM] =
275 localControlPointsMovement[iCPM];
278 pastControlPoints += nb;
288 label pastControlPoints(0);
291 const label nb(volume_[iNURB].getControlPoints().size());
295 forAll(localControlPointsMovement, iCPM)
297 localControlPointsMovement[iCPM] =
298 controlPointsMovement[pastControlPoints + iCPM];
303 volume_[iNURB].getControlPoints()
304 + localControlPointsMovement
307 volume_[iNURB].setControlPoints(newCps);
309 pastControlPoints += nb;
318 box.writeCps(
"cpsBsplines" + mesh_.time().timeName());
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const fvMesh & mesh() const
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
const vectorField & getControlPoints() const
Get control points.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const word & constant() const
Return constant name.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
wordList toc() const
Return the table of contents.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void updateMesh()
Update for new mesh topology.
Creates the parallel distribution map by describing the source and target objects using box shapes.
Class constructing a number of volumetric B-Splines boxes, read from dynamicMeshDict....
virtual bool movePoints()
Dummy function required by MeshObject.
void moveControlPoints(const vectorField &controlPointsMovement)
Move control points. No effect on mesh.
const vectorField & getControlPoints(const label &iNURB) const
Get reference to control points.
const PtrList< NURBS3DVolume > & boxes() const
Get const reference to the vol. B-splines boxes.
vectorField getAllControlPoints() const
Get control points from all boxes.
const labelList & getActiveDesignVariables() const
Get active design variables.
void writeControlPoints() const
Write control points to constant and optimisation folders.
scalar computeMaxBoundaryDisplacement(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved)
labelList getStartCpID() const
Get start CP ID for each box.
label findBoxID(const label cpI) const
Find box of certain control point.
NURBS3DVolume & boxRef(const label boxI)
Get non-const reference to a specific box.
PtrList< NURBS3DVolume > & boxesRef()
Get non-const reference to the vol. B-splines boxes.
labelList activeDesignVariables_
Active design variables numbering for all boxes.
label getTotalControlPointsNumber() const
Get cumulative number of control points from all boxes.
void boundControlPointMovement(vectorField &controlPointsMovement) const
Bound control points movement.
PtrList< NURBS3DVolume > volume_
List with volumetric B-splines boxes.
label getNumberOfBoxes() const
Get number of boxes.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.