Loading...
Searching...
No Matches
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.
void | addMaster (int n, int d, double c=double(1), double tol=double(1.0e-8))
| Adds a master DOF to the constraint equation.
void | updateMaster (size_t pos, double c)
| Updates the coefficient of the pos'th master DOF.
void | removeMaster (size_t pos)
| Removes the pos'th master DOF from the constraint equation.
void | addOffset (double offset)
| Increments the c0 coefficient by a given offset.
void | setSlaveCoeff (double c0)
| Assigns a new c0 coefficient to the constraint equation.
const DOF & | getSlave () const
| Returns a reference to the slave DOF.
const DOF & | getMaster (size_t i) const
| Returns a reference to the i'th master DOF.
size_t | getNoMaster () const
| Returns the number of master DOFs.

## Public Attributes

int | iceq
| Global constraint equation identifier.

## Friends

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

## 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

where

- denotes the slave dof
- is the value of the slave dof when all master dofs are zero, or when there are no masters in the equation (prescribed dof).
- is a master dof
- 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 ( ) or prescribed ( ) 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

## MPC()

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] | n | The node number of the slave DOF (1...NNOD)
  [in] | d | The local DOF number of the slave DOF (1...3)
  [in] | c | The actual value that this slave DOF is constrained to when there are no master DOFs, or all master DOFs are zero

## Member Function Documentation

## addMaster()

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] | n | The node number of the master DOF (1...NNOD)
  [in] | d | The local DOF number of the master DOF (1...3)
  [in] | c | The coefficient that this master should be scaled with
  [in] | tol | Tolerance for comparison with zero, if the coefficient c is zero, the master DOF is not added

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

- opm/elasticity/mpc.hh