Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 9126)
+++ /issm/trunk/src/c/Makefile.am	(revision 9127)
@@ -668,4 +668,7 @@
 					./modules/RequestedOutputsx/RequestedOutputsx.h\
 					./modules/RequestedOutputsx/RequestedOutputsx.cpp\
+					./modules/ResetConstraintsx/ResetConstraintsx.h\
+					./modules/ResetConstraintsx/ResetConstraintsx.cpp\
+					./modules/ResetConstraintsx/ThermalConstraintsReset.cpp\
 					./modules/Scotchx/Scotchx.cpp\
 					./modules/Scotchx/Scotchx.h\
@@ -1345,4 +1348,7 @@
 					./modules/RequestedOutputsx/RequestedOutputsx.h\
 					./modules/RequestedOutputsx/RequestedOutputsx.cpp\
+					./modules/ResetConstraintsx/ResetConstraintsx.h\
+					./modules/ResetConstraintsx/ResetConstraintsx.cpp\
+					./modules/ResetConstraintsx/ThermalConstraintsReset.cpp\
 					./modules/Solverx/Solverx.cpp\
 					./modules/Solverx/Solverx.h\
Index: /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h
===================================================================
--- /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 9126)
+++ /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 9127)
@@ -11,8 +11,6 @@
 /*melting: */
 void  ThermalConstraintsState(Loads* loads, int* pconverged, int* pnum_unstable_constraints,int analysis_type);
-int   ThermalIsPresent(Loads* loads,int analysis_type);
 
 /*rifts module: */
-int    RiftIsPresent(Loads* loads,int analysis_type);
 void   RiftConstraintsState(int* pconverged, int* pnum_unstable_constraints,Loads* loads,int min_mechanical_constraints,int analysis_type);
 void   RiftConstrain(int* pnum_unstable_constraints,Loads* loads,int analysis_type);
Index: /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.h
===================================================================
--- /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.h	(revision 9126)
+++ /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.h	(revision 9127)
@@ -10,4 +10,6 @@
 
 /* local prototypes: */
+int   ThermalIsPresent(Loads* loads,int analysis_type);
+int    RiftIsPresent(Loads* loads,int analysis_type);
 void ConstraintsStatex(int* pconverged, int* pnum_unstable_constraints, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials,  Parameters* parameters); 
 
Index: /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 9127)
+++ /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 9127)
@@ -0,0 +1,38 @@
+/*!\file ResetConstraintsx
+ * \brief: reset thermal penalties
+ */
+
+#include "./ResetConstraintsx.h"
+#include "../modules.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void ResetConstraintsx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials,  Parameters* parameters){
+
+	int i;
+
+	extern int num_procs;
+	extern int my_rank;
+
+	/*output: */
+	int analysis_type;
+
+	/*Display message*/
+	_printf_(VerboseModule(),"   Resetting penalties\n");
+
+	/*recover parameters: */
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	/*Do we have penalties linked to rifts? In this case, run our special rifts penalty 
+	 * management routine, otherwise, skip : */
+	if (RiftIsPresent(loads,analysis_type)){
+		_error_("rift constraints reset not supported yet!");
+	}
+	else if(ThermalIsPresent(loads,analysis_type)){
+		ThermalConstraintsReset(loads,analysis_type);
+	}
+	else{ /*Do nothing, no constraints management!:*/}
+
+}
Index: /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h
===================================================================
--- /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 9127)
+++ /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 9127)
@@ -0,0 +1,16 @@
+/*!\file:  ResetConstraintsx.h
+ * \brief header file for penalty constraints module
+ */ 
+
+#ifndef _RESETCONSTRAINTSX_H
+#define _RESETCONSTRAINTSX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void  ThermalConstraintsReset(Loads* loads, int configuration_type);
+void ResetConstraintsx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials,  Parameters* parameters); 
+
+#endif  /* _RESETCONSTRAINTSX_H */
+
Index: /issm/trunk/src/c/modules/ResetConstraintsx/ThermalConstraintsReset.cpp
===================================================================
--- /issm/trunk/src/c/modules/ResetConstraintsx/ThermalConstraintsReset.cpp	(revision 9127)
+++ /issm/trunk/src/c/modules/ResetConstraintsx/ThermalConstraintsReset.cpp	(revision 9127)
@@ -0,0 +1,29 @@
+/*!\file:  ThermalConstraintsState.cpp
+ * \brief  melting rate constraints
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./ResetConstraintsx.h"
+
+void  ThermalConstraintsReset(Loads* loads, int configuration_type){
+
+	int i;
+
+	/*Enforce constraints: */
+	for(i=0;i<loads->Size();i++){
+		Object* object=(Object*)loads->GetObjectByOffset(i);
+		Load* load=(Load*)object;
+		if(load->InAnalysis(configuration_type)){
+			if(object->Enum()==PengridEnum){
+
+				Pengrid* pengrid=(Pengrid*)object;
+				pengrid->ResetConstraint();
+			}
+		}
+	}
+}
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 9126)
+++ /issm/trunk/src/c/modules/modules.h	(revision 9127)
@@ -92,4 +92,5 @@
 #include "./Reducevectorgtofx/Reducevectorgtofx.h"
 #include "./RequestedOutputsx/RequestedOutputsx.h"
+#include "./ResetConstraintsx/ResetConstraintsx.h"
 #include "./Responsex/Responsex.h"
 #include "./RheologyBbarx/RheologyBbarx.h"
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9126)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 9127)
@@ -678,2 +678,8 @@
 }
 /*}}}1*/
+/*FUNCTION Pengrid::ResetConstraint {{{1*/
+void  Pengrid::ResetConstraint(void){
+	active=0;
+	zigzag_counter=0;
+}
+/*}}}1*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 9126)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 9127)
@@ -87,4 +87,5 @@
 		void  ConstraintActivateThermal(int* punstable);
 		void  UpdateInputs(double* solution);
+		void  ResetConstraint(void);
 		/*}}}*/
 
Index: /issm/trunk/src/c/solutions/thermal_core.cpp
===================================================================
--- /issm/trunk/src/c/solutions/thermal_core.cpp	(revision 9126)
+++ /issm/trunk/src/c/solutions/thermal_core.cpp	(revision 9127)
@@ -43,4 +43,6 @@
 	if(qmu_analysis){
 		InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuTemperatureEnum,TemperatureEnum);
+		InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuTemperatureEnum,TemperaturePicardEnum);
+		ResetConstraintsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
 	}
 
