73 int ivar = (
dof.dof-1) / 3;
74 int idof = (
dof.dof+2) % 3;
75 return s << (ivar < 1 ?
'u' : char(
'q'+ivar)) <<
'_'
76 <<
char(
'x'+idof) <<
" in node "<<
dof.node;
141 if (mdof.nextc)
return true;
152 int renumberNodes(
const std::map<int,int>& old2new,
bool msg =
false);
172 friend std::ostream&
operator<<(std::ostream& s,
const MPC& mpc);
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
A class representing a general multi-point constraint equation.
Definition: MPC.h:52
void updateMaster(size_t pos, Real c)
Updates the coefficient of the pos'th master DOF.
Definition: MPC.h:117
void removeMaster(size_t pos)
Removes the pos'th master DOF from the constraint equation.
Definition: MPC.h:131
void printMaster(std::ostream &os) const
Prints out the master(s) of this constraint equation.
Definition: MPC.C:125
int iceq
Global constraint equation identifier.
Definition: MPC.h:179
std::vector< DOF > master
The master DOFs of this constraint equation.
Definition: MPC.h:183
int renumberNodes(const std::map< int, int > &old2new, bool msg=false)
Renumbers all node numbers in the constraint equation.
Definition: MPC.C:106
void setSlaveCoeff(Real c0)
Assigns a new c0 coefficient to the constraint equation.
Definition: MPC.h:161
MPC(int n, int d, Real s=Real(0))
Constructor creating a constraint for a specified slave DOF.
Definition: MPC.h:99
const DOF & getSlave() const
Returns a reference to the slave DOF.
Definition: MPC.h:164
void addMaster(int n, int d, Real c=Real(1), Real tol=Real(1.0e-8))
Adds a master DOF to the constraint equation.
Definition: MPC.h:111
DOF slave
The slave DOF of this constraint equation.
Definition: MPC.h:182
void updateMaster(size_t pos, MPC *m)
Updates the next chain element of the pos'th master DOF.
Definition: MPC.h:124
const DOF & getMaster(size_t i) const
Returns a reference to the i'th master DOF.
Definition: MPC.h:166
void addOffset(Real offset)
Increments the c0 coefficient by a given offset.
Definition: MPC.h:158
friend std::ostream & operator<<(std::ostream &s, const MPC &mpc)
Global stream operator printing a constraint equation.
Definition: MPC.C:158
void addMaster(const DOF &dof, Real tol=Real(1.0e-8))
Adds a master DOF to the constraint equation.
Definition: MPC.C:74
void shiftNodes(int nshift)
Increments node numbers in the constraint equation by nshift.
Definition: MPC.C:117
bool isChained() const
Returns true if this MPC is chained.
Definition: MPC.h:138
size_t getNoMaster(bool recursive=false) const
Returns the number of master DOFs.
Definition: MPC.C:61
bool merge(const MPC *mpc)
Merges the given MPC equation into this one.
Definition: MPC.C:86
A struct representing one term in a multi-point constraint equation.
Definition: MPC.h:60
DOF(int n, int d, Real c)
Convenience constructor creating a valid DOF object.
Definition: MPC.h:68
int node
Node number identifying this DOF.
Definition: MPC.h:85
MPC * nextc
Points to another MPC object in case of chained constraints.
Definition: MPC.h:88
DOF()
Default constructor.
Definition: MPC.h:62
friend bool operator==(const DOF &a, const DOF &b)
Global equality operator.
Definition: MPC.h:80
Real coeff
The constrained value, or master DOF scaling coefficient.
Definition: MPC.h:87
int dof
Local DOF number within node.
Definition: MPC.h:86
friend std::ostream & operator<<(std::ostream &s, const DOF &dof)
Global stream operator printing a DOF instance.
Definition: MPC.h:71