From 7f2a8576477795f84b7e2adc592e8c3d160edae9 Mon Sep 17 00:00:00 2001
From: Eric Bechet <eric.bechet@ulg.ac.be>
Date: Mon, 4 Mar 2013 10:55:23 +0000
Subject: [PATCH] Added get- functions for linearconstraints in dofManager

---
 Solver/dofManager.h | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/Solver/dofManager.h b/Solver/dofManager.h
index d33330cbde..1c61b6617d 100644
--- a/Solver/dofManager.h
+++ b/Solver/dofManager.h
@@ -181,6 +181,14 @@ class dofManager : public dofManagerBase{
     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
   {
     return isFixed(Dof(ent, type));
@@ -543,6 +551,18 @@ class dofManager : public dofManagerBase{
     constraints[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)
   {
     std::map<Dof, int>::iterator itR = unknown.find(R);
@@ -583,13 +603,15 @@ class dofManager : public dofManagerBase{
     }
   }
 
-  virtual int getDofNumber(const Dof& key){
-		std::map<Dof,int>::iterator it = unknown.find(key);
-		if (it == unknown.end()) {
-			return -1;
-		}
-		else return it->second;
-	};
+  virtual int getDofNumber(const Dof& key)
+  {
+    std::map<Dof,int>::iterator it = unknown.find(key);
+    if (it == unknown.end()){
+      return -1;
+    }
+    else return it->second;
+  }
+  
 	virtual void clearAllLineConstraints() {
     constraints.clear();
 	}
-- 
GitLab