Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5258)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5259)
@@ -4533,5 +4533,5 @@
 	/*First, figure out size of doflist: */
 	for(i=0;i<6;i++){
-		numberofdofs+=nodes[i]->GetNumberOfDofs();
+		numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum);
 	}
 
@@ -4543,5 +4543,5 @@
 	for(i=0;i<6;i++){
 		nodes[i]->GetDofList(doflist+count,approximation_enum);
-		count+=nodes[i]->GetNumberOfDofs();
+		count+=nodes[i]->GetNumberOfDofs(approximation_enum);
 	}
 
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5258)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5259)
@@ -5543,5 +5543,5 @@
 	/*First, figure out size of doflist: */
 	for(i=0;i<3;i++){
-		numberofdofs+=nodes[i]->GetNumberOfDofs();
+		numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum);
 	}
 
@@ -5552,6 +5552,6 @@
 	count=0;
 	for(i=0;i<3;i++){
-		nodes[i]->GetDofList(doflist+count);
-		count+=nodes[i]->GetNumberOfDofs();
+		nodes[i]->GetDofList(doflist+count,approximation_enum);
+		count+=nodes[i]->GetNumberOfDofs(approximation_enum);
 	}
 
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 5258)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 5259)
@@ -334,6 +334,19 @@
 void  Node::GetDofList(int* outdoflist,int approximation_enum){
 	int i;
-	for(i=0;i<this->indexing.numberofdofs;i++){
-		outdoflist[i]=indexing.doflist[i];
+	int count=0;
+
+	if(approximation_enum && this->indexing.doftype){ //if an approximation is specified and this node has several approsimations
+		for(i=0;i<this->indexing.numberofdofs;i++){
+			if(indexing.doftype[i]==approximation_enum){
+				outdoflist[count]=indexing.doflist[i];
+				count++;
+			}
+		}
+		ISSMASSERT(count);
+	}
+	else{
+		for(i=0;i<this->indexing.numberofdofs;i++){
+			outdoflist[i]=indexing.doflist[i];
+		}
 	}
 }
@@ -455,7 +468,19 @@
 /*}}}*/
 /*FUNCTION Node::GetNumberOfDofs{{{1*/
-int   Node::GetNumberOfDofs(){
-	
-	return this->indexing.numberofdofs;
+int   Node::GetNumberOfDofs(int approximation_enum){
+	
+	int i;
+	int numdofs=0;
+
+	/*Count the dofs if an approximation is specified and the node contains several dofs type*/
+	if(approximation_enum && this->indexing.doftype){
+		for(i=0;i<this->indexing.numberofdofs;i++){
+			if(this->indexing.doftype[i]==approximation_enum) numdofs++;
+		}
+	}
+	else numdofs=this->indexing.numberofdofs;
+
+	ISSMASSERT(numdofs); 
+	return numdofs;
 
 }
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 5258)
+++ /issm/trunk/src/c/objects/Node.h	(revision 5259)
@@ -68,5 +68,5 @@
 		void  SetVertexDof(int in_dof);
 		bool  InAnalysis(int analysis_type);
-		int   GetNumberOfDofs();
+		int   GetNumberOfDofs(int approximation_enum=0);
 		int   IsClone();
 		void  ApplyConstraint(Vec yg,int dof,double value);
