3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Types | Public Member Functions | Protected Attributes | List of all members
Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag > Class Template Referenceabstract

compute local stiffness matrix for conforming finite elements for the full 2-phase pressure equation More...

#include <dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh>

Inheritance diagram for Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >:

Description

template<class TypeTag>
class Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >

compute local stiffness matrix for conforming finite elements for the full 2-phase pressure equation

Public Types

enum  { m = 1 }
 
enum  { size = 2 * dim }
 
using VBlockType = Dune::FieldVector< Scalar, m >
 
using MBlockType = Dune::FieldMatrix< Scalar, m, m >
 
using BCBlockType = std::array< BoundaryConditions::Flags, m >
 

Public Member Functions

 MimeticTwoPLocalStiffnessAdaptive (Problem &problem, bool levelBoundaryAsDirichlet, const GridView &gridView, const IntersectionMapper &intersectionMapper, bool procBoundaryAsDirichlet=true)
 Constructor. More...
 
void initialize ()
 
void adapt ()
 
void reset ()
 
void setErrorInfo (Scalar maxErr, Scalar dt)
 
int numberOfFaces (int eIdxGlobal)
 
void assemble (const Element &element, int k=1)
 Assembles local stiffness matrix for given element and order. More...
 
void assemble (const Element &cell, const Dune::BlockVector< VBlockType > &localSolution, int orderOfShapeFns=1)
 
void assembleBoundaryCondition (const Element &element, int k=1)
 Assembles only boundary conditions for given element. More...
 
template<class Vector >
void completeRHS (const Element &element, std::vector< int > &local2Global, Vector &f)
 
Scalar constructPressure (const Element &element, Dune::DynamicVector< Scalar > &pressTrace)
 
void constructVelocity (const Element &element, Dune::DynamicVector< Scalar > &vel, Dune::DynamicVector< Scalar > &pressTrace, Scalar press)
 
void computeReconstructionMatrices (const Element &element, const Dune::DynamicMatrix< Scalar > &W, Dune::DynamicVector< Scalar > &F, Scalar &dInv)
 
void assembleElementMatrices (const Element &element, Dune::DynamicVector< Scalar > &faceVol, Dune::DynamicVector< Scalar > &F, Dune::DynamicMatrix< Scalar > &Pi, Scalar &dInv, Scalar &qmean)
 
const Problem & problem () const
 
virtual void assemble (const Entity &e, int k=1)=0
 Assembles local stiffness matrix including boundary conditions for given element and order. More...
 
virtual void assemble (const Entity &e, const Dune::BlockVector< VBlockType > &localSolution, int k=1)=0
 assemble local stiffness matrix including boundary conditions for given element and order More...
 
virtual void assembleBoundaryCondition (const Entity &e, int k=1)=0
 assemble only boundary conditions for given element and order More...
 
void print (std::ostream &s, int width, int precision)
 Prints contents of local stiffness matrix. More...
 
const MBlockTypemat (int i, int j) const
 Accesses the local stiffness matrix. More...
 
const VBlockTyperhs (int i) const
 Accesses right hand side. More...
 
const BoundaryTypes & bc (int i) const
 Accesses boundary condition for each dof. More...
 
void setcurrentsize (int s)
 Sets the current size of the local stiffness matrix. More...
 
int currentsize ()
 Gets the current size of the local stiffness matrix. More...
 

Protected Attributes

Dune::Matrix< MBlockTypeA
 
std::vector< VBlockTypeb
 
std::vector< BoundaryTypes > bctype
 

Member Typedef Documentation

◆ BCBlockType

using Dumux::LocalStiffness< TypeTag, m >::BCBlockType = std::array<BoundaryConditions::Flags, m>
inherited

◆ MBlockType

using Dumux::LocalStiffness< TypeTag, m >::MBlockType = Dune::FieldMatrix<Scalar, m, m>
inherited

◆ VBlockType

template<class TypeTag >
using Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::VBlockType = Dune::FieldVector<Scalar, m>

Member Enumeration Documentation

◆ anonymous enum

template<class TypeTag >
anonymous enum
Enumerator

◆ anonymous enum

template<class TypeTag >
anonymous enum
Enumerator
size 

Constructor & Destructor Documentation

◆ MimeticTwoPLocalStiffnessAdaptive()

template<class TypeTag >
Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::MimeticTwoPLocalStiffnessAdaptive ( Problem &  problem,
bool  levelBoundaryAsDirichlet,
const GridView &  gridView,
const IntersectionMapper intersectionMapper,
bool  procBoundaryAsDirichlet = true 
)
inline

Constructor.

Member Function Documentation

◆ adapt()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::adapt ( )
inline

◆ assemble() [1/4]

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::assemble ( const Element &  cell,
const Dune::BlockVector< VBlockType > &  localSolution,
int  orderOfShapeFns = 1 
)
inline

◆ assemble() [2/4]

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::assemble ( const Element &  element,
int  k = 1 
)
inline

Assembles local stiffness matrix for given element and order.

On exit the following things have been done:

  • The stiffness matrix for the given entity and polynomial degree has been assembled and is accessible with the mat() method.
  • The boundary conditions have been evaluated and are accessible with the bc() method
  • The right hand side has been assembled. It contains either the value of the essential boundary condition or the assembled source term and neumann boundary condition. It is accessible via the rhs() method.
    Parameters
    elementa codim 0 entity reference
    korder of CR basis (only k = 1 is implemented)

◆ assemble() [3/4]

virtual void Dumux::LocalStiffness< TypeTag, m >::assemble ( const Entity &  e,
const Dune::BlockVector< VBlockType > &  localSolution,
int  k = 1 
)
pure virtualinherited

assemble local stiffness matrix including boundary conditions for given element and order

Unlike the method with only two arguments, this one additionally takes the local solution in order to allow assembly of nonlinear operators.

On exit the following things have been done:

  • The stiffness matrix for the given entity and polynomial degree has been assembled and is accessible with the mat() method.
  • The boundary conditions have been evaluated and are accessible with the bc() method. The boundary conditions are either Neumann, process or Dirichlet. Neumann indicates that the corresponding node (assuming a nodal basis) is at the Neumann boundary, process indicates that the node is at a process boundary (arising from the parallel decomposition of the mesh). Process boundaries are treated as homogeneous Dirichlet conditions, i.e. the corresponding value in the right hand side is set to 0. Finally, Dirichlet indicates that the node is at the Dirichlet boundary.
  • The right hand side has been assembled. It contains either the value of the essential boundary condition or the assembled source term and Neumann boundary condition. It is accessible via the rhs() method.
Parameters
ea codim 0 entity reference
localSolutionThe current solution on the entity, which is needed by nonlinear assemblers
korder of Lagrange basis (default is 1)

◆ assemble() [4/4]

virtual void Dumux::LocalStiffness< TypeTag, m >::assemble ( const Entity &  e,
int  k = 1 
)
pure virtualinherited

Assembles local stiffness matrix including boundary conditions for given element and order.

On exit the following things have been done:

  • The stiffness matrix for the given entity and polynomial degree has been assembled and is accessible with the mat() method.
  • The boundary conditions have been evaluated and are accessible with the bc() method. The boundary conditions are either neumann, process or dirichlet. Neumann indicates that the corresponding node (assuming a nodal basis) is at the Neumann boundary, process indicates that the node is at a process boundary (arising from the parallel decomposition of the mesh). Process boundaries are treated as homogeneous Dirichlet conditions, i.e. the corresponding value in the right hand side is set to 0. Finally, Dirichlet indicates that the node is at the Dirichlet boundary.
  • The right hand side has been assembled. It contains either the value of the essential boundary condition or the assembled source term and neumann boundary condition. It is accessible via the rhs() method.
Parameters
ea codim 0 entity reference
korder of Lagrange basis (default is 1)

◆ assembleBoundaryCondition() [1/2]

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::assembleBoundaryCondition ( const Element &  element,
int  k = 1 
)
inline

Assembles only boundary conditions for given element.

On exit the following things have been done:

  • The boundary conditions have been evaluated and are accessible with the bc() method
  • The right hand side contains either the value of the essential boundary condition or the assembled neumann boundary condition. It is accessible via the rhs() method.
    Parameters
    elementa codim 0 entity reference
    korder of CR basis

◆ assembleBoundaryCondition() [2/2]

virtual void Dumux::LocalStiffness< TypeTag, m >::assembleBoundaryCondition ( const Entity &  e,
int  k = 1 
)
pure virtualinherited

assemble only boundary conditions for given element and order

On exit the following things have been done:

  • The boundary conditions have been evaluated and are accessible with the bc() method. The boundary conditions are either Neumann, process or Dirichlet. Neumann indicates that the corresponding node (assuming a nodal basis) is at the Neumann boundary, process indicates that the node is at a process boundary (arising from the parallel decomposition of the mesh). Process boundaries are treated as homogeneous Dirichlet conditions, i.e. the corresponding value in the right hand side is set to 0. Finally, Dirichlet indicates that the node is at the Dirichlet boundary.
  • The right hand side has been assembled as far as boundary conditions are concerned. It contains either the value of the essential boundary condition or the assembled Neumann boundary condition. It is accessible via the rhs() method.
Parameters
ea codim 0 entity reference
korder of Lagrange basis (default is 1)

◆ assembleElementMatrices()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::assembleElementMatrices ( const Element &  element,
Dune::DynamicVector< Scalar > &  faceVol,
Dune::DynamicVector< Scalar > &  F,
Dune::DynamicMatrix< Scalar > &  Pi,
Scalar &  dInv,
Scalar &  qmean 
)

◆ bc()

const BoundaryTypes & Dumux::LocalStiffness< TypeTag, m >::bc ( int  i) const
inlineinherited

Accesses boundary condition for each dof.

Access boundary condition type for each degree of freedom. Elements are undefined without prior call to the assemble method.

Parameters
iindex i

◆ completeRHS()

template<class TypeTag >
template<class Vector >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::completeRHS ( const Element &  element,
std::vector< int > &  local2Global,
Vector &  f 
)
inline

◆ computeReconstructionMatrices()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::computeReconstructionMatrices ( const Element &  element,
const Dune::DynamicMatrix< Scalar > &  W,
Dune::DynamicVector< Scalar > &  F,
Scalar &  dInv 
)
inline

◆ constructPressure()

template<class TypeTag >
Scalar Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::constructPressure ( const Element &  element,
Dune::DynamicVector< Scalar > &  pressTrace 
)
inline

◆ constructVelocity()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::constructVelocity ( const Element &  element,
Dune::DynamicVector< Scalar > &  vel,
Dune::DynamicVector< Scalar > &  pressTrace,
Scalar  press 
)
inline

◆ currentsize()

int Dumux::LocalStiffness< TypeTag, m >::currentsize ( )
inlineinherited

Gets the current size of the local stiffness matrix.

◆ initialize()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::initialize ( )
inline

◆ mat()

const MBlockType & Dumux::LocalStiffness< TypeTag, m >::mat ( int  i,
int  j 
) const
inlineinherited

Accesses the local stiffness matrix.

Access elements of the local stiffness matrix. Elements are undefined without prior call to the assemble method.

Parameters
iindex i
jindex j

◆ numberOfFaces()

template<class TypeTag >
int Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::numberOfFaces ( int  eIdxGlobal)
inline

◆ print()

void Dumux::LocalStiffness< TypeTag, m >::print ( std::ostream &  s,
int  width,
int  precision 
)
inlineinherited

Prints contents of local stiffness matrix.

Parameters
soutput stream
widththe width
precisionthe precision

◆ problem()

template<class TypeTag >
const Problem & Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::problem ( ) const
inline

◆ reset()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::reset ( )
inline

◆ rhs()

const VBlockType & Dumux::LocalStiffness< TypeTag, m >::rhs ( int  i) const
inlineinherited

Accesses right hand side.

Access elements of the right hand side vector. Elements are undefined without prior call to the assemble method.

Parameters
iindex i

◆ setcurrentsize()

void Dumux::LocalStiffness< TypeTag, m >::setcurrentsize ( int  s)
inlineinherited

Sets the current size of the local stiffness matrix.

Parameters
ssize which is to be set

◆ setErrorInfo()

template<class TypeTag >
void Dumux::MimeticTwoPLocalStiffnessAdaptive< TypeTag >::setErrorInfo ( Scalar  maxErr,
Scalar  dt 
)
inline

Member Data Documentation

◆ A

Dune::Matrix<MBlockType> Dumux::LocalStiffness< TypeTag, m >::A
protectedinherited

◆ b

std::vector<VBlockType> Dumux::LocalStiffness< TypeTag, m >::b
protectedinherited

◆ bctype

std::vector<BoundaryTypes> Dumux::LocalStiffness< TypeTag, m >::bctype
protectedinherited

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