My Project
|
Class handling finite element assembly. More...
#include <asmhandler.hpp>
Public Types | |
typedef GridType::LeafGridView::IndexSet | LeafIndexSet |
A set of indices. | |
typedef GridType::LeafGridView::template Codim< 0 >::Iterator | LeafIterator |
An iterator over grid cells. | |
typedef Dune::FieldVector< double, dim > | NodeValue |
A vectorial node value. | |
Public Member Functions | |
ASMHandler (const GridType &gv_) | |
The default constructor. | |
~ASMHandler () | |
Destructor. | |
ASMHandler (const ASMHandler &)=delete | |
No copying of this class. | |
ASMHandler & | operator= (const ASMHandler &)=delete |
No copying of this class. | |
size_t | getEqns () const |
Get the number of equations in the system. | |
int | getEquationForDof (int node, int dof) |
Get the equation number for a given dof on a given node. | |
Matrix & | getOperator () |
Obtain a reference to the linear operator. | |
Vector & | getLoadVector () |
Obtain a reference to the load vector. | |
void | initForAssembly () |
This function needs to be called before starting the element assembly. | |
template<int esize> | |
void | addElement (const Dune::FieldMatrix< double, esize, esize > *K, const Dune::FieldVector< double, esize > *S, const LeafIterator &cell, Vector *b=NULL) |
Add an element matrix/vector to the system. | |
template<int comp> | |
void | extractValues (Dune::FieldVector< double, comp > &v, const Vector &u, const LeafIterator &it) |
Extract values corresponding to cell. | |
void | expandSolution (Vector &result, const Vector &u) |
Expand a system vector to a solution vector. | |
void | addMPC (MPC *mpc) |
Add a MPC. | |
MPC * | getMPC (int node, int dof) |
Look for and return a MPC for a specified node+dof. | |
void | updateFixedNode (int node, const std::pair< Direction, NodeValue > &entry) |
Update/add a fixed node. | |
bool | isFixed (int node) |
Check if a node is marked as fixed (in any direction) | |
void | printOperator () const |
Print the current operator. | |
void | printLoadVector () const |
Print the current load vector. | |
AdjacencyPattern & | getAdjacencyPattern () |
Access current adjacency pattern. | |
Static Public Attributes | |
static const int | dim = GridType::dimension |
The dimension of the grid. | |
Protected Types | |
typedef std::pair< Direction, NodeValue > | fixEntry |
Fixed nodes. | |
typedef std::map< int, fixEntry > | fixMap |
A mapping from dof to fix value info. | |
typedef fixMap::iterator | fixIt |
Iterator over a fixmap. | |
Protected Member Functions | |
void | resolveMPCChains () |
Resolve chained MPCs. | |
void | resolveMPCChain (MPC *mpc) |
Internal function. | |
void | preprocess () |
Internal function. Generate meqn for registered MPC/fixed nodes. | |
void | nodeAdjacency (const LeafIterator &it, int vertexsize, int row) |
Internal function. | |
void | determineAdjacencyPattern () |
Internal function. Calculate adjacency pattern. | |
template<int esize> | |
void | addDOF (int row, int erow, const Dune::FieldMatrix< double, esize, esize > *K, const Dune::FieldVector< double, esize > *S, const LeafIndexSet &set, const LeafIterator &cell, Vector *b, double scale=1.f) |
Internal function. | |
Protected Attributes | |
MPCMap | mpcs |
The set of MPC. | |
std::vector< int > | meqn |
Vector of (interleaved) dof<->eqn mapping. | |
fixMap | fixedNodes |
The map holding information about our fixed nodes. | |
AdjacencyPattern | adjacencyPattern |
Holds the adjacency pattern of the sparse matrix. | |
Matrix | A |
The linear operator. | |
Vector | b |
The load vector. | |
const GridType & | gv |
A reference to the grid in use. | |
size_t | maxeqn |
The number of equations in the system. | |
Class handling finite element assembly.
|
inlineexplicit |
The default constructor.
[in] | gv_ | The grid the operator is assembled over |
|
protected |
Internal function.
Assemble entries for a single DOF
[in] | row | The row in the global matrix |
[in] | erow | The row in the element matrix |
[in] | K | Pointer to the element matrix. Can be NULL |
[in] | S | Pointer to the element load vector. Can be NULL |
[in] | set | The index set |
[in] | cell | An iterator pointing to the cell we're assembling for |
[in] | b | Vector to add contributions to |
[in] | scale | Scale for elements. Used with MPC couplings |
void Opm::Elasticity::ASMHandler< GridType >::addElement | ( | const Dune::FieldMatrix< double, esize, esize > * | K, |
const Dune::FieldVector< double, esize > * | S, | ||
const LeafIterator & | cell, | ||
Vector * | b = NULL |
||
) |
Add an element matrix/vector to the system.
[in] | K | Pointer to the element matrix. Can be NULL |
[in] | S | Pointer to the element load vector. Can be NULL |
[in] | cell | An iterator pointing to the cell we're assembling for |
[in] | b | Vector to add contributions to. If not given, we use the internal vector |
void Opm::Elasticity::ASMHandler< GridType >::addMPC | ( | MPC * | mpc | ) |
void Opm::Elasticity::ASMHandler< GridType >::extractValues | ( | Dune::FieldVector< double, comp > & | v, |
const Vector & | u, | ||
const LeafIterator & | it | ||
) |
Extract values corresponding to cell.
[in] | u | The global load vector |
[in] | it | An iterator to the cell we want to extract values for |
[out] | v | Vector holding the values requested |
|
inline |
Access current adjacency pattern.
Can be used to add extra entries, such as other blocks
|
inline |
Get the number of equations in the system.
|
inline |
Get the equation number for a given dof on a given node.
[in] | node | The node number |
[in] | dof | The DOF |
|
inline |
Obtain a reference to the load vector.
MPC * Opm::Elasticity::ASMHandler< GridType >::getMPC | ( | int | node, |
int | dof | ||
) |
|
inline |
Obtain a reference to the linear operator.
void Opm::Elasticity::ASMHandler< GridType >::initForAssembly | ( | ) |
This function needs to be called before starting the element assembly.
|
inline |
Check if a node is marked as fixed (in any direction)
[in] | node | The node to query for |
|
protected |
Internal function.
Generate adjacency pattern for a given node
[in] | it | Iterator pointing to the cell in of the node |
[in] | vertexsize | Number of vertices in the cell |
[in] | row | The equation number/row in matrix |
|
protected |
void Opm::Elasticity::ASMHandler< GridType >::updateFixedNode | ( | int | node, |
const std::pair< Direction, NodeValue > & | entry | ||
) |
Update/add a fixed node.
[in] | node | The node number |
[in] | entry | The fixed values |