Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 8800)
@@ -28,6 +28,6 @@
 		virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
 		virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
-		virtual void   CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs,Vec dg, Vec df)=0;
-		virtual void   CreatePVector(Vec pg, Vec pf)=0;
+		virtual void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df)=0;
+		virtual void   CreatePVector(Vec pf)=0;
 		virtual void   GetSolutionFromInputs(Vec solution)=0;
 		virtual int    GetNodeIndex(Node* node)=0;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 8800)
@@ -571,5 +571,5 @@
 /*}}}*/
 /*FUNCTION Penta::CreateKMatrix {{{1*/
-void  Penta::CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs,Vec dg, Vec df){
+void  Penta::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){
 
 	/*retrieve parameters: */
@@ -624,10 +624,10 @@
 	/*Add to global matrix*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
 	/*Add to global Vector*/
 	if(De){
-		De->InsertIntoGlobal(dg,df);
+		De->InsertIntoGlobal(df);
 		delete De;
 	}
@@ -2342,5 +2342,5 @@
 /*}}}*/
 /*FUNCTION Penta::CreatePVector {{{1*/
-void  Penta::CreatePVector(Vec pg, Vec pf){
+void  Penta::CreatePVector(Vec pf){
 
 	/*retrive parameters: */
@@ -2397,5 +2397,5 @@
 	/*Add to global Vector*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 8800)
@@ -79,6 +79,6 @@
 		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		void   CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs,Vec dg,Vec df);
-		void   CreatePVector(Vec pg, Vec pf);
+		void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
+		void   CreatePVector(Vec pf);
 		void   DeleteResults(void);
 		double DragCoefficientAbsGradient(bool process_units,int weight_index);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 8800)
@@ -377,5 +377,5 @@
 /*}}}*/
 /*FUNCTION Tria::CreateKMatrix {{{1*/
-void  Tria::CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs,Vec dg,Vec df){
+void  Tria::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){
 
 	/*retreive parameters: */
@@ -423,5 +423,5 @@
 	/*Add to global matrix*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
@@ -1318,5 +1318,5 @@
 /*}}}*/
 /*FUNCTION Tria::CreatePVector {{{1*/
-void  Tria::CreatePVector(Vec pg, Vec pf){
+void  Tria::CreatePVector(Vec pf){
 
 	/*retrive parameters: */
@@ -1368,5 +1368,5 @@
 	/*Add to global Vector*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 8800)
@@ -76,6 +76,6 @@
 		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		void   CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs,Vec dg,Vec df);
-		void   CreatePVector(Vec pg, Vec pf);
+		void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
+		void   CreatePVector(Vec pf);
 		double DragCoefficientAbsGradient(bool process_units,int weight_index);
 		int    GetNodeIndex(Node* node);
Index: /issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/FemModel.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/FemModel.cpp	(revision 8800)
@@ -39,11 +39,7 @@
 	/*Dynamically allocate whatever is a list of length nummodels: */
 	analysis_type_list=(int*)xmalloc(nummodels*sizeof(int));
-	m_nodesets=(NodeSets**)xmalloc(nummodels*sizeof(NodeSets*));
-	m_ys=(Vec*)xmalloc(nummodels*sizeof(Vec));
 
 	/*Initialize: */
 	for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i];
-	for(i=0;i<nummodels;i++)m_nodesets[i]=NULL;
-	for(i=0;i<nummodels;i++)m_ys[i]=NULL;
 
 	/*create datasets for all analyses*/
@@ -68,10 +64,4 @@
 		NodesDofx(nodes,parameters,analysis_type);
 	
-		_printf_(VerboseMProcessor(),"      create nodal constraints vector\n");
-		CreateNodalConstraintsx(&m_ys[i],nodes,analysis_type);
-
-		_printf_(VerboseMProcessor(),"      create node sets\n");
-		BuildNodeSetsx(&m_nodesets[i], nodes,analysis_type);
-
 		_printf_(VerboseMProcessor(),"      configuring element and loads\n");
 		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
@@ -105,15 +95,4 @@
 	delete parameters;
 	delete results;
-
-	for(i=0;i<nummodels;i++){
-		NodeSets* temp_nodesets=m_nodesets[i];
-		delete temp_nodesets;
-		Vec temp_ys=m_ys[i];
-		VecFree(&temp_ys);
-	}
-
-	/*Delete dynamically allocated arrays: */
-	xfree((void**)&m_nodesets);
-	xfree((void**)&m_ys);
 
 }
@@ -153,8 +132,4 @@
 	else _error_("Could not find alias for analysis_type %s in list of FemModel analyses",EnumToStringx(configuration_type));
 
-	/*activate matrices/vectors: */
-	nodesets=m_nodesets[analysis_counter];
-	ys=m_ys[analysis_counter];
-
 	/*Now, plug analysis_counter and analysis_type inside the parameters: */
 	this->parameters->SetParam(analysis_counter,AnalysisCounterEnum);
Index: /issm/trunk/src/c/objects/FemModel.h
===================================================================
--- /issm/trunk/src/c/objects/FemModel.h	(revision 8799)
+++ /issm/trunk/src/c/objects/FemModel.h	(revision 8800)
@@ -36,13 +36,4 @@
 		Results*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
 
-		//multiple  sets of matrices/vectors for each analysis_type. m stands for multiple
-		NodeSets**           m_nodesets; //boundary conditions dof sets
-		Vec*                 m_ys; //boundary conditions, in reduced s-set
-
-		//pointers to point to sets of matrices/vectors, for a certain analysis type. activated in SetCurrentAnalysis
-		NodeSets*            nodesets;
-		Vec                  yg;
-		Vec                  ys;
-
 		/*constructors, destructors: */
 		FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
Index: /issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/IoModel.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/IoModel.cpp	(revision 8800)
@@ -203,5 +203,4 @@
 	IoModelFetchData(&this->shelf_dampening,iomodel_handle,"shelf_dampening");
 	IoModelFetchData(&this->waitonlock,iomodel_handle,"waitonlock");
-	IoModelFetchData(&this->kff,iomodel_handle,"kff");
 	IoModelFetchData(&this->gl_migration,iomodel_handle,"gl_migration");
 	IoModelFetchData(&this->isdiagnostic,iomodel_handle,"isdiagnostic"); 
@@ -374,5 +373,4 @@
 	this->connectivity=0;
 	this->lowmem=0;
-	this->kff=0;
 	this->optscal=NULL;
 	this->yts=0;
Index: /issm/trunk/src/c/objects/IoModel.h
===================================================================
--- /issm/trunk/src/c/objects/IoModel.h	(revision 8799)
+++ /issm/trunk/src/c/objects/IoModel.h	(revision 8800)
@@ -161,5 +161,4 @@
 		double  yts;
 		double  waitonlock;
-		int     kff;
 		int     isdiagnostic;
 		int     isprognostic;
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 8800)
@@ -303,5 +303,5 @@
 /*}}}*/
 /*FUNCTION Icefront::CreateKMatrix {{{1*/
-void  Icefront::CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs){
+void  Icefront::CreateKMatrix(Mat Kff, Mat Kfs){
 
 	/*No stiffness loads applied, do nothing: */
@@ -311,5 +311,5 @@
 /*}}}*/
 /*FUNCTION Icefront::CreatePVector {{{1*/
-void  Icefront::CreatePVector(Vec pg, Vec pf){
+void  Icefront::CreatePVector(Vec pf){
 
 	/*Checks in debugging mode*/
@@ -339,5 +339,5 @@
 	/*Add to global Vector*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
@@ -345,5 +345,5 @@
 /*}}}*/
 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/
-void  Icefront::PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs, double kmax){
+void  Icefront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax){
 	/*do nothing: */
 	return;
@@ -351,5 +351,5 @@
 /*}}}*/
 /*FUNCTION Icefront::PenaltyCreatePVector{{{1*/
-void  Icefront::PenaltyCreatePVector(Vec pg,Vec pf,double kmax){
+void  Icefront::PenaltyCreatePVector(Vec pf,double kmax){
 	/*do nothing: */
 	return;
Index: /issm/trunk/src/c/objects/Loads/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 8800)
@@ -71,8 +71,8 @@
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		void  CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs);
-		void  CreatePVector(Vec pg, Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat kfs, double kmax);
-		void  PenaltyCreatePVector(Vec pg,Vec pf, double kmax);
+		void  CreateKMatrix(Mat Kff, Mat Kfs);
+		void  CreatePVector(Vec pf);
+		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Load.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Load.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Load.h	(revision 8800)
@@ -26,8 +26,8 @@
 		virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
 		virtual void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
-		virtual void  CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs)=0;
-		virtual void  CreatePVector(Vec pg, Vec pf)=0;
-		virtual void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs, double kmax)=0;
-		virtual void  PenaltyCreatePVector(Vec pg, Vec pf, double kmax)=0;
+		virtual void  CreateKMatrix(Mat Kff, Mat Kfs)=0;
+		virtual void  CreatePVector(Vec pf)=0;
+		virtual void  PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax)=0;
+		virtual void  PenaltyCreatePVector(Vec pf, double kmax)=0;
 		virtual bool  InAnalysis(int analysis_type)=0;
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 8800)
@@ -327,5 +327,5 @@
 /*}}}*/
 /*FUNCTION Numericalflux::CreateKMatrix {{{1*/
-void  Numericalflux::CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs){
+void  Numericalflux::CreateKMatrix(Mat Kff, Mat Kfs){
 
 	/*recover some parameters*/
@@ -351,5 +351,5 @@
 	/*Add to global matrix*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
@@ -358,5 +358,5 @@
 /*}}}*/
 /*FUNCTION Numericalflux::CreatePVector {{{1*/
-void  Numericalflux::CreatePVector(Vec pg,Vec pf){
+void  Numericalflux::CreatePVector(Vec pf){
 
 	/*recover some parameters*/
@@ -381,5 +381,5 @@
 	/*Add to global matrix*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
@@ -388,5 +388,5 @@
 /*}}}*/
 /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/
-void  Numericalflux::PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs,double kmax){
+void  Numericalflux::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
 
 	/*No stiffness loads applied, do nothing: */
@@ -396,5 +396,5 @@
 /*}}}*/
 /*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/
-void  Numericalflux::PenaltyCreatePVector(Vec pg,Vec pf,double kmax){
+void  Numericalflux::PenaltyCreatePVector(Vec pf,double kmax){
 
 	/*No penalty loads applied, do nothing: */
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.h	(revision 8800)
@@ -67,8 +67,8 @@
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		void  CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs);
-		void  CreatePVector(Vec pg, Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat kfs, double kmax);
-		void  PenaltyCreatePVector(Vec pg,Vec pf, double kmax);
+		void  CreateKMatrix(Mat Kff, Mat Kfs);
+		void  CreatePVector(Vec pf);
+		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 8800)
@@ -286,5 +286,5 @@
 /*}}}1*/
 /*FUNCTION Pengrid::CreateKMatrix {{{1*/
-void  Pengrid::CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs){
+void  Pengrid::CreateKMatrix(Mat Kff, Mat Kfs){
 
 	/*No loads applied, do nothing: */
@@ -294,5 +294,5 @@
 /*}}}1*/
 /*FUNCTION Pengrid::CreatePVector {{{1*/
-void  Pengrid::CreatePVector(Vec pg,Vec pf){
+void  Pengrid::CreatePVector(Vec pf){
 
 	/*No loads applied, do nothing: */
@@ -302,5 +302,5 @@
 /*}}}1*/
 /*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/
-void  Pengrid::PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs,double kmax){
+void  Pengrid::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
 
 	/*Retrieve parameters: */
@@ -325,5 +325,5 @@
 	/*Add to global matrix*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
@@ -331,5 +331,5 @@
 /*}}}1*/
 /*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/
-void  Pengrid::PenaltyCreatePVector(Vec pg,Vec pf,double kmax){
+void  Pengrid::PenaltyCreatePVector(Vec pf,double kmax){
 
 	/*Retrieve parameters: */
@@ -353,5 +353,5 @@
 	/*Add to global Vector*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
Index: /issm/trunk/src/c/objects/Loads/Pengrid.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 8800)
@@ -72,8 +72,8 @@
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		void  CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs);
-		void  CreatePVector(Vec pg, Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat kfs, double kmax);
-		void  PenaltyCreatePVector(Vec pg,Vec pf, double kmax);
+		void  CreateKMatrix(Mat Kff, Mat Kfs);
+		void  CreatePVector(Vec pf);
+		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Penpair.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Penpair.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Penpair.cpp	(revision 8800)
@@ -197,5 +197,5 @@
 /*}}}1*/
 /*FUNCTION Penpair::CreateKMatrix {{{1*/
-void  Penpair::CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs){
+void  Penpair::CreateKMatrix(Mat Kff, Mat Kfs){
 	/*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
 	/*No loads applied, do nothing: */
@@ -205,5 +205,5 @@
 /*}}}1*/
 /*FUNCTION Penpair::CreatePVector {{{1*/
-void  Penpair::CreatePVector(Vec pg,Vec pf){
+void  Penpair::CreatePVector(Vec pf){
 
 	/*No loads applied, do nothing: */
@@ -213,5 +213,5 @@
 /*}}}1*/
 /*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/
-void  Penpair::PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs,double kmax){
+void  Penpair::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
 
 	/*Retrieve parameters: */
@@ -233,5 +233,5 @@
 	/*Add to global Vector*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
@@ -239,5 +239,5 @@
 /*}}}1*/
 /*FUNCTION Penpair::PenaltyCreatePVector {{{1*/
-void  Penpair::PenaltyCreatePVector(Vec pg,Vec pf,double kmax){
+void  Penpair::PenaltyCreatePVector(Vec pf,double kmax){
 	/*No loads applied, do nothing: */
 	return;
Index: /issm/trunk/src/c/objects/Loads/Penpair.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Penpair.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Penpair.h	(revision 8800)
@@ -59,8 +59,8 @@
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		void  CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs);
-		void  CreatePVector(Vec pg, Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat kfs, double kmax);
-		void  PenaltyCreatePVector(Vec pg,Vec pf, double kmax);
+		void  CreateKMatrix(Mat Kff, Mat Kfs);
+		void  CreatePVector(Vec pf);
+		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 8800)
@@ -420,5 +420,5 @@
 /*}}}*/
 /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{1*/
-void  Riftfront::PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs,double kmax){
+void  Riftfront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
 
 	/*Retrieve parameters: */
@@ -440,5 +440,5 @@
 	/*Add to global Vector*/
 	if(Ke){
-		Ke->AddToGlobal(Kgg,Kff,Kfs);
+		Ke->AddToGlobal(Kff,Kfs);
 		delete Ke;
 	}
@@ -446,5 +446,5 @@
 /*}}}1*/
 /*FUNCTION Riftfront::PenaltyCreatePVector {{{1*/
-void  Riftfront::PenaltyCreatePVector(Vec pg,Vec pf,double kmax){
+void  Riftfront::PenaltyCreatePVector(Vec pf,double kmax){
 
 	/*Retrieve parameters: */
@@ -466,5 +466,5 @@
 	/*Add to global Vector*/
 	if(pe){
-		pe->AddToGlobal(pg,pf);
+		pe->AddToGlobal(pf);
 		delete pe;
 	}
@@ -472,5 +472,5 @@
 /*}}}1*/
 /*FUNCTION Riftfront::CreateKMatrix {{{1*/
-void  Riftfront::CreateKMatrix(Mat Kgg,Mat Kff, Mat Kfs){
+void  Riftfront::CreateKMatrix(Mat Kff, Mat Kfs){
 	/*do nothing: */
 	return;
@@ -478,5 +478,5 @@
 /*}}}1*/
 /*FUNCTION Riftfront::CreatePVector {{{1*/
-void  Riftfront::CreatePVector(Vec pg,Vec pf){
+void  Riftfront::CreatePVector(Vec pf){
 	/*do nothing: */
 	return;
Index: /issm/trunk/src/c/objects/Loads/Riftfront.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.h	(revision 8800)
@@ -79,8 +79,8 @@
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		void  CreateKMatrix(Mat Kgg, Mat Kff, Mat Kfs);
-		void  CreatePVector(Vec pg, Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kgg,Mat Kff, Mat kfs, double kmax);
-		void  PenaltyCreatePVector(Vec pg,Vec pf, double kmax);
+		void  CreateKMatrix(Mat Kff, Mat Kfs);
+		void  CreatePVector(Vec pf);
+		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 8800)
@@ -806,4 +806,111 @@
 }
 /*}}}*/
+/*FUNCTION Node::UpdateSpcs {{{1*/
+void   Node::UpdateSpcs(double* ys){
+
+	int     count=0;
+	int     i;
+
+	count=0;
+	for(i=0;i<this->indexing.gsize;i++){
+		if(this->indexing.s_set[i]){
+			this->indexing.svalues[i]=ys[this->indexing.sdoflist[count]];
+			count++;
+		}
+	}
+}
+/*}}}*/
+/*FUNCTION Node::VecMerge {{{1*/
+void   Node::VecMerge(Vec ug, double* vector_serial,int setenum){
+
+	double* values=NULL;
+	int*    indices=NULL;
+	int     count=0;
+	int     i;
+
+	if(setenum==FsetEnum){
+		if(this->indexing.fsize){
+			indices=(int*)xmalloc(this->indexing.fsize*sizeof(int));
+			values=(double*)xmalloc(this->indexing.fsize*sizeof(double));
+
+			for(i=0;i<this->indexing.gsize;i++){
+				if(this->indexing.f_set[i]){
+					values[count]=vector_serial[this->indexing.fdoflist[count]];
+					indices[count]=this->indexing.gdoflist[i];
+					count++;
+				}
+			}
+
+			/*Add values into ug: */
+			VecSetValues(ug,this->indexing.fsize,indices,(const double*)values,INSERT_VALUES);
+		}
+	}
+	else if(setenum==SsetEnum){
+		if(this->indexing.ssize){
+			indices=(int*)xmalloc(this->indexing.ssize*sizeof(int));
+			values=(double*)xmalloc(this->indexing.ssize*sizeof(double));
+
+			for(i=0;i<this->indexing.gsize;i++){
+				if(this->indexing.s_set[i]){
+					values[count]=vector_serial[this->indexing.sdoflist[count]];
+					indices[count]=this->indexing.gdoflist[i];
+					count++;
+				}
+			}
+
+			/*Add values into ug: */
+			VecSetValues(ug,this->indexing.ssize,indices,(const double*)values,INSERT_VALUES);
+		}
+	}
+	else _error_("VecMerge can only merge from the s or f-set onto the g-set!");
+
+	/*Free ressources:*/
+	xfree((void**)&values);
+	xfree((void**)&indices);
+}
+/*}}}*/
+/*FUNCTION Node::VecReduce {{{1*/
+void   Node::VecReduce(Vec vector, double* ug_serial,int setenum){
+
+	double* values=NULL;
+	int     count=0;
+	int     i;
+
+	if(setenum==FsetEnum){
+		if(this->indexing.fsize){
+			values=(double*)xmalloc(this->indexing.fsize*sizeof(double));
+
+			for(i=0;i<this->indexing.gsize;i++){
+				if(this->indexing.f_set[i]){
+					values[count]=ug_serial[this->indexing.gdoflist[count]];
+					count++;
+				}
+			}
+
+			/*Add values into ug: */
+			VecSetValues(vector,this->indexing.fsize,this->indexing.fdoflist,(const double*)values,INSERT_VALUES);
+		}
+	}
+	else if(setenum==SsetEnum){
+		if(this->indexing.ssize){
+			values=(double*)xmalloc(this->indexing.ssize*sizeof(double));
+
+			for(i=0;i<this->indexing.gsize;i++){
+				if(this->indexing.s_set[i]){
+					values[count]=ug_serial[this->indexing.gdoflist[count]];
+					count++;
+				}
+			}
+
+			/*Add values into ug: */
+			VecSetValues(vector,this->indexing.ssize,this->indexing.sdoflist,(const double*)values,INSERT_VALUES);
+		}
+	}
+	else _error_("VecReduce can only merge from the s or f-set onto the g-set!");
+
+	/*Free ressources:*/
+	xfree((void**)&values);
+}
+/*}}}*/
 
 /* DofObject routines:*/
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Node.h	(revision 8800)
@@ -92,4 +92,8 @@
 		int   IsOnShelf();
 		int   IsOnSheet();
+		void  UpdateSpcs(double* ys);
+		void  VecMerge(Vec ug, double* vector_serial,int setnum);
+		void  VecReduce(Vec vector, double* ug_serial,int setnum);
+		
 		/*}}}*/
 		/*Dof Object routines {{{1*/
Index: /issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp	(revision 8800)
@@ -27,5 +27,4 @@
 	this->values=NULL;
 	this->dofsymmetrical=false;
-	this->kff=false;
 
 	this->row_fsize=0;
@@ -99,5 +98,4 @@
 	this->ncols=gsize;
 	this->dofsymmetrical=true;
-	this->kff=Ke1->kff;
 
 	/*Gset and values*/
@@ -201,7 +199,4 @@
 ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){
 
-	/*retrieve some parameters: */
-	parameters->FindParam(&kff,KffEnum);
-
 	/*get Matrix size and properties*/
 	this->dofsymmetrical=true;
@@ -216,20 +211,10 @@
 
 	/*get dof lists for f and s set: */
-	if(kff){
-		this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
-		this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
-		this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
-		this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
-		this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
-		this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
-	}
-	else{
-		this->row_fsize=0;
-		this->row_flocaldoflist=NULL;
-		this->row_fglobaldoflist=NULL;
-		this->row_ssize=0;
-		this->row_slocaldoflist=NULL;
-		this->row_sglobaldoflist=NULL;
-	}
+	this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+	this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+	this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+	this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
+	this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
+	this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
 
 	/*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */
@@ -261,5 +246,5 @@
 /*ElementMatrix specific routines: */
 /*FUNCTION ElementMatrix::AddToGlobal{{{1*/
-void ElementMatrix::AddToGlobal(Mat Kgg, Mat Kff, Mat Kfs){
+void ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){
 
 	int i,j;
@@ -269,39 +254,33 @@
 		/*only use row dofs to add values into global matrices: */
 		
-		if(!this->kff){
+		if(this->row_fsize){
+			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+			localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double));
+			for(i=0;i<this->row_fsize;i++){
+				for(j=0;j<this->row_fsize;j++){
+					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
+				}
+			}
 			/*add local values into global  matrix, using the fglobaldoflist: */
-			MatSetValues(Kgg,this->nrows,this->gglobaldoflist,this->nrows,this->gglobaldoflist,(const double*)values,ADD_VALUES);
-		}
-		else{
-			if(this->row_fsize){
-				/*first, retrieve values that are in the f-set from the g-set values matrix: */
-				localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double));
-				for(i=0;i<this->row_fsize;i++){
-					for(j=0;j<this->row_fsize;j++){
-						*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
-					}
+			MatSetValues(Kff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES);
+
+			/*Free ressources:*/
+			xfree((void**)&localvalues);
+		}
+
+
+		if((this->row_ssize!=0) && (this->row_fsize!=0)){
+			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
+			localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double));
+			for(i=0;i<this->row_fsize;i++){
+				for(j=0;j<this->row_ssize;j++){
+					*(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]);
 				}
-				/*add local values into global  matrix, using the fglobaldoflist: */
-				MatSetValues(Kff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES);
-
-				/*Free ressources:*/
-				xfree((void**)&localvalues);
 			}
-
-
-			if((this->row_ssize!=0) && (this->row_fsize!=0)){
-				/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
-				localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double));
-				for(i=0;i<this->row_fsize;i++){
-					for(j=0;j<this->row_ssize;j++){
-						*(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]);
-					}
-				}
-				/*add local values into global  matrix, using the fglobaldoflist: */
-				MatSetValues(Kfs,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES);
-
-				/*Free ressources:*/
-				xfree((void**)&localvalues);
-			}
+			/*add local values into global  matrix, using the fglobaldoflist: */
+			MatSetValues(Kfs,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES);
+
+			/*Free ressources:*/
+			xfree((void**)&localvalues);
 		}
 	}
@@ -356,5 +335,4 @@
 	printf("   ncols: %i\n",ncols);
 	printf("   dofsymmetrical: %s\n",dofsymmetrical?"true":"false");
-	printf("   kff: %s\n",kff?"true":"false");
 
 	printf("   values: \n");
@@ -403,5 +381,4 @@
 	this->ncols =Ke->ncols;
 	this->dofsymmetrical=Ke->dofsymmetrical;
-	this->kff   =Ke->kff;
 
 	this->values=(double*)xmalloc(this->nrows*this->ncols*sizeof(double));
Index: /issm/trunk/src/c/objects/Numerics/ElementMatrix.h
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementMatrix.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Numerics/ElementMatrix.h	(revision 8800)
@@ -24,5 +24,4 @@
 		int      ncols;
 		bool     dofsymmetrical;
-		bool     kff;
 		double*  values;
 
@@ -59,5 +58,5 @@
 		/*}}}*/
 		/*ElementMatrix specific routines {{{1*/
-		void AddToGlobal(Mat Kgg, Mat Kff, Mat Kfs);
+		void AddToGlobal(Mat Kff, Mat Kfs);
 		void Echo(void);
 		void CheckConsistency(void);
Index: /issm/trunk/src/c/objects/Numerics/ElementVector.cpp
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementVector.cpp	(revision 8799)
+++ /issm/trunk/src/c/objects/Numerics/ElementVector.cpp	(revision 8800)
@@ -72,5 +72,4 @@
 	/*2: Initialize static fields*/
 	this->nrows=gsize;
-	this->pf=pe1->pf;
 
 	/*Gset and values*/
@@ -135,7 +134,4 @@
 ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){
 
-	/*retrieve some parameters: */
-	parameters->FindParam(&this->pf,KffEnum);
-
 	/*get Vector size and properties*/
 	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
@@ -148,14 +144,7 @@
 
 	/*Get fsize*/
-	if(pf){
-		this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
-		this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
-		this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
-	}
-	else{
-		this->fsize=0;
-		this->flocaldoflist =NULL;
-		this->fglobaldoflist=NULL;
-	}
+	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+	this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
 }
 /*}}}*/
@@ -171,53 +160,41 @@
 
 /*ElementVector specific routines: */
-/*FUNCTION ElementVector::AddToGlobal(Vec pg, Vec pf){{{1*/
-void ElementVector::AddToGlobal(Vec pg, Vec pf){
+/*FUNCTION ElementVector::AddToGlobal(Vec pf){{{1*/
+void ElementVector::AddToGlobal(Vec pf){
 
 	int i;
 	double* localvalues=NULL;
 
-	if(!pf){
+	if(this->fsize){
+		/*first, retrieve values that are in the f-set from the g-set values vector: */
+		localvalues=(double*)xmalloc(this->fsize*sizeof(double));
+		for(i=0;i<this->fsize;i++){
+			localvalues[i]=this->values[this->flocaldoflist[i]];
+		}
 		/*add local values into global  vector, using the fglobaldoflist: */
-		VecSetValues(pg,this->nrows,this->gglobaldoflist,(const double*)values,ADD_VALUES);
-	}
-	else{
-		if(this->fsize){
-			/*first, retrieve values that are in the f-set from the g-set values vector: */
-			localvalues=(double*)xmalloc(this->fsize*sizeof(double));
-			for(i=0;i<this->fsize;i++){
-				localvalues[i]=this->values[this->flocaldoflist[i]];
-			}
-			/*add local values into global  vector, using the fglobaldoflist: */
-			VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES);
-
-			/*Free ressources:*/
-			xfree((void**)&localvalues);
-		}
-	}
-}
-/*}}}*/
-/*FUNCTION ElementVector::InsertIntoGlobal(Vec pg, Vec pf){{{1*/
-void ElementVector::InsertIntoGlobal(Vec pg, Vec pf){
+		VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES);
+
+		/*Free ressources:*/
+		xfree((void**)&localvalues);
+	}
+}
+/*}}}*/
+/*FUNCTION ElementVector::InsertIntoGlobal(Vec pf){{{1*/
+void ElementVector::InsertIntoGlobal(Vec pf){
 
 	int i;
 	double* localvalues=NULL;
 
-	if(!pf){
+	if(this->fsize){
+		/*first, retrieve values that are in the f-set from the g-set values vector: */
+		localvalues=(double*)xmalloc(this->fsize*sizeof(double));
+		for(i=0;i<this->fsize;i++){
+			localvalues[i]=this->values[this->flocaldoflist[i]];
+		}
 		/*add local values into global  vector, using the fglobaldoflist: */
-		VecSetValues(pg,this->nrows,this->gglobaldoflist,(const double*)values,INSERT_VALUES);
-	}
-	else{
-		if(this->fsize){
-			/*first, retrieve values that are in the f-set from the g-set values vector: */
-			localvalues=(double*)xmalloc(this->fsize*sizeof(double));
-			for(i=0;i<this->fsize;i++){
-				localvalues[i]=this->values[this->flocaldoflist[i]];
-			}
-			/*add local values into global  vector, using the fglobaldoflist: */
-			VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES);
-
-			/*Free ressources:*/
-			xfree((void**)&localvalues);
-		}
+		VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES);
+
+		/*Free ressources:*/
+		xfree((void**)&localvalues);
 	}
 }
@@ -229,5 +206,4 @@
 	printf("Element Vector echo: \n");
 	printf("   nrows: %i\n",nrows);
-	printf("   pf: %s\n",pf?"true":"false");
 
 	printf("   values: \n");
@@ -252,5 +228,4 @@
 
 	this->nrows =pe->nrows;
-	this->pf    =pe->pf;
 
 	this->values=(double*)xmalloc(this->nrows*sizeof(double));
Index: /issm/trunk/src/c/objects/Numerics/ElementVector.h
===================================================================
--- /issm/trunk/src/c/objects/Numerics/ElementVector.h	(revision 8799)
+++ /issm/trunk/src/c/objects/Numerics/ElementVector.h	(revision 8800)
@@ -23,5 +23,4 @@
 		int      nrows;
 		double*  values;
-		bool     pf;
 		
 		//gset
@@ -41,6 +40,6 @@
 		/*}}}*/
 		/*ElementVector specific routines {{{1*/
-		void AddToGlobal(Vec pg, Vec pf);
-		void InsertIntoGlobal(Vec pg, Vec pf);
+		void AddToGlobal(Vec pf);
+		void InsertIntoGlobal(Vec pf);
 		void Echo(void);
 		void Init(ElementVector* pe);
Index: /issm/trunk/src/c/objects/objects.h
===================================================================
--- /issm/trunk/src/c/objects/objects.h	(revision 8799)
+++ /issm/trunk/src/c/objects/objects.h	(revision 8800)
@@ -15,5 +15,4 @@
 #include "./Node.h"
 #include "./Segment.h"
-#include "./NodeSets.h"
 #include "./IoModel.h"
 #include "./Patch.h"
