|
IFEM
90A354
|
A class representing a general multi-point constraint equation. More...
#include <MPC.h>

Classes | |
| struct | DOF |
| A struct representing one term in a multi-point constraint equation. More... | |
Public Member Functions | |
| MPC (int n, int d, Real s=Real(0)) | |
| Constructor creating a constraint for a specified slave DOF. More... | |
| void | addMaster (const DOF &dof, Real tol=Real(1.0e-8)) |
| Adds a master DOF to the constraint equation. More... | |
| void | addMaster (int n, int d, Real c=Real(1), Real tol=Real(1.0e-8)) |
| Adds a master DOF to the constraint equation. More... | |
| void | updateMaster (size_t pos, Real c) |
| Updates the coefficient of the pos'th master DOF. | |
| void | updateMaster (size_t pos, MPC *m) |
| Updates the next chain element of the pos'th master DOF. | |
| void | removeMaster (size_t pos) |
| Removes the pos'th master DOF from the constraint equation. | |
| bool | isChained () const |
| Returns true if this MPC is chained. | |
| bool | merge (const MPC *mpc) |
| Merges the given MPC equation into this one. | |
| int | renumberNodes (const std::map< int, int > &old2new, bool msg=false) |
| Renumbers all node numbers in the constraint equation. More... | |
| void | shiftNodes (int nshift) |
| Increments node numbers in the constraint equation by nshift. | |
| void | addOffset (Real offset) |
| Increments the c0 coefficient by a given offset. | |
| void | setSlaveCoeff (Real 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 (bool recursive=false) const |
| Returns the number of master DOFs. | |
Public Attributes | |
| int | iceq |
| Global constraint equation identifier. | |
Protected Member Functions | |
| void | printMaster (std::ostream &os) const |
| Prints out the master(s) of this constraint equation. | |
Private Attributes | |
| DOF | slave |
| The slave DOF of this constraint equation. | |
| std::vector< DOF > | master |
| The master DOFs of this constraint equation. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const MPC &mpc) |
| Global stream operator printing a constraint equation. | |
A class representing a general multi-point constraint equation.
A multi-point constraint (MPC) equation is used to introduce additional couplings 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
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 constraints). In this case the two equations are combined during model preprocessing, to eliminate the master DOF that is constrained.
Constructor creating a constraint for a specified slave DOF.
| [in] | n | The node number of the slave DOF (1...NNOD) |
| [in] | d | The local DOF number of the slave DOF (1...3) |
| [in] | s | Associated constrained value |
The created constraint equation will by default constrain the specified slave DOF to zero. To constrain to a non-zero value, the method setSlaveCoeff() has to be invoked with the desired value.
References iceq.
Adds a master DOF to the constraint equation.
| [in] | dof | The the master DOF and associated coefficient to be added |
| [in] | tol | Tolerance for comparison with zero, if the coefficient c is zero, the master DOF is not added |
References MPC::DOF::coeff, and master.
Referenced by ASMbase::add2PC(), ASMbase::add3PC(), addMaster(), ASMs2DC1::addRigidCpl(), ASMs1DC1::addRigidCpl(), ASMs2D::constrainEdgeLocal(), ASMs3D::constrainFaceLocal(), ASMstruct::evalSolution(), and merge().
Adds a master DOF to the constraint equation.
| [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 |
References addMaster().
| int MPC::renumberNodes | ( | const std::map< int, int > & | old2new, |
| bool | msg = false |
||
| ) |
Renumbers all node numbers in the constraint equation.
| [in] | old2new | Old-to-new node number mapping |
| [in] | msg | If true, give error message for each invalid node number |
References master, MPC::DOF::node, utl::renumber(), and slave.