Index: issm/trunk/src/c/Makefile.am
===================================================================
--- issm/trunk/src/c/Makefile.am	(revision 4701)
+++ issm/trunk/src/c/Makefile.am	(revision 4702)
@@ -565,4 +565,6 @@
 					./modules/InputExtrudex/InputExtrudex.cpp\
 					./modules/InputExtrudex/InputExtrudex.h\
+					./modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.cpp\
+					./modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h\
 					./modules/OutputRiftsx/OutputRiftsx.h\
 					./modules/OutputRiftsx/OutputRiftsx.cpp\
@@ -1117,4 +1119,6 @@
 					./modules/InputExtrudex/InputExtrudex.cpp\
 					./modules/InputExtrudex/InputExtrudex.h\
+					./modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.cpp\
+					./modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h\
 					./modules/OutputRiftsx/OutputRiftsx.h\
 					./modules/OutputRiftsx/OutputRiftsx.cpp\
Index: issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.cpp
===================================================================
--- issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.cpp	(revision 4702)
+++ issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.cpp	(revision 4702)
@@ -0,0 +1,24 @@
+/*!\file MaterialUpdateFromTemperaturex
+ * \brief: transfer an input to the results  dataset inside the elements
+ */
+
+#include "./MaterialUpdateFromTemperaturex.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void MaterialUpdateFromTemperaturex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){
+
+	/*intermediary:*/
+	int      i;
+	Element *element = NULL;
+
+	/*Go through elemnets, and ask each element to update their material*/
+	for(i=0;i<elements->Size();i++){
+
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->MaterialUpdateFromTemperature();
+	}
+
+}
Index: issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h
===================================================================
--- issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h	(revision 4702)
+++ issm/trunk/src/c/modules/MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h	(revision 4702)
@@ -0,0 +1,14 @@
+/*!\file:  MaterialUpdateFromTemperaturex.h
+ * \brief header file for field extrusion
+ */ 
+
+#ifndef _INPUTTORESULTX_H
+#define _INPUTTORESULTX_H
+
+#include "../../Container/Container.h"
+
+/* local prototypes: */
+void MaterialUpdateFromTemperaturex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters);
+
+#endif  /* _INPUTTORESULTX_H */
+
Index: issm/trunk/src/c/modules/modules.h
===================================================================
--- issm/trunk/src/c/modules/modules.h	(revision 4701)
+++ issm/trunk/src/c/modules/modules.h	(revision 4702)
@@ -46,4 +46,5 @@
 #include "./InputUpdateFromVectorx/InputUpdateFromVectorx.h"
 #include "./MassFluxx/MassFluxx.h"
+#include "./MaterialUpdateFromTemperaturex/MaterialUpdateFromTemperaturex.h"
 #include "./MaxAbsVxx/MaxAbsVxx.h"
 #include "./MaxAbsVyx/MaxAbsVyx.h"
Index: issm/trunk/src/c/objects/Elements/Beam.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Beam.h	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Beam.h	(revision 4702)
@@ -85,9 +85,10 @@
 		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     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	   MaterialUpdateFromTemperature(void){ISSMERROR("not implemented yet");};
+		double	MassFlux(double* segment);
 		void	   MaxAbsVx(double* pmaxabsvx, bool process_units);
 		void	   MaxAbsVy(double* pmaxabsvy, bool process_units);
Index: issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Element.h	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Element.h	(revision 4702)
@@ -54,4 +54,5 @@
 		virtual void   UpdateGeometry(void)=0;
 		virtual void   InputToResult(int enum_type,int step,double time)=0;
+		virtual void   MaterialUpdateFromTemperature(void)=0;
 		virtual void   ProcessResultsUnits(void)=0;
 		virtual void   MinVel(double* pminvel, bool process_units)=0;
Index: issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4702)
@@ -1243,4 +1243,36 @@
 double Penta::MassFlux( double* segment){
 	ISSMERROR(" not supported yet!");
+}
+/*}}}*/
+/*FUNCTION Penta::MaterialUpdateFromTemperature{{{1*/
+void  Penta::MaterialUpdateFromTemperature(void){
+
+	/*Intermediaries*/
+	double Taverage;
+	double B;
+
+	/*inputs: */
+	bool   collapse;
+	Input *TempInput = NULL;
+	Input *RheologyBInput = NULL;
+
+	/*retrieve inputs :*/
+	inputs->GetParameterValue(&collapse,CollapseEnum);
+
+	if (collapse){
+		/*find temperature average*/
+		this->inputs->GetParameterAverage(&Taverage,TemperatureAverageEnum);
+	}
+	else{
+		/*find 3d temperature*/
+		this->inputs->GetParameterAverage(&Taverage,TemperatureEnum);
+	}
+
+	/*Get B from T using Paterson*/
+	B=Paterson(Taverage);
+
+	/*Add input to Matice*/
+	this->matice->inputs->AddInput(new DoubleInput(RheologyBEnum,B));
+
 }
 /*}}}*/
Index: issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.h	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Penta.h	(revision 4702)
@@ -92,4 +92,5 @@
 		void   InputScale(int enum_type,double scale_factor);
 		void   InputToResult(int enum_type,int step,double time);
+		void   MaterialUpdateFromTemperature(void);
 		double MassFlux(double* segment);
 		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
Index: issm/trunk/src/c/objects/Elements/Sing.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Sing.h	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Sing.h	(revision 4702)
@@ -89,4 +89,5 @@
 		void   InputScale(int enum_type,double scale_factor);
 		void   InputToResult(int enum_type,int step,double time);
+		void   MaterialUpdateFromTemperature(void){ISSMERROR("not implemented yet");};
 		double MassFlux(double* segment);
 		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
Index: issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.h	(revision 4701)
+++ issm/trunk/src/c/objects/Elements/Tria.h	(revision 4702)
@@ -89,4 +89,5 @@
 		void   InputScale(int enum_type,double scale_factor);
 		void   InputToResult(int enum_type,int step,double time);
+		void   MaterialUpdateFromTemperature(void){ISSMERROR("not implemented yet");};
 		double MassFlux(double* segment);
 		void   MaxAbsVx(double* pmaxabsvx, bool process_units);
Index: issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4702)
@@ -41,4 +41,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/BoolInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4702)
@@ -41,4 +41,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4702)
@@ -40,4 +40,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/Input.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/Input.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/Input.h	(revision 4702)
@@ -45,4 +45,5 @@
 		virtual Input* SpawnBeamInput(int* indices)=0;
 		virtual Input* SpawnTriaInput(int* indices)=0;
+		virtual Input* SpawnProcessedInput(double (*f)(double))=0;
 		virtual Input* PointwiseDivide(Input* inputB)=0;
 		virtual ElementResult* SpawnResult(int step, double time)=0;
Index: issm/trunk/src/c/objects/Inputs/IntInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4702)
@@ -41,4 +41,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4702)
@@ -40,4 +40,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB);
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/SingVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4702)
@@ -40,4 +40,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
Index: issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4701)
+++ issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4702)
@@ -41,4 +41,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
+		Input* SpawnProcessedInput(double (*f)(double)){ISSMERROR("not implemented yet");};
 		Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");};
 		ElementResult* SpawnResult(int step, double time);
