NuTo
Numerics Tool
Classes | Public Member Functions | List of all members
NuTo::Constraint::Constraints Class Reference

stores constraint equations, separated by their dof type More...

#include <Constraints.h>

Public Member Functions

void Add (DofType dof, Equation equation)
 adds an equation More...
 
void Add (DofType dof, std::vector< Equation > equations)
 adds multiple equations More...
 
Eigen::VectorXd GetRhs (DofType dof, double time) const
 builds the time dependent constraint rhs vector for a specific dof type More...
 
Eigen::SparseVector< double > GetSparseGlobalRhs (DofType dof, int numDofs, double time) const
 builds the rhs of the constraint equations in a sparse global vector More...
 
JKNumbering GetJKNumbering (DofType dof, int numDofs) const
 builds a numbering where first the independent dofs are consecutively numbered leaving out the dependent ones and then the dependent dof numbers are appended. More...
 
Eigen::SparseMatrix< double > BuildUnitConstraintMatrix (DofType dof, int numDofs) const
 builds a sparse matrix containing the constraint terms for a specific dof type and a unit matrix for the independent dofs More...
 
int GetNumEquations (DofType dof) const
 calculates the number of constraint equations for a specific dof type More...
 
const EquationGetEquation (DofType dof, int equationNumber) const
 gets the specified equation More...
 

Detailed Description

stores constraint equations, separated by their dof type

Member Function Documentation

void Constraints::Add ( DofType  dof,
Equation  equation 
)

adds an equation

Parameters
dofdof type
equationconstraint equation
void Constraints::Add ( DofType  dof,
std::vector< Equation equations 
)

adds multiple equations

Parameters
dofdof type
equationsconstraint equations
Eigen::SparseMatrix< double > Constraints::BuildUnitConstraintMatrix ( DofType  dof,
int  numDofs 
) const

builds a sparse matrix containing the constraint terms for a specific dof type and a unit matrix for the independent dofs

Parameters
dofdof type
numDofsnumber dofs for the dof type, required for a proper resize of the sparse matrix
Returns
sparse matrix containing the constraint terms
const Equation & Constraints::GetEquation ( DofType  dof,
int  equationNumber 
) const

gets the specified equation

Parameters
dofdoftype of the equation
equationNumbernumber of the equation
Returns
selected equation
JKNumbering Constraints::GetJKNumbering ( DofType  dof,
int  numDofs 
) const

builds a numbering where first the independent dofs are consecutively numbered leaving out the dependent ones and then the dependent dof numbers are appended.

The order of the dependent dofs is given by the order of the constraint equations

This numbering is used in BuildUnitConstraintMatrix

Parameters
dofdof type
numDofsnumber dofs for the dof type
Returns
index vector with first independent dof numbers and then dependent
int Constraints::GetNumEquations ( DofType  dof) const

calculates the number of constraint equations for a specific dof type

Parameters
dofdof type
Returns
number of constraint equations
Eigen::VectorXd Constraints::GetRhs ( DofType  dof,
double  time 
) const

builds the time dependent constraint rhs vector for a specific dof type

Parameters
dofdof type
timeglobal time
Returns
constraint rhs vector
Eigen::SparseVector< double > Constraints::GetSparseGlobalRhs ( DofType  dof,
int  numDofs,
double  time 
) const

builds the rhs of the constraint equations in a sparse global vector

Parameters
dofdof type
numDofstotal number of dofs for a specfic dof type
timetime at which the rhs vector should be evaluated
Returns
sparse rhs vector of the constraint equations rhs(time)

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