Go to the documentation of this file.
54 #ifndef NURBS3DVolume_H
55 #define NURBS3DVolume_H
152 label
getCPID(
const label i,
const label j,
const label
k)
const;
197 const vector& localCoordinates
227 bool computeParamCoors
239 bool computeParamCoors =
true
253 bool computeParamCoors =
true
338 bool DimensionedNormalSens =
true
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.
const NURBSbasis & basisV() const
bool confineWMovement() const
A class for handling file names.
label nUSymmetry() const
Get number of variables if CPs are moved symmetrically in U.
boolListList3 confineUMaxCPs_
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 function. Used to construct NURBS curves, surfaces and volumes.
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.
boolListList3 confineWMaxCPs_
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.
bool confineVMovement() const
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.
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.
boolListList3 confineVMinCPs_
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
boolListList3 confineUMinCPs_
Which movement components to freeze in each plane.
void writeCpsInDict() const
Write control points on the local coordinate system.
Mesh data needed to do the Finite Volume discretisation.
label confineBoundaryControlPoints_
tmp< vectorField > getPointsInBox()
Get mesh points that reside within the control points box.
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.
void writeCps(const fileName &baseName="cpsFile") const
const boolList & getActiveCPs() const
Which control points are active?
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.
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 confineUMovement() 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.
boolListList3 confineVMaxCPs_
boolListList3 confineWMinCPs_
const vectorField & getControlPoints() const
Get control points.
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.
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))