Go to the documentation of this file.
54 #ifndef NURBS3DVolume_H
55 #define NURBS3DVolume_H
197 const vector& localCoordinates
227 bool computeParamCoors
239 bool computeParamCoors =
true
253 bool computeParamCoors =
true
338 bool DimensionedNormalSens =
true
471 void writeCps(
const string=
"cpsFile")
const;
void computeParametricCoordinates(const vectorField &points)
label maxIter_
Max iterations for Newton-Raphson.
label nWSymmetry() const
Get number of variables if CPs are moved symmetrically in W.
A class for handling words, derived from Foam::string.
boolListList3 boundVMinCPs_
const NURBSbasis & basisV() const
label nUSymmetry() const
Get number of variables if CPs are moved symmetrically in U.
const labelList & getMap()
Get map of points in box to mesh points.
vector volumeDerivativeU(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt u at point u,v,w.
void write() const
Write parametric coordinates.
boolList activeDesignVariables_
Which design variables are changed in an optimisation.
A class for managing temporary objects.
boolList activeControlPoints_
Which of the cps are moved in an optimisation.
NURBS3DVolume morpher. Includes support functions for gradient computations Base class providing supp...
NURBSbasis fuction. Used to construct NURBS curves, surfaces and volumes.
boolListList3 boundUMaxCPs_
vector volumeDerivativeW(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt w at point u,v,w.
autoPtr< pointVectorField > parametricCoordinatesPtr_
Parametric coordinates of pointsInBox.
virtual ~NURBS3DVolume()=default
Destructor.
string cpsFolder_
Folder to store control points.
vectorField localSystemCoordinates_
Coordinates in the local system for which CPs are defined.
tmp< vectorField > computeNewBoundaryPoints(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved)
Boundary mesh movement based on given control point movement.
void makeFolders()
Create folders to store cps and derivatives.
bool bound(vector &vec, scalar minValue=1e-7, scalar maxValue=0.999999)
Bound components to certain limits.
void confineControlPoint(const label cpI)
Confine all three movements for a prescribed control point.
vectorField cps_
The volumetric B-Splines control points.
virtual void updateLocalCoordinateSystem(const vectorField &cartesianPoints)=0
Update coordinates in the local system based on the cartesian points.
void confineControlPointsDirections()
Confine movement in all control points for user-defined directions.
void continuityRealatedConfinement()
Confine control point movement to maintain user-defined continuity.
vectorField computeControlPointSensitivities(const pointVectorField &pointSens, const labelList &sensitivityPatchIDs)
autoPtr< labelList > reverseMapPtr_
Map of mesh points to points-in-box.
label getCPID(const label i, const label j, const label k) const
Get control point ID from its I-J-K coordinates.
const pointVectorField & getParametricCoordinates()
Get parametric coordinates.
void confineBoundaryControlPoints()
Confine movement in boundary control points if necessary.
TypeName("NURBS3DVolume")
Runtime type information.
const fvMesh & mesh_
NURBS basis functions.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void findPointsInBox(const vectorField &meshPoints)
Find points within control points box.
const boolList & getActiveDesignVariables() const
Which design variables are active?
void determineActiveDesignVariablesAndPoints()
Create lists with active design variables and control points.
autoPtr< labelList > mapPtr_
Map of points-in-box to mesh points.
void writeCps(const string="cpsFile") const
scalar volumeDerivativeCP(const vector &u, const label cpI) const
Volume point derivative wrt to control point cpI at point u,v,w.
label nVSymmetry() const
Get number of variables if CPs are moved symmetrically in V.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void writeCpsInDict() const
Write control points on the local coordinate system.
bool confineX3movement() const
Mesh data needed to do the Finite Volume discretisation.
label confineBoundaryControlPoints_
bool confineX2movement() const
tmp< vectorField > getPointsInBox()
const NURBSbasis & basisW() const
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
vector volumeDerivativeV(const scalar u, const scalar v, const scalar w) const
Volume point derivative wrt v at point u,v,w.
virtual tensor transformationTensorDxDb(label globalPointIndex)=0
void setControlPoints(const vectorField &newCps)
Set new control points.
tmp< tensorField > dndbBasedSensitivities(const label patchI, const label cpI, bool DimensionedNormalSens=true)
Useful typenames for fields defined only at the boundaries.
const boolList & getActiveCPs() const
Which control points are active?
boolListList3 boundVMaxCPs_
virtual vector transformPointToCartesian(const vector &localCoordinates) const =0
Transform a point from its coordinate system to a cartesian system.
const labelList & getReverseMap()
void boundControlPointMovement(vectorField &controlPointsMovement)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
scalar tolerance_
Tolerance for Newton-Raphson.
tensor JacobianUVW(const vector &u) const
Jacobian matrix wrt to the volume parametric coordinates.
A 1D vector of objects of type <T> with a fixed length <N>.
boolListList3 boundUMinCPs_
Which movement components to freeze in each plane.
label k
Boltzmann constant.
const dimensionedScalar e
Elementary charge.
tmp< vectorField > coordinates(const vectorField &uVector) const
NURBS3DVolume(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors=true)
Construct from dictionary.
scalar computeMaxBoundaryDisplacement(const vectorField &controlPointsMovement, const labelList &patchesToBeMoved)
Compute max. displacement at the boundary.
const word & name() const
Get box name.
bool confineX1movement() const
Get confine movements.
tmp< tensorField > patchDxDbFace(const label patchI, const label cpI)
Get patch dx/db.
static autoPtr< NURBS3DVolume > New(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors=true)
Return a reference to the selected NURBS model.
tmp< pointTensorField > getDxDb(const label cpI)
Get dxCartesiandb for a certain control point.
tmp< volTensorField > getDxCellsDb(const label cpI)
Get dxCartesiandb for a certain control point on cells.
const NURBSbasis & basisU() const
Get basis functions.
const vectorField & getControlPoints() const
Get control points.
boolListList3 boundWMaxCPs_
tmp< tensorField > patchDxDb(const label patchI, const label cpI)
Get patch dx/db.
tmp< vectorField > computeNewPoints(const vectorField &controlPointsMovement)
Mesh movement based on given control point movement.
boolListList3 boundWMinCPs_
bool readStoredData_
Read parametric coordinates from file if present in the folder.
List< FixedList< bool, 3 > > boolListList3
declareRunTimeSelectionTable(autoPtr, NURBS3DVolume, dictionary,(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors),(dict, mesh, computeParamCoors))