MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
mfem::KnotVector Class Reference

#include <nurbs.hpp>

Collaboration diagram for mfem::KnotVector:
[legend]

Public Member Functions

 KnotVector ()
 Create KnotVector.
 
 KnotVector (std::istream &input)
 
 KnotVector (int Order_, int NCP)
 
 KnotVector (const KnotVector &kv)
 
KnotVectoroperator= (const KnotVector &kv)
 
int GetNE () const
 
int GetNKS () const
 
int GetNCP () const
 
int GetOrder () const
 
int Size () const
 
void GetElements ()
 Count the number of elements.
 
bool isElement (int i) const
 
real_t getKnotLocation (real_t xi, int ni) const
 
int findKnotSpan (real_t u) const
 
void CalcShape (Vector &shape, int i, real_t xi) const
 
void CalcDShape (Vector &grad, int i, real_t xi) const
 
void CalcDnShape (Vector &gradn, int n, int i, real_t xi) const
 
void CalcD2Shape (Vector &grad2, int i, real_t xi) const
 
void FindMaxima (Array< int > &ks, Vector &xi, Vector &u) const
 
void FindInterpolant (Array< Vector * > &x)
 
void Difference (const KnotVector &kv, Vector &diff) const
 Finds the knots in the larger of this and kv, not contained in the other.
 
void UniformRefinement (Vector &newknots, int rf) const
 Refine uniformly with refinement factor rf.
 
void Refinement (Vector &newknots, int rf) const
 Refine with refinement factor rf.
 
int GetCoarseningFactor () const
 
Vector GetFineKnots (const int cf) const
 
KnotVectorDegreeElevate (int t) const
 
void Flip ()
 
void Print (std::ostream &os) const
 
void PrintFunctions (std::ostream &os, int samples=11) const
 
 ~KnotVector ()
 Destroys KnotVector.
 
real_toperator[] (int i)
 
const real_toperator[] (int i) const
 

Public Attributes

std::shared_ptr< SpacingFunctionspacing
 Function to define the distribution of knots for any number of knot spans.
 
bool coarse
 

Protected Attributes

Vector knot
 
int Order
 
int NumOfControlPoints
 
int NumOfElements
 

Static Protected Attributes

static const int MaxOrder = 10
 

Detailed Description

Definition at line 33 of file nurbs.hpp.

Constructor & Destructor Documentation

◆ KnotVector() [1/4]

mfem::KnotVector::KnotVector ( )
inline

Create KnotVector.

Definition at line 43 of file nurbs.hpp.

◆ KnotVector() [2/4]

mfem::KnotVector::KnotVector ( std::istream &  input)

Definition at line 30 of file nurbs.cpp.

◆ KnotVector() [3/4]

mfem::KnotVector::KnotVector ( int  Order_,
int  NCP 
)

Definition at line 38 of file nurbs.cpp.

◆ KnotVector() [4/4]

mfem::KnotVector::KnotVector ( const KnotVector kv)
inline

Definition at line 46 of file nurbs.hpp.

◆ ~KnotVector()

mfem::KnotVector::~KnotVector ( )
inline

Destroys KnotVector.

Definition at line 115 of file nurbs.hpp.

Member Function Documentation

◆ CalcD2Shape()

void mfem::KnotVector::CalcD2Shape ( Vector grad2,
int  i,
real_t  xi 
) const
inline

Definition at line 69 of file nurbs.hpp.

◆ CalcDnShape()

void mfem::KnotVector::CalcDnShape ( Vector gradn,
int  n,
int  i,
real_t  xi 
) const

Definition at line 381 of file nurbs.cpp.

◆ CalcDShape()

void mfem::KnotVector::CalcDShape ( Vector grad,
int  i,
real_t  xi 
) const

Definition at line 324 of file nurbs.cpp.

◆ CalcShape()

void mfem::KnotVector::CalcShape ( Vector shape,
int  i,
real_t  xi 
) const

Definition at line 297 of file nurbs.cpp.

◆ DegreeElevate()

KnotVector * mfem::KnotVector::DegreeElevate ( int  t) const

Return a new KnotVector with elevated degree by repeating the endpoints of the knot vector.

Note
The returned object should be deleted by the caller.

Definition at line 63 of file nurbs.cpp.

◆ Difference()

void mfem::KnotVector::Difference ( const KnotVector kv,
Vector diff 
) const

Finds the knots in the larger of this and kv, not contained in the other.

Definition at line 605 of file nurbs.cpp.

◆ FindInterpolant()

void mfem::KnotVector::FindInterpolant ( Array< Vector * > &  x)

Global curve interpolation through the points x. x is an array with the length of the spatial dimension containing vectors with spatial coordinates. The control points of the interpolated curve are given in x in the same form.

Definition at line 543 of file nurbs.cpp.

◆ findKnotSpan()

int mfem::KnotVector::findKnotSpan ( real_t  u) const

Definition at line 576 of file nurbs.cpp.

◆ FindMaxima()

void mfem::KnotVector::FindMaxima ( Array< int > &  ks,
Vector xi,
Vector u 
) const

Gives the locations of the maxima of the knotvector in reference space. The function gives the knotspan ks, the coordinate in the knotspan xi and the coordinate of the maximum in parameter space u

Definition at line 482 of file nurbs.cpp.

◆ Flip()

void mfem::KnotVector::Flip ( )

Definition at line 241 of file nurbs.cpp.

◆ GetCoarseningFactor()

int mfem::KnotVector::GetCoarseningFactor ( ) const

Returns the coarsening factor needed for non-nested nonuniform spacing functions, to result in a single element from which refinement can be done. The return value is 1 if uniform or nested spacing is used.

Definition at line 113 of file nurbs.cpp.

◆ GetElements()

void mfem::KnotVector::GetElements ( )

Count the number of elements.

Definition at line 229 of file nurbs.cpp.

◆ GetFineKnots()

Vector mfem::KnotVector::GetFineKnots ( const int  cf) const

For a given coarsening factor cf, find the fine knots between the coarse knots.

Definition at line 132 of file nurbs.cpp.

◆ getKnotLocation()

real_t mfem::KnotVector::getKnotLocation ( real_t  xi,
int  ni 
) const
inline

Definition at line 61 of file nurbs.hpp.

◆ GetNCP()

int mfem::KnotVector::GetNCP ( ) const
inline

Definition at line 52 of file nurbs.hpp.

◆ GetNE()

int mfem::KnotVector::GetNE ( ) const
inline

Definition at line 50 of file nurbs.hpp.

◆ GetNKS()

int mfem::KnotVector::GetNKS ( ) const
inline

Definition at line 51 of file nurbs.hpp.

◆ GetOrder()

int mfem::KnotVector::GetOrder ( ) const
inline

Definition at line 53 of file nurbs.hpp.

◆ isElement()

bool mfem::KnotVector::isElement ( int  i) const
inline

Definition at line 59 of file nurbs.hpp.

◆ operator=()

KnotVector & mfem::KnotVector::operator= ( const KnotVector kv)

Definition at line 48 of file nurbs.cpp.

◆ operator[]() [1/2]

real_t & mfem::KnotVector::operator[] ( int  i)
inline

Definition at line 117 of file nurbs.hpp.

◆ operator[]() [2/2]

const real_t & mfem::KnotVector::operator[] ( int  i) const
inline

Definition at line 118 of file nurbs.hpp.

◆ Print()

void mfem::KnotVector::Print ( std::ostream &  os) const

Definition at line 254 of file nurbs.cpp.

◆ PrintFunctions()

void mfem::KnotVector::PrintFunctions ( std::ostream &  os,
int  samples = 11 
) const

Prints the non-zero shape functions and their first and second derivatives associated with the KnotVector per element. Use GetElements() to count the elements before using this function. samples is the number of samples of the shape functions per element.

Definition at line 260 of file nurbs.cpp.

◆ Refinement()

void mfem::KnotVector::Refinement ( Vector newknots,
int  rf 
) const

Refine with refinement factor rf.

Definition at line 169 of file nurbs.cpp.

◆ Size()

int mfem::KnotVector::Size ( ) const
inline

Definition at line 54 of file nurbs.hpp.

◆ UniformRefinement()

void mfem::KnotVector::UniformRefinement ( Vector newknots,
int  rf 
) const

Refine uniformly with refinement factor rf.

Definition at line 92 of file nurbs.cpp.

Member Data Documentation

◆ coarse

bool mfem::KnotVector::coarse

Flag to indicate whether the KnotVector has been coarsened, which means it is ready for non-nested refinement.

Definition at line 125 of file nurbs.hpp.

◆ knot

Vector mfem::KnotVector::knot
protected

Definition at line 38 of file nurbs.hpp.

◆ MaxOrder

const int mfem::KnotVector::MaxOrder = 10
staticprotected

Definition at line 36 of file nurbs.hpp.

◆ NumOfControlPoints

int mfem::KnotVector::NumOfControlPoints
protected

Definition at line 39 of file nurbs.hpp.

◆ NumOfElements

int mfem::KnotVector::NumOfElements
protected

Definition at line 39 of file nurbs.hpp.

◆ Order

int mfem::KnotVector::Order
protected

Definition at line 39 of file nurbs.hpp.

◆ spacing

std::shared_ptr<SpacingFunction> mfem::KnotVector::spacing

Function to define the distribution of knots for any number of knot spans.

Definition at line 121 of file nurbs.hpp.


The documentation for this class was generated from the following files: