ASPECT
Public Member Functions | Public Attributes | List of all members
aspect::VariableDeclaration< dim > Struct Template Reference
Inheritance diagram for aspect::VariableDeclaration< dim >:
Inheritance graph
[legend]

Public Member Functions

 VariableDeclaration (const std::string &name, const std::shared_ptr< FiniteElement< dim >> &fe, const unsigned int multiplicity, const unsigned int n_blocks)
 
 VariableDeclaration ()
 
unsigned int n_components () const
 

Public Attributes

std::string name
 
std::shared_ptr< FiniteElement< dim > > fe
 
unsigned int multiplicity
 
unsigned int n_blocks
 

Detailed Description

template<int dim>
struct aspect::VariableDeclaration< dim >

A structure to describe everything necessary to define a single variable of the finite element system in isolation. It groups the FiniteElement<dim> with other information like a name and the block structure used in linear systems. A std::vector of these structs will be converted into an ordered collection of objects of type FEVariable represented by FEVariableCollection to form the finite element system.

Blocks are used to extract or solve for certain variables separately or in block based preconditioners. As an example, in a Stokes problem one might want velocity and pressure in a single block (for use with a direct solver), or one block for all velocity components and a second block for the pressure (for a Schur complement-based preconditioner), or separate blocks for pressure and each velocity component.

Definition at line 49 of file fe_variable_collection.h.

Constructor & Destructor Documentation

§ VariableDeclaration() [1/2]

template<int dim>
aspect::VariableDeclaration< dim >::VariableDeclaration ( const std::string &  name,
const std::shared_ptr< FiniteElement< dim >> &  fe,
const unsigned int  multiplicity,
const unsigned int  n_blocks 
)

Constructor.

Parameters
nameA user-friendly and unique string representation of the variable.
feThe FiniteElement class to use. Currently, this needs to be a scalar finite element class (with exactly one component).
multiplicityNumber of copies of the fe to create.
n_blocksNumber of blocks this variable represents inside the linear system. A value of 0 will add the next variable (in the std::vector<VariableDeclaration> that is used to construct the FEVariableCollection) to the current block, while 1 will put the next variable into a new block. A value that is equal to the number of components will create a block for each component.

§ VariableDeclaration() [2/2]

template<int dim>
aspect::VariableDeclaration< dim >::VariableDeclaration ( )

Default constructor.

Member Function Documentation

§ n_components()

template<int dim>
unsigned int aspect::VariableDeclaration< dim >::n_components ( ) const

Return the total number of components of this variable.

Member Data Documentation

§ name

template<int dim>
std::string aspect::VariableDeclaration< dim >::name

Name of the variable used in FEVariableCollection to identify it.

Definition at line 86 of file fe_variable_collection.h.

§ fe

template<int dim>
std::shared_ptr<FiniteElement<dim> > aspect::VariableDeclaration< dim >::fe

The FiniteElement space.

Definition at line 91 of file fe_variable_collection.h.

§ multiplicity

template<int dim>
unsigned int aspect::VariableDeclaration< dim >::multiplicity

The multiplicity used in FESystem: how many copies of fe are there?

Definition at line 96 of file fe_variable_collection.h.

§ n_blocks

template<int dim>
unsigned int aspect::VariableDeclaration< dim >::n_blocks

Number of linear algebra blocks occupied by this variable. See constructor for details.

Definition at line 102 of file fe_variable_collection.h.


The documentation for this struct was generated from the following file: