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

Detailed Description

template<class T>
class gismo::gsExprAssembler< T >

Assembler class for generating matrices and right-hand sides based on isogeometric expressions

+ Collaboration diagram for gsExprAssembler< T >:

Public Types

typedef gsExprHelper< T >::element element
 Current element.
 
typedef gsExprHelper< T >
::geometryMap 
geometryMap
 Geometry map type.
 
typedef expr::gsFeSolution< T > solution
 Solution type.
 
typedef gsExprHelper< T >::space space
 Space type.
 
typedef gsExprHelper< T >::variable variable
 Variable type.
 

Public Member Functions

template<class... expr>
void assemble (const expr &...args)
 Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the whole domain. More...
 
template<class... expr>
void assembleBdr (const bcRefList &BCs, expr &...args)
 Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the boundary parts in BCs.
 
template<class expr >
void assembleJacobian (const expr residual, solution &u)
 Assembles the Jacobian matrix of the expression args with.
 
void clearMatrix (const bool &save_sparsety_pattern=true)
 Re-Init Matrix (set zero by default) More...
 
variable getCoeff (const gsFunctionSet< T > &func)
 
expr::gsComposition< T > getCoeff (const gsFunctionSet< T > &func, geometryMap &G)
 
geometryMap getMap (const gsFunctionSet< T > &g)
 Registers g as an isogeometric geometry map and return a handle to it.
 
solution getSolution (const expr::gsFeSpace< T > &s, gsMatrix< T > &cf) const
 Registers a representation of a solution variable from space s, based on the vector cf. More...
 
space getSpace (const gsFunctionSet< T > &mp, index_t dim=1, index_t id=0)
 
space getTestSpace (const gsFunctionSet< T > &mp, index_t dim=1, index_t id=0)
 
space getTestSpace (space u, const gsFunctionSet< T > &mp, index_t dim=-1)
 Registers mp as an isogeometric test space corresponding to trial space u and return a handle to it. More...
 
 gsExprAssembler (index_t _rBlocks=1, index_t _cBlocks=1)
 
void initMatrix ()
 Initializes the sparse matrix only.
 
void initSystem (const index_t numRhs=1)
 Initializes the sparse system (sparse matrix and rhs)
 
void initVector (const index_t numRhs=1)
 Initializes the right-hand side vector only.
 
const gsMultiBasis< T > & integrationElements () const
 Returns the domain of integration.
 
const gsSparseMatrix< T > & matrix () const
 Returns the left-hand global matrix.
 
void matrix_into (gsSparseMatrix< T > &out)
 Writes the resulting matrix in out. The internal matrix is moved.
 
matBlockView matrixBlockView ()
 
matConstBlockView matrixBlockView () const
 
index_t numBlocks () const
 
index_t numDofs () const
 Returns the number of degrees of freedom (after initialization)
 
index_t numTestDofs () const
 Returns the number of test functions (after initialization)
 
gsOptionListoptions ()
 Returns a reference to the options structure.
 
const gsMatrix< T > & rhs () const
 Returns the right-hand side vector(s)
 
void rhs_into (gsMatrix< T > &out)
 Writes the resulting vector in out. The internal data is moved.
 
void setGeometryMap (const gsMultiPatch< T > &gMap)
 Set the geometrymap ( used for interface assembly) More...
 
void setIntegrationElements (const gsMultiBasis< T > &mesh)
 Sets the domain of integration. More...
 
void setOptions (gsOptionList opt)
 Set the assembler options.
 
space testSpace (const index_t id)
 
space testSpace (space u) const
 Return the test space of a pre-existing trial space u.
 
space trialSpace (const index_t id) const
 
space trialSpace (space &v) const
 Return the trial space of a pre-existing test space v.
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Returns the list of default options for assembly. More...
 

Private Member Functions

void resetDimensions ()
 Reset the dimensions of all involved spaces. Called internally by the init* functions.
 

Constructor & Destructor Documentation

gsExprAssembler ( index_t  _rBlocks = 1,
index_t  _cBlocks = 1 
)
inline

Constructor

Parameters
_rBlocksNumber of spaces for test functions
_cBlocksNumber of spaces for solution variables

Member Function Documentation

void assemble ( const expr &...  args)

Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the whole domain.

See Also
gsExprAssembler::setIntegrationElements
void clearMatrix ( const bool &  save_sparsety_pattern = true)
inline

Re-Init Matrix (set zero by default)

Parameters
save_sparsety_patternonly modify values but keep sparsety information by multiplying matrix by zero in-place
gsOptionList defaultOptions ( )
static

Returns the list of default options for assembly.

dirichlet treatment? elimination ????

variable getCoeff ( const gsFunctionSet< T > &  func)
inline

Registers func as a variable and returns a handle to it

expr::gsComposition<T> getCoeff ( const gsFunctionSet< T > &  func,
geometryMap G 
)
inline

Registers func as a variable defined on G and returns a handle to it

solution getSolution ( const expr::gsFeSpace< T > &  s,
gsMatrix< T > &  cf 
) const
inline

Registers a representation of a solution variable from space s, based on the vector cf.

The vector cf should have the structure of the columns of the system matrix this->matrix(). The returned handle corresponds to a function in the space s

space getSpace ( const gsFunctionSet< T > &  mp,
index_t  dim = 1,
index_t  id = 0 
)
inline

Registers mp as an isogeometric (both trial and test) space and returns a handle to it

space getTestSpace ( const gsFunctionSet< T > &  mp,
index_t  dim = 1,
index_t  id = 0 
)
inline

Registers mp as an isogeometric test (row) space and returns a handle to it

space getTestSpace ( space  u,
const gsFunctionSet< T > &  mp,
index_t  dim = -1 
)
inline

Registers mp as an isogeometric test space corresponding to trial space u and return a handle to it.

Note
Both test and trial spaces are registered at once by gsExprAssembler::getSpace.

Use this function after calling gsExprAssembler::getSpace when a distinct test space is requred (eg. Petrov-Galerkin methods).

Note
The dimension is set to the same as u, unless the caller sets as a third argument a new value.
matBlockView matrixBlockView ( )
inline

Returns a block view of the system matrix, each block corresponding to a different space, or to different groups of dofs, in case of calar problems

matConstBlockView matrixBlockView ( ) const
inline

Returns a const block view of the system matrix, each block corresponding to a different space, or to different groups of dofs, in case of calar problems

index_t numBlocks ( ) const
inline

Returns the number of blocks in the matrix, corresponding to variables/components

void setGeometryMap ( const gsMultiPatch< T > &  gMap)
inline

Set the geometrymap ( used for interface assembly)

Warning
Must be called before any computation is requested
void setIntegrationElements ( const gsMultiBasis< T > &  mesh)
inline

Sets the domain of integration.

Warning
Must be called before any computation is requested
space testSpace ( const index_t  id)
inline

Return the variable (previously created by getTrialSpace) with the given id

space trialSpace ( const index_t  id) const
inline

Return a variable handle (previously created by getSpace) for unknown id