Index: /issm/trunk-jpl/src/c/classes/Elements/SegRef.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/SegRef.cpp	(revision 16376)
+++ /issm/trunk-jpl/src/c/classes/Elements/SegRef.cpp	(revision 16377)
@@ -48,3 +48,57 @@
 
 /*Reference Element numerics*/
+/*FUNCTION SegRef::GetNodalFunctions{{{*/
+void SegRef::GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss){
+	/*This routine returns the values of the nodal functions  at the gaussian point.*/
 
+	_assert_(basis);
+
+	switch(this->element_type){
+		case P1Enum: case P1DGEnum:
+			basis[0]=(1.-gauss->coord1)/2.;
+			basis[1]=(1.+gauss->coord1)/2.;
+			return;
+		default:
+			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
+	}
+}
+/*}}}*/
+/*FUNCTION SegRef::GetJacobian{{{*/
+void SegRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussSeg* gauss){
+	/*The Jacobian is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size 1*/
+
+	IssmDouble x1=xyz_list[3*0+0];
+	IssmDouble y1=xyz_list[3*0+1];
+	IssmDouble z1=xyz_list[3*0+2];
+	IssmDouble x2=xyz_list[3*1+0];
+	IssmDouble y2=xyz_list[3*1+1];
+	IssmDouble z2=xyz_list[3*1+2];
+
+	*Jdet=.5*sqrt(pow(x2-x1,2) + pow(y2-y1,2) + pow(z2-z1,2));
+	if(*Jdet<0) _error_("negative jacobian determinant!");
+}
+/*}}}*/
+/*FUNCTION SegRef::GetJacobianDeterminant{{{*/
+void SegRef::GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussSeg* gauss){
+	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
+
+	/*Call Jacobian routine to get the jacobian:*/
+	GetJacobian(&Jdet, xyz_list, gauss);
+
+}
+/*}}}*/
+/*FUNCTION SegRef::GetJacobianInvert {{{*/
+void SegRef::GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussSeg* gauss){
+
+	/*Jacobian*/
+	IssmDouble J;
+
+	/*Call Jacobian routine to get the jacobian:*/
+	GetJacobian(&J, xyz_list, gauss);
+
+	/*Invert Jacobian matrix: */
+	*Jinv = 1./J;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/SegRef.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/SegRef.h	(revision 16376)
+++ /issm/trunk-jpl/src/c/classes/Elements/SegRef.h	(revision 16377)
@@ -22,4 +22,8 @@
 		/*Management*/
 		void SetElementType(int type,int type_counter);
+		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussSeg* gauss);
+		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussSeg* gauss);
+		void GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussSeg* gauss);
+		void GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss);
 };
 #endif
