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