Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/BoolInput.h	(revision 12285)
@@ -40,4 +40,5 @@
 		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
 		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+		Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
 		void Configure(Parameters* parameters);
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.cpp	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.cpp	(revision 12285)
@@ -375,7 +375,9 @@
 	Input* newvalues=NULL;
 
-	newvalues=this->values->PointwiseMin(maxvalues);
+	newvalues=this->values->PointwiseMin(maxvalues); /*compare input to maxvalues and retain pointwise minimum*/
 	delete values; this->values=newvalues;
 	newvalues=this->values->PointwiseMax(minvalues);
+	delete values; this->values=newvalues;
+	newvalues=this->values->PointwiseThresh(threshvalues,minvalues);
 	delete values; this->values=newvalues;
 }/*}}}*/
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/ControlInput.h	(revision 12285)
@@ -45,4 +45,5 @@
 		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
 		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+		Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DatasetInput.h	(revision 12285)
@@ -40,4 +40,5 @@
 		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
 		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+		Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time){_error_("not implemented yet");};
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/DoubleInput.h	(revision 12285)
@@ -39,4 +39,5 @@
 		Input* PointwiseMin(Input* inputB);
 		Input* PointwiseMax(Input* inputB);
+		Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not supported yet");};
 		ElementResult* SpawnResult(int step, double time);
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/Input.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/Input.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/Input.h	(revision 12285)
@@ -63,4 +63,5 @@
 		virtual Input* PointwiseMax(Input* inputmax)=0;
 		virtual Input* PointwiseMin(Input* inputmin)=0;
+		virtual Input* PointwiseThresh(Input* inputthresh,Input* inputmin)=0;
 		virtual ElementResult* SpawnResult(int step, double time)=0;
 
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/IntInput.h	(revision 12285)
@@ -40,4 +40,5 @@
 		Input* PointwiseMin(Input* inputB){_error_("not implemented yet");};
 		Input* PointwiseMax(Input* inputB){_error_("not implemented yet");};
+		Input* PointwiseThresh(Input* inputB,Input* inputC){_error_("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.cpp	(revision 12285)
@@ -609,4 +609,40 @@
 }
 /*}}}*/
+/*FUNCTION PentaP1Input::PointwiseThresh{{{1*/
+Input* PentaP1Input::PointwiseThresh(Input* inputB,Input* inputC){
+
+	/*Ouput*/
+	PentaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	PentaP1Input *xinputB     = NULL;
+	PentaP1Input *xinputC     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 6;
+	double            threshvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(PentaP1Input*)inputB;
+
+	/*Check that inputB is of the same type*/
+	if (inputC->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputC is of type %s",EnumToStringx(inputC->ObjectEnum()));
+	xinputC=(PentaP1Input*)inputC;
+
+	/*Create point wise thresh*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] < xinputB->values[i]) threshvalues[i]=xinputC->values[i];
+		else threshvalues[i]=this->values[i];
+	}
+
+	/*Create new Penta vertex input (copy of current input)*/
+	outinput=new PentaP1Input(this->enum_type,&threshvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
 /*FUNCTION PentaP1Input::GetVectorFromInputs{{{1*/
 void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/PentaP1Input.h	(revision 12285)
@@ -40,4 +40,5 @@
 		Input* PointwiseMin(Input* inputB);
 		Input* PointwiseMax(Input* inputB);
+		Input* PointwiseThresh(Input* inputB,Input* inputC);
 		ElementResult* SpawnResult(int step, double time);
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TransientInput.h	(revision 12285)
@@ -43,4 +43,5 @@
 		Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");};
 		Input* PointwiseMax(Input* forcingB){_error_("not implemented yet");};
+		Input* PointwiseThresh(Input* forcingB,Input* forcingC){_error_("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
 		void Configure(Parameters* parameters);
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.cpp
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.cpp	(revision 12285)
@@ -364,5 +364,5 @@
 	int               i;
 	TriaP1Input *xinputB     = NULL;
-	int               B_numvalues;
+	int               B_numvalues; /* doesn't look like this is used */
 	const int         numnodes    = 3;
 	double            minvalues[numnodes];
@@ -395,5 +395,5 @@
 	int               i;
 	TriaP1Input *xinputB     = NULL;
-	int               B_numvalues;
+	int               B_numvalues; /* doesn't look like this is used */
 	const int         numnodes    = 3;
 	double            maxvalues[numnodes];
@@ -417,4 +417,41 @@
 }
 /*}}}*/
+/*FUNCTION TriaP1Input::PointwiseThresh{{{1*/
+Input* TriaP1Input::PointwiseThresh(Input* inputB, Input* inputC){
+	/*pointwise comparison to inputB.  If less than inputB, set nodal output to input C*/
+
+	/*Ouput*/
+	TriaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	TriaP1Input *xinputB     = NULL;
+	TriaP1Input *xinputC     = NULL;
+	int               B_numvalues; /* doesn't look like this is used */
+	const int         numnodes    = 3;
+	double            threshvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(TriaP1Input*)inputB;
+
+	/*Check that inputC is of the same type*/
+	if (inputC->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputC is of type %s",EnumToStringx(inputC->ObjectEnum()));
+	xinputC=(TriaP1Input*)inputC;
+
+	/*Create point wise thresh*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] < xinputB->values[i]) threshvalues[i]=xinputC->values[i];
+		else threshvalues[i]=this->values[i];
+	}
+
+	/*Create new Tria vertex input (copy of current input)*/
+	outinput=new TriaP1Input(this->enum_type,&threshvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
 /*FUNCTION TriaP1Input::Configure{{{1*/
 void TriaP1Input::Configure(Parameters* parameters){
Index: /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.h
===================================================================
--- /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.h	(revision 12284)
+++ /issm/branches/trunk-jpl-damage/src/c/objects/Inputs/TriaP1Input.h	(revision 12285)
@@ -40,4 +40,5 @@
 		Input* PointwiseMin(Input* inputB);
 		Input* PointwiseMax(Input* inputB);
+		Input* PointwiseThresh(Input* inputB, Input* inputC);
 		ElementResult* SpawnResult(int step, double time);
 		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
