Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 23487)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 23488)
@@ -188,5 +188,8 @@
 		xDelete<Constraints*>(constraints_list);
 	}
-	if(loads)delete loads;
+	if(this->loads_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->loads_list[i];
+		xDelete<Loads*>(loads_list);
+	}
 	if(materials)delete materials;
 	if(parameters)delete parameters;
@@ -324,12 +327,11 @@
 	/*Analysis dependent arrays*/
 	output->constraints_list=xNew<Constraints*>(this->nummodels);
+	output->loads_list=xNew<Loads*>(this->nummodels);
 
 	output->profiler=static_cast<Profiler*>(this->profiler->copy());
 
-	output->loads=static_cast<Loads*>(this->loads->Copy());
 	output->materials=static_cast<Materials*>(this->materials->Copy());
 	output->parameters=static_cast<Parameters*>(this->parameters->Copy());
 	output->results=static_cast<Results*>(this->results->Copy());
-
 	output->nodes=static_cast<Nodes*>(this->nodes->Copy());
 	output->vertices=static_cast<Vertices*>(this->vertices->Copy());
@@ -344,4 +346,5 @@
 	for(i=0;i<nummodels;i++){
 		output->constraints_list[i] = static_cast<Constraints*>(this->constraints_list[i]->Copy());
+		output->loads_list[i] = static_cast<Loads*>(this->loads_list[i]->Copy());
 		analysis_type=output->analysis_type_list[i];
 		output->SetCurrentConfiguration(analysis_type);
@@ -349,5 +352,5 @@
 		SpcNodesx(output->nodes,output->constraints_list[i],output->parameters,analysis_type);
 		NodesDofx(output->nodes,output->parameters,analysis_type);
-		ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters);
+		ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes,output->vertices,output->materials,output->parameters);
 	}
 
@@ -423,5 +426,5 @@
 
 	/*create datasets for all analyses*/
-	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints_list,&this->loads,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list);
+	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints_list,&this->loads_list,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list);
 
 	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
@@ -432,5 +435,5 @@
 
 		if(VerboseMProcessor()) _printf0_("      configuring element and loads\n");
-		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
+		ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters);
 
 		if(i==0){
@@ -458,5 +461,4 @@
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
-		delete this->loads;
 		delete this->materials;
 		delete this->parameters;
@@ -464,4 +466,8 @@
 			for(i=0;i<this->nummodels;i++) delete this->constraints_list[i];
 			xDelete<Constraints*>(constraints_list);
+		}
+		if(this->loads_list && this->nummodels){
+			for(i=0;i<this->nummodels;i++) delete this->loads_list[i];
+			xDelete<Loads*>(loads_list);
 		}
 		delete this->results;
@@ -487,5 +493,4 @@
 	MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels);
 
-	this->loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
@@ -498,8 +503,11 @@
 		this->constraints_list = xNew<Constraints*>(this->nummodels);
 		for(i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints();
+		this->loads_list = xNew<Loads*>(this->nummodels);
+		for(i=0;i<nummodels;i++) this->loads_list[i] = new Loads();
 	}
 
 	for(i=0;i<nummodels;i++){
 		this->constraints_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+		this->loads_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	}
 
@@ -517,5 +525,5 @@
 			SpcNodesx(this->nodes,this->constraints_list[i],this->parameters,analysis_type);
 			NodesDofx(this->nodes,this->parameters,analysis_type);
-			ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters);
+			ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes,this->vertices,this->materials,this->parameters);
 		}
 
@@ -598,7 +606,8 @@
 
 	/*configure elements, loads and nodes, for this new analysis: */
+	this->loads = this->loads_list[this->analysis_counter];
+	this->constraints = this->constraints_list[this->analysis_counter];
+	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
 	this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
-	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
-	this->constraints = this->constraints_list[this->analysis_counter];
 
 	/*take care of toolkits options, that depend on this analysis type (present only after model processor)*/
@@ -2614,6 +2623,4 @@
 	this->ElementsAndVerticesPartitioning(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,&my_elements,&my_vertices);
 
-	if(this->loads->Size()!=0) _error_("not supported yet");
-
 	/*Create vertices*/
 	Vertices* new_vertices=new Vertices();
@@ -2639,4 +2646,5 @@
 	for(int i=0;i<this->nummodels;i++){//create nodes for each analysis in analysis_type_list
 
+		if(this->loads_list[i]->Size()!=0) _error_("not supported yet");
 		new_constraints_list[i] = new Constraints();
 
@@ -2661,10 +2669,10 @@
 	new_nodes->Presort();
 	new_vertices->Presort();
-	this->loads->Presort();
+	//this->loads->Presort();
 	new_materials->Presort();
 
 	/*reset hooks for elements, loads and nodes: */
 	new_elements->ResetHooks();
-	this->loads->ResetHooks();
+	//this->loads->ResetHooks();
 	new_materials->ResetHooks();
 
Index: /issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 23487)
+++ /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 23488)
@@ -42,5 +42,4 @@
 
 		Elements    *elements;             //elements (one set for all analyses)
-		Loads       *loads;                //one set of constraints. each constraint knows which analysis_type it handles
 		Materials   *materials;            //one set of materials, for each element
 		Nodes       *nodes;                //one set of nodes
@@ -52,4 +51,6 @@
 		Constraints  *constraints;
 		Constraints **constraints_list;
+		Loads        *loads;
+		Loads       **loads_list;
 
 		//FIXME: do we want only one class and have virtual functions? or keep 2 classes, at least rename AdaptiveMeshRefinement -> AmrNeopz
Index: /issm/trunk-jpl/src/c/classes/Loads/Loads.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 23487)
+++ /issm/trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 23488)
@@ -121,5 +121,6 @@
 
 		/*Check that this load corresponds to our analysis currently being carried out: */
-		if (load->InAnalysis(analysis_type)) localloads++;
+		_assert_(load->InAnalysis(analysis_type));
+		localloads++;
 	}
 
@@ -174,5 +175,6 @@
 
 		/*Check that this load corresponds to our analysis currently being carried out: */
-		if (load->InAnalysis(analysis_type)) localloads++;
+		_assert_(load->InAnalysis(analysis_type));
+		localloads++;
 	}
 
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 23487)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 23488)
@@ -13,5 +13,5 @@
 #include "./ModelProcessorx.h"
 
-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){
+void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){
 
 	/*Set Verbosity once for all*/
@@ -28,9 +28,10 @@
 	Vertices    *vertices    = new Vertices();
 	Materials   *materials   = new Materials();
-	Loads       *loads       = new Loads();
 	Parameters  *parameters  = new Parameters();
 
 	Constraints **constraints = xNew<Constraints*>(nummodels);
 	for(int i=0;i<nummodels;i++) constraints[i] = new Constraints();
+	Loads **loads = xNew<Loads*>(nummodels);
+	for(int i=0;i<nummodels;i++) loads[i] = new Loads();
 
 
@@ -56,5 +57,5 @@
 		analysis->CreateNodes(nodes,iomodel);
 		analysis->CreateConstraints(constraints[i],iomodel);
-		analysis->CreateLoads(loads,iomodel);
+		analysis->CreateLoads(loads[i],iomodel);
 		analysis->UpdateElements(elements,iomodel,i,analysis_enum);
 		delete analysis;
@@ -64,5 +65,5 @@
 		 * will need to start at the end of the updated counters: */
 		if(nodes->Size()) iomodel->nodecounter = nodes->MaximumId();
-		iomodel->loadcounter       = loads->NumberOfLoads();
+		iomodel->loadcounter       = loads[i]->NumberOfLoads();
 		iomodel->constraintcounter = constraints[i]->NumberOfConstraints();
 
@@ -70,6 +71,7 @@
 		_assert_(iomodel->nodecounter>=0);
 
-		/*Tell constraints that Ids are already sorted*/
+		/*Tell datasets that Ids are already sorted*/
 		constraints[i]->Presort();
+		loads[i]->Presort();
 	}
 
@@ -94,5 +96,4 @@
 	nodes->Presort();
 	vertices->Presort();
-	loads->Presort();
 	materials->Presort();
 
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 23487)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 23488)
@@ -9,5 +9,5 @@
 #include "../../analyses/analyses.h"
 
-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
+void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
 
 /*Creation of fem datasets: general drivers*/
Index: /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 23487)
+++ /issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 23488)
@@ -99,8 +99,7 @@
 		for (i=0;i<femmodel->loads->Size();i++){
 			load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
-			if(load->InAnalysis(configuration_type)){
-				load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
-				load->PenaltyCreatePVector(pf,kmax);
-			}
+			_assert_(load->InAnalysis(configuration_type)); 
+			load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
+			load->PenaltyCreatePVector(pf,kmax);
 		}
 	}
Index: /issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp
===================================================================
--- /issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 23487)
+++ /issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 23488)
@@ -109,4 +109,6 @@
 	if(conserve_loads){
 		delete femmodel->loads;
+		int index=femmodel->AnalysisIndex(configuration_type);
+		femmodel->loads_list[index]=savedloads;
 		femmodel->loads=savedloads;
 	}
