Loading...
Searching...
No Matches
Opm::Elasticity::ASMHandler< GridType > Class Template Reference

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.
void | addMatElement (const int i, const int j, const double val)
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.

## Detailed Description

template<class GridType>
class Opm::Elasticity::ASMHandler< GridType >

Class handling finite element assembly.

## Constructor & Destructor Documentation

## ASMHandler()

template<class GridType>

Opm::Elasticity::ASMHandler< GridType >::ASMHandler | ( | const GridType & | gv_ | ) |

inline explicit

The default constructor.

Parameters

  [in] | gv_ | The grid the operator is assembled over

## Member Function Documentation

## addDOF()

template<class GridType>
template<int esize>

void Opm::Elasticity::ASMHandler< GridType >::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 )

protected

Internal function.

Assemble entries for a single DOF

Parameters

  [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

## addElement()

template<class GridType>
template<int esize>

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.

Parameters

  [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

## addMPC()

template<class GridType>

void Opm::Elasticity::ASMHandler< GridType >::addMPC | ( | MPC * | mpc | ) |

Add a MPC.

Parameters

  [in] | mpc | Pointer to the MPC to add.

Note
  This class handles destruction

## extractValues()

template<class GridType>
template<int comp>

void Opm::Elasticity::ASMHandler< GridType >::extractValues | ( | Dune::FieldVector< double, comp > & | v,
|  | const Vector & | u,
|  | const LeafIterator & | it )

Extract values corresponding to cell.

Parameters

  [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

## getAdjacencyPattern()

template<class GridType>

AdjacencyPattern & Opm::Elasticity::ASMHandler< GridType >::getAdjacencyPattern | ( |  | ) |

inline

Access current adjacency pattern.

Can be used to add extra entries, such as other blocks

## getEqns()

template<class GridType>

size_t Opm::Elasticity::ASMHandler< GridType >::getEqns | ( |  | ) | const

inline

Get the number of equations in the system.

Returns
  The number of equations in the system

## getEquationForDof()

template<class GridType>

int Opm::Elasticity::ASMHandler< GridType >::getEquationForDof | ( | int | node,
|  | int | dof )

inline

Get the equation number for a given dof on a given node.

Parameters

  [in] | node | The node number
  [in] | dof | The DOF

Returns
  The equation number if active, -1 otherwise

## getLoadVector()

template<class GridType>

Vector & Opm::Elasticity::ASMHandler< GridType >::getLoadVector | ( |  | ) |

inline

Obtain a reference to the load vector.

Returns
  Reference to load vector

## getMPC()

template<class GridType>

MPC * Opm::Elasticity::ASMHandler< GridType >::getMPC | ( | int | node,
|  | int | dof )

Look for and return a MPC for a specified node+dof.

Parameters

  [in] | node | The requested node
  [in] | dof | The requested DOF at given node

Returns
  The MPC for the node/dof if found, else NULL

## getOperator()

template<class GridType>

Matrix & Opm::Elasticity::ASMHandler< GridType >::getOperator | ( |  | ) |

inline

Obtain a reference to the linear operator.

Returns
  Reference to linear operator

## isFixed()

template<class GridType>

bool Opm::Elasticity::ASMHandler< GridType >::isFixed | ( | int | node | ) |

inline

Check if a node is marked as fixed (in any direction).

Parameters

  [in] | node | The node to query for

## nodeAdjacency()

template<class GridType>

void Opm::Elasticity::ASMHandler< GridType >::nodeAdjacency | ( | const LeafIterator & | it,
|  | int | vertexsize,
|  | int | row )

protected

Internal function.

Generate adjacency pattern for a given node

Parameters

  [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

## resolveMPCChain()

template<class GridType>

void Opm::Elasticity::ASMHandler< GridType >::resolveMPCChain | ( | MPC * | mpc | ) |

protected

Internal function.

Handles a single MPC

Parameters

  [in] | mpc | Pointer to the MPC to resolve

## updateFixedNode()

template<class GridType>

void Opm::Elasticity::ASMHandler< GridType >::updateFixedNode | ( | int | node,
|  | const std::pair< Direction, NodeValue > & | entry )

Update/add a fixed node.

Parameters

  [in] | node | The node number
  [in] | entry | The fixed values

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

- opm/elasticity/asmhandler.hpp
- opm/elasticity/asmhandler_impl.hpp