Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 8799)
@@ -323,5 +323,4 @@
 		case IsMacAyealPattynEnum : return "IsMacAyealPattyn";
 		case IsStokesEnum : return "IsStokes";
-		case KffEnum : return "Kff";
 		case LatentHeatEnum : return "LatentHeat";
 		case LowmemEnum : return "Lowmem";
Index: /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 8799)
@@ -3,39 +3,47 @@
  */
 
+#include "../VecMergex/VecMergex.h"
 #include "./Mergesolutionfromftogx.h"
 
-void	Mergesolutionfromftogx( Vec* pug, Vec uf, Vec ys, NodeSets* nodesets,bool flag_ys0){
+void	Mergesolutionfromftogx( Vec* pug, Vec uf, Vec ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
 
 	/*output: */
 	Vec ug=NULL;
-	Vec ys0=NULL;
-	int ug_local_size;
-	
+
+	/*intermediary: */
+	int configuration_type;
+	int analysis_type;
+	int gsize,fsize,ssize;
+
 	/*Display message*/
 	_printf_(VerboseModule(),"   Merging solution vector from fset to gset\n");
 
-	/*Merge f set back into g set: */
-	ug=NewVec(nodesets->GetGSize());
-	if(uf) VecMerge(ug,uf,nodesets->GetPV_F(),nodesets->GetFSize());
+	/*first, get gsize, fsize and ssize: */
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+	ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
 
-	/*merge single point constraints into g set: */
-	if(ys){
-		if (flag_ys0){
-
-			/*Create ys0, full of 0: */
-			VecDuplicate(ys,&ys0);
-			VecSet(ys0,0.0);
-			VecAssemblyBegin(ys0);
-			VecAssemblyEnd(ys0);
-
-			VecMerge(ug,ys0,nodesets->GetPV_S(),nodesets->GetSSize());
-		}
-		else{
-			VecMerge(ug,ys,nodesets->GetPV_S(),nodesets->GetSSize());
+	/*serialize uf and ys: those two vectors will be indexed by the nodes, who are the only ones 
+	 *that know which values should be plugged into ug and where: */
+	if(ssize){
+		if(flag_ys0){
+			VecSet(ys,0.0);
 		}
 	}
 
-	/*Free ressources:*/
-	VecFree(&ys0);
+	/*initialize ug: */
+	ug=NewVec(gsize);
+
+	/*Merge f set back into g set: */
+	if(fsize){
+		VecMergex(ug,uf,nodes,parameters,FsetEnum);
+	}
+	
+	/*Merge s set back into g set: */
+	if(ssize){
+		VecMergex(ug,ys,nodes,parameters,SsetEnum);
+	}
 
 	/*Assign correct pointer*/
Index: /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h
===================================================================
--- /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 8798)
+++ /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h	(revision 8799)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void	Mergesolutionfromftogx( Vec* pug, Vec uf,Vec ys, NodeSets* nodesets,bool flag_ys0=false);
+void	Mergesolutionfromftogx( Vec* pug, Vec uf, Vec ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
 
 #endif  /* _MERGESOLUTIONFROMFTOGX_H */
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 8799)
@@ -77,5 +77,4 @@
 	parameters->AddObject(new BoolParam(WaitOnLockEnum,iomodel->waitonlock));
 	parameters->AddObject(new IntParam(NumberOfElementsEnum,iomodel->numberofelements));
-	parameters->AddObject(new BoolParam(KffEnum,iomodel->kff));
 	parameters->AddObject(new BoolParam(IoGatherEnum,iomodel->io_gather));
 	parameters->AddObject(new IntParam(GroundingLineMigrationEnum,iomodel->gl_migration));
Index: /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 8799)
@@ -6,22 +6,57 @@
 #include "./Reducevectorgtofx.h"
  
-void Reducevectorgtofx(Vec* puf, Vec ug, NodeSets* nodesets,Parameters* parameters){
+void Reducevectorgtofx(Vec* puf, Vec ug, Nodes* nodes,Parameters* parameters){
 
 	/*output: */
 	Vec uf=NULL;
 
-	/*what type of partitioning: */
-	bool kffpartitioning=false;
+	/*variables: */
+	int i;
+	int analysis_type;
+	int configuration_type;
+	int fsize;
+	double* ug_serial=NULL;
 
-	/*find parameter: */
-	parameters->FindParam(&kffpartitioning,KffEnum);
+	/*first figure out fsize: */
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
 
-	if(nodesets){
+	if(fsize==0){
+		uf=NULL;
+	}
+	else{
+		/*allocate: */
+		uf=NewVec(fsize);
 
-		if (nodesets->GetGSize() && nodesets->GetFSize()){
-			VecPartition(&uf,ug,nodesets->GetPV_F(),nodesets->GetFSize(),kffpartitioning);
+		if(nodes->NumberOfNodes(analysis_type)){ 
+
+			/*serialize ug, so nodes can index into it: */
+			VecToMPISerial(&ug_serial,ug);
+
+			/*Go through all nodes, and ask them to retrieve values from ug, and plug them into uf: */
+			for(i=0;i<nodes->Size();i++){
+
+				Node* node=(Node*)nodes->GetObjectByOffset(i);
+
+				/*Check that this node corresponds to our analysis currently being carried out: */
+				if (node->InAnalysis(analysis_type)){
+
+					/*For this object, reduce values for enum set Fset: */
+					node->VecReduce(uf,ug_serial,FsetEnum);
+				}
+			}
+
 		}
 	}
-	
+
+	/*Assemble vector: */
+	VecAssemblyBegin(uf);
+	VecAssemblyEnd(uf);
+
+
+	/*Free ressources:*/
+	xfree((void**)&ug_serial);
+
 	/*Assign output pointers:*/
 	*puf=uf;
Index: /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
===================================================================
--- /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 8798)
+++ /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h	(revision 8799)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void	Reducevectorgtofx(Vec* puf, Vec ug, NodeSets* nodesets, Parameters* parameters);
+void Reducevectorgtofx(Vec* puf, Vec ug, Nodes* nodes,Parameters* parameters);
 
 #endif  /* _REDUCEVECTORGTOFX_H */
Index: /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp	(revision 8799)
@@ -6,22 +6,56 @@
 #include "./Reducevectorgtosx.h"
 
-void Reducevectorgtosx( Vec* pys, Vec yg, NodeSets* nodesets,Parameters* parameters){
+void Reducevectorgtosx(Vec* pys, Vec yg, Nodes* nodes,Parameters* parameters){
 
 	/*output: */
 	Vec ys=NULL;
 
-	/*what type of partitioning: */
-	bool kffpartitioning=false;
+	/*variables: */
+	int i;
+	int analysis_type;
+	int configuration_type;
+	int ssize;
+	double* yg_serial=NULL;
 
-	/*find parameter: */
-	parameters->FindParam(&kffpartitioning,KffEnum);
+	/*first figure out ssize: */
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
 
-	if(nodesets){
-		if (nodesets->GetGSize() && nodesets->GetSSize()){
-			VecPartition(&ys,yg,nodesets->GetPV_S(),nodesets->GetSSize(),kffpartitioning);
+	if(ssize==0){
+		ys=NULL;
+	}
+	else{
+		/*allocate: */
+		ys=NewVec(ssize);
+
+		if(nodes->NumberOfNodes(analysis_type)){ 
+
+			/*serialize yg, so nodes can index into it: */
+			VecToMPISerial(&yg_serial,yg);
+
+			/*Go throygh all nodes, and ask them to retrieve values from yg, and plyg them into ys: */
+			for(i=0;i<nodes->Size();i++){
+
+				Node* node=(Node*)nodes->GetObjectByOffset(i);
+
+				/*Check that this node corresponds to our analysis currently being carried out: */
+				if (node->InAnalysis(analysis_type)){
+
+					/*For this object, reduce values for enum set Fset: */
+					node->VecReduce(ys,yg_serial,SsetEnum);
+				}
+			}
 		}
 	}
-	
-	/*Assign output pointer:*/
+
+	/*Assemble vector: */
+	VecAssemblyBegin(ys);
+	VecAssemblyEnd(ys);
+
+	/*Free ressources:*/
+	xfree((void**)&yg_serial);
+
+	/*Assign output pointers:*/
 	*pys=ys;
 }
Index: /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
===================================================================
--- /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 8798)
+++ /issm/trunk/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h	(revision 8799)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void	Reducevectorgtosx( Vec* pys, Vec yg, NodeSets* nodesets,Parameters* parameters);
+void Reducevectorgtosx(Vec* pys, Vec yg, Nodes* nodes,Parameters* parameters);
 
 #endif  /* _REDUCEVECTORGTOSX_H */
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 8799)
@@ -321,5 +321,4 @@
 	else if (strcmp(name,"IsMacAyealPattyn")==0) return IsMacAyealPattynEnum;
 	else if (strcmp(name,"IsStokes")==0) return IsStokesEnum;
-	else if (strcmp(name,"Kff")==0) return KffEnum;
 	else if (strcmp(name,"LatentHeat")==0) return LatentHeatEnum;
 	else if (strcmp(name,"Lowmem")==0) return LowmemEnum;
Index: /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 8798)
+++ /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 8799)
@@ -9,22 +9,18 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void SystemMatricesx(Mat* pKgg, Mat* pKff, Mat* pKfs, Vec* ppg, Vec* ppf, Vec* pdg, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){
+void SystemMatricesx(Mat* pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){
 	
 	/*intermediary: */
 	int      i,j;
-	int      gsize,fsize,ssize;
+	int      fsize,ssize;
 	int      connectivity, numberofdofspernode;
 	int      analysis_type, configuration_type;
 	Element *element = NULL;
 	Load    *load    = NULL;
-	bool    buildkff=false;
 	
 	/*output: */
-	Mat    Kgg  = NULL;
 	Mat    Kff  = NULL;
 	Mat    Kfs  = NULL;
-	Vec    pg   = NULL;
 	Vec    pf   = NULL;
-	Vec    dg=NULL;
 	Vec    df=NULL;
 	double kmax = 0;
@@ -37,8 +33,6 @@
 	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	parameters->FindParam(&connectivity,ConnectivityEnum);
-	parameters->FindParam(&buildkff,KffEnum);
 
-	/*Get size of matrix: */
-	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+	/*Get size of matrices: */
 	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
 	ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
@@ -54,18 +48,12 @@
 	if(kflag){
 
-		if(!buildkff){
-			Kgg=NewMat(gsize,gsize,connectivity,numberofdofspernode);
-			dg=NewVec(gsize);
-		}
-		else{
-			Kff=NewMat(fsize,fsize,connectivity,numberofdofspernode);
-			Kfs=NewMat(fsize,ssize,connectivity,numberofdofspernode);
-			df=NewVec(fsize);
-		}
+		Kff=NewMat(fsize,fsize,connectivity,numberofdofspernode);
+		Kfs=NewMat(fsize,ssize,connectivity,numberofdofspernode);
+		df=NewVec(fsize);
 
 		/*Fill stiffness matrix from elements: */
 		for (i=0;i<elements->Size();i++){
 			element=(Element*)elements->GetObjectByOffset(i);
-			element->CreateKMatrix(Kgg,Kff,Kfs,dg,df);
+			element->CreateKMatrix(Kff,Kfs,df);
 		}
 
@@ -73,32 +61,21 @@
 		for (i=0;i<loads->Size();i++){
 			load=(Load*)loads->GetObjectByOffset(i);
-			if (load->InAnalysis(configuration_type)) load->CreateKMatrix(Kgg,Kff,Kfs);
+			if (load->InAnalysis(configuration_type)) load->CreateKMatrix(Kff,Kfs);
 		}
 
 		/*Assemble matrix and doftypes and compress matrix to save memory: */
-		if(!buildkff){
-			MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kgg);
-			#endif
-			VecAssemblyBegin(dg);
-			VecAssemblyEnd(dg);
-		}
-		else{
-			MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kff);
-			#endif
+		MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY);
+		#if _PETSC_VERSION_ == 2 
+		MatCompress(Kff);
+		#endif
 
-			MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kfs);
-			#endif
-			VecAssemblyBegin(df);
-			VecAssemblyEnd(df);
-		}
+		MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);
+		#if _PETSC_VERSION_ == 2 
+		MatCompress(Kfs);
+		#endif
+		VecAssemblyBegin(df);
+		VecAssemblyEnd(df);
 		
 	}
@@ -106,11 +83,10 @@
 	if(pflag){
 
-		if(!buildkff)pg=NewVec(gsize);
-		else         pf=NewVec(fsize);
+		pf=NewVec(fsize);
 
 		/*Fill right hand side vector, from elements: */
 		for (i=0;i<elements->Size();i++){
 			element=(Element*)elements->GetObjectByOffset(i);
-			element->CreatePVector(pg,pf);
+			element->CreatePVector(pf);
 		}
 
@@ -118,20 +94,13 @@
 		for (i=0;i<loads->Size();i++){
 			load=(Load*)loads->GetObjectByOffset(i);
-			if (load->InAnalysis(configuration_type)) load->CreatePVector(pg,pf);
+			if (load->InAnalysis(configuration_type)) load->CreatePVector(pf);
 		}
 
-		if(!buildkff){
-			VecAssemblyBegin(pg);
-			VecAssemblyEnd(pg);
-		}
-		else{
-			VecAssemblyBegin(pf);
-			VecAssemblyEnd(pf);
-		}
+		VecAssemblyBegin(pf);
+		VecAssemblyEnd(pf);
 	}
 
 	/*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */
-	if(!buildkff)MatNorm(Kgg,NORM_INFINITY,&kmax);
-	else MatNorm(Kff,NORM_INFINITY,&kmax);
+	MatNorm(Kff,NORM_INFINITY,&kmax);
 
 	/*Now, deal with penalties*/
@@ -141,28 +110,19 @@
 		for (i=0;i<loads->Size();i++){
 			load=(Load*)loads->GetObjectByOffset(i);
-			if (load->InAnalysis(configuration_type)) load->PenaltyCreateKMatrix(Kgg,Kff,Kfs,kmax);
+			if (load->InAnalysis(configuration_type)) load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
 		}
 
 		/*Assemble matrix and compress matrix to save memory: */
-		if(!buildkff){
-			MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kgg);
-			#endif
-		}
-		else{
-			MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kff);
-			#endif
+		MatAssemblyBegin(Kff,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kff,MAT_FINAL_ASSEMBLY);
+		#if _PETSC_VERSION_ == 2 
+		MatCompress(Kff);
+		#endif
 
-			MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);
-			MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);
-			#if _PETSC_VERSION_ == 2 
-			MatCompress(Kfs);
-			#endif
-		}
+		MatAssemblyBegin(Kfs,MAT_FINAL_ASSEMBLY);
+		MatAssemblyEnd(Kfs,MAT_FINAL_ASSEMBLY);
+		#if _PETSC_VERSION_ == 2 
+		MatCompress(Kfs);
+		#endif
 	}
 
@@ -173,24 +133,15 @@
 		for (i=0;i<loads->Size();i++){
 			load=(Load*)loads->GetObjectByOffset(i);
-			if (load->InAnalysis(configuration_type)) load->PenaltyCreatePVector(pg,pf,kmax);
+			if (load->InAnalysis(configuration_type)) load->PenaltyCreatePVector(pf,kmax);
 		}
 
-		if(!buildkff){
-			VecAssemblyBegin(pg);
-			VecAssemblyEnd(pg);
-		}
-		else{
-			VecAssemblyBegin(pf);
-			VecAssemblyEnd(pf);
-		}
+		VecAssemblyBegin(pf);
+		VecAssemblyEnd(pf);
 	}
 
 	/*Assign output pointers: */
-	if(pKgg) *pKgg=Kgg;
 	if(pKff) *pKff=Kff;
 	if(pKfs) *pKfs=Kfs;
-	if(ppg)  *ppg=pg;
 	if(ppf)  *ppf=pf;
-	if(pdg)  *pdg=dg;
 	if(pdf)  *pdf=df;
 	if(pkmax) *pkmax=kmax;
Index: /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 8798)
+++ /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 8799)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void SystemMatricesx(Mat* pKgg, Mat* pKff, Mat* pKfs, Vec* ppg, Vec* ppf, Vec* pdg, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
+void SystemMatricesx(Mat* pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
 			bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
 
Index: /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.cpp	(revision 8799)
+++ /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.cpp	(revision 8799)
@@ -0,0 +1,42 @@
+/*!\file UpdateSpcsx
+ * \brief module to update single point constraints  out of new spc vector, for next time step.
+ */
+
+#include "./UpdateSpcsx.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void UpdateSpcsx(Nodes* nodes,Parameters* parameters,Vec ys){
+	
+	int i;
+	int analysis_type;
+	double* ys_serial=NULL;
+
+	/*retrieve parameters: */
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	if(nodes->NumberOfNodes(analysis_type)){ 
+
+		/*serialize ys, so nodes can index into it: */
+		VecToMPISerial(&ys_serial,ys);
+
+		/*Go through all nodes, and ask them to retrieve values from ys and then update their spc values :*/
+		for(i=0;i<nodes->Size();i++){
+
+			Node* node=(Node*)nodes->GetObjectByOffset(i);
+
+			/*Check that this node corresponds to our analysis currently being carried out: */
+			if (node->InAnalysis(analysis_type)){
+
+				/*For this object, reset values of spc fields in the node: */
+				node->UpdateSpcs(ys_serial);
+			}
+		}
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&ys_serial);
+}
Index: /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.h
===================================================================
--- /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.h	(revision 8799)
+++ /issm/trunk/src/c/modules/UpdateSpcsx/UpdateSpcsx.h	(revision 8799)
@@ -0,0 +1,13 @@
+/*!\file:  UpdateSpcsx.h
+ * \brief header file for updating single point constraints  for next time step
+ */ 
+
+#ifndef _UPDATESPCSX_H
+#define _UPDATESPCSX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+void UpdateSpcsx(Nodes* nodes,Parameters* parameters,Vec ys);
+
+#endif  /* _UPDATESPCSX_H */
Index: /issm/trunk/src/c/modules/VecMergex/VecMergex.cpp
===================================================================
--- /issm/trunk/src/c/modules/VecMergex/VecMergex.cpp	(revision 8799)
+++ /issm/trunk/src/c/modules/VecMergex/VecMergex.cpp	(revision 8799)
@@ -0,0 +1,49 @@
+/*!\file VecMergex
+ * \brief: merge one vector into another
+ */
+
+#include "./VecMergex.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void VecMergex(Vec ug, Vec uf, Nodes* nodes, Parameters* parameters, int SetEnum){
+
+	/*variables: */
+	int i;
+	int analysis_type, configuration_type;
+	double* uf_serial=NULL;
+
+	/*retrieve parameters: */
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	
+	/*serialize uf: */
+	VecToMPISerial(&uf_serial,uf);
+
+	/*Do we have any nodes for this analysis type? :*/
+	if(nodes->NumberOfNodes(analysis_type)){ 
+
+		/*yes. Go through all nodes, and ask them to retrieve values from uf, and plug them into ug: */
+		for(i=0;i<nodes->Size();i++){
+
+			Node* node=(Node*)nodes->GetObjectByOffset(i);
+
+			/*Check that this node corresponds to our analysis currently being carried out: */
+			if (node->InAnalysis(analysis_type)){
+
+				/*For this object, merge values for enum set SetEnum: */
+				node->VecMerge(ug,uf_serial,SetEnum);
+			}
+		}
+	}
+	/*Free ressources:*/
+	xfree((void**)&uf_serial);
+
+	/*Assemble vector: */
+	VecAssemblyBegin(ug);
+	VecAssemblyEnd(ug);
+
+}
Index: /issm/trunk/src/c/modules/VecMergex/VecMergex.h
===================================================================
--- /issm/trunk/src/c/modules/VecMergex/VecMergex.h	(revision 8799)
+++ /issm/trunk/src/c/modules/VecMergex/VecMergex.h	(revision 8799)
@@ -0,0 +1,14 @@
+/*!\file:  VecMergex.h
+ * \brief header file for merging one vector into another
+ */ 
+
+#ifndef _VECMERGEX_H
+#define _VECMERGEX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void VecMergex(Vec ug, Vec uf, Nodes* nodes, Parameters* parameters, int SetEnum);
+
+#endif  /* _VECMERGEX_H */
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 8798)
+++ /issm/trunk/src/c/modules/modules.h	(revision 8799)
@@ -12,5 +12,4 @@
 #include "./Bamgx/Bamgx.h"
 #include "./BamgConvertMeshx/BamgConvertMeshx.h"
-#include "./BuildNodeSetsx/BuildNodeSetsx.h"
 #include "./Chacox/Chacox.h"
 #include "./ComputeBasalStressx/ComputeBasalStressx.h"
@@ -87,7 +86,5 @@
 #include "./PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.h"
 #include "./Qmux/Qmux.h"
-#include "./Reduceloadfromgtofx/Reduceloadfromgtofx.h"
 #include "./Reduceloadx/Reduceloadx.h"
-#include "./Reducematrixfromgtofx/Reducematrixfromgtofx.h"
 #include "./Reducevectorgtosx/Reducevectorgtosx.h"
 #include "./Reducevectorgtofx/Reducevectorgtofx.h"
@@ -104,5 +101,7 @@
 #include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h"
 #include "./UpdateVertexPositionsx/UpdateVertexPositionsx.h"
+#include "./UpdateSpcsx/UpdateSpcsx.h"
 #include "./VerticesDofx/VerticesDofx.h"
+#include "./VecMergex/VecMergex.h"
 
 #endif
