Index: issm/trunk/src/c/Makefile.am
===================================================================
--- issm/trunk/src/c/Makefile.am	(revision 3772)
+++ issm/trunk/src/c/Makefile.am	(revision 3773)
@@ -288,4 +288,6 @@
 					./Gradjx/Gradjx.h\
 					./Gradjx/Gradjx.cpp\
+					./SplitSolutionVectorx/SplitSolutionVectorx.h\
+					./SplitSolutionVectorx/SplitSolutionVectorx.cpp\
 					./UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.h\
 					./UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.cpp\
@@ -577,6 +579,4 @@
 					./shared/Numerics/OptFunc.cpp\
 					./shared/Numerics/extrema.cpp\
-					./shared/Numerics/SplitSolutionVector.h\
-					./shared/Numerics/SplitSolutionVector.cpp\
 					./shared/Exceptions/exceptions.h\
 					./shared/Exceptions/Exceptions.cpp\
@@ -712,4 +712,6 @@
 					./Gradjx/Gradjx.h\
 					./Gradjx/Gradjx.cpp\
+					./shared/Numerics/SplitSolutionVector.h\
+					./shared/Numerics/SplitSolutionVector.cpp\
 					./UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.h\
 					./UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.cpp\
Index: issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.cpp
===================================================================
--- issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.cpp	(revision 3773)
+++ issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.cpp	(revision 3773)
@@ -0,0 +1,47 @@
+/*!\file SplitSolutionVectorx
+ */
+
+#include "./SplitSolutionVectorx.h"
+
+void SplitSolutionVectorx(Vec u_g,int numberofnodes,int numberofdofs, ...){
+	
+	/*http://www.dreamincode.net/forums/topic/79104-variadic-functions-or-how-printf-works */
+
+	/*Intermediary*/
+	va_list  outputlist;
+	double*  u_g_serial=NULL;
+	double** pvector;
+	int     i,count;
+
+	/*Serialize vector and allocate once for all*/
+	VecToMPISerial(&u_g_serial,u_g);
+
+	/* va_start() takes the arg list type we just declared, as well
+	as the last argument in this function's definition, ie. 'int numberofdofs'*/
+	va_start(outputlist,numberofdofs);
+
+	/*Loop over the arguments*/
+	count=0;
+	while (count<numberofdofs){
+		/* va_arg() takes the arg list from above, and the type
+		the argument is supposed to be and then (hopefully) returns it*/
+		pvector=va_arg(outputlist,double**);
+
+		//continue if the pointer is NULL (output not requested)
+		if (pvector==NULL) continue;
+
+		/*Dynamically allocate single dof vector*/
+		double* vector=NULL;
+		vector=(double*)xmalloc(numberofnodes*sizeof(double));
+
+		/*Fill vector*/
+		for (i=0;i<numberofnodes;i++) vector[i]=u_g_serial[i*numberofdofs+count];
+
+		/*Assign vector*/
+		*pvector=vector;
+
+		/*update counter*/
+		count++;
+	}
+	va_end (outputlist);
+}
Index: issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.h
===================================================================
--- issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.h	(revision 3773)
+++ issm/trunk/src/c/SplitSolutionVectorx/SplitSolutionVectorx.h	(revision 3773)
@@ -0,0 +1,21 @@
+/*!\file:  SplitSolutionVectorx.h
+ */ 
+
+#ifndef _SPLITSOLUTIONVECTORX_H
+#define _SPLITSOLUTIONVECTORX_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include <stdarg.h>
+
+#include "../../shared/shared.h"
+#include "../../include/macros.h"
+
+void SplitSolutionVector(Vec u_g,int numberofnodes,int numberofdofs, ...);
+
+#endif  /* _SPLITSOLUTIONVECTORX_H */
+
Index: issm/trunk/src/c/modules.h
===================================================================
--- issm/trunk/src/c/modules.h	(revision 3772)
+++ issm/trunk/src/c/modules.h	(revision 3773)
@@ -58,3 +58,4 @@
 #include "./Bamgx/Bamgx.h"
 #include "./BamgConvertMeshx/BamgConvertMeshx.h"
+#include "./SplitSolutionVectorx/SplitSolutionVectorx.h"
 #endif
Index: issm/trunk/src/c/shared/Numerics/SplitSolutionVector.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/SplitSolutionVector.cpp	(revision 3772)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#include "./SplitSolutionVector.h"
-
-void SplitSolutionVector(Vec u_g,int numberofnodes,int numberofdofs, ...){
-	/*http://www.dreamincode.net/forums/topic/79104-variadic-functions-or-how-printf-works */
-
-	/*Intermediary*/
-	va_list  outputlist;
-	double*  u_g_serial=NULL;
-	double** pvector;
-	int     i,count;
-
-	/*Serialize vector and allocate once for all*/
-	VecToMPISerial(&u_g_serial,u_g);
-
-	/* va_start() takes the arg list type we just declared, as well
-	as the last argument in this function's definition, ie. 'int numberofdofs'*/
-	va_start(outputlist,numberofdofs);
-
-	/*Loop over the arguments*/
-	count=0;
-	while (count<numberofdofs){
-		/* va_arg() takes the arg list from above, and the type
-		the argument is supposed to be and then (hopefully) returns it*/
-		pvector=va_arg(outputlist,double**);
-
-		//continue if the pointer is NULL (output not requested)
-		if (pvector==NULL) continue;
-
-		/*Dynamically allocate single dof vector*/
-		double* vector=NULL;
-		vector=(double*)xmalloc(numberofnodes*sizeof(double));
-
-		/*Fill vector*/
-		for (i=0;i<numberofnodes;i++) vector[i]=u_g_serial[i*numberofdofs+count];
-
-		/*Assign vector*/
-		*pvector=vector;
-
-		/*update counter*/
-		count++;
-	}
-	va_end (outputlist);
-}
Index: issm/trunk/src/c/shared/Numerics/SplitSolutionVector.h
===================================================================
--- issm/trunk/src/c/shared/Numerics/SplitSolutionVector.h	(revision 3772)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#include <stdarg.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../../shared/shared.h"
-#include "../../include/macros.h"
-
-void SplitSolutionVector(Vec u_g,int numberofnodes,int numberofdofs, ...);
Index: issm/trunk/src/c/shared/Numerics/numerics.h
===================================================================
--- issm/trunk/src/c/shared/Numerics/numerics.h	(revision 3772)
+++ issm/trunk/src/c/shared/Numerics/numerics.h	(revision 3773)
@@ -7,5 +7,4 @@
 
 #include "./GaussPoints.h"
-#include "./SplitSolutionVector.h"
 #include "./isnan.h"
 #include "./SplitSolutionVector.h"
Index: issm/trunk/src/m/solutions/jpl/diagnostic_core.m
===================================================================
--- issm/trunk/src/m/solutions/jpl/diagnostic_core.m	(revision 3772)
+++ issm/trunk/src/m/solutions/jpl/diagnostic_core.m	(revision 3773)
@@ -72,5 +72,5 @@
 	u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.vertices,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1);
 
-	SplitSolutionVector(ug,numberofnodes,numberofdofspernode_dh,&vx,&vy);
+	[vx,vy]=SplitSolutionVector(ug,numberofnodes,numberofdofspernode_dh);
 	model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
 	model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
Index: issm/trunk/src/mex/Makefile.am
===================================================================
--- issm/trunk/src/mex/Makefile.am	(revision 3772)
+++ issm/trunk/src/mex/Makefile.am	(revision 3773)
@@ -52,4 +52,5 @@
 				Solver\
 				SpcNodes\
+				SplitSolutionVector\
 				SystemMatrices\
 				Test\
@@ -227,4 +228,7 @@
 			  SpcNodes/SpcNodes.h
 
+SplitSolutionVector_SOURCES = SplitSolutionVector/SplitSolutionVector.cpp\
+			  SplitSolutionVector/SplitSolutionVector.h
+
 SystemMatrices_SOURCES = SystemMatrices/SystemMatrices.cpp\
 			  SystemMatrices/SystemMatrices.h
Index: issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.cpp
===================================================================
--- issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.cpp	(revision 3773)
+++ issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.cpp	(revision 3773)
@@ -0,0 +1,52 @@
+/*\file SplitSolutionVector.c
+ *\brief: average field throfieldh thickness
+ */
+
+#include "./SplitSolutionVector.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int i,j;
+
+	/*input datasets: */
+	double* vector=NULL;
+	int dummy=NULL;
+	int numberofnodes;
+	int numberofdofspernode;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*Input datasets: */
+	FetchData(&vector,&dummy,VECTOR);
+	FetchData(&numberofnodes,NUMBEROFNODES);
+	FetchData(&numberofdofspernode,NUMBEROFDOFSPERNODE);
+
+	/*Now, loop on the number of outputs requested: */
+	for(i=0;i<numberofdofspernode;i++){
+		double*  component=(double*)xmalloc(numberofnodes*sizeof(double));
+		for (j=0;j<numberofnodes;j++) component[i]=vector[j*numberofdofs+i];
+
+
+		/*write output : */
+		WriteData(&plhs[i],component,numberofnodes);
+
+		/*Free ressources:*/
+		xfree((void**)&component);
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&vector);
+	
+	/*end module: */
+	MODULEEND();
+
+}
+
+void SplitSolutionVectorUsage(void)
+{
+	_printf_("\n");
+	_printf_("   usage: [vectorx,vectory,...] = %s(vector,numberofnodes,numberofdofpernode);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.h
===================================================================
--- issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.h	(revision 3773)
+++ issm/trunk/src/mex/SplitSolutionVector/SplitSolutionVector.h	(revision 3773)
@@ -0,0 +1,24 @@
+
+/*
+	SplitSolutionVector.h
+*/
+
+
+#ifndef _SPLITSOLUTIONVECTOR_H
+#define _SPLITSOLUTIONVECTOR_H
+
+/* local prototypes: */
+void SplitSolutionVectorUsage(void);
+
+#include "../../c/modules.h"
+#include "../../c/shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "SplitSolutionVector"
+
+/* serial input macros: */
+#define VECTOR (mxArray*)prhs[0]
+#define NUMBEROFNODES (mxArray*)prhs[1]
+#define NUMBEROFDOFSPERNODE (mxArray*)prhs[2]
+
+#endif  /* _SPLITSOLUTIONVECTOR_H */
