Index: /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 17141)
+++ /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 17142)
@@ -320,38 +320,9 @@
 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
 
-	switch(this->element_type){
-		case P1P1Enum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = P1P1Enum;
-			return;
-		case P1P1GLSEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = P1P1GLSEnum;
-			return;
-		case MINIcondensedEnum:
-			this->element_type = P1bubbleEnum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = MINIcondensedEnum;
-			return;
-		case MINIEnum:
-			this->element_type = P1bubbleEnum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = MINIEnum;
-			return;
-		case TaylorHoodEnum:
-			this->element_type = P2Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = TaylorHoodEnum;
-			return;
-		case OneLayerP4zEnum:
-			this->element_type = P2xP4Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = OneLayerP4zEnum;
-			return;
-		default:
-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
-	}
+	int save = this->element_type;
+	this->element_type = VelocityInterpolation();
+	this->GetNodalFunctions(basis,gauss);
+	this->element_type = save;
+
 }
 /*}}}*/
@@ -360,38 +331,9 @@
 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
 
-	switch(this->element_type){
-		case P1P1Enum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = P1P1Enum;
-			return;
-		case P1P1GLSEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = P1P1GLSEnum;
-			return;
-		case MINIcondensedEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = MINIcondensedEnum;
-			return;
-		case MINIEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = MINIEnum;
-			return;
-		case TaylorHoodEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = TaylorHoodEnum;
-			return;
-		case OneLayerP4zEnum:
-			this->element_type = P1xP3Enum;
-			this->GetNodalFunctions(basis,gauss);
-			this->element_type = OneLayerP4zEnum;
-			return;
-		default:
-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
-	}
+	int save = this->element_type;
+	this->element_type = PressureInterpolation();
+	this->GetNodalFunctions(basis,gauss);
+	this->element_type = save;
+
 }
 /*}}}*/
@@ -433,71 +375,19 @@
 /*FUNCTION PentaRef::GetNodalFunctionsDerivativesVelocity{{{*/
 void PentaRef::GetNodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
-	switch(this->element_type){
-		case P1P1Enum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = P1P1Enum;
-			return;
-		case P1P1GLSEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = P1P1GLSEnum;
-			return;
-		case MINIcondensedEnum:
-			this->element_type = P1bubbleEnum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = MINIcondensedEnum;
-			return;
-		case MINIEnum:
-			this->element_type = P1bubbleEnum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = MINIEnum;
-			return;
-		case TaylorHoodEnum:
-			this->element_type = P2Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = TaylorHoodEnum;
-			return;
-		case OneLayerP4zEnum:
-			this->element_type = P2xP4Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = OneLayerP4zEnum;
-			return;
-		default:
-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
-	}
+
+	int save = this->element_type;
+	this->element_type = VelocityInterpolation();
+	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+	this->element_type = save;
+
 }
 /*}}}*/
 /*FUNCTION PentaRef::GetNodalFunctionsDerivativesPressure{{{*/
 void PentaRef::GetNodalFunctionsDerivativesPressure(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){
-	switch(this->element_type){
-		case P1P1Enum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = P1P1Enum;
-			return;
-		case P1P1GLSEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = P1P1GLSEnum;
-			return;
-		case MINIcondensedEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = MINIcondensedEnum;
-			return;
-		case MINIEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = MINIEnum;
-			return;
-		case TaylorHoodEnum:
-			this->element_type = P1Enum;
-			this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-			this->element_type = TaylorHoodEnum;
-			return;
-		default:
-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
-	}
+
+	int save = this->element_type;
+	this->element_type = PressureInterpolation();
+	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+	this->element_type = save;
 }
 /*}}}*/
