Index: /issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp	(revision 4056)
+++ /issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp	(revision 4057)
@@ -184,4 +184,5 @@
 		case SurfaceSlopeYEnum : return "SurfaceSlopeY";
 		case TemperatureEnum : return "Temperature";
+		case TemperatureOldEnum : return "TemperatureOld";
 		case TemperatureAverageEnum : return "TemperatureAverage";
 		case ThicknessEnum : return "Thickness";
Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 4056)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 4057)
@@ -213,4 +213,5 @@
 	SurfaceSlopeYEnum,
 	TemperatureEnum,
+	TemperatureOldEnum,
 	TemperatureAverageEnum,
 	ThicknessEnum,
Index: /issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp	(revision 4056)
+++ /issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp	(revision 4057)
@@ -182,4 +182,5 @@
 	else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
 	else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
+	else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;
 	else if (strcmp(name,"TemperatureAverage")==0) return TemperatureAverageEnum;
 	else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 4056)
+++ /issm/trunk/src/c/Makefile.am	(revision 4057)
@@ -93,14 +93,16 @@
 					./objects/DakotaPlugin.h\
 					./objects/DakotaPlugin.cpp\
+					./objects/Node.h\
+					./objects/Node.cpp\
 					./objects/Vertex.h\
 					./objects/Vertex.cpp\
 					./objects/Hook.h\
 					./objects/Hook.cpp\
+					./objects/Patch.h\
+					./objects/Patch.cpp\
 					./objects/DofIndexing.h\
 					./objects/DofIndexing.cpp\
 					./objects/IoModel.h\
 					./objects/IoModel.cpp\
-					./objects/Node.h\
-					./objects/Node.cpp\
 					./objects/ElementResults/ElementResultLocal.h\
 					./objects/ElementResults/NodalValuesUnitConversion.cpp\
@@ -124,4 +126,6 @@
 					./objects/ExternalResults/IntExternalResult.h\
 					./objects/ExternalResults/IntExternalResult.cpp\
+					./objects/ExternalResults/StringExternalResult.h\
+					./objects/ExternalResults/StringExternalResult.cpp\
 					./objects/ExternalResults/PetscVecExternalResult.h\
 					./objects/ExternalResults/PetscVecExternalResult.cpp\
@@ -220,4 +224,5 @@
 					./shared/Numerics/isnan.h\
 					./shared/Numerics/isnan.cpp\
+					./shared/Numerics/IsInputConverged.cpp\
 					./shared/Numerics/GaussPoints.h\
 					./shared/Numerics/cross.cpp\
@@ -426,4 +431,6 @@
 					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h\
 					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp\
+					./modules/GetVectorFromInputsx/GetVectorFromInputsx.h\
+					./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp\
 					./modules/UpdateInputsFromVectorx/UpdateInputsFromVectorx.h\
 					./modules/UpdateInputsFromVectorx/UpdateInputsFromVectorx.cpp\
@@ -617,4 +624,6 @@
 					./objects/Hook.h\
 					./objects/Hook.cpp\
+					./objects/Patch.h\
+					./objects/Patch.cpp\
 					./objects/ElementResults/ElementResultLocal.h\
 					./objects/ElementResults/NodalValuesUnitConversion.cpp\
@@ -638,4 +647,6 @@
 					./objects/ExternalResults/IntExternalResult.h\
 					./objects/ExternalResults/IntExternalResult.cpp\
+					./objects/ExternalResults/StringExternalResult.h\
+					./objects/ExternalResults/StringExternalResult.cpp\
 					./objects/ExternalResults/PetscVecExternalResult.h\
 					./objects/ExternalResults/PetscVecExternalResult.cpp\
@@ -732,4 +743,5 @@
 					./shared/Dofs/DistributeNumDofs.cpp\
 					./shared/Numerics/numerics.h\
+					./shared/Numerics/IsInputConverged.cpp\
 					./shared/Numerics/GaussPoints.h\
 					./shared/Numerics/GaussPoints.cpp\
@@ -939,4 +951,6 @@
 					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h\
 					./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp\
+					./modules/GetVectorFromInputsx/GetVectorFromInputsx.h\
+					./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp\
 					./modules/UpdateInputsFromVectorx/UpdateInputsFromVectorx.h\
 					./modules/UpdateInputsFromVectorx/UpdateInputsFromVectorx.cpp\
@@ -1029,8 +1043,10 @@
 					./solutions/convergence.cpp\
 					./solutions/thermal_core.cpp\
+					./solutions/thermal_core_step.cpp\
 					./solutions/WriteLockFile.cpp\
 					./solutions/control_core.cpp\
 					./solutions/stokescontrolinit.cpp\
 					./solutions/controlrestart.cpp\
+					./solutions/controlconvergence.cpp\
 					./solutions/objectivefunctionC.cpp\
 					./solutions/gradient_core.cpp\
@@ -1048,4 +1064,5 @@
 					./solutions/transient3d_core.cpp\
 					./solutions/steadystate_core.cpp\
+					./solutions/steadystateconvergence.cpp\
 					./solutions/ResetBoundaryConditions.cpp\
 					./solvers/solver_linear.cpp\
@@ -1062,5 +1079,5 @@
 bin_PROGRAMS = 
 else 
-bin_PROGRAMS = DiagnosticSolution.exe ThermalSolution.exe PrognosticSolution.exe Prognostic2Solution.exe BalancedthicknessSolution.exe Balancedthickness2Solution.exe BalancedvelocitiesSolution.exe Transient2DSolution.exe Transient23Solution.exe SteadystateSolution.exe SurfaceSlopeSolution.exe BedSlopeSolution.exe 
+bin_PROGRAMS = DiagnosticSolution.exe ThermalSolution.exe PrognosticSolution.exe Prognostic2Solution.exe BalancedthicknessSolution.exe Balancedthickness2Solution.exe BalancedvelocitiesSolution.exe Transient2DSolution.exe Transient3DSolution.exe SteadystateSolution.exe SurfaceSlopeSolution.exe BedSlopeSolution.exe 
 endif
 
Index: /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	(revision 4057)
@@ -12,4 +12,5 @@
 
 
+	int i;
 	Vec vector=NULL;
 
@@ -39,5 +40,5 @@
 }
 
-void GetVectorFromInputsx( double* pvector, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, int NameEnum, int TypeEnum){
+void GetVectorFromInputsx( double** pvector, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, int NameEnum, int TypeEnum){
 	
 	/*output: */
Index: /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
===================================================================
--- /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 4056)
+++ /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 4057)
@@ -10,5 +10,5 @@
 /* local prototypes: */
 void	GetVectorFromInputsx( Vec* pvector, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,int NameEnum,int TypeEnum);
-void	GetVectorFromInputsx( double* pvector, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,int NameEnum,int TypeEnum);
+void	GetVectorFromInputsx( double** pvector, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,int NameEnum,int TypeEnum);
 
 #endif  /* _GETVECTORFROMINPUTSXX_H */
Index: /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp	(revision 4057)
@@ -8,5 +8,5 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-int InputConvergencex(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters,int enums, int num_enums, int criterionenums, double* criterionvalues,int num_criterionenums){
+int InputConvergencex(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters,int* enums, int num_enums, int* criterionenums, double* criterionvalues,int num_criterionenums){
 
 	/*intermediary:*/
@@ -17,4 +17,6 @@
 	extern int  my_rank;
 	int         rank_allowed;
+	Element*    element=NULL;
+	int         verbose=0;
 
 	/*First, configure our datasets: */
@@ -24,4 +26,7 @@
 	parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
 
+	/*retrieve parameters: */
+	parameters->FindParam(&verbose,VerboseEnum);
+	
 	/*allocate dynamic memory: */
 	eps=(double*)xmalloc(num_criterionenums*sizeof(double));
@@ -29,5 +34,5 @@
 	/*Go through elements, and ask them to do the job: */
 	for(i=0;i<elements->Size();i++){
-		Element* element=(Element*)elements->GetObjectByOffset(i);
+		element=(Element*)elements->GetObjectByOffset(i);
 		element->InputConvergence(&converged,eps,enums,num_enums,criterionenums,criterionvalues,num_criterionenums);
 		if(!converged)break;
Index: /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.h
===================================================================
--- /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.h	(revision 4056)
+++ /issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.h	(revision 4057)
@@ -8,5 +8,5 @@
 
 /* local prototypes: */
-int InputConvergencex(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters,int enums, int num_enums, int criterionenums, double* criterionvalues,int num_criterionenums);
+int InputConvergencex(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters,int* enums, int num_enums, int* criterionenums, double* criterionvalues,int num_criterionenums);
 
 #endif  /* _INPUTCONVERGENCEX_H */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesBalancedthickness(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateNodesBalancedthickness2.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateNodesBalancedthickness2.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateNodesBalancedthickness2.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesBalancedthickness2(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesBalancedthickness2(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesBalancedvelocities(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesDiagnosticHutter(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesDiagnosticStokes(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/UpdateElementsDiagnosticStokes.cpp	(revision 4057)
@@ -1,4 +1,4 @@
 /*
- * UpdateElementsDiagnosticHoriz:
+ * UpdateElementsDiagnosticStokes:
  */
 
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	UpdateElementsDiagnosticHoriz(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter,int analysis_type){
+void	UpdateElementsDiagnosticStokes(DataSet* elements, IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_counter,int analysis_type){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesDiagnosticVert(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesMelting(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesMelting(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesPrognostic(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateNodesPrognostic2.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateNodesPrognostic2.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateNodesPrognostic2.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesPrognostic2(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateNodesSlopeCompute.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateNodesSlopeCompute.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateNodesSlopeCompute.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesSlopeCompute(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp	(revision 4057)
@@ -13,5 +13,5 @@
 #include "../ModelProcessorx.h"
 
-void	CreateNodesThermal(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
+void	CreateNodesThermal(DataSet** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
 	/*Intermediary*/
Index: /issm/trunk/src/c/modules/PenaltySystemMatricesx/PenaltySystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/modules/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 4056)
+++ /issm/trunk/src/c/modules/PenaltySystemMatricesx/PenaltySystemMatricesx.h	(revision 4057)
@@ -10,6 +10,5 @@
 
 /* local prototypes: */
-void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters,
-		int kflag,int pflag,int analysis_type,int sub_analysis_type); 
+void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, int kflag,int pflag);
 
 #endif  /* _PENALTYSYSTEMMATRICESX_H */
Index: /issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp
===================================================================
--- /issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp	(revision 4057)
@@ -111,8 +111,14 @@
 
 	}
-	else if(solution_type==TransientAnalysisEnum){
+	else if(solution_type==Transient2DAnalysisEnum){
 
 		if(verbose)_printf_("Starting transient core\n");
-		transient_core(femmodel);
+		transient2d_core(femmodel);
+
+	}
+	else if(solution_type==Transient3DAnalysisEnum){
+
+		if(verbose)_printf_("Starting transient core\n");
+		transient3d_core(femmodel);
 
 	}
Index: /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h
===================================================================
--- /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 4056)
+++ /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.h	(revision 4057)
@@ -10,6 +10,5 @@
 
 /* local prototypes: */
-void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters,
-		int kflag,int pflag,int analysis_type,int sub_analysis_type); 
+void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, int kflag,int pflag);
 
 #endif  /* _SYSTEMMATRICESX_H */
Index: /issm/trunk/src/c/modules/UpdateGeometryx/UpdateGeometryx.cpp
===================================================================
--- /issm/trunk/src/c/modules/UpdateGeometryx/UpdateGeometryx.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/UpdateGeometryx/UpdateGeometryx.cpp	(revision 4057)
@@ -4,6 +4,5 @@
 
 #include "./UpdateGeometryx.h"
-
-#include "../../shared/shared.h"
+#include "../modules.h"
 #include "../../include/include.h"
 #include "../../toolkits/toolkits.h"
@@ -19,5 +18,5 @@
 	Vec     vec_newthickness=NULL;
 	Vec     vec_bed=NULL;
-	Vec     vec_surface=NULL:
+	Vec     vec_surface=NULL;
 	double* newthickness=NULL;
 	double* bed=NULL;
@@ -25,5 +24,5 @@
 
 	/*objects: */
-	Vertex* vertex=NULL;
+	Node* node=NULL;
 	Object* object=NULL;
 	Matpar* matpar=NULL;
@@ -62,14 +61,14 @@
 	rho_water=matpar->GetRhoWater();
 
-	/*Go through vertices and for each vertex, update the thickness, bed and surface, using the 
+	/*Go through nodes and for each node, update the thickness, bed and surface, using the 
 	 * new thickness computed in the prognostic_core part of the transient solution sequence: */
 
-	for(i=0;i<vertices->Size();i++){
+	for(i=0;i<nodes->Size();i++){
 
 		/*get i'th node: */
-		vertex=(Vertex*)vertices->GetObjectByOffset(i);
+		node=(Node*)vertices->GetObjectByOffset(i);
 
-		/*first, recover thickness, surface and bed for this vertex: */
-		dof=vertex->GetDofList1();
+		/*first, recover thickness, surface and bed for this node: */
+		dof=node->GetDofList1();
 		h=newthickness[dof];
 		s=surface[dof];
@@ -80,10 +79,10 @@
 
 		//For grids on ice sheet, the new bed remains the same, the new surface becomes bed+new_thickness. 
-		if (vertex->IsOnSheet()){
+		if (node->IsOnSheet()){
 			s=b+h;
 		}
 
 		//For grids on ice shelt, we have hydrostatic equilibrium (for now)
-		if (vertex->IsOnShelf()){
+		if (node->IsOnShelf()){
 			b=-rho_ice/rho_water*h;
 			s=(1-rho_ice/rho_water)*h;
Index: /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	(revision 4056)
+++ /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	(revision 4057)
@@ -4,5 +4,5 @@
 
 #include "./UpdateVertexPositionsx.h"
-
+#include "../modules.h"
 #include "../../shared/shared.h"
 #include "../../include/include.h"
@@ -10,24 +10,29 @@
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void UpdateVertexPositionsx( DataSet* vertices, Vec thickness,Vec bed){
+int UpdateVertexPositionsx(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters){
 
-	/*intermediary: */
 	int i;
 	Vertex* vertex=NULL;
-	double* thickness_serial=NULL;
-	double* bed_serial=NULL;
+	double* thickness=NULL;
+	double* bed=NULL;
 
-	/*serialize inputs: */
-	VecToMPISerial(&thickness_serial,thickness);
-	VecToMPISerial(&bed_serial,bed);
-	
+	/*First, get elements and loads configured: */
+	elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
+	nodes->     Configure(elements,loads, nodes,vertices, materials,parameters);
+	parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
+
+
+	/*get vertex vectors for bed and thickness: */
+	GetVectorFromInputsx( &thickness,elements,nodes, vertices, loads, materials, parameters, ThicknessEnum,VertexEnum);
+	GetVectorFromInputsx( &thickness,elements,nodes, vertices, loads, materials, parameters, BedEnum,VertexEnum);
+
 	/*Update verices new geometry: */
 	for (i=0;i<vertices->Size();i++){
 		vertex=(Vertex*)vertices->GetObjectByOffset(i);
-		vertex->UpdatePosition(thickness_serial,bed_serial);
+		vertex->UpdatePosition(thickness,bed);
 	}
 
 	/*Free ressources:*/
-	xfree((void**)&thickness_serial);
-	xfree((void**)&bed_serial);
+	xfree((void**)&thickness);
+	xfree((void**)&bed);
 }
Index: /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.h
===================================================================
--- /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.h	(revision 4056)
+++ /issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.h	(revision 4057)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void UpdateVertexPositionsx( DataSet* vertices, Vec thickness,Vec bed);
+int UpdateVertexPositionsx(DataSet* elements,DataSet* nodes,DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters);
 
 #endif  /* _UPDATEVERTEXPOSITIONSXX_H */
Index: /issm/trunk/src/c/objects/Elements/Beam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4057)
@@ -64,4 +64,11 @@
 
 	return beam;
+}
+/*}}}*/
+/*FUNCTION Beam::Configure {{{1*/
+void  Beam::Configure(DataSet* elementsin,DataSet* loadsin, DataSet* nodesin, DataSet* materialsin, Parameters* parametersin){
+
+	ISSMERROR(" not supported yet!");
+
 }
 /*}}}*/
@@ -1056,6 +1063,7 @@
 /*}}}*/
 /*FUNCTION Beam::InputConvergence(int* pconverged, double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){{{1*/
-void  Beam::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){a
-
+void  Beam::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
+
+	int     i;
 	Input** new_inputs=NULL;
 	Input** old_inputs=NULL;
@@ -1066,13 +1074,13 @@
 	
 	for(i=0;i<num_enums/2;i++){
-		new_inputs[i]=(Input*)this->inputs->GetInput(new_enums[2*i+0]);
-		old_inputs[i]=(Input*)this->inputs->GetInput(old_enums[2*i+1]);
-		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(new_enums[2*i+0]));
-		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(old_enums[2*i+0]));
+		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
+		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
 	}
 
 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
 	for(i=0;i<num_criterionenums;i++){
-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,,criterionenums[i]);
+		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
 		if(eps[i]>criterionvalues[i]) converged=0; 
 	}
Index: /issm/trunk/src/c/objects/Elements/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4057)
@@ -98,5 +98,5 @@
 		void  AXPYInput(int YEnum, double scalar, int XEnum);
 		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
-		void  InputConvergence(int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 4057)
@@ -69,5 +69,5 @@
 		virtual void   AXPYInput(int YEnum, double scalar, int XEnum)=0;
 		virtual void   ControlConstrainInput(int control_type,double cm_min, double cm_max)=0;
-		virtual void   InputConvergence(int* pconverged, double* eps, int* enums,int num_enums,int* criterionenums,double criterionvalues,double* criterionvalues,int num_criterionenums)=0;
+		virtual void   InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums)=0;
 
 		/*Implementation: */
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4057)
@@ -5316,6 +5316,7 @@
 /*}}}*/
 /*FUNCTION Penta::InputConvergence(int* pconverged, double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){{{1*/
-void  Penta::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){a
-
+void  Penta::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
+
+	int     i;
 	Input** new_inputs=NULL;
 	Input** old_inputs=NULL;
@@ -5326,13 +5327,13 @@
 	
 	for(i=0;i<num_enums/2;i++){
-		new_inputs[i]=(Input*)this->inputs->GetInput(new_enums[2*i+0]);
-		old_inputs[i]=(Input*)this->inputs->GetInput(old_enums[2*i+1]);
-		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(new_enums[2*i+0]));
-		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(old_enums[2*i+0]));
+		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
+		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
 	}
 
 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
 	for(i=0;i<num_criterionenums;i++){
-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,,criterionenums[i]);
+		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
 		if(eps[i]>criterionvalues[i]) converged=0; 
 	}
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4057)
@@ -165,5 +165,5 @@
 		void  AXPYInput(int YEnum, double scalar, int XEnum);
 		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
-		void  InputConvergence(int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
 		void  GetVectorFromInputs(Vec vector,int NameEnum);
 
Index: /issm/trunk/src/c/objects/Elements/Sing.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4057)
@@ -762,6 +762,7 @@
 /*}}}*/
 /*FUNCTION Sing::InputConvergence(int* pconverged, double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){{{1*/
-void  Sing::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){a
-
+void  Sing::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
+
+	int i;
 	Input** new_inputs=NULL;
 	Input** old_inputs=NULL;
@@ -772,13 +773,13 @@
 	
 	for(i=0;i<num_enums/2;i++){
-		new_inputs[i]=(Input*)this->inputs->GetInput(new_enums[2*i+0]);
-		old_inputs[i]=(Input*)this->inputs->GetInput(old_enums[2*i+1]);
-		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(new_enums[2*i+0]));
-		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(old_enums[2*i+0]));
+		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
+		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
 	}
 
 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
 	for(i=0;i<num_criterionenums;i++){
-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,,criterionenums[i]);
+		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
 		if(eps[i]>criterionvalues[i]) converged=0; 
 	}
Index: /issm/trunk/src/c/objects/Elements/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4057)
@@ -96,5 +96,5 @@
 		void  ScaleInput(int enum_type,double scale_factor);
 		void  AXPYInput(int YEnum, double scalar, int XEnum);
-		void  InputConvergence(int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
 		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4057)
@@ -5495,6 +5495,7 @@
 /*}}}*/
 /*FUNCTION Tria::InputConvergence(int* pconverged, double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){{{1*/
-void  Tria::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){a
-
+void  Tria::InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums){
+
+	int i;
 	Input** new_inputs=NULL;
 	Input** old_inputs=NULL;
@@ -5505,13 +5506,13 @@
 	
 	for(i=0;i<num_enums/2;i++){
-		new_inputs[i]=(Input*)this->inputs->GetInput(new_enums[2*i+0]);
-		old_inputs[i]=(Input*)this->inputs->GetInput(old_enums[2*i+1]);
-		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(new_enums[2*i+0]));
-		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(old_enums[2*i+0]));
+		new_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+0]);
+		old_inputs[i]=(Input*)this->inputs->GetInput(enums[2*i+1]);
+		if(!new_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
+		if(!old_inputs[i])ISSMERROR("%s%s"," could not find input with enum ",EnumAsString(enums[2*i+0]));
 	}
 
 	/*ok, we've got the inputs (new and old), now loop throught the number of criterions and fill the eps array:*/
 	for(i=0;i<num_criterionenums;i++){
-		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,,criterionenums[i]);
+		IsInputConverged(eps+i,new_inputs,old_inputs,num_enums/2,criterionenums[i]);
 		if(eps[i]>criterionvalues[i]) converged=0; 
 	}
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4057)
@@ -142,5 +142,5 @@
 		void  ScaleInput(int enum_type,double scale_factor);
 		void  AXPYInput(int YEnum, double scalar, int XEnum);
-		void  InputConvergence(int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
 		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 		void  GetVectorFromInputs(Vec vector,int NameEnum);
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4057)
@@ -81,7 +81,7 @@
 	
 	this->value=(char*)xmalloc(stringsize*sizeof(char));
-	memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	memcpy(this->step,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	memcpy(this->time,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
 
 	/*return: */
@@ -128,6 +128,6 @@
 	memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
 	memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	memcpy(marshalled_dataset,this->step,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	memcpy(marshalled_dataset,this->time,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
 
 	*pmarshalled_dataset=marshalled_dataset;
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4057)
@@ -199,5 +199,5 @@
 /*}}}*/
 /*FUNCTION BeamVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){{{1*/
-void BeamVertexInput::GetParameterValues(double* pvalues,double* gauss_pointers, int numgauss){
+void BeamVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){
 	/*It is assumed that output has been correctly allocated*/
 
@@ -295,5 +295,5 @@
 /*}}}*/
 /*FUNCTION BeamVertexInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void BeamVertexInput::GetValuesPtr(double* pvalues,int* pnum_values){
+void BeamVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	*pvalues=this->values;
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4057)
@@ -78,5 +78,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4057)
@@ -256,6 +256,6 @@
 }
 /*}}}*/
-/*FUNCTION BoolInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void BoolInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*FUNCTION BoolInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void BoolInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	ISSMERROR(" not supported yet!");
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4057)
@@ -78,5 +78,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4057)
@@ -267,6 +267,6 @@
 }
 /*}}}*/
-/*FUNCTION DoubleInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void DoubleInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*FUNCTION DoubleInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void DoubleInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	ISSMERROR(" not supported yet!");
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4057)
@@ -79,5 +79,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/Input.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4057)
@@ -55,5 +55,5 @@
 		virtual void Constrain(double cm_min, double cm_max)=0;
 		virtual void GetVectorFromInputs(Vec vector,int* doflist)=0;
-		virtual void GetValuesPtr(double* pvalues,int* pnum_values)=0;
+		virtual void GetValuesPtr(double** pvalues,int* pnum_values)=0;
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/IntInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4057)
@@ -257,6 +257,6 @@
 }
 /*}}}*/
-/*FUNCTION IntInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void IntInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*FUNCTION IntInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void IntInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	ISSMERROR(" not supported yet!");
Index: /issm/trunk/src/c/objects/Inputs/IntInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4057)
@@ -78,5 +78,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4057)
@@ -943,6 +943,6 @@
 }
 /*}}}*/
-/*FUNCTION PentaVertexInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void PentaVertexInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*FUNCTION PentaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void PentaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	*pvalues=this->values;
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4057)
@@ -87,5 +87,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4057)
@@ -258,7 +258,7 @@
 
 }
-/2*}}}*/
-/*FUNCTION SingVertexInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void SingVertexInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*}}}*/
+/*FUNCTION SingVertexInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void SingVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	*pvalues=&this->value;
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4057)
@@ -77,5 +77,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4057)
@@ -517,6 +517,6 @@
 }
 /*}}}*/
-/*FUNCTION TriaVertexInput::GetValuesPtr(double* pvalues,int* pnum_values);{{{1*/
-void TriaVertexInput::GetValuesPtr(double* pvalues,int* pnum_values){
+/*FUNCTION TriaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values);{{{1*/
+void TriaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
 
 	*pvalues=this->values;
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4057)
@@ -84,5 +84,5 @@
 		void Constrain(double cm_min, double cm_max);
 		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double* pvalues,int* pnum_values);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Loads/Load.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Load.h	(revision 4056)
+++ /issm/trunk/src/c/objects/Loads/Load.h	(revision 4057)
@@ -34,5 +34,5 @@
 		virtual void  PenaltyCreateKMatrix(Mat Kgg,double kmax)=0;
 		virtual void  PenaltyCreatePVector(Vec pg,double kmax)=0;
-		virtual bool  InAnalysis(int analysis_type);
+		virtual bool  InAnalysis(int analysis_type)=0;
 };
 #endif
Index: /issm/trunk/src/c/objects/Patch.cpp
===================================================================
--- /issm/trunk/src/c/objects/Patch.cpp	(revision 4056)
+++ /issm/trunk/src/c/objects/Patch.cpp	(revision 4057)
@@ -14,4 +14,5 @@
 #include "./objects.h"
 #include "../DataSet/DataSet.h"
+#include "../io/io.h"
 #include "../EnumDefinitions/EnumDefinitions.h"
 #include "../shared/shared.h"
@@ -26,5 +27,5 @@
 	this->maxvertices=0;
 	this->maxnodes=0;
-	this->values=NULL:
+	this->values=NULL;
 }
 /*}}}*/
@@ -32,4 +33,5 @@
 Patch::Patch(int in_numrows, int in_maxvertices, int in_maxnodes){
 
+	int i,j;
 	this->numrows=in_numrows;
 	this->maxvertices=in_maxvertices;
@@ -45,7 +47,7 @@
 
 	//allocate and fill with NaN:
-	this->values=xmalloc(this->numcols*this->numrows*sizeof(double));
+	this->values=(double*)xmalloc(this->numcols*this->numrows*sizeof(double));
 	for(i=0;i<this->numcols;i++){
-		for(j=0;j<this->nurows;j++){
+		for(j=0;j<this->numrows;j++){
 			*(this->values+i*this->numcols+j)=NAN;
 		}
@@ -105,4 +107,5 @@
 
 	int         i;
+	int         count;
 	extern int  my_rank;
 	extern int  num_procs;
@@ -110,4 +113,5 @@
 	int         node_numrows;
 	double     *total_values  = NULL;
+	MPI_Status  status;
 
 	#ifdef _SERIAL_
@@ -126,5 +130,5 @@
 	if(my_rank==0){
 		count=0;
-		memcpy(total_values+count,this->values,this->numcols*this->numrifts*sizeof(double));
+		memcpy(total_values+count,this->values,this->numcols*this->numrows*sizeof(double));
 		count+=this->numrows*this->numcols;
 	}
@@ -159,5 +163,5 @@
 /*}}}*/
 /*FUNCTION Patch::WriteToDisk(int solutiontype,char* filename);{{{1*/
-void WriteToDisk(int solutiontype,char* filename){
+void Patch::WriteToDisk(int solutiontype,char* filename){
 
 	extern int my_rank;
Index: /issm/trunk/src/c/shared/Numerics/IsInputConverged.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/IsInputConverged.cpp	(revision 4056)
+++ /issm/trunk/src/c/shared/Numerics/IsInputConverged.cpp	(revision 4057)
@@ -16,5 +16,5 @@
 void IsInputConverged(double* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum){
 
-	int i;
+	int i,j;
 
 	/*output: */
Index: /issm/trunk/src/c/solutions/ResetBoundaryConditions.cpp
===================================================================
--- /issm/trunk/src/c/solutions/ResetBoundaryConditions.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/ResetBoundaryConditions.cpp	(revision 4057)
@@ -11,9 +11,10 @@
 	int verbose=0;
 	Vec ug=NULL;
+	int analysis_counter;
 			
 	femmodel->parameters->FindParam(&verbose,VerboseEnum);
 	if(verbose)_printf_("%s\n"," updating boundary conditions...");
 			
-	GetSolutionFromInputsx( &ug, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,  femmodel->parameters, analysis_type,sub_analysis_type);
+	GetSolutionFromInputsx( &ug, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,  femmodel->parameters);
 
 	/*set current analysis: */
@@ -21,15 +22,16 @@
 	
 	/*For this analysis_type, free existing boundary condition vectors: */
+	analysis_counter=femmodel->analysis_counter;
 
 	//global dof set
-	VecFree(&femmodel->yg[femmodel->analysis_counter]->vector); 
+	VecFree(&femmodel->m_yg[analysis_counter]); 
 	//in the s-set
-	VecFree(&femmodel->ys[analysis_counter]);
+	VecFree(&femmodel->m_ys[analysis_counter]);
 
 	//Now, duplicate ug (the solution vector) into the boundary conditions vector on the g-set
-	VecDuplicatePatch(&femmodel->yg[analysis_counter]->vector,ug);
+	VecDuplicatePatch(&femmodel->m_yg[analysis_counter],ug);
 	
 	//Reduce from g to s set
-	Reducevectorgtosx(&femmodel->ys[analysis_counter],femmodel->yg[analysis_counter]->vector,femmodel->nodesets[analysis_counter]);
+	Reducevectorgtosx(&femmodel->m_ys[analysis_counter],femmodel->m_yg[analysis_counter],femmodel->m_nodesets[analysis_counter]);
 
 	/*Free ressources:*/
Index: /issm/trunk/src/c/solutions/balancedthickness2_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/balancedthickness2_core.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/balancedthickness2_core.cpp	(revision 4057)
@@ -26,7 +26,7 @@
 
 	_printf_("depth averaging velocity...\n");
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum);
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum);
-	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum,VxAverageEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum,VyAverageEnum);
+	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum,VzAverageEnum);
 
 
Index: /issm/trunk/src/c/solutions/balancedthickness_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/balancedthickness_core.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/balancedthickness_core.cpp	(revision 4057)
@@ -26,7 +26,7 @@
 
 	_printf_("depth averaging velocity...\n");
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum);
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum);
-	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum,VxAverageEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum,VyAverageEnum);
+	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum,VzAverageEnum);
 
 	_printf_("call computational core:\n");
Index: /issm/trunk/src/c/solutions/balancedvelocities_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/balancedvelocities_core.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/balancedvelocities_core.cpp	(revision 4057)
@@ -25,7 +25,7 @@
 
 	_printf_("depth averaging velocity...\n");
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum);
-	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum);
-	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum,VxAverageEnum);
+	DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum,VyAverageEnum);
+	if(dim==3) DepthAverageInputx(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VzEnum,VzAverageEnum);
 
 	_printf_("call computational core:\n");
Index: /issm/trunk/src/c/solutions/controlconvergence.cpp
===================================================================
--- /issm/trunk/src/c/solutions/controlconvergence.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/controlconvergence.cpp	(revision 4057)
@@ -8,4 +8,13 @@
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
+
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "../DataSet/DataSet.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../include/include.h"
+#include "../modules/modules.h"
+#include "./solutions.h"
+
 
 int controlconvergence(double* J, double* fit, double eps_cm, int n){
Index: /issm/trunk/src/c/solutions/solutions.h
===================================================================
--- /issm/trunk/src/c/solutions/solutions.h	(revision 4056)
+++ /issm/trunk/src/c/solutions/solutions.h	(revision 4057)
@@ -35,4 +35,5 @@
 void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters);
 int controlconvergence(double* J, double* fit, double eps_cm, int n);
+int steadystateconvergence(FemModel* femmodel);
 
 //optimization
Index: /issm/trunk/src/c/solutions/steadystate_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/steadystate_core.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/steadystate_core.cpp	(revision 4057)
@@ -43,9 +43,9 @@
 		
 		if(verbose)_printf_("%s\n","saving velocity, temperature and pressure to check for convergence at next step");
-		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,OldVxEnum);
-		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,OldVyEnum);
-		if(dim==3)DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,OldVzEnum);
-		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,OldPressureEnum);
-		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,OldTemperatureEnum);
+		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum);
+		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum);
+		if(dim==3)DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);
+		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum);
+		DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum);
 		
 		//increase counter
Index: /issm/trunk/src/c/solutions/steadystateconvergence.cpp
===================================================================
--- /issm/trunk/src/c/solutions/steadystateconvergence.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/steadystateconvergence.cpp	(revision 4057)
@@ -9,4 +9,12 @@
 #endif
 
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "../DataSet/DataSet.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../include/include.h"
+#include "../modules/modules.h"
+#include "./solutions.h"
+
 int steadystateconvergence(FemModel* femmodel){
 	
@@ -17,8 +25,8 @@
 
 	/*intermediary: */
-	int velocityenums[8]={VxEnum,OldVxEnum,VyEnum,OldVyEnum,VzEnum,OldVzEnum,PressureEnum,OldPressureEnum}; //pairs of enums (new and old) on which to carry out the converence tests
-	int temperatureenums[2]={TemperatureEnum,OldTemperatureEnum};
+	int velocityenums[8]={VxEnum,VxOldEnum,VyEnum,VyOldEnum,VzEnum,VzOldEnum,PressureEnum,PressureOldEnum}; //pairs of enums (new and old) on which to carry out the converence tests
+	int temperatureenums[2]={TemperatureEnum,TemperatureOldEnum};
 	int convergencecriterion[1]={RelativeEnum}; //criterions for convergence, RelativeEnum or AbsoluteEnum 
-	int convergencecriterionvalue[1]; //value of criterion to be respected
+	double convergencecriterionvalue[1]; //value of criterion to be respected
 
 	/*retrieve parameters: */
@@ -26,6 +34,7 @@
 	
 	/*figure out convergence at the input level, because we don't have the solution vectors!: */
-	velocity_converged=InputConvergencex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,velocityenums,8,convergencecriterion,convergencecriterionvalue,1);
-	temperature_converged=InputConvergencex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,temperatureenums,2,convergencecriterion,convergencecriterionvalue,1);
+	velocity_converged=InputConvergencex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,&velocityenums[0],8,&convergencecriterion[0],&convergencecriterionvalue[0],1);
+	temperature_converged=InputConvergencex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,&temperatureenums[0],2,&convergencecriterion[0],&convergencecriterionvalue[0],1);
+
 
 	if(velocity_converged && temperature_converged)converged=1;
Index: /issm/trunk/src/c/solutions/thermal_core_step.cpp
===================================================================
--- /issm/trunk/src/c/solutions/thermal_core_step.cpp	(revision 4056)
+++ /issm/trunk/src/c/solutions/thermal_core_step.cpp	(revision 4057)
@@ -14,4 +14,6 @@
 void thermal_core_step(FemModel* femmodel,int step, double time){
 
+	int verbose;
+
 	//first recover parameters common to all solutions
 	femmodel->parameters->FindParam(&verbose,VerboseEnum);
Index: /issm/trunk/src/c/solvers/solver_diagnostic_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solvers/solver_diagnostic_nonlinear.cpp	(revision 4056)
+++ /issm/trunk/src/c/solvers/solver_diagnostic_nonlinear.cpp	(revision 4057)
@@ -7,5 +7,6 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 #include "../modules/modules.h"
-#include "./solutions.h"
+#include "../solutions/solutions.h"
+#include "./solvers.h"
 
 void solver_diagnostic_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, FemModel* fem,bool conserve_loads){
@@ -37,7 +38,5 @@
 	char* solver_string=NULL;
 	int verbose=0;
-
-	//Set active analysis_type:
-	fem->SetActiveAnalysis(analysis_type);
+	int dim;
 
 	/*Recover parameters: */
@@ -45,4 +44,5 @@
 	fem->parameters->FindParam(&numberofnodes,NumberOfNodesEnum);
 	fem->parameters->FindParam(&solver_string,SolverStringEnum);
+	fem->parameters->FindParam(&dim,DimEnum);
 	fem->parameters->FindParam(&verbose,VerboseEnum);
 	fem->parameters->FindParam(&min_mechanical_constraints,MinMechanicalConstraintsEnum);
@@ -137,6 +137,6 @@
 	if (dim==3){
 		if(verbose)_printf_("%s\n","extruding velocity and pressure in 3d...");
-		InputsExtrudex( fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,VxEnum,0);
-		InputsExtrudex( fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,VyEnum,0);
+		ExtrudeInputx( fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,VxEnum);
+		ExtrudeInputx( fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,VyEnum);
 	}
 
