54#ifndef NURBS3DVolume_H
55#define NURBS3DVolume_H
199 const vector& localCoordinates
229 bool computeParamCoors
241 bool computeParamCoors =
true
255 bool computeParamCoors =
true
340 bool DimensionedNormalSens =
true
378 const bool moveCPs =
true
385 label
getCPID(
const label i,
const label j,
const label
k)
const;
Useful typenames for fields defined only at the boundaries.
Generic GeometricBoundaryField class.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
bool readStoredData_
Read parametric coordinates from file if present in the folder.
label maxIter_
Max iterations for Newton-Raphson.
virtual void updateLocalCoordinateSystem(const vectorField &cartesianPoints)=0
Update coordinates in the local system based on the cartesian points.
boolVectorList confineWMinCPs_
static autoPtr< NURBS3DVolume > New(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors=true)
Return a reference to the selected NURBS model.
boolVectorList confineVMinCPs_
tmp< tensorField > patchDxDbFace(const label patchI, const label cpI)
Get patch dx/db.
void computeParametricCoordinates(const vectorField &points)
bool bound(vector &vec, scalar minValue=1e-7, scalar maxValue=0.999999)
Bound components to certain limits.
label nUSymmetry() const
Get number of variables if CPs are moved symmetrically in U.
autoPtr< labelList > mapPtr_
Map of points-in-box to mesh points.
declareRunTimeSelectionTable(autoPtr, NURBS3DVolume, dictionary,(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors),(dict, mesh, computeParamCoors))
vector volumeDerivativeU(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt u at point u,v,w.
void confineBoundaryControlPoints()
Confine movement in boundary control points if necessary.
const labelList & getMap()
Get map of points in box to mesh points.
scalar tolerance_
Tolerance for Newton-Raphson.
Vector< label > nCPsPerDirection() const
Get number of control points per direction.
virtual bool writeData(Ostream &os) const
Write the control points to support restart.
scalar computeMaxBoundaryDisplacement(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved)
Compute max. displacement at the boundary.
boolVectorList confineVMaxCPs_
void findPointsInBox(const vectorField &meshPoints)
Find points within control points box.
tmp< vectorField > computeNewBoundaryPoints(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved, const bool moveCPs=true)
Boundary mesh movement based on given control point movement.
boolVectorList confineWMaxCPs_
const boolList & getActiveDesignVariables() const
Which design variables are active?
vectorField localSystemCoordinates_
Coordinates in the local system for which CPs are defined.
boolVectorList confineUMaxCPs_
vectorField computeControlPointSensitivities(const pointVectorField &pointSens, const labelList &sensitivityPatchIDs)
boolVectorList confineUMinCPs_
Which movement components to freeze in each plane.
const pointVectorField & getParametricCoordinates()
Get parametric coordinates.
tmp< volTensorField > getDxCellsDb(const label cpI)
Get dxCartesiandb for a certain control point on cells.
virtual tensor transformationTensorDxDb(label globalPointIndex)=0
autoPtr< labelList > reverseMapPtr_
Map of mesh points to points-in-box.
label nVSymmetry() const
Get number of variables if CPs are moved symmetrically in V.
tmp< pointTensorField > getDxDb(const label cpI)
Get dxCartesiandb for a certain control point.
NURBS3DVolume(const NURBS3DVolume &)
Construct as copy.
virtual ~NURBS3DVolume()=default
Destructor.
bool confineVMovement() const
void makeFolders()
Create folders to store cps and derivatives.
void writeCps(const fileName &="cpsFile", const bool transform=true) const
boolList activeDesignVariables_
Which design variables are changed in an optimisation.
tmp< tensorField > patchDxDb(const label patchI, const label cpI)
Get patch dx/db.
tmp< vectorField > getPointsInBox()
Get mesh points that reside within the control points box.
vector volumeDerivativeV(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt v at point u,v,w.
virtual vector transformPointToCartesian(const vector &localCoordinates) const =0
Transform a point from its coordinate system to a cartesian system.
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool DimensionedNormalSens=true)
string cpsFolder_
Folder to store control points.
NURBSbasis basisU_
NURBS basis functions.
void confineControlPoint(const label cpI)
Confine all three movements for a prescribed control point.
bool confineWMovement() const
const dictionary & dict() const
Get dictionary.
Vector< label > nSymmetry() const
vectorField cps_
The volumetric B-Splines control points.
const NURBSbasis & basisV() const
void boundControlPointMovement(vectorField &controlPointsMovement) const
void continuityRealatedConfinement()
Confine control point movement to maintain user-defined continuity.
label getCPID(const label i, const label j, const label k) const
Get control point ID from its I-J-K coordinates.
autoPtr< pointVectorField > parametricCoordinatesPtr_
Parametric coordinates of pointsInBox.
scalar volumeDerivativeCP(const vector &u, const label cpI) const
Volume point derivative wrt to control point cpI at point u,v,w.
label confineBoundaryControlPoints_
const NURBSbasis & basisW() const
const fvMesh & mesh() const
Get mesh.
label nWSymmetry() const
Get number of variables if CPs are moved symmetrically in W.
void writeParamCoordinates() const
Write parametric coordinates.
void determineActiveDesignVariablesAndPoints()
Create lists with active design variables and control points.
tmp< vectorField > coordinates(const vectorField &uVector) const
tmp< vectorField > computeNewPoints(const vectorField &controlPointsMovement)
Mesh movement based on given control point movement.
const word & name() const
Get box name.
List< boolVector > boolVectorList
bool confineUMovement() const
Get confine movements.
const boolList & getActiveCPs() const
Which control points are active?
tensor JacobianUVW(const vector &u) const
Jacobian matrix wrt to the volume parametric coordinates.
void setControlPoints(const vectorField &newCps)
Set new control points.
boolList activeControlPoints_
Which of the cps are moved in an optimisation.
const labelList & getReverseMap()
TypeName("NURBS3DVolume")
Runtime type information.
const NURBSbasis & basisU() const
Get basis functions.
const vectorField & getControlPoints() const
Get control points.
vector volumeDerivativeW(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt w at point u,v,w.
void confineControlPointsDirections()
Confine movement in all control points for user-defined directions.
NURBSbasis function. Used to construct NURBS curves, surfaces and volumes.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Specialized bundling of boolean values as a vector of 3 components, element access using x(),...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
localIOdictionary is derived from IOdictionary but excludes parallel master reading.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.