Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 17397)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 17398)
@@ -30,4 +30,8 @@
 					./classes/gauss/GaussTria.h\
 					./classes/gauss/GaussTria.cpp\
+					./classes/gauss/GaussTetra.h\
+					./classes/gauss/GaussTetra.cpp\
+					./classes/gauss/GaussPenta.h\
+					./classes/gauss/GaussPenta.cpp\
 					./classes/Update.h\
 					./classes/FemModel.h\
@@ -81,4 +85,12 @@
 					./classes/Elements/TriaRef.h\
 					./classes/Elements/TriaRef.cpp\
+					./classes/Elements/Tetra.h\
+					./classes/Elements/Tetra.cpp\
+					./classes/Elements/TetraRef.h\
+					./classes/Elements/TetraRef.cpp\
+					./classes/Elements/Penta.h\
+					./classes/Elements/Penta.cpp\
+					./classes/Elements/PentaRef.h\
+					./classes/Elements/PentaRef.cpp\
 					./classes/Inputs/Inputs.h\
 					./classes/Inputs/Inputs.cpp\
@@ -431,12 +443,6 @@
 					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h\
 					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\
-					./classes/gauss/GaussPenta.h\
-					./classes/gauss/GaussPenta.cpp\
 					./classes/Inputs/PentaInput.h\
 					./classes/Inputs/PentaInput.cpp\
-					./classes/Elements/Penta.h\
-					./classes/Elements/Penta.cpp\
-					./classes/Elements/PentaRef.h\
-					./classes/Elements/PentaRef.cpp\
 					#}}}
 #DAKOTA sources  {{{
Index: /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 17398)
@@ -0,0 +1,215 @@
+/*!\file Tetra.cpp
+ * \brief: implementation of the Tetrament object
+ */
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "../classes.h"
+#include "../../shared/shared.h"
+/*}}}*/
+
+/*Element macros*/
+#define NUMVERTICES 4
+
+/*Constructors/destructor/copy*/
+/*FUNCTION Tetra::Tetra(int id, int sid,int index, IoModel* iomodel,int nummodels){{{*/
+Tetra::Tetra(int seg_id, int seg_sid, int index, IoModel* iomodel,int nummodels)
+		:TetraRef(nummodels),ElementHook(nummodels,index+1,2,iomodel){
+
+			/*id: */
+			this->id  = seg_id;
+			this->sid = seg_sid;
+
+			//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+			this->parameters = NULL;
+
+			/*intialize inputs: */
+			this->inputs  = new Inputs();
+
+			/*initialize pointers:*/
+			this->nodes    = NULL;
+			this->vertices = NULL;
+			this->material = NULL;
+			this->matpar   = NULL;
+		}
+/*}}}*/
+/*FUNCTION Tetra::~Tetra(){{{*/
+Tetra::~Tetra(){
+	this->parameters=NULL;
+}
+/*}}}*/
+/*FUNCTION Tetra::copy {{{*/
+Object* Tetra::copy() {
+	_error_("not implemented yet");
+}
+/*}}}*/
+
+/*FUNCTION Tetra::Echo{{{*/
+void Tetra::Echo(void){
+	_printf_("Tetra:\n");
+	_printf_("   id: " << id << "\n");
+	if(nodes){
+		nodes[0]->Echo();
+		nodes[1]->Echo();
+		nodes[2]->Echo();
+		nodes[3]->Echo();
+	}
+	else _printf_("nodes = NULL\n");
+
+	if (material) material->Echo();
+	else _printf_("material = NULL\n");
+
+	if (matpar) matpar->Echo();
+	else _printf_("matpar = NULL\n");
+
+	_printf_("   parameters\n");
+	if (parameters) parameters->Echo();
+	else _printf_("parameters = NULL\n");
+
+	_printf_("   inputs\n");
+	if (inputs) inputs->Echo();
+	else _printf_("inputs=NULL\n");
+}
+/*}}}*/
+/*FUNCTION Tetra::FiniteElement{{{*/
+int Tetra::FiniteElement(void){
+	return this->element_type;
+}
+/*}}}*/
+/*FUNCTION Tetra::DeepEcho{{{*/
+void Tetra::DeepEcho(void){
+
+	_printf_("Tetra:\n");
+	_printf_("   id: " << id << "\n");
+	if(nodes){
+		nodes[0]->DeepEcho();
+		nodes[1]->DeepEcho();
+		nodes[2]->DeepEcho();
+		nodes[3]->DeepEcho();
+	}
+	else _printf_("nodes = NULL\n");
+
+	if (material) material->DeepEcho();
+	else _printf_("material = NULL\n");
+
+	if (matpar) matpar->DeepEcho();
+	else _printf_("matpar = NULL\n");
+
+	_printf_("   parameters\n");
+	if (parameters) parameters->DeepEcho();
+	else _printf_("parameters = NULL\n");
+
+	_printf_("   inputs\n");
+	if (inputs) inputs->DeepEcho();
+	else _printf_("inputs=NULL\n");
+
+	return;
+}
+/*}}}*/
+/*FUNCTION Tetra::ObjectEnum{{{*/
+int Tetra::ObjectEnum(void){
+
+	return TetraEnum;
+
+}
+/*}}}*/
+/*FUNCTION Tetra::Id {{{*/
+int Tetra::Id(){
+	return id;
+}
+/*}}}*/
+
+/*FUNCTION Tetra::GetNumberOfNodes;{{{*/
+int Tetra::GetNumberOfNodes(void){
+	return this->NumberofNodes();
+}
+/*}}}*/
+/*FUNCTION Tetra::GetNumberOfVertices;{{{*/
+int Tetra::GetNumberOfVertices(void){
+	return NUMVERTICES;
+}
+/*}}}*/
+/*FUNCTION Tetra::GetVerticesCoordinates(IssmDouble** pxyz_list)   THIS ONE{{{*/
+void Tetra::GetVerticesCoordinates(IssmDouble** pxyz_list){
+
+	IssmDouble* xyz_list = xNew<IssmDouble>(NUMVERTICES*3);
+	::GetVerticesCoordinates(xyz_list,this->vertices,NUMVERTICES);
+
+	/*Assign output pointer*/
+	*pxyz_list = xyz_list;
+
+}/*}}}*/
+/*FUNCTION Tetra::IsIceInElement {{{*/
+bool   Tetra::IsIceInElement(){
+
+	_error_("not implemented yet");
+}
+/*}}}*/
+bool Tetra::IsIcefront(void){/*{{{*/
+
+	_error_("not implemented yet");
+}/*}}}*/
+/*FUNCTION Tetra::JacobianDeterminant{{{*/
+void Tetra::JacobianDeterminant(IssmDouble* pJdet,IssmDouble* xyz_list,Gauss* gauss){
+
+	_assert_(gauss->Enum()==GaussTetraEnum);
+	this->GetJacobianDeterminant(pJdet,xyz_list,(GaussTetra*)gauss);
+
+}
+/*}}}*/
+/*FUNCTION Tetra::JacobianDeterminantSurface{{{*/
+void Tetra::JacobianDeterminantSurface(IssmDouble* pJdet,IssmDouble* xyz_list,Gauss* gauss){
+
+	_error_("not implemented yet");
+
+}
+/*}}}*/
+/*FUNCTION Tetra::NewGauss(){{{*/
+Gauss* Tetra::NewGauss(void){
+	return new GaussTetra();
+}
+/*}}}*/
+/*FUNCTION Tetra::NewGauss(int order){{{*/
+Gauss* Tetra::NewGauss(int order){
+	return new GaussTetra(order);
+}
+/*}}}*/
+/*FUNCTION Tetra::NewElementVector THIS ONE{{{*/
+ElementVector* Tetra::NewElementVector(int approximation_enum){
+	return new ElementVector(nodes,this->NumberofNodes(),this->parameters,approximation_enum);
+}
+/*}}}*/
+/*FUNCTION Tetra::NewElementMatrix  THIS ONE{{{*/
+ElementMatrix* Tetra::NewElementMatrix(int approximation_enum){
+	return new ElementMatrix(nodes,this->NumberofNodes(),this->parameters,approximation_enum);
+}
+/*}}}*/
+/*FUNCTION Tetra::NodalFunctions{{{*/
+void Tetra::NodalFunctions(IssmDouble* basis, Gauss* gauss){
+
+	_assert_(gauss->Enum()==GaussTetraEnum);
+	this->GetNodalFunctions(basis,(GaussTetra*)gauss);
+
+}
+/*}}}*/
+/*FUNCTION Tetra::NodalFunctionsDerivatives{{{*/
+void Tetra::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){
+
+	_assert_(gauss->Enum()==GaussTetraEnum);
+	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTetra*)gauss);
+
+}
+/*}}}*/
+/*FUNCTION Tetra::NormalSection{{{*/
+void Tetra::NormalSection(IssmDouble* normal,IssmDouble* xyz_list_front){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tetra.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 17398)
@@ -0,0 +1,234 @@
+/*! \file Tetra.h 
+ *  \brief: header file for seg object
+ */
+
+#ifndef _TETRA_H_
+#define _TETRA_H_
+
+/*Headers:*/
+/*{{{*/
+#include "./Element.h"
+#include "./ElementHook.h"
+#include "./TetraRef.h"
+class Parameters;
+class Inputs;
+class IoModel;
+class Results;
+class Node;
+class Material;
+class Matpar;
+class ElementMatrix;
+class ElementVector;
+class Vertex;
+
+#include "../../shared/Exceptions/exceptions.h"
+#include "../../shared/Enum/Enum.h"
+/*}}}*/
+
+class Tetra: public Element,public ElementHook,public TetraRef{
+
+	public:
+
+		int id;
+		int sid;
+
+		/*Tetra constructors, destructors {{{*/
+		Tetra(){};
+		Tetra(int seg_id,int seg_sid,int i, IoModel* iomodel,int nummodels);
+		~Tetra();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{ */
+		void    Echo();
+		void    DeepEcho();
+		int     Id();
+		int     ObjectEnum();
+		Object *copy();
+		/*}}}*/
+		/*Update virtual functions resolution: {{{*/
+		void  InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum){_error_("not implemented yet");};
+		void  InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum){_error_("not implemented yet");};
+		void  InputUpdateFromVector(IssmDouble* vector, int name, int type){_error_("not implemented yet");};
+#ifdef _HAVE_DAKOTA_
+		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("not implemented yet");};
+		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type){_error_("not implemented yet");};
+#endif
+		void  InputUpdateFromConstant(IssmDouble constant, int name){_error_("not implemented yet");};
+		void  InputUpdateFromConstant(int constant, int name){_error_("not implemented yet");};
+		void  InputUpdateFromConstant(bool constant, int name){_error_("not implemented yet");};
+		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+		/*}}}*/
+		/*Element virtual functions definitions: {{{*/
+		void        AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented yet");};
+		void        AddInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented yet");};
+		IssmDouble  CharacteristicLength(void){_error_("not implemented yet");};
+		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b){_error_("not implemented yet");};
+		void        ComputeStrainRate(Vector<IssmDouble>* eps){_error_("not implemented yet");};
+		void        ComputeStressTensor(){_error_("not implemented yet");};
+		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
+		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
+		void        SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){_error_("not implemented yet");};
+		void        Delta18oParameterization(void){_error_("not implemented yet");};
+		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
+		void        ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){_error_("not implemented yet");};
+		void        EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){_error_("not implemented yet");};
+		IssmDouble  EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){_error_("not implemented");};
+		IssmDouble  EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){_error_("not implemented");};
+		int         FiniteElement(void);
+		Element*    GetUpperElement(void){_error_("not implemented yet");};
+	  	Element*    GetLowerElement(void){_error_("not implemented yet");};
+	  	Element*    GetSurfaceElement(void){_error_("not implemented yet");};
+		Element*    GetBasalElement(void){_error_("not implemented yet");};
+		int         GetNodeIndex(Node* node){_error_("not implemented yet");};
+		void        GetNodesSidList(int* sidlist){_error_("not implemented yet");};
+		void        GetNodesLidList(int* lidlist){_error_("not implemented yet");};
+		int         GetNumberOfNodes(void);
+		int         GetNumberOfNodesVelocity(void){_error_("not implemented yet");};
+		int         GetNumberOfNodesPressure(void){_error_("not implemented yet");};
+		int         GetNumberOfVertices(void);
+		void        GetVerticesCoordinates(IssmDouble** pxyz_list);
+		void        GetVerticesCoordinatesBase(IssmDouble** pxyz_list){_error_("not implemented yet");};
+		void        GetVerticesCoordinatesTop(IssmDouble** pxyz_list){_error_("not implemented yet");};
+		int         Sid(){_error_("not implemented yet");};
+		void        InputChangeName(int input_enum, int enum_type_old){_error_("not implemented yet");};
+		bool        IsOnBed(){_error_("not implemented yet");};
+		bool        IsOnSurface(){_error_("not implemented yet");};
+		bool        IsNodeOnShelfFromFlags(IssmDouble* flags){_error_("not implemented yet");};
+		void        JacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,Gauss* gauss);
+		void        JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+		void        JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+		void        JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss){_error_("not implemented yet");};
+		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss){_error_("not implemented yet");};
+		IssmDouble  MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
+		void        NodalFunctions(IssmDouble* basis,Gauss* gauss);
+		void        NodalFunctionsP1(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+		void        NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+		void        NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+		void        NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+		void        NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+		void        NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+		void        NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+		bool        IsIceInElement();
+		void        NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
+		void        NormalTop(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
+		void        NormalBase(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
+		int         NumberofNodesVelocity(void){_error_("not implemented yet");};
+		int         NumberofNodesPressure(void){_error_("not implemented yet");};
+	   Element*    SpawnBasalElement(void){_error_("not implemented yet");};
+		Element*    SpawnTopElement(void){_error_("not implemented yet");};
+		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+		IssmDouble  PureIceEnthalpy(IssmDouble pressure){_error_("not implemented yet");};
+		int         PressureInterpolation(void){_error_("not implemented yet");};
+		void        ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss){_error_("not implemented yet");};
+		void        ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+		int         VelocityInterpolation(void){_error_("not implemented yet");};
+		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
+		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
+		void        GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");};
+		Node*       GetNode(int node_number){_error_("Not implemented");};
+		IssmDouble  GetXcoord(Gauss* gauss){_error_("Not implemented");};
+		IssmDouble  GetYcoord(Gauss* gauss){_error_("Not implemented");};
+		IssmDouble  GetZcoord(Gauss* gauss){_error_("not implemented yet");};
+		int         GetElementType(void){_error_("not implemented yet");};
+		Gauss*      NewGauss(void);
+		Gauss*      NewGauss(int order);
+      Gauss*      NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){_error_("not implemented yet");};
+      Gauss*      NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){_error_("not implemented yet");};
+      Gauss*      NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order){_error_("not implemented yet");};
+		Gauss*      NewGaussBase(int order){_error_("not implemented yet");};
+		Gauss*      NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
+		Gauss*      NewGaussTop(int order){_error_("not implemented yet");};
+		ElementVector* NewElementVector(int approximation_enum);
+		ElementMatrix* NewElementMatrix(int approximation_enum);
+		ElementMatrix* NewElementMatrixCoupling(int number_nodes,int approximation_enum){_error_("not implemented yet");};
+		int         VertexConnectivity(int vertexindex){_error_("not implemented yet");};
+		void        VerticalSegmentIndices(int** pindices,int* pnumseg){_error_("not implemented yet");};
+		void        ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");};
+		bool        IsZeroLevelset(int levelset_enum){_error_("not implemented");};
+		bool		   IsIcefront(void);
+		void        ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented");};
+		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented yet");};
+		void        GetNormalFromLSF(IssmDouble *pnormal){_error_("not implemented yet");};
+
+		void        GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type){_error_("not implemented yet");};
+		void        GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum){_error_("not implemented yet");};
+		void        InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){_error_("not implemented yet");};
+		void        InputDepthAverageAtBase(int enum_type,int average_enum_type){_error_("not implemented yet");};
+		void        InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
+		void        InputScale(int enum_type,IssmDouble scale_factor){_error_("not implemented yet");};
+		void        MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
+		int         NodalValue(IssmDouble* pvalue, int index, int natureofdataenum){_error_("not implemented yet");};
+		void        PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){_error_("not implemented yet");};
+		void        ResetFSBasalBoundaryCondition(void){_error_("not implemented yet");};
+		void        ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){_error_("not implemented yet");};
+		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+		void	      SmbGradients(){_error_("not implemented yet");};
+		IssmDouble  SurfaceArea(void){_error_("not implemented yet");};
+		void        Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement){_error_("not implemented yet");};
+		IssmDouble  TimeAdapt(){_error_("not implemented yet");};
+		void UpdateConstraintsExtrudeFromBase(){_error_("not implemented");};
+		void UpdateConstraintsExtrudeFromTop(){_error_("not implemented");};
+
+		void       AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){_error_("not implemented yet");};
+		IssmDouble IceVolume(void){_error_("not implemented yet");};
+		IssmDouble IceVolumeAboveFloatation(void){_error_("not implemented yet");};
+		IssmDouble TotalSmb(void){_error_("not implemented yet");};
+		void       MinVel(IssmDouble* pminvel){_error_("not implemented yet");};
+		void       MinVx(IssmDouble* pminvx){_error_("not implemented yet");};
+		void       MinVy(IssmDouble* pminvy){_error_("not implemented yet");};
+		void       MinVz(IssmDouble* pminvz){_error_("not implemented yet");};
+		IssmDouble MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+		IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+		void       MaxAbsVx(IssmDouble* pmaxabsvx){_error_("not implemented yet");};
+		void       MaxAbsVy(IssmDouble* pmaxabsvy){_error_("not implemented yet");};
+		void       MaxAbsVz(IssmDouble* pmaxabsvz){_error_("not implemented yet");};
+		void       ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+		void       MaxVel(IssmDouble* pmaxvel){_error_("not implemented yet");};
+		void       MaxVx(IssmDouble* pmaxvx){_error_("not implemented yet");};
+		void       MaxVy(IssmDouble* pmaxvy){_error_("not implemented yet");};
+		void       MaxVz(IssmDouble* pmaxvz){_error_("not implemented yet");};
+		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
+
+#ifdef _HAVE_GIA_
+		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+#endif
+
+		IssmDouble DragCoefficientAbsGradient(void){_error_("not implemented yet");};
+		void       GradientIndexing(int* indexing,int control_index){_error_("not implemented yet");};
+		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){_error_("not implemented yet");};
+		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjBSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDragSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDragFS(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDragGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data){_error_("not implemented yet");};
+		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){_error_("not implemented yet");};
+		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+		void       ControlInputScaleGradient(int enum_type,IssmDouble scale){_error_("not implemented yet");};
+		void       ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+		void       ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum){_error_("not implemented yet");};
+		IssmDouble RheologyBbarAbsGradient(void){_error_("not implemented yet");};
+		IssmDouble ThicknessAbsMisfit(void){_error_("not implemented yet");};
+		IssmDouble SurfaceAbsVelMisfit(void){_error_("not implemented yet");};
+		IssmDouble ThicknessAbsGradient(void){_error_("not implemented yet");};
+		IssmDouble ThicknessAlongGradient(void){_error_("not implemented yet");};
+		IssmDouble ThicknessAcrossGradient(void){_error_("not implemented yet");};
+		IssmDouble BalancethicknessMisfit(void){_error_("not implemented yet");};
+		IssmDouble SurfaceRelVelMisfit(void){_error_("not implemented yet");};
+		IssmDouble SurfaceLogVelMisfit(void){_error_("not implemented yet");};
+		IssmDouble SurfaceLogVxVyMisfit(void){_error_("not implemented yet");};
+		IssmDouble SurfaceAverageVelMisfit(void){_error_("not implemented yet");};
+		void       InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};
+
+		void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");};
+		void   MigrateGroundingLine(IssmDouble* sheet_ungrounding){_error_("not implemented yet");};
+		int    UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){_error_("not implemented yet");};
+		/*}}}*/
+};
+#endif  /* _SEG_H */
Index: /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 17398)
@@ -0,0 +1,250 @@
+/*!\file TetraRef.c
+ * \brief: implementation of the TetraRef object
+ */
+
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../classes.h"
+#include "../../shared/shared.h"
+/*}}}*/
+
+/*Element macros*/
+#define NUMNODESP0  1
+#define NUMNODESP1  4
+
+/*Object constructors and destructor*/
+/*FUNCTION TetraRef::TetraRef(){{{*/
+TetraRef::TetraRef(){
+	this->element_type_list=NULL;
+}
+/*}}}*/
+/*FUNCTION TetraRef::TetraRef(int* types,int nummodels){{{*/
+TetraRef::TetraRef(const int nummodels){
+
+	/*Only allocate pointer*/
+	element_type_list=xNew<int>(nummodels);
+
+}
+/*}}}*/
+/*FUNCTION TetraRef::~TetraRef(){{{*/
+TetraRef::~TetraRef(){
+	xDelete<int>(element_type_list);
+}
+/*}}}*/
+
+/*Management*/
+/*FUNCTION TetraRef::SetElementType{{{*/
+void TetraRef::SetElementType(int type,int type_counter){
+
+	/*initialize element type*/
+	this->element_type_list[type_counter]=type;
+}
+/*}}}*/
+
+/*Reference Element numerics*/
+/*FUNCTION TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss){{{*/
+void TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss){
+	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+	_assert_(basis);
+	GetNodalFunctions(basis,gauss,this->element_type);
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement){{{*/
+void TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement){
+	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+
+	_assert_(basis);
+
+	switch(element_type){
+		default:
+			_error_("Element type "<<EnumToStringx(element_type)<<" not supported yet");
+	}
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss){{{*/
+void TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss){
+	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement){{{*/
+void TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement){
+
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	 * actual coordinate system): */
+	IssmDouble    Jinv[3][3];
+
+	/*Fetch number of nodes for this finite element*/
+	int numnodes = this->NumberofNodes(finiteelement);
+
+	/*Get nodal functions derivatives in reference triangle*/
+	IssmDouble* dbasis_ref=xNew<IssmDouble>(3*numnodes);
+	GetNodalFunctionsDerivativesReference(dbasis_ref,gauss,finiteelement); 
+
+	/*Get Jacobian invert: */
+	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+
+	/*Build dbasis: 
+	 *
+	 * [dhi/dx]= Jinv'*[dhi/dr]
+	 * [dhi/dy]        [dhi/ds]
+	 * [dhi/dz]        [dhi/dzeta]
+	 */
+
+	for(int i=0;i<numnodes;i++){
+		dbasis[numnodes*0+i]=Jinv[0][0]*dbasis_ref[0*numnodes+i]+Jinv[0][1]*dbasis_ref[1*numnodes+i]+Jinv[0][2]*dbasis_ref[2*numnodes+i];
+		dbasis[numnodes*1+i]=Jinv[1][0]*dbasis_ref[0*numnodes+i]+Jinv[1][1]*dbasis_ref[1*numnodes+i]+Jinv[1][2]*dbasis_ref[2*numnodes+i];
+		dbasis[numnodes*2+i]=Jinv[2][0]*dbasis_ref[0*numnodes+i]+Jinv[2][1]*dbasis_ref[1*numnodes+i]+Jinv[2][2]*dbasis_ref[2*numnodes+i];
+	}
+
+	/*Clean up*/
+	xDelete<IssmDouble>(dbasis_ref);
+
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss){{{*/
+void TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss){
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	 * natural coordinate system) at the gaussian point. */
+
+	GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
+
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement){{{*/
+void TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement){
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	 * natural coordinate system) at the gaussian point. */
+
+	_assert_(dbasis && gauss);
+
+	switch(finiteelement){
+		default:
+			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
+	}
+
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetInputDerivativeValue{{{*/
+void TetraRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss){
+	/*From node values of parameter p (p_list[0], p_list[1], p_list[2],
+	 * p_list[3], p_list[4] and p_list[4]), return parameter derivative value at
+	 * gaussian point specified by gauss_coord:
+	 *   dp/dx=p_list[0]*dh1/dx+p_list[1]*dh2/dx+p_list[2]*dh3/dx+p_list[3]*dh4/dx+p_list[4]*dh5/dx+p_list[5]*dh6/dx;
+	 *   dp/dy=p_list[0]*dh1/dy+p_list[1]*dh2/dy+p_list[2]*dh3/dy+p_list[3]*dh4/dy+p_list[4]*dh5/dy+p_list[5]*dh6/dy;
+	 *   dp/dz=p_list[0]*dh1/dz+p_list[1]*dh2/dz+p_list[2]*dh3/dz+p_list[3]*dh4/dz+p_list[4]*dh5/dz+p_list[5]*dh6/dz;
+	 *
+	 *   p is a vector of size 3x1 already allocated.
+	 */
+
+	/*Output*/
+	IssmDouble dpx=0.;
+	IssmDouble dpy=0.;
+	IssmDouble dpz=0.;
+
+	/*Fetch number of nodes for this finite element*/
+	int numnodes = this->NumberofNodes();
+
+	/*Get nodal functions derivatives*/
+	IssmDouble* dbasis=xNew<IssmDouble>(3*numnodes);
+	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+
+	/*Calculate parameter for this Gauss point*/
+	for(int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
+	for(int i=0;i<numnodes;i++) dpy += dbasis[1*numnodes+i]*plist[i];
+	for(int i=0;i<numnodes;i++) dpz += dbasis[2*numnodes+i]*plist[i];
+
+	/*Assign values*/
+	xDelete<IssmDouble>(dbasis);
+	p[0]=dpx;
+	p[1]=dpy;
+	p[2]=dpz;
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss){{{*/
+void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss){
+
+	GetInputValue(p,plist,gauss,this->element_type);
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement){{{*/
+void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement){
+
+	/*Output*/
+	IssmDouble value =0.;
+
+	/*Fetch number of nodes for this finite element*/
+	int numnodes = this->NumberofNodes(finiteelement);
+
+	/*Get nodal functions*/
+	IssmDouble* basis=xNew<IssmDouble>(numnodes);
+	GetNodalFunctions(basis, gauss,finiteelement);
+
+	/*Calculate parameter for this Gauss point*/
+	for(int i=0;i<numnodes;i++) value += basis[i]*plist[i];
+
+	/*Assign output pointer*/
+	xDelete<IssmDouble>(basis);
+	*p = value;
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetJacobian{{{*/
+void TetraRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTetra* gauss){
+	/*The Jacobian is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size 1*/
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetJacobianDeterminant{{{*/
+void TetraRef::GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss){
+	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+	IssmDouble J[3][3];
+
+	/*Call Jacobian routine to get the jacobian:*/
+	GetJacobian(&J[0][0],xyz_list, gauss);
+
+	/*Get Determinant*/
+	Matrix3x3Determinant(Jdet,&J[0][0]);
+	if(*Jdet<0) _error_("negative jacobian determinant!");
+
+}
+/*}}}*/
+/*FUNCTION TetraRef::GetJacobianInvert {{{*/
+void TetraRef::GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussTetra* gauss){
+
+	/*Jacobian*/
+	IssmDouble J[3][3];
+
+	/*Call Jacobian routine to get the jacobian:*/
+	GetJacobian(&J[0][0], xyz_list, gauss);
+
+	/*Invert Jacobian matrix: */
+	Matrix3x3Invert(Jinv,&J[0][0]);
+}
+/*}}}*/
+/*FUNCTION TetraRef::NumberofNodes(){{{*/
+int TetraRef::NumberofNodes(void){
+
+	return this->NumberofNodes(this->element_type);
+}
+/*}}}*/
+/*FUNCTION TetraRef::NumberofNodes(int finiteelement){{{*/
+int TetraRef::NumberofNodes(int finiteelement){
+
+	switch(finiteelement){
+		case P0Enum:                return NUMNODESP0;
+		case P1Enum:                return NUMNODESP1;
+		case P1DGEnum:              return NUMNODESP1;
+		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
+	}
+
+	return -1;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/TetraRef.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 17398)
@@ -0,0 +1,41 @@
+
+/*!\file:  TetraRef.h
+ * \brief abstract class for handling Tetra oriented routines, like nodal functions, 
+ * strain rate generation, etc ...
+ */ 
+
+#ifndef _TETRAREF_H_
+#define _TETRAREF_H_
+
+class GaussTetra;
+
+class TetraRef{
+
+	public: 
+		int* element_type_list;
+		int  element_type;
+
+		TetraRef();
+		TetraRef(const int nummodels);
+		~TetraRef();
+
+		/*Management*/
+		void SetElementType(int type,int type_counter);
+		void GetBprimeMasstransport(IssmDouble* Bprime, IssmDouble* xyz_list, GaussTetra* gauss);
+		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTetra* gauss);
+		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss);
+		void GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussTetra* gauss);
+		void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss);
+		void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement);
+		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss);
+		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
+		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss);
+		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement);
+		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss);
+		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss);
+		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement);
+
+		int  NumberofNodes(void);
+		int  NumberofNodes(int finiteelement);
+};
+#endif
Index: /issm/trunk-jpl/src/c/classes/classes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/classes.h	(revision 17397)
+++ /issm/trunk-jpl/src/c/classes/classes.h	(revision 17398)
@@ -45,4 +45,6 @@
 #include "./Elements/Tria.h"
 #include "./Elements/TriaRef.h"
+#include "./Elements/Tetra.h"
+#include "./Elements/TetraRef.h"
 #include "./Elements/ElementHook.h"
 
Index: /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp	(revision 17398)
@@ -0,0 +1,175 @@
+/*!\file GaussTetra.c
+ * \brief: implementation of the GaussTetra object
+ */
+
+#include "./GaussTetra.h"
+#include "../../shared/io/Print/Print.h"
+#include "../../shared/Exceptions/exceptions.h"
+#include "../../shared/MemOps/MemOps.h"
+#include "../../shared/Enum/Enum.h"
+#include "../../shared/Numerics/GaussPoints.h"
+#include "../../shared/Numerics/constants.h"
+
+/*GaussTetra constructors and destructors:*/
+/*FUNCTION GaussTetra::GaussTetra() {{{*/
+GaussTetra::GaussTetra(){
+
+	numgauss=-1;
+
+	weights=NULL;
+	coords1=NULL;
+	coords2=NULL;
+	coords3=NULL;
+	coords4=NULL;
+
+	weight=UNDEF;
+	coord1=UNDEF;
+	coord2=UNDEF;
+	coord3=UNDEF;
+	coord4=UNDEF;
+}
+/*}}}*/
+/*FUNCTION GaussTetra::GaussTetra(int order) {{{*/
+GaussTetra::GaussTetra(int order){
+	_error_("not implemented yet");
+}
+/*}}}*/
+/*FUNCTION GaussTetra::~GaussTetra(){{{*/
+GaussTetra::~GaussTetra(){
+	xDelete<IssmDouble>(weights);
+	xDelete<IssmDouble>(coords1);
+	xDelete<IssmDouble>(coords2);
+	xDelete<IssmDouble>(coords3);
+	xDelete<IssmDouble>(coords4);
+}
+/*}}}*/
+
+/*Methods*/
+/*FUNCTION GaussTetra::Echo{{{*/
+void GaussTetra::Echo(void){
+
+	_printf_("GaussTetra:\n");
+	_printf_("   numgauss: " << numgauss << "\n");
+
+	if (weights){
+	 _printf_("   weights = ["); 
+	 for(int i=0;i<numgauss;i++) _printf_(" " << weights[i] << "\n");
+	 _printf_("]\n");
+	}
+	else _printf_("weights = NULL\n");
+	if (coords1){
+	 _printf_("   coords1 = ["); 
+	 for(int i=0;i<numgauss;i++) _printf_(" " << coords1[i] << "\n");
+	 _printf_("]\n");
+	}
+	else _printf_("coords1 = NULL\n");
+	if (coords2){
+	 _printf_("   coords2 = ["); 
+	 for(int i=0;i<numgauss;i++) _printf_(" " << coords2[i] << "\n");
+	 _printf_("]\n");
+	}
+	else _printf_("coords2 = NULL\n");
+	if (coords3){
+	 _printf_("   coords3 = ["); 
+	 for(int i=0;i<numgauss;i++) _printf_(" " << coords3[i] << "\n");
+	 _printf_("]\n");
+	}
+	else _printf_("coords3 = NULL\n");
+	if (coords4){
+		_printf_("   coords4 = ["); 
+		for(int i=0;i<numgauss;i++) _printf_(" " << coords4[i] << "\n");
+		_printf_("]\n");
+	}
+	else _printf_("coords4 = NULL\n");
+
+	_printf_("   weight = " << weight << "\n");
+	_printf_("   coord1 = " << coord1 << "\n");
+	_printf_("   coord2 = " << coord2 << "\n");
+	_printf_("   coord3 = " << coord3 << "\n");
+	_printf_("   coord4 = " << coord4 << "\n");
+
+}
+/*}}}*/
+/*FUNCTION GaussTetra::Enum{{{*/
+int GaussTetra::Enum(void){
+	return GaussTetraEnum;
+}
+/*}}}*/
+/*FUNCTION GaussTetra::GaussPoint{{{*/
+void GaussTetra::GaussPoint(int ig){
+
+	/*Check input in debugging mode*/
+	 _assert_(ig>=0 && ig< numgauss);
+
+	 /*update static arrays*/
+	 weight=weights[ig];
+	 coord1=coords1[ig];
+	 coord2=coords2[ig];
+	 coord3=coords3[ig];
+	 coord4=coords4[ig];
+
+}
+/*}}}*/
+/*FUNCTION GaussTetra::GaussVertex{{{*/
+void GaussTetra::GaussVertex(int iv){
+
+	/*in debugging mode: check that the default constructor has been called*/
+	_assert_(numgauss==-1);
+
+	/*update static arrays*/
+	switch(iv){
+		default: _error_("vertex index should be in [0 5]");
+
+	}
+
+}
+/*}}}*/
+/*FUNCTION GaussTetra::GaussNode{{{*/
+void GaussTetra::GaussNode(int finiteelement,int iv){
+
+	/*in debugging mode: check that the default constructor has been called*/
+	_assert_(numgauss==-1);
+
+	/*update static arrays*/
+	switch(finiteelement){
+		default: _error_("Finite element "<<EnumToStringx(finiteelement)<<" not supported");
+	}
+
+}
+/*}}}*/
+/*FUNCTION GaussTetra::begin{{{*/
+int GaussTetra::begin(void){
+
+	/*Check that this has been initialized*/
+	_assert_(numgauss>0);
+	_assert_(weights);
+	_assert_(coords1);
+	_assert_(coords2);
+	_assert_(coords3);
+	_assert_(coords4);
+
+	/*return first gauss index*/
+	return 0;
+}
+/*}}}*/
+/*FUNCTION GaussTetra::end{{{*/
+int GaussTetra::end(void){
+
+	/*Check that this has been initialized*/
+	_assert_(numgauss>0);
+	_assert_(weights);
+	_assert_(coords1);
+	_assert_(coords2);
+	_assert_(coords3);
+	_assert_(coords4);
+
+	/*return last gauss index +1*/
+	return numgauss;
+}
+/*}}}*/
+/*FUNCTION GaussTetra::SynchronizeGaussBase{{{*/
+void GaussTetra::SynchronizeGaussBase(Gauss* gauss){
+
+	_error_("not supported");
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.h	(revision 17398)
+++ /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.h	(revision 17398)
@@ -0,0 +1,45 @@
+/*!\file GaussTetra.h
+ * \brief: header file for node object
+ */
+
+#ifndef _GAUSSTETRA_H_
+#define _GAUSSTETRA_H_
+
+/*Headers:*/
+#include "../../shared/Numerics/types.h"
+#include "./Gauss.h"
+
+class GaussTetra: public Gauss{
+
+	private:
+		int numgauss;
+		IssmDouble* weights;
+		IssmDouble* coords1;
+		IssmDouble* coords2;
+		IssmDouble* coords3;
+		IssmDouble* coords4;
+
+	public:
+		IssmDouble coord1;
+		IssmDouble coord2;
+		IssmDouble coord3;
+		IssmDouble coord4;
+
+	public:
+
+		/*GaussTetra constructors, destructors*/
+		GaussTetra();
+		GaussTetra(int order);
+		~GaussTetra();
+
+		/*Methods*/
+		int  begin(void);
+		int  end(void);
+		void Echo(void);
+		int  Enum(void);
+		void GaussPoint(int ig);
+		void GaussVertex(int iv);
+		void GaussNode(int finitelement,int iv);
+		void SynchronizeGaussBase(Gauss* gauss);
+};
+#endif
Index: /issm/trunk-jpl/src/c/classes/gauss/gaussobjects.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/gaussobjects.h	(revision 17397)
+++ /issm/trunk-jpl/src/c/classes/gauss/gaussobjects.h	(revision 17398)
@@ -9,4 +9,5 @@
 #include "./GaussSeg.h"
 #include "./GaussTria.h"
+#include "./GaussTetra.h"
 #include "./GaussPenta.h"
 
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 17397)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 17398)
@@ -415,6 +415,4 @@
 	PengridEnum,
 	PenpairEnum,
-	PentaEnum,
-	PentaInputEnum,
 	ProfilerEnum,
 	MatrixParamEnum,
@@ -434,4 +432,8 @@
 	TriaEnum,
 	TriaInputEnum,
+	TetraEnum,
+	TetraInputEnum,
+	PentaEnum,
+	PentaInputEnum,
 	VertexEnum,
 	VertexPIdEnum,
@@ -616,4 +618,5 @@
 	GaussSegEnum,
 	GaussTriaEnum,
+	GaussTetraEnum,
 	GaussPentaEnum,
 	/*}}}*/
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 17397)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 17398)
@@ -410,6 +410,4 @@
 		case PengridEnum : return "Pengrid";
 		case PenpairEnum : return "Penpair";
-		case PentaEnum : return "Penta";
-		case PentaInputEnum : return "PentaInput";
 		case ProfilerEnum : return "Profiler";
 		case MatrixParamEnum : return "MatrixParam";
@@ -429,4 +427,8 @@
 		case TriaEnum : return "Tria";
 		case TriaInputEnum : return "TriaInput";
+		case TetraEnum : return "Tetra";
+		case TetraInputEnum : return "TetraInput";
+		case PentaEnum : return "Penta";
+		case PentaInputEnum : return "PentaInput";
 		case VertexEnum : return "Vertex";
 		case VertexPIdEnum : return "VertexPId";
@@ -591,4 +593,5 @@
 		case GaussSegEnum : return "GaussSeg";
 		case GaussTriaEnum : return "GaussTria";
+		case GaussTetraEnum : return "GaussTetra";
 		case GaussPentaEnum : return "GaussPenta";
 		case FSSolverEnum : return "FSSolver";
Index: /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 17397)
+++ /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 17398)
@@ -419,6 +419,4 @@
 	      else if (strcmp(name,"Pengrid")==0) return PengridEnum;
 	      else if (strcmp(name,"Penpair")==0) return PenpairEnum;
-	      else if (strcmp(name,"Penta")==0) return PentaEnum;
-	      else if (strcmp(name,"PentaInput")==0) return PentaInputEnum;
 	      else if (strcmp(name,"Profiler")==0) return ProfilerEnum;
 	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
@@ -438,4 +436,8 @@
 	      else if (strcmp(name,"Tria")==0) return TriaEnum;
 	      else if (strcmp(name,"TriaInput")==0) return TriaInputEnum;
+	      else if (strcmp(name,"Tetra")==0) return TetraEnum;
+	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
+	      else if (strcmp(name,"Penta")==0) return PentaEnum;
+	      else if (strcmp(name,"PentaInput")==0) return PentaInputEnum;
 	      else if (strcmp(name,"Vertex")==0) return VertexEnum;
 	      else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum;
@@ -504,10 +506,10 @@
 	      else if (strcmp(name,"VzHO")==0) return VzHOEnum;
 	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
-	      else if (strcmp(name,"VzFS")==0) return VzFSEnum;
-	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+	      if (strcmp(name,"VzFS")==0) return VzFSEnum;
+	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
@@ -603,4 +605,5 @@
 	      else if (strcmp(name,"GaussSeg")==0) return GaussSegEnum;
 	      else if (strcmp(name,"GaussTria")==0) return GaussTriaEnum;
+	      else if (strcmp(name,"GaussTetra")==0) return GaussTetraEnum;
 	      else if (strcmp(name,"GaussPenta")==0) return GaussPentaEnum;
 	      else if (strcmp(name,"FSSolver")==0) return FSSolverEnum;
@@ -626,11 +629,11 @@
 	      else if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
 	      else if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
-	      else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
-	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
-	      else if (strcmp(name,"Regular")==0) return RegularEnum;
          else stage=6;
    }
    if(stage==6){
-	      if (strcmp(name,"Scaled")==0) return ScaledEnum;
+	      if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
+	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
+	      else if (strcmp(name,"Regular")==0) return RegularEnum;
+	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
