Index: /issm/trunk/src/mex/BamgMesher/Bamg.cpp
===================================================================
--- /issm/trunk/src/mex/BamgMesher/Bamg.cpp	(revision 5232)
+++ /issm/trunk/src/mex/BamgMesher/Bamg.cpp	(revision 5232)
@@ -0,0 +1,56 @@
+/*\file Bamg.c
+ *\brief: bamg module.
+ */
+#include "./Bamg.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*Outputs*/
+	mxArray* bamgmesh_mat=NULL;
+	mxArray* bamggeom_mat=NULL;
+
+	/*diverse: */
+	BamgOpts *bamgopts=NULL;
+	BamgMesh *bamgmesh_in=NULL;
+	BamgGeom *bamggeom_in=NULL;
+	BamgMesh *bamgmesh_out=NULL;
+	BamgGeom *bamggeom_out=NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&BamgUsage);
+
+	/*Initialize variables*/
+	bamgopts   = new BamgOpts(BAMGOPTIONS);
+	bamggeom_in= new BamgGeom(BAMGGEOMIN);
+	bamgmesh_in= new BamgMesh(BAMGMESHIN);
+
+	/*Initialize outputs*/
+	bamggeom_out=new BamgGeom();
+	bamgmesh_out=new BamgMesh();
+
+	/*!Generate internal degree of freedom numbers: */
+	Bamgx(bamgmesh_out,bamggeom_out,bamgmesh_in,bamggeom_in,bamgopts);
+
+	/*Generate output Matlab Structures*/
+	bamggeom_out->SetMatlabStructureFields(BAMGGEOMOUT);
+	bamgmesh_out->SetMatlabStructureFields(BAMGMESHOUT);
+
+	/*Free ressources: */
+	delete bamgopts;
+	delete bamggeom_in;
+	delete bamggeom_out;
+	delete bamgmesh_in;
+	delete bamgmesh_out;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void BamgUsage(void){
+	_printf_("\n");
+	_printf_("   usage: [bamgmesh,bamggeom]=%s(bamgmesh,bamggeom,bamgoptions);\n",__FUNCT__);
+	_printf_("\n");
+}
Index: /issm/trunk/src/mex/BamgMesher/Bamg.h
===================================================================
--- /issm/trunk/src/mex/BamgMesher/Bamg.h	(revision 5232)
+++ /issm/trunk/src/mex/BamgMesher/Bamg.h	(revision 5232)
@@ -0,0 +1,34 @@
+/*
+	Bamg.h
+*/
+
+#ifndef _BAMG_H
+#define _BAMG_H
+
+/* local prototypes: */
+void BamgUsage(void);
+
+#include "../../c/modules/modules.h"
+#include "../../c/Container/Container.h"
+#include "../../c/shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Bamg"
+    
+/* serial input macros: */
+#define BAMGMESHIN  (mxArray*)prhs[0]
+#define BAMGGEOMIN  (mxArray*)prhs[1]
+#define BAMGOPTIONS (mxArray*)prhs[2]
+
+/* serial output macros: */
+#define BAMGMESHOUT    (mxArray**)&plhs[0]
+#define BAMGGEOMOUT    (mxArray**)&plhs[1]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  2
+#undef NRHS
+#define NRHS  3
+
+#endif  /* _BAMG_H */
+
Index: /issm/trunk/src/mex/Makefile.am
===================================================================
--- /issm/trunk/src/mex/Makefile.am	(revision 5231)
+++ /issm/trunk/src/mex/Makefile.am	(revision 5232)
@@ -7,5 +7,5 @@
 bin_PROGRAMS = AverageFilter\
 				AddExternalResult\
-				Bamg\
+				BamgMesher\
 				BamgConvertMesh\
 				BuildNodeSets\
@@ -103,6 +103,6 @@
 			  BuildNodeSets/BuildNodeSets.h
 
-Bamg_SOURCES = Bamg/Bamg.cpp\
-					Bamg/Bamg.h
+BamgMesher_SOURCES = BamgMesher/BamgMesher.cpp\
+					BamgMesher/BamgMesher.h
 
 BamgConvertMesh_SOURCES = BamgConvertMesh/BamgConvertMesh.cpp\
