Index: /issm/trunk/src/c/DataSet/DataSet.h
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.h	(revision 4228)
+++ /issm/trunk/src/c/DataSet/DataSet.h	(revision 4229)
@@ -130,10 +130,11 @@
 		/*}}}*/
 		/*numerics: {{{1*/
-		void  DistributeDofs(int numberofnodes,int numdofspernode);
-		void  FlagClones(int numberofnodes);
+		void  DistributeDofs(int numberofnodes,int numdofspernode,int analysis_type);
+		void  FlagClones(int numberofnodes,int analysis_type);
 		void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s,int analysis_type);
 		int   NumberOfDofs(int analysis_type);
+		int   NumberOfNodes(int analysis_type);
 		int   NumberOfNodes(void);
-		void  Ranks(int* ranks);
+		void  Ranks(int* ranks,int analysis_type);
 		/*}}}*/
 
Index: /issm/trunk/src/c/DataSet/Nodes.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/Nodes.cpp	(revision 4228)
+++ /issm/trunk/src/c/DataSet/Nodes.cpp	(revision 4229)
@@ -44,5 +44,5 @@
 /*Numerics*/
 /*FUNCTION Nodes::DistributeDofs{{{1*/
-void  Nodes::DistributeDofs(int numberofobjects,int numberofdofsperobject){
+void  Nodes::DistributeDofs(int numberofobjects,int numberofdofsperobject,int analysis_type){
 
 	extern int num_procs;
@@ -59,5 +59,9 @@
 	for (i=0;i<this->Size();i++){
 		Node* node=(Node*)this->GetObjectByOffset(i);
-		node->DistributeDofs(&dofcount);
+
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		if (node->InAnalysis(analysis_type)){
+			node->DistributeDofs(&dofcount);
+		}
 	}
 
@@ -85,6 +89,11 @@
 	/*Ok, now every cpu knows where his dofs should start. Update the dof count: */
 	for (i=0;i<this->Size();i++){
-		Node* node=(Node*)this->GetObjectByOffset(i);
-		node->OffsetDofs(dofcount);
+
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		Node* node=(Node*)this->GetObjectByOffset(i);
+		if (node->InAnalysis(analysis_type)){
+			node->OffsetDofs(dofcount);
+		}
+
 	}
 
@@ -96,6 +105,9 @@
 
 	for (i=0;i<this->Size();i++){
-		Node* node=(Node*)this->GetObjectByOffset(i);
-		node->ShowTrueDofs(truedofs);
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		Node* node=(Node*)this->GetObjectByOffset(i);
+		if (node->InAnalysis(analysis_type)){
+			node->ShowTrueDofs(truedofs);
+		}
 	}
 	
@@ -104,6 +116,9 @@
 	/*Ok, now every cpu knows the true dofs of everyone else that is not a clone. Let the clones recover those true dofs: */
 	for (i=0;i<this->Size();i++){
-		Node* node=(Node*)this->GetObjectByOffset(i);
-		node->UpdateCloneDofs(alltruedofs);
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		Node* node=(Node*)this->GetObjectByOffset(i);
+		if (node->InAnalysis(analysis_type)){
+			node->UpdateCloneDofs(alltruedofs);
+		}
 	}
 
@@ -116,5 +131,5 @@
 /*}}}*/
 /*FUNCTION Nodes::FlagClones{{{1*/
-void  Nodes::FlagClones(int numberofobjects){
+void  Nodes::FlagClones(int numberofobjects,int analysis_type){
 
 	int i;
@@ -131,5 +146,5 @@
 
 	/*Now go through all our objects and ask them to report to who they belong (which rank): */
-	Ranks(ranks);
+	Ranks(ranks,analysis_type);
 
 	/*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way, 
@@ -141,7 +156,13 @@
 	/*Now go through all objects, and use minranks to flag which objects are cloned: */
 	for(i=0;i<this->Size();i++){
-		/*For this object, decide whether it is a clone: */
-		Node* node=(Node*)this->GetObjectByOffset(i);
-		node->SetClone(minranks);
+
+		Node* node=(Node*)this->GetObjectByOffset(i);
+
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		if (node->InAnalysis(analysis_type)){
+
+			/*For this object, decide whether it is a clone: */
+			node->SetClone(minranks);
+		}
 	}
 
@@ -158,7 +179,10 @@
 
 	for(i=0;i<this->Size();i++){
+
 		Node* node=(Node*)this->GetObjectByOffset(i);
 			
-		if (node->InAnalysis(analysis_type)){
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		if (node->InAnalysis(analysis_type)){
+
 			/*Plug set values intp our 4 set vectors: */
 			node->CreateVecSets(pv_g,pv_m,pv_n,pv_f,pv_s);
@@ -215,5 +239,5 @@
 }
 /*}}}*/
-/*FUNCTION Nodes::NumberOfNodes{{{1*/
+/*FUNCTION Nodes::NumberOfNodes(){{{1*/
 int Nodes::NumberOfNodes(void){
 
@@ -244,6 +268,40 @@
 }
 /*}}}*/
+/*FUNCTION Nodes::NumberOfNodes{{{1*/
+int Nodes::NumberOfNodes(int analysis_type){
+
+	int i;
+
+	int max_sid=0;
+	int sid;
+	int node_max_sid;
+
+	for(i=0;i<this->Size();i++){
+
+		Node* node=(Node*)this->GetObjectByOffset(i);
+
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		if (node->InAnalysis(analysis_type)){
+
+			sid=node->Sid();
+			if (sid>max_sid)max_sid=sid;
+		}
+	}
+
+#ifdef _PARALLEL_
+	MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
+	MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
+	max_sid=node_max_sid;
+#endif 
+
+	/*sid starts at 0*/
+	max_sid++;
+
+	/*return*/
+	return max_sid;
+}
+/*}}}*/
 /*FUNCTION Nodes::Ranks{{{1*/
-void   Nodes::Ranks(int* ranks){
+void   Nodes::Ranks(int* ranks,int analysis_type){
 
 	/*Go through nodes, and for each object, report it cpu: */
@@ -254,10 +312,16 @@
 	
 	for(i=0;i<this->Size();i++){
-		Node* node=(Node*)this->GetObjectByOffset(i);
-		rank=node->MyRank();
-		sid=node->Sid();
-		
-		/*Plug rank into ranks, according to id: */
-		ranks[sid]=rank; 
+
+		Node* node=(Node*)this->GetObjectByOffset(i);
+
+		/*Check that this node corresponds to our analysis currently being carried out: */
+		if (node->InAnalysis(analysis_type)){
+
+			rank=node->MyRank();
+			sid=node->Sid();
+
+			/*Plug rank into ranks, according to id: */
+			ranks[sid]=rank; 
+		}
 	}
 	return;
Index: /issm/trunk/src/c/modules/BuildNodeSetsx/BuildNodeSetsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/BuildNodeSetsx/BuildNodeSetsx.cpp	(revision 4228)
+++ /issm/trunk/src/c/modules/BuildNodeSetsx/BuildNodeSetsx.cpp	(revision 4229)
@@ -77,5 +77,4 @@
 		VecFree(&vec_pv_s);
 
-
 		/*Create NodeSets* object: */
 		nodesets=new NodeSets(pv_m,pv_n,pv_f,pv_s,gsize,msize,nsize,fsize,ssize);
Index: /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp
===================================================================
--- /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp	(revision 4228)
+++ /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp	(revision 4229)
@@ -10,5 +10,5 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void NodesDofx(Nodes* nodes, Parameters* parameters){
+void NodesDofx(Nodes* nodes, Parameters* parameters,int analysis_type){
 
 	int noerr=1;
@@ -20,19 +20,19 @@
 	int  numberofdofspernode;
 
-	/*First, recover number of vertices and nodes: */
-	numberofnodes=nodes->NumberOfNodes();
+	/*First, recover number nodes associated th this analysis: */
+	numberofnodes=nodes->NumberOfNodes(analysis_type);
 
 	/*Recover number of dofs per node: */
 	found=parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);
-	if(!found)ISSMERROR(" could not find numberofdofspernode in parameters");
+	if(!found)ISSMERROR("could not find numberofdofspernode in parameters");
 
 	/*Ensure that only for each cpu, the partition border nodes only will be taken into account once 
 	 * across the cluster. To do so, we flag all the clone nodes: */
-	nodes->FlagClones(numberofnodes);
+	nodes->FlagClones(numberofnodes,analysis_type);
 
 	/*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When 
 	 *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it 
 	 *anymore. Use clone field to be sure of that: */
-	nodes->DistributeDofs(numberofnodes,numberofdofspernode);
+	nodes->DistributeDofs(numberofnodes,numberofdofspernode,analysis_type);
 
 }
Index: /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h
===================================================================
--- /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h	(revision 4228)
+++ /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h	(revision 4229)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void NodesDofx(Nodes* nodes, Parameters* parameters);
+void NodesDofx(Nodes* nodes, Parameters* parameters,int analysis_type);
 
 #endif  /* _NODESDOFX_H */
Index: /issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/FemModel.cpp	(revision 4228)
+++ /issm/trunk/src/c/objects/FemModel.cpp	(revision 4229)
@@ -63,5 +63,5 @@
 		_printf_("      create degrees of freedom\n");
 		VerticesDofx(&partition,&tpartition,vertices,parameters);
-		NodesDofx(nodes,parameters);
+		NodesDofx(nodes,parameters,analysis_type);
 
 		_printf_("      create single point constraints\n");
