G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsField< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsField< T >

A scalar of vector field defined on a m_parametric geometry.

A gsField is, generally speaking, some mathematical function that is defined on a domain of interest (the name "field" is motivated by, e.g., "scalar field" or "vector field").

The gsField combines the following:

  • Geometric information on the domain:
    The domain can be represented as one single patch or as a collection of multiple patches (a.k.a. subdomains).
    This information is stored in a member of the gsMultiPatch class.
  • The function defined on the domain:
    For each patch (a.k.a. subdomain), the gsField contains a member of class gsFunction (which represents the "local field", so to say). On this, the operations of gsFunction can be carried out (e.g., function evaluation or computation of derivatives).
    Remark: The collection of patch-wise gsFunction is stored in the private member gsField::m_fields.

Note that the geometry representation of a single patch can be extracted by calling the member function gsField::patch.

The "local field" on a single patch can be extracted by calling gsField::function.

Public Member Functions

const gsMatrix< T > & coefficientVector (int i=0) const
 Returns the coefficient vector (if it exists) corresponding to the function field for patch i. More...
 
short_t dim () const
 Returns the dimension of the physical domain (e.g., if the domain is a surface in three-dimensional space, it returns 3).
 
distanceDG (gsFunctionSet< T > const &func, bool isFunc_param=false, int=1000) const
 
distanceH1 (gsFunctionSet< T > const &func, bool isFunc_param=false, int=1000) const
 
distanceH1 (gsFunctionSet< T > const &func, gsMultiBasis< T > const &B, bool isFunc_param=false, int=1000) const
 
distanceH2 (gsFunctionSet< T > const &func, bool isFunc_param=false) const
 
distanceL2 (gsField< T > const &field, int numEvals=1000) const
 Computes the L2-distance between the two fields, on the physical domain.
 
distanceL2 (gsFunctionSet< T > const &func, bool isFunc_param=false, int numEvals=1000) const
 Computes the L2-distance between the field and a function func on the physical domain.
 
distanceL2 (gsFunctionSet< T > const &func, gsMultiBasis< T > const &B, bool isFunc_param=false, int numEvals=1000) const
 
const gsFunctionSet< T > & fields () const
 Returns the fields (defined per patch)
 
const gsFunction< T > & function (int i=0) const
 Returns the gsFunction of patch i.
 
short_t geoDim () const
 Returns the dimension of the physical domain (e.g., if the domain is a surface in three-dimensional space, it returns 3).
 
const gsGeometry< T > & igaFunction (int i=0) const
 Attempts to return an Isogeometric function for patch i.
 
bool isParametric () const
 
bool isParametrized () const
 
GISMO_DEPRECATED index_t nPatches () const
 Returns the number of patches.
 
int nPieces () const
 Returns the number of pieces.
 
short_t parDim () const
 Returns the dimension of the parameter domain (e.g., if the domain is a surface in three-dimensional space, it returns 2).
 
const gsGeometry< T > & patch (int i=0) const
 Returns the gsGeometry of patch i.
 
const gsMultiPatch< T > & patches () const
 Returns gsMultiPatch containing the geometric information on the domain.
 
gsMatrix< T > point (const gsMatrix< T > &u, int i=0) const
 Maps points u from the parameter domain to the physical domain. More...
 
std::ostream & print (std::ostream &os) const
 Prints the object as a string.
 
gsMatrix< T > value (const gsMatrix< T > &u, int i=0) const
 Evaluation of the field at points u. More...
 

Private Attributes

gsFunctionSet< T >::Ptr m_fields
 Vector containing "local fields" for each patch/subdomain. More...
 
bool m_parametric
 True iff this is an isogeometric field. More...
 
const gsFunctionSet< T > * m_patches
 The isogeometric field is defined on this multipatch domain.
 

Member Function Documentation

const gsMatrix<T>& coefficientVector ( int  i = 0) const
inline

Returns the coefficient vector (if it exists) corresponding to the function field for patch i.

Returns the coefficients of the field corresponding to the i-th patch. This is only possible in the case when the field is defined in terms of basis functions (ie. it derives from gsGeometry).

T distanceDG ( gsFunctionSet< T > const &  func,
bool  isFunc_param = false,
int  = 1000 
) const

Computes the DG-distance between the field and a function func on the physical domain

T distanceH1 ( gsFunctionSet< T > const &  func,
bool  isFunc_param = false,
int  = 1000 
) const

Computes the H1-seminorm of the diff. between the field and a function func on the physical domain

T distanceH1 ( gsFunctionSet< T > const &  func,
gsMultiBasis< T > const &  B,
bool  isFunc_param = false,
int  = 1000 
) const

Computes the H1-seminorm of the diff. between the field and a function func on the physical domain, using mesh from B

T distanceH2 ( gsFunctionSet< T > const &  func,
bool  isFunc_param = false 
) const

Computes the H2-seminorm of the diff. between the field and a function func on the physical domain, using mesh from B

T distanceL2 ( gsFunctionSet< T > const &  func,
gsMultiBasis< T > const &  B,
bool  isFunc_param = false,
int  numEvals = 1000 
) const

Computes the L2-distance between the field and a function func on the physical domain, using mesh from B

bool isParametric ( ) const
inline

True if the field function is defined on parametric coordinates (i.e. the same coordinate system as the patches)

bool isParametrized ( ) const
inline

True if the field function is parametrized by a set of basis functions in parametric coordinates (i.e. the same coordinate system as the patches)

gsMatrix<T> point ( const gsMatrix< T > &  u,
int  i = 0 
) const
inline

Maps points u from the parameter domain to the physical domain.

Parameters
[in]uEvaluation points as gsMatrix of size d x n.
d denotes the dimension of the parameter domain (i.e., d = parDim()).
n denotes the number of evaluation points.
Each column of u corresponds to one evaluation point.
[in]iIndex of the considered patch/subdomain.
Returns
uPtr The j-th column of uPtr corresponds to the image of the point u_j (which is defined by the j-th column of the input parameter u).
gsMatrix<T> value ( const gsMatrix< T > &  u,
int  i = 0 
) const
inline

Evaluation of the field at points u.

Parameters
[in]uEvaluation points as gsMatrix of size d x n.
d denotes the dimension of the parameter domain (i.e., d = parDim()).
n denotes the number of evaluation points.
Each column of u corresponds to one evaluation point.
[in]iIndex of the considered patch/subdomain.
Returns
uPtr The j-th column of uPtr corresponds to the value of the field at the point u_j (which is defined by the j-th column of the input parameter u).

Member Data Documentation

gsFunctionSet<T>::Ptr m_fields
private

Vector containing "local fields" for each patch/subdomain.

For each patch/subdomain, the "local field" is represented by a gsFunction. This local field can be accessed with gsField::function.

bool m_parametric
private

True iff this is an isogeometric field.

If m_parametric is true, the evaluation points for calling gsField::value have to be placed in the parameter domain.

If m_parametric is false, then the evaluation points are in the physical domain. This applies to, e.g., given exact solutions which are defined on the physical domain.