Go to the documentation of this file.
54 #ifndef NURBS3DVolume_H
55 #define NURBS3DVolume_H
196 const vector& localCoordinates
226 bool computeParamCoors
238 bool computeParamCoors =
true
252 bool computeParamCoors =
true
337 bool DimensionedNormalSens =
true
381 label
getCPID(
const label i,
const label j,
const label
k)
const;
void computeParametricCoordinates(const vectorField &points)
const dictionary & dict() const
Get dictionary.
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.
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...
boolVectorList confineVMaxCPs_
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.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
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.
Specialized bundling of boolean values as a vector of 3 components, element access using x(),...
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.
List< boolVector > boolVectorList
bool confineVMovement() const
void findPointsInBox(const vectorField &meshPoints)
Find points within control points box.
NURBSbasis basisU_
NURBS basis functions.
const boolList & getActiveDesignVariables() const
Which design variables are active?
boolVectorList confineWMaxCPs_
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.
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.
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.
boolVectorList confineVMinCPs_
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?
boolVectorList confineUMinCPs_
Which movement components to freeze in each plane.
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)
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.
void writeCps(const fileName &="cpsFile", const bool transform=true) const
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.
const fvMesh & mesh() const
Get mesh.
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.
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.
boolVectorList confineWMinCPs_
boolVectorList confineUMaxCPs_
declareRunTimeSelectionTable(autoPtr, NURBS3DVolume, dictionary,(const dictionary &dict, const fvMesh &mesh, bool computeParamCoors),(dict, mesh, computeParamCoors))