![]() |
MFEM v4.8.0
Finite element discretization library
|
A NURBS patch can be 1D, 2D, or 3D, and is defined as a tensor product of KnotVectors. More...
#include <nurbs.hpp>
Public Member Functions | |
NURBSPatch (const NURBSPatch &orig) | |
Copy constructor. | |
NURBSPatch (std::istream &input) | |
Constructor using data read from stream input. | |
NURBSPatch (const KnotVector *kv0, const KnotVector *kv1, int dim) | |
Constructor for a 2D patch. dim is the physical dimension plus 1. | |
NURBSPatch (const KnotVector *kv0, const KnotVector *kv1, const KnotVector *kv2, int dim) | |
Constructor for a 3D patch. | |
NURBSPatch (const KnotVector *kv0, const KnotVector *kv1, int dim_, const real_t *control_points) | |
NURBSPatch (const KnotVector *kv0, const KnotVector *kv1, const KnotVector *kv2, int dim_, const real_t *control_points) | |
NURBSPatch (Array< const KnotVector * > &kv_, int dim_, const real_t *control_points) | |
NURBSPatch (Array< const KnotVector * > &kv, int dim) | |
Constructor for a patch of dimension equal to the size of kv. | |
NURBSPatch & | operator= (const NURBSPatch &)=delete |
Copy assignment not supported. | |
~NURBSPatch () | |
Deletes data and KnotVectors. | |
void | Print (std::ostream &os) const |
Writes KnotVectors and data to the stream os. | |
void | DegreeElevate (int dir, int t) |
Increase the order in direction dir by t >= 0. | |
void | KnotInsert (int dir, const KnotVector &knot) |
Insert any new knots from knot in direction dir. If the order of knot is higher than the current order in direction dir, then the order is elevated in that direction to match. | |
void | KnotInsert (int dir, const Vector &knot) |
Insert knots from knot in direction dir. If a knot already exists, then it is still added, increasing its multiplicity. | |
void | KnotInsert (Array< Vector * > &knot) |
Call KnotInsert for each direction with the corresponding knot entry. | |
void | KnotInsert (Array< KnotVector * > &knot) |
Insert knots from knot determined by Difference, in each direction. | |
int | KnotRemove (int dir, real_t knot, int ntimes=1, real_t tol=1.0e-12) |
Remove knot with value knot from direction dir. | |
void | KnotRemove (int dir, Vector const &knot, real_t tol=1.0e-12) |
Remove all knots in knot once. | |
void | KnotRemove (Array< Vector * > &knot, real_t tol=1.0e-12) |
Remove all knots in knot once, for each direction. | |
void | DegreeElevate (int t) |
void | UniformRefinement (int rf=2) |
Refine with optional refinement factor rf. Uniform means refinement is done everywhere by the same factor, although nonuniform spacing functions may be used. | |
void | UniformRefinement (Array< int > const &rf) |
void | Coarsen (int cf=2, real_t tol=1.0e-12) |
Coarsen with optional coarsening factor cf which divides the number of elements in each dimension. Nonuniform spacing functions may be used in each direction. | |
void | Coarsen (Array< int > const &cf, real_t tol=1.0e-12) |
void | GetCoarseningFactors (Array< int > &f) const |
Calls KnotVector::GetCoarseningFactor for each direction. | |
void | SetKnotVectorsCoarse (bool c) |
Marks the KnotVector in each dimension as coarse. | |
int | GetNC () const |
Return the number of components stored in the NURBSPatch. | |
int | GetNKV () const |
Return the number of KnotVectors, which is the patch dimension. | |
KnotVector * | GetKV (int dir) |
real_t & | operator() (int i, int l) |
1D access function. i is a B-NET index, and l is a variable index. | |
const real_t & | operator() (int i, int l) const |
real_t & | operator() (int i, int j, int l) |
2D access function. i, j are B-NET indices, and l is a variable index. | |
const real_t & | operator() (int i, int j, int l) const |
real_t & | operator() (int i, int j, int k, int l) |
3D access function. i, j, k are B-NET indices, and l is a variable index. | |
const real_t & | operator() (int i, int j, int k, int l) const |
void | FlipDirection (int dir) |
Reverse data and knots in direction dir. | |
void | SwapDirections (int dir1, int dir2) |
Swap data and KnotVectors in directions dir1 and dir2. | |
void | Rotate (real_t angle, real_t normal[]=NULL) |
Rotate the NURBSPatch in 2D or 3D.. | |
void | Rotate2D (real_t angle) |
Rotate the NURBSPatch, 2D case. | |
void | Rotate3D (real_t normal[], real_t angle) |
Rotate the NURBSPatch, 3D case. | |
int | MakeUniformDegree (int degree=-1) |
Static Public Member Functions | |
static void | Get2DRotationMatrix (real_t angle, DenseMatrix &T) |
Compute the 2D rotation matrix T for angle angle. | |
static void | Get3DRotationMatrix (real_t n[], real_t angle, real_t r, DenseMatrix &T) |
Compute the 3D rotation matrix T for angle angle around axis n (a 3D vector, not necessarily normalized) and scalar factor r. | |
Protected Member Functions | |
int | SetLoopDirection (int dir) |
Flattens the B-NET in direction dir, producing a 1D net. Returns the number of variables per knot in flattened structure. | |
real_t & | slice (int i, int j) |
Access function for the effectively 1D flattened net, where i is a knot index, and j is an index of a variable per knot. | |
const real_t & | slice (int i, int j) const |
NURBSPatch (NURBSPatch *parent, int dir, int Order, int NCP) | |
Copy constructor. | |
void | swap (NURBSPatch *np) |
Deletes own data, takes data from np, and deletes np. | |
void | init (int dim) |
Protected Attributes | |
int | ni |
B-NET dimensions. | |
int | nj |
int | nk |
int | Dim |
Physical dimension plus 1. | |
real_t * | data |
Data with the layout (Dim x ni x nj x nk) | |
Array< KnotVector * > | kv |
KnotVectors in each direction. | |
int | nd |
int | ls |
int | sd |
Friends | |
NURBSPatch * | Interpolate (NURBSPatch &p1, NURBSPatch &p2) |
Given two patches p1 and p2 of the same dimensions, create and return a new patch by merging their knots and data. | |
NURBSPatch * | Revolve3D (NURBSPatch &patch, real_t n[], real_t ang, int times) |
A NURBS patch can be 1D, 2D, or 3D, and is defined as a tensor product of KnotVectors.
|
protected |
mfem::NURBSPatch::NURBSPatch | ( | const NURBSPatch & | orig | ) |
mfem::NURBSPatch::NURBSPatch | ( | std::istream & | input | ) |
mfem::NURBSPatch::NURBSPatch | ( | const KnotVector * | kv0, |
const KnotVector * | kv1, | ||
int | dim ) |
mfem::NURBSPatch::NURBSPatch | ( | const KnotVector * | kv0, |
const KnotVector * | kv1, | ||
const KnotVector * | kv2, | ||
int | dim ) |
mfem::NURBSPatch::NURBSPatch | ( | const KnotVector * | kv0, |
const KnotVector * | kv1, | ||
int | dim_, | ||
const real_t * | control_points ) |
mfem::NURBSPatch::NURBSPatch | ( | const KnotVector * | kv0, |
const KnotVector * | kv1, | ||
const KnotVector * | kv2, | ||
int | dim_, | ||
const real_t * | control_points ) |
mfem::NURBSPatch::NURBSPatch | ( | Array< const KnotVector * > & | kv_, |
int | dim_, | ||
const real_t * | control_points ) |
Create an n-variate NURBS patch with given control points of dimension dim_, where n is the length of the array of knot vectors and dim_ includes the weight. The array of control point coordinates stores each point's coordinates contiguously, and points are ordered in a standard ijk grid ordering.
mfem::NURBSPatch::NURBSPatch | ( | Array< const KnotVector * > & | kv, |
int | dim ) |
mfem::NURBSPatch::~NURBSPatch | ( | ) |
void mfem::NURBSPatch::Coarsen | ( | int | cf = 2, |
real_t | tol = 1.0e-12 ) |
Coarsen with optional coarsening factor cf which divides the number of elements in each dimension. Nonuniform spacing functions may be used in each direction.
[in] | cf | Optional coarsening factor. If scalar, the factor is used for all dimensions. If an array, factors can be specified for each dimension. |
[in] | tol | NURBS geometry deviation tolerance, cf. Algorithm A5.8 of "The NURBS Book", 2nd ed, Piegl and Tiller. |
void mfem::NURBSPatch::DegreeElevate | ( | int | dir, |
int | t ) |
void mfem::NURBSPatch::FlipDirection | ( | int | dir | ) |
|
static |
|
static |
void mfem::NURBSPatch::GetCoarseningFactors | ( | Array< int > & | f | ) | const |
Calls KnotVector::GetCoarseningFactor for each direction.
|
inline |
Return a pointer to the KnotVector in direction dir.
|
inline |
Return the number of components stored in the NURBSPatch.
|
inline |
|
protected |
void mfem::NURBSPatch::KnotInsert | ( | Array< KnotVector * > & | knot | ) |
void mfem::NURBSPatch::KnotInsert | ( | int | dir, |
const KnotVector & | knot ) |
void mfem::NURBSPatch::KnotInsert | ( | int | dir, |
const Vector & | knot ) |
Remove knot with value knot from direction dir.
The optional input parameter ntimes specifies the number of times the knot should be removed, default 1. The knot is removed only if the new curve (in direction dir) deviates from the old curve by less than tol.
int mfem::NURBSPatch::MakeUniformDegree | ( | int | degree = -1 | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
Copy assignment not supported.
void mfem::NURBSPatch::Print | ( | std::ostream & | os | ) | const |
Writes KnotVectors and data to the stream os.
The output is formatted for writing a mesh to file. This function is called by NURBSExtension::Print.
Rotate the NURBSPatch in 2D or 3D..
A rotation of a 2D NURBS-patch requires an angle only. Rotating a 3D NURBS-patch requires a normal as well.
void mfem::NURBSPatch::Rotate2D | ( | real_t | angle | ) |
Rotate the NURBSPatch, 2D case.
Rotate the NURBSPatch, 3D case.
void mfem::NURBSPatch::SetKnotVectorsCoarse | ( | bool | c | ) |
Marks the KnotVector in each dimension as coarse.
|
protected |
|
inlineprotected |
|
inlineprotected |
|
protected |
void mfem::NURBSPatch::SwapDirections | ( | int | dir1, |
int | dir2 ) |
void mfem::NURBSPatch::UniformRefinement | ( | Array< int > const & | rf | ) |
void mfem::NURBSPatch::UniformRefinement | ( | int | rf = 2 | ) |
Refine with optional refinement factor rf. Uniform means refinement is done everywhere by the same factor, although nonuniform spacing functions may be used.
[in] | rf | Optional refinement factor. If scalar, the factor is used for all dimensions. If an array, factors can be specified for each dimension. |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |