Index: /issm/trunk/src/mex/InputConvergence/InputConvergence.cpp
===================================================================
--- /issm/trunk/src/mex/InputConvergence/InputConvergence.cpp	(revision 4515)
+++ /issm/trunk/src/mex/InputConvergence/InputConvergence.cpp	(revision 4515)
@@ -0,0 +1,79 @@
+/*\file InputConvergence.c
+ *\brief: processes model inputs from the matlab workspace, and transforms them into datasets or vectors 
+ *        that will be used throughout the matlab solution sequences.
+ */
+
+#include "./InputConvergence.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){ 
+
+	int i;
+
+	/*inputs: */
+	Elements* elements=NULL;
+	Nodes* nodes=NULL;
+	Vertices* vertices=NULL;
+	Loads* loads=NULL;
+	Materials* materials=NULL;
+	Parameters* parameters=NULL;
+
+	int* field_enums=NULL;
+	double* double_fields=NULL;
+	int numfields;
+	int* criterion_enums=NULL;
+	double* double_criterion=NULL;
+	double* criterion_values=NULL;
+	int numcriterions;
+
+	/* output datasets: */
+	int converged;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputConvergenceUsage);
+
+	FetchData((DataSet**)&elements,ELEMENTS);
+	FetchData((DataSet**)&loads,LOADS);
+	FetchData((DataSet**)&nodes,NODES);
+	FetchData((DataSet**)&vertices,VERTICES);
+	FetchData((DataSet**)&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+
+	FetchData(&double_fields,&numfields,FIELDENUMS);
+	field_enums=(int*)xmalloc(numfields*sizeof(int));
+	for(i=0;i<numfields;i++)field_enums[i]=(int)double_fields[i];
+
+	FetchData(&double_criterion,&numcriterions,CRITERIONENUMS);
+	FetchData(&criterion_values,&numcriterions,CRITERIONVALUES);
+	criterion_enums=(int*)xmalloc(numcriterions*sizeof(int));
+	for(i=0;i<numcriterions;i++)criterion_enums[i]=(int)double_criterion[i];
+	/*call x code InputConvergencex: */
+	converged=InputConvergencex(elements,nodes,vertices,loads,materials,parameters, field_enums,numfields,criterion_enums,criterion_values,numcriterions);
+
+	/*Write output data: */
+	WriteData(CONVERGED,converged);
+
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete vertices;
+	delete loads;
+	delete materials;
+	delete parameters;
+	xfree((void**)&field_enums);
+	xfree((void**)&double_fields);
+	xfree((void**)&criterion_enums);
+	xfree((void**)&double_criterion);
+	xfree((void**)&criterion_values);
+	
+	/*end module: */
+	MODULEEND();
+}
+	
+void InputConvergenceUsage(void) {
+	_printf_("\n");
+	_printf_("   usage: convergence=InputConvergence(elements,nodes,vertices,loads,materials,parameters,fieldenums,criterionenums,criterionvalue)\n");
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/InputConvergence/InputConvergence.h
===================================================================
--- /issm/trunk/src/mex/InputConvergence/InputConvergence.h	(revision 4515)
+++ /issm/trunk/src/mex/InputConvergence/InputConvergence.h	(revision 4515)
@@ -0,0 +1,41 @@
+/*\file InputConvergence.h
+ * \brief: InputConvergence module include
+ */
+
+#ifndef _MEXINPUTCONVERGENCE_H_
+#define _MEXINPUTCONVERGENCE_H_
+
+/* local prototypes: */
+void InputConvergenceUsage(void);
+
+#include "../../c/modules/modules.h"
+#include "../../c/Container/Container.h"
+#include "../../c/shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "InputConvergence"
+
+#undef ALL
+#define ALL 0
+
+/* serial input macros: */
+#define ELEMENTS (mxArray*)prhs[0]
+#define NODES (mxArray*)prhs[1]
+#define VERTICES (mxArray*)prhs[2]
+#define LOADS (mxArray*)prhs[3]
+#define MATERIALS (mxArray*)prhs[4]
+#define PARAMETERS (mxArray*)prhs[5]
+#define FIELDENUMS (mxArray*)prhs[6]
+#define CRITERIONENUMS (mxArray*)prhs[7]
+#define CRITERIONVALUES (mxArray*)prhs[8]
+
+/* serial output macros: */
+#define CONVERGED (mxArray**)&plhs[0]
+		
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  9 
+
+#endif  /* _MEXINPUTCONVERGENCE_H */
Index: /issm/trunk/src/mex/Makefile.am
===================================================================
--- /issm/trunk/src/mex/Makefile.am	(revision 4514)
+++ /issm/trunk/src/mex/Makefile.am	(revision 4515)
@@ -21,4 +21,5 @@
 				ElementConnectivity\
 				InputControlConstrain \
+				InputConvergence\
 				InputDepthAverage\
 				InputExtrude\
@@ -127,4 +128,7 @@
 			  InputControlConstrain/InputControlConstrain.h
 
+InputConvergence_SOURCES = InputConvergence/InputConvergence.cpp\
+			  InputConvergence/InputConvergence.h
+
 CostFunction_SOURCES =  CostFunction/CostFunction.cpp \
 						CostFunction/CostFunction.h
