Index: /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.cpp
===================================================================
--- /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.cpp	(revision 3530)
+++ /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.cpp	(revision 3530)
@@ -0,0 +1,74 @@
+/*\file ComputeBasalStress.c
+ *\brief: recover pressure from elements
+ */
+
+#include "./ComputeBasalStress.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*diverse: */
+	int   noerr=1;
+
+	/*input datasets: */
+	DataSet* elements=NULL;
+	DataSet* nodes=NULL; 
+	DataSet* vertices=NULL;
+	DataSet* loads=NULL;
+	DataSet* materials=NULL;
+	DataSet* parameters=NULL;
+	ParameterInputs* inputs=NULL;
+	int      numberofnodes;
+	int      analysis_type;
+	int      sub_analysis_type;
+
+	/* output datasets: */
+	Vec sigma_g=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ComputeBasalStressUsage);
+        
+	/*Input datasets: */
+	FetchData(&elements,ELEMENTS);
+	FetchData(&nodes,NODES);
+	FetchData(&vertices,VERTICES);
+	FetchData(&loads,LOADS);
+	FetchData(&materials,MATERIALS);
+	FetchParams(&parameters,PARAMETERS);
+	FetchData(&analysis_type,ANALYSIS);
+	FetchData(&sub_analysis_type,SUBANALYSIS);
+
+	/*!Generate internal degree of freedom numbers: */
+	/*Fetch inputs: */
+	inputs=new ParameterInputs;
+	inputs->Init(INPUTS);
+
+	UpdateFromInputsx(elements,nodes,vertices,loads, materials,parameters,inputs);
+
+	/*!Generate internal degree of freedom numbers: */
+	ComputeBasalStressx(&sigma_g, elements,nodes,vertices,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
+
+	/*write output datasets: */
+	WriteData(SIGMA,sigma_g);
+
+	/*Free ressources: */
+	delete nodes;
+	delete vertices;
+	delete elements;
+	delete materials;
+	delete loads;
+	delete parameters;
+	delete inputs;
+	VecFree(&sigma_g);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void ComputeBasalStressUsage(void) {
+	printf("\n");
+	printf("   usage: [p_g] = %s(elements, nodes, vertices, loads, materials, params,inputs);\n",__FUNCT__);
+	printf("\n");
+}
Index: /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.h
===================================================================
--- /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.h	(revision 3530)
+++ /issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.h	(revision 3530)
@@ -0,0 +1,40 @@
+
+/*
+	ComputeBasalStress.h
+*/
+
+
+#ifndef _COMPUTEBASALSTRESS_H
+#define _COMPUTEBASALSTRESS_H
+
+/* local prototypes: */
+void ComputeBasalStressUsage(void);
+
+#include "../../c/issm.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "ComputeBasalStress"
+
+/* 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 INPUTS (mxArray*)prhs[6]
+#define ANALYSIS (mxArray*)prhs[7]
+#define SUBANALYSIS (mxArray*)prhs[8]
+
+/* serial output macros: */
+#define SIGMA (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  9
+
+
+#endif  /* _COMPUTEPRESSURE_H */
+
