Index: /issm/trunk/src/c/objects/Elements/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4248)
+++ /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4249)
@@ -40,6 +40,4 @@
 		Beam();
 		~Beam();
-		void  Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
-		void  UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
 		/*Object virtual functions definitions: {{{1*/
@@ -54,12 +52,4 @@
 		Object* copy();
 		/*}}}*/
-		/*Beam management: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		bool  IsInput(int name);
-		void  SetClone(int* minranks);
-		void  InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");};
-		void  InputToResult(int enum_type,int step,double time);
-		void   ProcessResultsUnits(void);
-		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
 		void  InputUpdateFromVector(double* vector, int name, int type);
@@ -71,59 +61,63 @@
 		void  InputUpdateFromSolution(double* solution);
 		/*}}}*/
-		/*numerics: {{{1*/
-		void  CreateKMatrix(Mat Kgg);
-		void  CreatePVector(Vec pg);
-		void  GetSolutionFromInputs(Vec solution);
-		void  GetDofList(int* doflist,int* pnumberofdofs);
-		void  GetDofList1(int* doflist);
-		void  CreateKMatrixDiagnosticHutter(Mat Kgg);
-		void  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
-		void  CreatePVectorDiagnosticHutter(Vec pg);
-		void* GetMatPar();
-
-		void  ComputeBasalStress(Vec sigma_bg);
-		void  ComputePressure(Vec p_gg);
-		void  ComputeStrainRate(Vec epsg);
-		void  GetNodes(void** vpnodes);
-		void  PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
-		void  PatchFill(int* pcount, Patch* patch);
-		void  MinVel(double* pminvel, bool process_units);
-		void  MaxVel(double* pmaxvel, bool process_units);
-		void  MinVx(double* pminvx, bool process_units);
-		void  MaxVx(double* pmaxvx, bool process_units);
-		void  MaxAbsVx(double* pmaxabsvx, bool process_units);
-		void  MinVy(double* pminvy, bool process_units);
-		void  MaxVy(double* pmaxvy, bool process_units);
-		void  MaxAbsVy(double* pmaxabsvy, bool process_units);
-		void  MinVz(double* pminvz, bool process_units);
-		void  MaxVz(double* pmaxvz, bool process_units);
-		void  MaxAbsVz(double* pmaxabsvz, bool process_units);
-		void  InputDuplicate(int original_enum,int new_enum);
-		void  InputScale(int enum_type,double scale_factor);
-		void  InputAXPY(int YEnum, double scalar, int XEnum);
-		void  InputControlConstrain(int control_type,double cm_min, double cm_max);
-		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
-
+		/*Element virtual functions definitions: {{{1*/
+		void	   ComputeBasalStress(Vec sigma_b);
+		void	   ComputePressure(Vec p_g);
+		void	   ComputeStrainRate(Vec eps);
+		void	   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		double	   CostFunction(void);
+		void	   CreateKMatrix(Mat Kgg);
+		void	   CreatePVector(Vec pg);
+		void	   Du(Vec du_g);
+		void	   GetBedList(double* bed_list);
+		void*	   GetMatPar();
+		void	   GetNodes(void** nodes);
+		bool	   GetOnBed();
+		bool	   GetShelf(); 
+		void	   GetSolutionFromInputs(Vec solution);
+		void	   GetThicknessList(double* thickness_list);
+		void	   GetVectorFromInputs(Vec vector,int NameEnum);
+		void	   Gradj(Vec gradient,int control_type);
+		void	   GradjB(Vec gradient);
+		void	   GradjDrag(Vec gradient);
+		void	   InputAXPY(int YEnum, double scalar, int XEnum);
+		void	   InputControlConstrain(int control_type,double cm_min, double cm_max);
+		void	   InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void       InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");}
+		void	   InputDuplicate(int original_enum,int new_enum);
+		void	   InputScale(int enum_type,double scale_factor);
+		void	   InputToResult(int enum_type,int step,double time);
+		double	   MassFlux(double* segment);
+		void	   MaxAbsVx(double* pmaxabsvx, bool process_units);
+		void	   MaxAbsVy(double* pmaxabsvy, bool process_units);
+		void	   MaxAbsVz(double* pmaxabsvz, bool process_units);
+		void	   MaxVel(double* pmaxvel, bool process_units);
+		void	   MaxVx(double* pmaxvx, bool process_units);
+		void	   MaxVy(double* pmaxvy, bool process_units);
+		void	   MaxVz(double* pmaxvz, bool process_units);
+		void	   MinVel(double* pminvel, bool process_units);
+		void	   MinVx(double* pminvx, bool process_units);
+		void	   MinVy(double* pminvy, bool process_units);
+		void	   MinVz(double* pminvz, bool process_units);
+		double	   Misfit(void);
+		void	   PatchFill(int* pcount, Patch* patch);
+		void	   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+		void	   ProcessResultsUnits(void);
+		double	   SurfaceArea(void);
+		void       Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+		void       UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
-		/*not implemented: {{{1*/
-		bool  GetShelf();
-		bool  GetOnBed();
-		void  GetBedList(double*);
-		void  GetThicknessList(double* thickness_list);
-		void  Du(Vec);
-		void  Gradj(Vec gradient,int control_type);
-		void  GradjDrag(Vec gradient);
-		void  GradjB(Vec gradient);
-		double Misfit(void);
-		double SurfaceArea(void);
-		double CostFunction(void);
-		void  GetNodalFunctions(double* l1l2, double gauss_coord);
-		void  GetParameterValue(double* pvalue, double* value_list,double gauss_coord);
-		void  GetJacobianDeterminant(double* pJdet,double* z_list, double gauss_coord);
-		double MassFlux(double* segment);
-		void GetVectorFromInputs(Vec vector,int NameEnum);
-
+		/*Beam specific routines: {{{1*/
+		void	  CreateKMatrixDiagnosticHutter(Mat Kgg);
+		void	  CreatePVectorDiagnosticHutter(Vec pg);
+		void	  GetDofList(int* doflist,int* pnumberofdofs);
+		void	  GetDofList1(int* doflist);
+		void	  GetJacobianDeterminant(double* pJdet,double* z_list, double gauss_coord);
+		void	  GetNodalFunctions(double* l1l2, double gauss_coord);
+		void	  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
+		void	  GetParameterValue(double* pvalue, double* value_list,double gauss_coord);
+		bool	  IsInput(int name);
+		void	  SetClone(int* minranks);
 		/*}}}*/
-
 };
 #endif  /* _BEAM_H */
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4248)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4249)
@@ -44,151 +44,149 @@
 		Penta();
 		Penta(int penta_id,int i, IoModel* iomodel,int nummodels);
-		void  Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
-		void  UpdateGeometry(void);
 		~Penta();
 		/*}}}*/
 		/*Object virtual functions definitions: {{{1*/
-		void  Echo();
-		void  DeepEcho();
-		int   Id(); 
-		int   MyRank();
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		void  Demarshall(char** pmarshalled_dataset);
-		int   Enum();
-		Object* copy();
+		Object*   copy();
+		void	  DeepEcho();
+		void	  Demarshall(char** pmarshalled_dataset);
+		void	  Echo();
+		int		  Enum();
+		int		  Id(); 
+		void	  Marshall(char** pmarshalled_dataset);
+		int		  MarshallSize();
+		int		  MyRank();
 		/*}}}*/
-		/*Penta management: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		bool  IsInput(int name);
-		bool  IsOnSurface(void);
-		Penta* GetUpperElement(void);
-		void* SpawnSing(int g0);
-		void* SpawnBeam(int g0, int g1);
-		void* SpawnTria(int g0, int g1, int g2);
-		void  SetClone(int* minranks);
-		double* GaussFromNode(Node* node);
-		void  InputToResult(int enum_type,int step,double time);
-		void   ProcessResultsUnits(void);
-		/*}}}*/
-		/*Update virtual functions resolution: {{{1*/
+		/*Update virtual functions definitions: {{{1*/
+		void  InputUpdateFromConstant(bool constant, int name);
+		void  InputUpdateFromConstant(double constant, int name);
+		void  InputUpdateFromConstant(int constant, int name);
 		void  InputUpdateFromSolution(double* solutiong);
-		void  InputUpdateFromSolutionDiagnosticHoriz( double* solutiong);
-		void  InputUpdateFromSolutionDiagnosticStokes( double* solutiong);
-		void  InputUpdateFromSolutionSlopeCompute( double* solutiong);
-		void  InputUpdateFromSolutionPrognostic( double* solutiong);
-		void  InputUpdateFromSolutionPrognostic2(double* solutiong);
 		void  InputUpdateFromSolutionBalancedthickness( double* solutiong);
 		void  InputUpdateFromSolutionBalancedthickness2( double* solutiong);
 		void  InputUpdateFromSolutionBalancedvelocities( double* solutiong);
+		void  InputUpdateFromSolutionDiagnosticHoriz( double* solutiong);
+		void  InputUpdateFromSolutionDiagnosticStokes( double* solutiong);
+		void  InputUpdateFromSolutionPrognostic( double* solutiong);
+		void  InputUpdateFromSolutionPrognostic2(double* solutiong);
+		void  InputUpdateFromSolutionSlopeCompute( double* solutiong);
+		void  InputUpdateFromVector(bool* vector, int name, int type);
 		void  InputUpdateFromVector(double* vector, int name, int type);
 		void  InputUpdateFromVector(int* vector, int name, int type);
-		void  InputUpdateFromVector(bool* vector, int name, int type);
-		void  InputUpdateFromConstant(double constant, int name);
-		void  InputUpdateFromConstant(int constant, int name);
-		void  InputUpdateFromConstant(bool constant, int name);
 		void  UpdateFromDakota(void* inputs);
 		/*}}}*/
-		/*FUNCTION element numerical routines {{{1*/
-		void  CreateKMatrix(Mat Kggg);
-		void  CreateKMatrixDiagnosticHoriz( Mat Kgg);
-		void  CreateKMatrixDiagnosticHutter( Mat Kgg);
-		void  CreateKMatrixDiagnosticVert( Mat Kgg);
-		void  CreatePVector(Vec pg);
-		void  GetSolutionFromInputs(Vec solution);
-		void  GetSolutionFromInputsDiagnosticHoriz(Vec solutiong);
-		void  GetSolutionFromInputsDiagnosticVert(Vec solutiong);
-		void  GetSolutionFromInputsDiagnosticStokes(Vec solutiong);
-		void  GetDofList(int* doflist,int* pnumberofdofs);
-		void  GetDofList1(int* doflist);
-		void* GetMatPar();
-		bool   GetShelf();
-		void  GetNodes(void** nodes);
+		/*Element virtual functions definitions: {{{1*/
+		void   ComputeBasalStress(Vec sigma_b);
+		void   ComputePressure(Vec p_g);
+		void   ComputeStrainRate(Vec eps);
+		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		double CostFunction(void);
+		void   CreateKMatrix(Mat Kgg);
+		void   CreatePVector(Vec pg);
+		void   Du(Vec du_g);
+		void   GetBedList(double* bed_list);
+		void*  GetMatPar();
+		void   GetNodes(void** nodes);
 		bool   GetOnBed();
-		void  Du(Vec du_gg);
-		void  Gradj(Vec gradient,int control_type);
-		void  GradjDrag(Vec gradient);
-		void  GradjB(Vec gradient);
+		bool   GetShelf(); 
+		void   GetSolutionFromInputs(Vec solution);
+		void   GetThicknessList(double* thickness_list);
+		void   GetVectorFromInputs(Vec vector,int NameEnum);
+		void   Gradj(Vec gradient,int control_type);
+		void   GradjB(Vec gradient);
+		void   GradjDrag(Vec gradient);
+		void   InputAXPY(int YEnum, double scalar, int XEnum);
+		void   InputControlConstrain(int control_type,double cm_min, double cm_max);
+		void   InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void   InputDepthAverageAtBase(int enum_type,int average_enum_type);
+		void   InputDuplicate(int original_enum,int new_enum);
+		void   InputScale(int enum_type,double scale_factor);
+		void   InputToResult(int enum_type,int step,double time);
+		double MassFlux(double* segment);
+		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
+		void   MaxAbsVy(double* pmaxabsvy, bool process_units);
+		void   MaxAbsVz(double* pmaxabsvz, bool process_units);
+		void   MaxVel(double* pmaxvel, bool process_units);
+		void   MaxVx(double* pmaxvx, bool process_units);
+		void   MaxVy(double* pmaxvy, bool process_units);
+		void   MaxVz(double* pmaxvz, bool process_units);
+		void   MinVel(double* pminvel, bool process_units);
+		void   MinVx(double* pminvx, bool process_units);
+		void   MinVy(double* pminvy, bool process_units);
+		void   MinVz(double* pminvz, bool process_units);
 		double Misfit(void);
+		void   PatchFill(int* pcount, Patch* patch);
+		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+		void   ProcessResultsUnits(void);
 		double SurfaceArea(void);
-		double CostFunction(void);
-		void  GetThicknessList(double* thickness_list);
-		void  GetBedList(double* bed_list);
-		void  GetStrainRate(double* epsilon, double* velocity, double* xyz_list, double* gauss_coord);
-		void  GetB(double* pB, double* xyz_list, double* gauss_coord);
-		void  GetBPrime(double* B, double* xyz_list, double* gauss_coord);
-		void  GetB_vert(double* B, double* xyz_list, double* gauss_coord);
-		void  GetBPrime_vert(double* B, double* xyz_list, double* gauss_coord);
-		void  GetJacobianDeterminant(double*  Jdet, double* xyz_list,double* gauss_coord);
-		void  GetNodalFunctionsDerivatives(double* dh1dh6,double* xyz_list, double* gauss_coord);
-		void  GetJacobian(double* J, double* xyz_list,double* gauss_coord);
-		void  GetNodalFunctionsDerivativesReference(double* dl1dl6,double* gauss_coord);
-		void  GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_coord);
-		void  CreatePVectorDiagnosticHoriz( Vec pg);
-		void  CreatePVectorDiagnosticHutter( Vec pg);
-		void  CreatePVectorDiagnosticVert( Vec pg);
-		void  GetParameterValue(double* pvalue, double* v_list,double* gauss_coord);
-		void  GetParameterDerivativeValue(double* p, double* p_list,double* xyz_list, double* gauss_coord);
-		void  GetNodalFunctions(double* l1l6, double* gauss_coord);
-		void  VecExtrude(Vec vector,double* vector_serial,int iscollapsed);
-		void  InputExtrude(int enum_type);
-		void  InputDepthAverageAtBase(int enum_type,int average_enum_type);
-		void  ComputeBasalStress(Vec sigma_bg);
-		void  ComputePressure(Vec p_gg);
-		void  ComputeStrainRate(Vec epsg);
-		void  CreateKMatrixSlopeCompute(Mat Kggg);
-		void  CreatePVectorSlopeCompute( Vec pg);
-		void  CreateKMatrixPrognostic(Mat Kggg);
-		void  CreatePVectorPrognostic( Vec pg);
-		void  CreateKMatrixBalancedthickness(Mat Kggg);
-		void  CreateKMatrixBalancedvelocities(Mat Kggg);
-		void  CreateKMatrixDiagnosticStokes( Mat Kgg);
-		void  CreatePVectorBalancedthickness( Vec pg);
-		void  CreatePVectorBalancedvelocities( Vec pg);
-		void  CreatePVectorDiagnosticStokes( Vec pg);
-		void  ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp);
-		void  GetMatrixInvert(double*  Ke_invert, double* Ke);
-		void  SurfaceNormal(double* surface_normal, double xyz_list[3][3]);
-		void  GetStrainRateStokes(double* epsilon, double* velocity, double* xyz_list, double* gauss_coord);
-		void  GetBStokes(double* B, double* xyz_list, double* gauss_coord);
-		void  GetBprimeStokes(double* B_prime, double* xyz_list, double* gauss_coord);
-		void  GetLStokes(double* LStokes, double* gauss_coord_tria);
-		void  GetLprimeStokes(double* LprimeStokes, double* xyz_list, double* gauss_coord_tria, double* gauss_coord);
-		void  GetNodalFunctionsDerivativesStokes(double* dh1dh7,double* xyz_list, double* gauss_coord);
-		void  GetNodalFunctionsDerivativesReferenceStokes(double* dl1dl7,double* gauss_coord);
-		void  ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp);
-		void  GetNodalFunctionsStokes(double* l1l7, double* gauss_coord);
-		void  CreateKMatrixThermal(Mat Kggg);
-		void  GetB_conduct(double* B_conduct, double* xyz_list, double* gauss_coord);
-		void  GetB_advec(double* B_advec, double* xyz_list, double* gauss_coord);
-		void  GetBprime_advec(double* Bprime_advec, double* xyz_list, double* gauss_coord);
-		void  GetB_artdiff(double* B_artdiff, double* xyz_list, double* gauss_coord);
-		void  CreateKMatrixMelting(Mat Kggg);
-		void  CreatePVectorThermal( Vec pg);
-		void  CreatePVectorMelting( Vec pg);
-		void  GetPhi(double* phi, double*  epsilon, double viscosity);
-		double MassFlux(double* segment);
-		void  PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
-		void  PatchFill(int* pcount, Patch* patch);
-		void  MinVel(double* pminvel, bool process_units);
-		void  MaxVel(double* pmaxvel, bool process_units);
-		void  MinVx(double* pminvx, bool process_units);
-		void  MaxVx(double* pmaxvx, bool process_units);
-		void  MaxAbsVx(double* pmaxabsvx, bool process_units);
-		void  MinVy(double* pminvy, bool process_units);
-		void  MaxVy(double* pmaxvy, bool process_units);
-		void  MaxAbsVy(double* pmaxabsvy, bool process_units);
-		void  MinVz(double* pminvz, bool process_units);
-		void  MaxVz(double* pmaxvz, bool process_units);
-		void  MaxAbsVz(double* pmaxabsvz, bool process_units);
-		void  InputDuplicate(int original_enum,int new_enum);
-		void  InputScale(int enum_type,double scale_factor);
-		void  InputAXPY(int YEnum, double scalar, int XEnum);
-		void  InputControlConstrain(int control_type,double cm_min, double cm_max);
-		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
-		void  GetVectorFromInputs(Vec vector,int NameEnum);
+		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+		void   UpdateGeometry(void);
 		/*}}}*/
-
-
+		/*Penta specific routines:{{{1*/
+		void	  CreateKMatrixBalancedthickness(Mat Kggg);
+		void	  CreateKMatrixBalancedvelocities(Mat Kggg);
+		void	  CreateKMatrixDiagnosticHoriz( Mat Kgg);
+		void	  CreateKMatrixDiagnosticHutter( Mat Kgg);
+		void	  CreateKMatrixDiagnosticStokes( Mat Kgg);
+		void	  CreateKMatrixDiagnosticVert( Mat Kgg);
+		void	  CreateKMatrixMelting(Mat Kggg);
+		void	  CreateKMatrixPrognostic(Mat Kggg);
+		void	  CreateKMatrixSlopeCompute(Mat Kggg);
+		void	  CreateKMatrixThermal(Mat Kggg);
+		void	  CreatePVectorBalancedthickness( Vec pg);
+		void	  CreatePVectorBalancedvelocities( Vec pg);
+		void	  CreatePVectorDiagnosticHoriz( Vec pg);
+		void	  CreatePVectorDiagnosticHutter( Vec pg);
+		void	  CreatePVectorDiagnosticStokes( Vec pg);
+		void	  CreatePVectorDiagnosticVert( Vec pg);
+		void	  CreatePVectorMelting( Vec pg);
+		void	  CreatePVectorPrognostic( Vec pg);
+		void	  CreatePVectorSlopeCompute( Vec pg);
+		void	  CreatePVectorThermal( Vec pg);
+		double*   GaussFromNode(Node* node);
+		void	  GetB(double* pB, double* xyz_list, double* gauss_coord);
+		void	  GetBPrime(double* B, double* xyz_list, double* gauss_coord);
+		void	  GetBPrime_vert(double* B, double* xyz_list, double* gauss_coord);
+		void	  GetBStokes(double* B, double* xyz_list, double* gauss_coord);
+		void	  GetB_advec(double* B_advec, double* xyz_list, double* gauss_coord);
+		void	  GetB_artdiff(double* B_artdiff, double* xyz_list, double* gauss_coord);
+		void	  GetB_conduct(double* B_conduct, double* xyz_list, double* gauss_coord);
+		void	  GetB_vert(double* B, double* xyz_list, double* gauss_coord);
+		void	  GetBprimeStokes(double* B_prime, double* xyz_list, double* gauss_coord);
+		void	  GetBprime_advec(double* Bprime_advec, double* xyz_list, double* gauss_coord);
+		void	  GetDofList(int* doflist,int* pnumberofdofs);
+		void	  GetDofList1(int* doflist);
+		void	  GetJacobian(double* J, double* xyz_list,double* gauss_coord);
+		void	  GetJacobianDeterminant(double*  Jdet, double* xyz_list,double* gauss_coord);
+		void	  GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_coord);
+		void	  GetLStokes(double* LStokes, double* gauss_coord_tria);
+		void	  GetLprimeStokes(double* LprimeStokes, double* xyz_list, double* gauss_coord_tria, double* gauss_coord);
+		void	  GetMatrixInvert(double*  Ke_invert, double* Ke);
+		void	  GetNodalFunctions(double* l1l6, double* gauss_coord);
+		void	  GetNodalFunctionsDerivatives(double* dh1dh6,double* xyz_list, double* gauss_coord);
+		void	  GetNodalFunctionsDerivativesReference(double* dl1dl6,double* gauss_coord);
+		void	  GetNodalFunctionsDerivativesReferenceStokes(double* dl1dl7,double* gauss_coord);
+		void	  GetNodalFunctionsDerivativesStokes(double* dh1dh7,double* xyz_list, double* gauss_coord);
+		void	  GetNodalFunctionsStokes(double* l1l7, double* gauss_coord);
+		void	  GetParameterDerivativeValue(double* p, double* p_list,double* xyz_list, double* gauss_coord);
+		void	  GetParameterValue(double* pvalue, double* v_list,double* gauss_coord);
+		void	  GetPhi(double* phi, double*  epsilon, double viscosity);
+		void	  GetSolutionFromInputsDiagnosticHoriz(Vec solutiong);
+		void	  GetSolutionFromInputsDiagnosticStokes(Vec solutiong);
+		void	  GetSolutionFromInputsDiagnosticVert(Vec solutiong);
+		void	  GetStrainRate(double* epsilon, double* velocity, double* xyz_list, double* gauss_coord);
+		void	  GetStrainRateStokes(double* epsilon, double* velocity, double* xyz_list, double* gauss_coord);
+		Penta*    GetUpperElement(void);
+		void	  InputExtrude(int enum_type);
+		bool	  IsInput(int name);
+		bool	  IsOnSurface(void);
+		void	  ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp);
+		void	  ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp);
+		void	  SetClone(int* minranks);
+		void*	  SpawnBeam(int g0, int g1);
+		void*	  SpawnSing(int g0);
+		void*	  SpawnTria(int g0, int g1, int g2);
+		void	  SurfaceNormal(double* surface_normal, double xyz_list[3][3]);
+		void	  VecExtrude(Vec vector,double* vector_serial,int iscollapsed);
+		/*}}}*/
 };
 #endif  /* _PENTA_H */
Index: /issm/trunk/src/c/objects/Elements/PentaHook.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/PentaHook.h	(revision 4248)
+++ /issm/trunk/src/c/objects/Elements/PentaHook.h	(revision 4249)
@@ -17,5 +17,4 @@
 		Hook hneighbors; // 2 elements, first down, second up
 
-
 		/*FUNCTION constructors, destructors {{{1*/
 		PentaHook();
Index: /issm/trunk/src/c/objects/Elements/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4248)
+++ /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4249)
@@ -1,2 +1,3 @@
+
 /*!\file: Sing.h
  * \brief prototypes for Sing element
@@ -36,10 +37,7 @@
 		Inputs* inputs;
 
-
 		/*Sing constructors, destructors: {{{1*/
 		Sing();
 		~Sing();
-		void  Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
-		void  UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
 		/*Object virtual functions definitions:{{{1 */
@@ -54,12 +52,4 @@
 		Object* copy();
 		/*}}}*/
-		/*Sing managemnet: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		bool  IsInput(int name);
-		void  SetClone(int* minranks);
-		void  InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");};
-		void  InputToResult(int enum_type,int step,double time);
-		void   ProcessResultsUnits(void);
-		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
 		void  InputUpdateFromVector(double* vector, int name, int type);
@@ -71,55 +61,60 @@
 		void  InputUpdateFromSolution(double* solutiong);
 		/*}}}*/
-		/*numerics: {{{1*/
-		void  CreateKMatrix(Mat Kggg);
-		void  CreatePVector(Vec pg);
-		void  GetDofList(int* doflist,int* pnumberofdofs);
-		void  GetSolutionFromInputs(Vec solution);
-		void  GetDofList1(int* doflist);
-		void  CreateKMatrixDiagnosticHutter(Mat Kggg);
-		void  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
-		void  CreatePVectorDiagnosticHutter(Vec pgg);
-		void* GetMatPar();
-		void  ComputeBasalStress(Vec sigma_bg);
-		void  ComputePressure(Vec p_gg);
-		void  ComputeStrainRate(Vec epsg);
-		void  GetNodes(void** vpnodes);
-		void  PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
-		void  PatchFill(int* pcount, Patch* patch);
-		void  MinVel(double* pminvel, bool process_units);
-		void  MaxVel(double* pmaxvel, bool process_units);
-		void  MinVx(double* pminvx, bool process_units);
-		void  MaxVx(double* pmaxvx, bool process_units);
-		void  MaxAbsVx(double* pmaxabsvx, bool process_units);
-		void  MinVy(double* pminvy, bool process_units);
-		void  MaxVy(double* pmaxvy, bool process_units);
-		void  MaxAbsVy(double* pmaxabsvy, bool process_units);
-		void  MinVz(double* pminvz, bool process_units);
-		void  MaxVz(double* pmaxvz, bool process_units);
-		void  MaxAbsVz(double* pmaxabsvz, bool process_units);
-		void  InputDuplicate(int original_enum,int new_enum);
-		void  InputScale(int enum_type,double scale_factor);
-		void  InputAXPY(int YEnum, double scalar, int XEnum);
-		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
-		void  InputControlConstrain(int control_type,double cm_min, double cm_max);
-
-
+		/*Element virtual functions definitions: {{{1*/
+		void   ComputeBasalStress(Vec sigma_b);
+		void   ComputePressure(Vec p_g);
+		void   ComputeStrainRate(Vec eps);
+		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		double CostFunction(void);
+		void   CreateKMatrix(Mat Kgg);
+		void   CreatePVector(Vec pg);
+		void   Du(Vec du_g);
+		void   GetBedList(double* bed_list);
+		void*  GetMatPar();
+		void   GetNodes(void** nodes);
+		bool   GetOnBed();
+		bool   GetShelf(); 
+		void   GetSolutionFromInputs(Vec solution);
+		void   GetThicknessList(double* thickness_list);
+		void   GetVectorFromInputs(Vec vector,int NameEnum);
+		void   Gradj(Vec gradient,int control_type);
+		void   GradjB(Vec gradient);
+		void   GradjDrag(Vec gradient);
+		void   InputAXPY(int YEnum, double scalar, int XEnum);
+		void   InputControlConstrain(int control_type,double cm_min, double cm_max);
+		void   InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void   InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");}
+		void   InputDuplicate(int original_enum,int new_enum);
+		void   InputScale(int enum_type,double scale_factor);
+		void   InputToResult(int enum_type,int step,double time);
+		double MassFlux(double* segment);
+		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
+		void   MaxAbsVy(double* pmaxabsvy, bool process_units);
+		void   MaxAbsVz(double* pmaxabsvz, bool process_units);
+		void   MaxVel(double* pmaxvel, bool process_units);
+		void   MaxVx(double* pmaxvx, bool process_units);
+		void   MaxVy(double* pmaxvy, bool process_units);
+		void   MaxVz(double* pmaxvz, bool process_units);
+		void   MinVel(double* pminvel, bool process_units);
+		void   MinVx(double* pminvx, bool process_units);
+		void   MinVy(double* pminvy, bool process_units);
+		void   MinVz(double* pminvz, bool process_units);
+		double Misfit(void);
+		void   PatchFill(int* pcount, Patch* patch);
+		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+		void   ProcessResultsUnits(void);
+		double SurfaceArea(void);
+		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+		void   UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
-		/*not implemented: {{{1*/
-		bool   GetShelf();
-		bool   GetOnBed();
-		void  GetBedList(double*);
-		void  GetThicknessList(double* thickness_list);
-		void  Du(Vec);
-		void  Gradj(Vec gradient,int control_type);
-		void  GradjDrag(Vec gradient);
-		void  GradjB(Vec gradient);
-		double Misfit(void);
-		double SurfaceArea(void);
-		double CostFunction(void);
-		double MassFlux(double* segment);
-		void  GetVectorFromInputs(Vec vector,int NameEnum);
+		/*Sing specific routines: {{{1*/
+		void	  CreateKMatrixDiagnosticHutter(Mat Kggg);
+		void	  CreatePVectorDiagnosticHutter(Vec pgg);
+		void	  GetDofList(int* doflist,int* pnumberofdofs);
+		void	  GetDofList1(int* doflist);
+		void	  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
+		bool	  IsInput(int name);
+		void	  SetClone(int* minranks);
 		/*}}}*/
-
 
 
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4248)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4249)
@@ -39,6 +39,4 @@
 		Tria();
 		Tria(int tria_id,int i, IoModel* iomodel,int nummodels);
-		void  Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void  UpdateGeometry(void);
 		~Tria();
 		/*}}}*/
@@ -53,14 +51,4 @@
 		int   Enum();
 		Object* copy();
-		/*}}}*/
-		/*Tria management:{{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		bool  IsInput(int name);
-		void  SetClone(int* minranks);
-		void  InputDepthAverageAtBase(int enum_type,int average_enum_type);
-		void*  SpawnSing(int g0);
-		void*  SpawnBeam(int g0, int g1);
-		void  InputToResult(int enum_type,int step,double time);
-		void   ProcessResultsUnits(void);
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
@@ -81,90 +69,100 @@
 		void  UpdateFromDakota(void* inputs);
 		/*}}}*/
-		/*FUNCTION element numerical routines {{{1*/
-		void  CreateKMatrix(Mat Kgg);
-		void  CreatePVector(Vec pg);
-		void  GetSolutionFromInputs(Vec solution);
-		void  GetSolutionFromInputsDiagnosticHoriz(Vec solution);
-		void  GetDofList(int* doflist,int* pnumberofdofs);
-		void  GetDofList1(int* doflist);
-		void  CreateKMatrixDiagnosticHutter(Mat Kgg);
-		void  CreateKMatrixDiagnosticHoriz(Mat Kgg);
-		void  CreateKMatrixDiagnosticHorizFriction(Mat Kgg);
-		void  CreateKMatrixDiagnosticSurfaceVert(Mat Kgg);
-		void  CreateKMatrixSlopeCompute(Mat Kgg);
-		void  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
-		void  GetParameterDerivativeValue(double* p, double* plist,double* xyz_list, double* gauss_l1l2l3);
-		void  GetJacobianDeterminant2d(double*  Jdet, double* xyz_list,double* gauss_l1l2l3);
-		void  GetJacobianDeterminant3d(double*  Jdet, double* xyz_list,double* gauss_l1l2l3);
-		void  GetB(double* B, double* xyz_list, double* gauss_l1l2l3);
-		void  GetBPrime(double* Bprime, double* xyz_list, double* gauss_l1l2l3);
-		void  GetL(double* L, double* xyz_list, double* gauss_l1l2l3,int numdof);
-		void  GetB_prog(double* B_prog, double* xyz_list, double* gauss_l1l2l3);
-		void  GetBPrime_prog(double* Bprime_prog, double* xyz_list, double* gauss_l1l2l3);
-		void  GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3);
-		void  GetNodalFunctionsDerivatives(double* dh1dh3,double* xyz_list, double* gauss_l1l2l3);
-		void  GetNodalFunctionsDerivativesReference(double* dl1dl3,double* gauss_l1l2l3);
-		void  GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_l1l2l3);
-		void  GetJacobian(double* J, double* xyz_list,double* gauss_l1l2l3);
-		void  Du(Vec du_g);
-		void  Gradj(Vec gradient,int control_type);
-		void  GradjDrag(Vec gradient);
-		void  GradjDragStokes(Vec gradient);
-		void  GradjB(Vec gradient);
-		void  SurfaceNormal(double* surface_normal, double xyz_list[3][3]);
+		/*Element virtual functions definitions: {{{1*/
+		void   ComputeBasalStress(Vec sigma_b);
+		void   ComputePressure(Vec p_g);
+		void   ComputeStrainRate(Vec eps);
+		void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		double CostFunction(void);
+		void   CreateKMatrix(Mat Kgg);
+		void   CreatePVector(Vec pg);
+		void   Du(Vec du_g);
+		void   GetBedList(double* bed_list);
+		void*  GetMatPar();
+		void   GetNodes(void** nodes);
+		bool   GetOnBed();
+		bool   GetShelf(); 
+		void   GetSolutionFromInputs(Vec solution);
+		void   GetThicknessList(double* thickness_list);
+		void   GetVectorFromInputs(Vec vector,int NameEnum);
+		void   Gradj(Vec gradient,int control_type);
+		void   GradjB(Vec gradient);
+		void   GradjDrag(Vec gradient);
+		void   InputAXPY(int YEnum, double scalar, int XEnum);
+		void   InputControlConstrain(int control_type,double cm_min, double cm_max);
+		void   InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
+		void   InputDepthAverageAtBase(int enum_type,int average_enum_type);
+		void   InputDuplicate(int original_enum,int new_enum);
+		void   InputScale(int enum_type,double scale_factor);
+		void   InputToResult(int enum_type,int step,double time);
+		double MassFlux(double* segment);
+		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
+		void   MaxAbsVy(double* pmaxabsvy, bool process_units);
+		void   MaxAbsVz(double* pmaxabsvz, bool process_units);
+		void   MaxVel(double* pmaxvel, bool process_units);
+		void   MaxVx(double* pmaxvx, bool process_units);
+		void   MaxVy(double* pmaxvy, bool process_units);
+		void   MaxVz(double* pmaxvz, bool process_units);
+		void   MinVel(double* pminvel, bool process_units);
+		void   MinVx(double* pminvx, bool process_units);
+		void   MinVy(double* pminvy, bool process_units);
+		void   MinVz(double* pminvz, bool process_units);
 		double Misfit(void);
+		void   PatchFill(int* pcount, Patch* patch);
+		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+		void   ProcessResultsUnits(void);
 		double SurfaceArea(void);
-		double CostFunction(void);
-		void  CreatePVectorDiagnosticHutter(Vec pg);
-		void  CreatePVectorDiagnosticHoriz(Vec pg);
-		void  CreatePVectorDiagnosticBaseVert(Vec pg);
-		void  CreatePVectorSlopeCompute( Vec pg);
-		void* GetMatPar(void);
-		bool  GetShelf(void);
-		void  GetNodes(void** nodes);
-		bool  GetOnBed(void);
-		void  GetThicknessList(double* thickness_list);
-		void  GetBedList(double* bed_list);
-		void  ComputeBasalStress(Vec sigma_b);
-		void  ComputePressure(Vec p_g);
-		void  ComputeStrainRate(Vec eps);
-		void  CreateKMatrixThermal(Mat Kgg);
-		void  CreateKMatrixMelting(Mat Kgg);
-		void  CreatePVectorThermalShelf( Vec pg);
-		void  CreatePVectorThermalSheet( Vec pg);
-		void  CreateKMatrixPrognostic(Mat Kgg);
-		void  CreatePVectorPrognostic(Vec pg);
-		void  CreateKMatrixPrognostic2(Mat Kgg);
-		void  CreatePVectorPrognostic2(Vec pg);
-		void  CreateKMatrixBalancedthickness(Mat Kgg);
-		void  CreatePVectorBalancedthickness(Vec pg);
-		void  CreateKMatrixBalancedthickness2(Mat Kgg);
-		void  CreatePVectorBalancedthickness2(Vec pg);
-		void  CreateKMatrixBalancedvelocities(Mat Kgg);
-		void  CreatePVectorBalancedvelocities(Vec pg);
-		double MassFlux(double* segment);
-		double GetArea(void);
-		double GetAreaCoordinate(double x, double y, int which_one);
-		void  PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
-		void  PatchFill(int* pcount, Patch* patch);
-		void  MinVel(double* pminvel, bool process_units);
-		void  MaxVel(double* pmaxvel, bool process_units);
-		void  MinVx(double* pminvx, bool process_units);
-		void  MaxVx(double* pmaxvx, bool process_units);
-		void  MaxAbsVx(double* pmaxabsvx, bool process_units);
-		void  MinVy(double* pminvy, bool process_units);
-		void  MaxVy(double* pmaxvy, bool process_units);
-		void  MaxAbsVy(double* pmaxabsvy, bool process_units);
-		void  MinVz(double* pminvz, bool process_units);
-		void  MaxVz(double* pmaxvz, bool process_units);
-		void  MaxAbsVz(double* pmaxabsvz, bool process_units);
-		void  InputDuplicate(int original_enum,int new_enum);
-		void  InputScale(int enum_type,double scale_factor);
-		void  InputAXPY(int YEnum, double scalar, int XEnum);
-		void  InputConvergence(int* pconverged,double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
-		void  InputControlConstrain(int control_type,double cm_min, double cm_max);
-		void  GetVectorFromInputs(Vec vector,int NameEnum);
-
-
+		void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
+		void   UpdateGeometry(void);
+		/*}}}*/
+		/*Tria specific routines:{{{1*/
+		void	  CreateKMatrixBalancedthickness(Mat Kgg);
+		void	  CreateKMatrixBalancedthickness2(Mat Kgg);
+		void	  CreateKMatrixBalancedvelocities(Mat Kgg);
+		void	  CreateKMatrixDiagnosticHoriz(Mat Kgg);
+		void	  CreateKMatrixDiagnosticHorizFriction(Mat Kgg);
+		void	  CreateKMatrixDiagnosticHutter(Mat Kgg);
+		void	  CreateKMatrixDiagnosticSurfaceVert(Mat Kgg);
+		void	  CreateKMatrixMelting(Mat Kgg);
+		void	  CreateKMatrixPrognostic(Mat Kgg);
+		void	  CreateKMatrixPrognostic2(Mat Kgg);
+		void	  CreateKMatrixSlopeCompute(Mat Kgg);
+		void	  CreateKMatrixThermal(Mat Kgg);
+		void	  CreatePVectorBalancedthickness(Vec pg);
+		void	  CreatePVectorBalancedthickness2(Vec pg);
+		void	  CreatePVectorBalancedvelocities(Vec pg);
+		void	  CreatePVectorDiagnosticBaseVert(Vec pg);
+		void	  CreatePVectorDiagnosticHoriz(Vec pg);
+		void	  CreatePVectorDiagnosticHutter(Vec pg);
+		void	  CreatePVectorPrognostic(Vec pg);
+		void	  CreatePVectorPrognostic2(Vec pg);
+		void	  CreatePVectorSlopeCompute( Vec pg);
+		void	  CreatePVectorThermalSheet( Vec pg);
+		void	  CreatePVectorThermalShelf( Vec pg);
+		double	  GetArea(void);
+		double	  GetAreaCoordinate(double x, double y, int which_one);
+		void	  GetB(double* B, double* xyz_list, double* gauss_l1l2l3);
+		void	  GetBPrime(double* Bprime, double* xyz_list, double* gauss_l1l2l3);
+		void	  GetBPrime_prog(double* Bprime_prog, double* xyz_list, double* gauss_l1l2l3);
+		void	  GetB_prog(double* B_prog, double* xyz_list, double* gauss_l1l2l3);
+		void	  GetDofList(int* doflist,int* pnumberofdofs);
+		void	  GetDofList1(int* doflist);
+		void	  GetJacobian(double* J, double* xyz_list,double* gauss_l1l2l3);
+		void	  GetJacobianDeterminant2d(double*  Jdet, double* xyz_list,double* gauss_l1l2l3);
+		void	  GetJacobianDeterminant3d(double*  Jdet, double* xyz_list,double* gauss_l1l2l3);
+		void	  GetJacobianInvert(double*  Jinv, double* xyz_list,double* gauss_l1l2l3);
+		void	  GetL(double* L, double* xyz_list, double* gauss_l1l2l3,int numdof);
+		void	  GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3);
+		void	  GetNodalFunctionsDerivatives(double* dh1dh3,double* xyz_list, double* gauss_l1l2l3);
+		void	  GetNodalFunctionsDerivativesReference(double* dl1dl3,double* gauss_l1l2l3);
+		void	  GetParameterDerivativeValue(double* p, double* plist,double* xyz_list, double* gauss_l1l2l3);
+		void	  GetParameterValue(double* pp, double* plist, double* gauss_l1l2l3);
+		void	  GetSolutionFromInputsDiagnosticHoriz(Vec solution);
+		void	  GradjDragStokes(Vec gradient);
+		bool	  IsInput(int name);
+		void	  SetClone(int* minranks);
+		void*	  SpawnBeam(int g0, int g1);
+		void*	  SpawnSing(int g0);
+		void	  SurfaceNormal(double* surface_normal, double xyz_list[3][3]);
 		/*}}}*/
 
