39 #ifndef NURBS3DSurface_H 40 #define NURBS3DSurface_H 100 label nrmOrientation_;
109 label sgn(
const scalar val)
const;
111 scalar abs(
const scalar val)
const;
113 label mod(
const label
x,
const label interval)
const;
115 void setCPUVLinking();
131 const scalar minVal=1
e-7,
132 const scalar maxVal=0.999999
138 const scalar minVal=1
e-7,
139 const scalar maxVal=0.999999
152 const label spacingCorrInterval,
153 const scalar tolerance
164 const label nPointsU,
165 const label nPointsV,
176 const label nPointsU,
177 const label nPointsV,
187 const label nPointsU,
188 const label nPointsV,
201 const label nPointsU,
202 const label nPointsV,
218 const label nPointsU,
219 const label nPointsV,
233 const label nPointsU,
234 const label nPointsV,
282 const label lenAcc=25,
283 const label maxIter=10,
284 const label spacingCorrInterval=-1,
285 const scalar tolerance=1.
e-5
294 const vector& targetPoint,
295 const label maxIter=100,
296 const scalar tolerance=1.
e-6
302 const label maxIter=100,
303 const scalar tolerance=1.
e-6
308 const vector& targetPoint,
309 const scalar& uInitGuess,
310 const scalar& vInitGuess,
311 const label maxIter=100,
312 const scalar tolerance=1.
e-6
321 const label nUPts=100,
322 const label nVPts=100,
323 const label lenAcc=25,
324 const label maxIter=10,
325 const label spacingCorrInterval=-1,
326 const scalar tolerance=1.
e-5
338 bool checkRangeU(
const scalar u,
const label CPI)
const;
347 bool checkRangeV(
const scalar v,
const label CPI)
const;
380 scalar
lengthU(
const label vIConst)
const;
382 scalar
lengthU(
const scalar vConst)
const;
399 scalar
lengthV(
const label uIConst)
const;
401 scalar
lengthV(
const scalar uConst)
const;
520 return nrmOrientation_;
526 return givenInitNrm_;
scalar lengthU(const label vIConst, const label uIStart, const label uIEnd) const
const labelList & getCPsVCPIs() const
Return ID in v direction for a given cp ID.
label getNPtsU() const
Get number of point in u direction.
vector surfaceDerivativeUV(const scalar u, const scalar v) const
Surface second derivative wrt u and v at point u,v.
A class for handling file names.
vector surfaceDerivativeVV(const scalar u, const scalar v) const
Surface second derivative wrt v at point u,v.
const scalarList & getParametricCoordinatesU() const
Get parametric coordinates.
const NURBSbasis & getBasisFunctionV() const
void makeEquidistant(const label lenAcc=25, const label maxIter=10, const label spacingCorrInterval=-1, const scalar tolerance=1.e-5)
const List< vector > & getCPs() const
Get CPs.
const labelList & getBoundaryCPIDs()
Get IDs of boundary control points.
scalar lengthV(const label uIConst, const label vIStart, const label vIEnd) const
scalar surfaceDerivativeCP(const scalar u, const scalar v, const label CPI) const
Surface derivative wrt the weight of CPI at point u,v.
void setCPs(const List< vector > &CPs)
vector surfacePoint(const scalar &u, const scalar &v)
void write()
Write curve to file.
~NURBS3DSurface()=default
Destructor.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
const vector nrm(scalar u, scalar v)
const word & getName() const
Get name.
NURBSbasis function. Used to construct NURBS curves, surfaces and volumes.
NURBS3DSurface(const List< vector > &CPs, const label nPointsU, const label nPointsV, const NURBSbasis &uBasis, const NURBSbasis &vBasis, const word name="NURBS3DSurface")
Construct from number of control points and basis functions.
const scalarList & getWeights() const
Get weights.
const scalarList & getParametricCoordinatesV() const
vector surfaceDerivativeW(const scalar u, const scalar v, const label CPI) const
Surface derivative wrt WI at point u,v.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const vector & givenInitNrm() const
Return the initial nrmal given to compare to the Curve's nrmals.
bool checkRangeUV(const scalar v, const scalar u, const label CPI, const label uDegree, const label vDegree) const
List< scalarList > genEquidistant(const label nUPts=100, const label nVPts=100, const label lenAcc=25, const label maxIter=10, const label spacingCorrInterval=-1, const scalar tolerance=1.e-5)
Generate points on the surface which are evenly spaced in cartesian.
label getNPtsV() const
Get number of point in u direction.
bool checkRangeU(const scalar u, const label CPI, const label uDegree) const
const NURBSbasis & getBasisFunctionU() const
Get basis function.
const labelList & getCPsUCPIs() const
Return ID in u direction for a given cp ID.
bool checkRangeV(const scalar v, const label CPI, const label vDegree) const
label nrmOrientation() const
Return the nrm sgn relation to the u=0 nrm.
scalar lengthDerivativeV(const scalar uConst, const scalar vStart, const scalar vEnd, const label nPts) const
Surface derivative wrt v length along u=const contour range.
scalarList findClosestSurfacePoint(const vector &targetPoint, const label maxIter=100, const scalar tolerance=1.e-6)
#define R(A, B, C, D, E, F, K, M)
vector surfaceDerivativeU(const scalar u, const scalar v) const
Surface derivative wrt u at point u,v.
vector surfaceDerivativeUU(const scalar u, const scalar v) const
Surface second derivative wrt u at point u,v.
const label & whichBoundaryCPI(const label &globalCPI)
Get the boundary CP ID based on the global CP ID.
void writeVTK(const fileName vtkDirName, const fileName vtkFileName)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
void setWeights(const scalarList &weights)
vector surfaceDerivativeV(const scalar u, const scalar v) const
Surface derivative wrt v at point u,v.
A class for managing temporary objects.
void setNrmOrientation(const vector &givenNrm, const scalar u, const scalar v)
const labelList & getBoundaryCPIs()
void flipNrmOrientation()
Flip the orientation of the nrm.
void setName(const word &name)
scalar lengthDerivativeU(const scalar vConst, const scalar uStart, const scalar uEnd, const label nPts) const
Surface derivative wrt u length along v=const contour range.