Opm::Elasticity::MPC Class Reference

A class for representing a general multi-point constraint equation. More...

#include <mpc.hh>

Classes

struct  DOF
 A struct for representing one term (DOF number and associated coefficient) in a MPC equation. More...
 
class  Less
 Comparison predicate for MPCs. More...
 

Public Member Functions

 MPC (int n, int d, double c=double(0))
 Constructor creating a constraint for a specified slave DOF with no master DOFs. More...
 
void addMaster (int n, int d, double c=double(1), double tol=double(1.0e-8))
 Adds a master DOF to the constraint equation. More...
 
void updateMaster (size_t pos, double c)
 Updates the coefficient of the pos'th master DOF. More...
 
void removeMaster (size_t pos)
 Removes the pos'th master DOF from the constraint equation. More...
 
void addOffset (double offset)
 Increments the c0 coefficient by a given offset. More...
 
void setSlaveCoeff (double c0)
 Assigns a new c0 coefficient to the constraint equation. More...
 
const DOFgetSlave () const
 Returns a reference to the slave DOF. More...
 
const DOFgetMaster (size_t i) const
 Returns a reference to the i'th master DOF. More...
 
size_t getNoMaster () const
 Returns the number of master DOFs. More...
 

Public Attributes

int iceq
 Global constraint equation identifier. More...
 

Friends

std::ostream & operator<< (std::ostream &s, const MPC &mpc)
 Global stream operator printing a constraint equation. More...
 

Detailed Description

A class for representing a general multi-point constraint equation.

A multi-point constraint (MPC) equation is used to introduce additional coupling between the degrees of freedom (DOF) in a FE grid.

An MPC equation is in general a linear coupling of one (slave) dof to a set of master dofs, and may be expressed as

\[ s = c_0 + c_1 m_1 + c_2 m_2 + \ldots + c_n m_n \]

where

  • $s$ denotes the slave dof
  • $c_0$ is the value of the slave dof when all master dofs are zero, or when there are no masters in the equation (prescribed dof).
  • $m_i$ is a master dof
  • $c_i, i > 0$ is a constant scaling coefficient associated with the i'th master
  • n denotes the total number of master dofs in the equation

When n = 0, the above equation represents a fixed ( $c_0=0$) or prescribed ( $c_0\ne0$) dof.

One or more of the master dofs may also be a slave in another constraint equation (chained constrains). In this case the two equations are combined to eliminate the master dof that is constrained. This is done while preprocessing the model by the resolveMPCchains function.

Constructor & Destructor Documentation

Opm::Elasticity::MPC::MPC ( int  n,
int  d,
double  c = double(0) 
)
inline

Constructor creating a constraint for a specified slave DOF with no master DOFs.

Parameters
[in]nThe node number of the slave DOF (1...NNOD)
[in]dThe local DOF number of the slave DOF (1...3)
[in]cThe actual value that this slave DOF is constrained to when there are no master DOFs, or all master DOFs are zero

References iceq.

Member Function Documentation

void Opm::Elasticity::MPC::addMaster ( int  n,
int  d,
double  c = double(1),
double  tol = double(1.0e-8) 
)
inline

Adds a master DOF to the constraint equation.

Parameters
[in]nThe node number of the master DOF (1...NNOD)
[in]dThe local DOF number of the master DOF (1...3)
[in]cThe coefficient that this master should be scaled with
[in]tolTolerance for comparison with zero, if the coefficient c is zero, the master DOF is not added

Referenced by Opm::Elasticity::IMPL_FUNC(), and Opm::Elasticity::ASMHandler< GridType >::resolveMPCChain().

void Opm::Elasticity::MPC::addOffset ( double  offset)
inline

Increments the c0 coefficient by a given offset.

References Opm::Elasticity::MPC::DOF::coeff.

Referenced by Opm::Elasticity::ASMHandler< GridType >::resolveMPCChain().

const DOF& Opm::Elasticity::MPC::getSlave ( ) const
inline
void Opm::Elasticity::MPC::removeMaster ( size_t  pos)
inline

Removes the pos'th master DOF from the constraint equation.

Referenced by Opm::Elasticity::ASMHandler< GridType >::resolveMPCChain().

void Opm::Elasticity::MPC::setSlaveCoeff ( double  c0)
inline

Assigns a new c0 coefficient to the constraint equation.

References Opm::Elasticity::MPC::DOF::coeff.

void Opm::Elasticity::MPC::updateMaster ( size_t  pos,
double  c 
)
inline

Updates the coefficient of the pos'th master DOF.

Referenced by Opm::Elasticity::ASMHandler< GridType >::resolveMPCChain().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const MPC mpc 
)
friend

Global stream operator printing a constraint equation.

Member Data Documentation

int Opm::Elasticity::MPC::iceq

Global constraint equation identifier.

Referenced by MPC().


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