Skip to content
Snippets Groups Projects
Commit 7f2a8576 authored by Éric Béchet's avatar Éric Béchet
Browse files

Added get- functions for linearconstraints in dofManager

parent 83c8aafb
Branches
Tags
No related merge requests found
...@@ -181,6 +181,14 @@ class dofManager : public dofManagerBase{ ...@@ -181,6 +181,14 @@ class dofManager : public dofManagerBase{
return false; return false;
} }
virtual inline bool isConstrained(Dof key) const
{
if(constraints.find(key) != constraints.end()){
return true;
}
return false;
}
inline bool isFixed(long int ent, int type) const inline bool isFixed(long int ent, int type) const
{ {
return isFixed(Dof(ent, type)); return isFixed(Dof(ent, type));
...@@ -543,6 +551,18 @@ class dofManager : public dofManagerBase{ ...@@ -543,6 +551,18 @@ class dofManager : public dofManagerBase{
constraints[key] = affineconstraint; constraints[key] = affineconstraint;
// constraints.insert(std::make_pair(key, affineconstraint)); // constraints.insert(std::make_pair(key, affineconstraint));
} }
virtual inline bool getLinearConstraint (Dof key, DofAffineConstraint<dataVec> &affineconstraint)
{
typename std::map<Dof, DofAffineConstraint< dataVec > >::const_iterator it=constraints.find(key);
if (it!=constraints.end())
{
affineconstraint=it->second;
return true;
}
return false;
}
virtual inline void assembleLinConst(const Dof &R, const Dof &C, const dataMat &value) virtual inline void assembleLinConst(const Dof &R, const Dof &C, const dataMat &value)
{ {
std::map<Dof, int>::iterator itR = unknown.find(R); std::map<Dof, int>::iterator itR = unknown.find(R);
...@@ -583,13 +603,15 @@ class dofManager : public dofManagerBase{ ...@@ -583,13 +603,15 @@ class dofManager : public dofManagerBase{
} }
} }
virtual int getDofNumber(const Dof& key){ virtual int getDofNumber(const Dof& key)
std::map<Dof,int>::iterator it = unknown.find(key); {
if (it == unknown.end()) { std::map<Dof,int>::iterator it = unknown.find(key);
return -1; if (it == unknown.end()){
} return -1;
else return it->second; }
}; else return it->second;
}
virtual void clearAllLineConstraints() { virtual void clearAllLineConstraints() {
constraints.clear(); constraints.clear();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment