Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 988)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp	(revision 989)
@@ -192,4 +192,5 @@
 	ModelFetchData((void**)&model->elementonbed,NULL,NULL,model_handle,"elementonbed","Matrix","Mat");
 	ModelFetchData((void**)&model->elementonsurface,NULL,NULL,model_handle,"elementonsurface","Matrix","Mat");
+	ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat");
 	ModelFetchData((void**)&model->geothermalflux,NULL,NULL,model_handle,"geothermalflux","Matrix","Mat");
 	ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
@@ -230,5 +231,12 @@
 		penta_meanvel=model->meanvel;
 		penta_epsvel=model->epsvel;
-		penta_collapse=0;
+
+		/*We need the field collapse for transient, so that we can use compute B with the average temperature*/
+		if (*(model->elements_type+2*i+0)==MacAyealEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.
+			penta_collapse=1;
+		}
+		else{
+			penta_collapse=0;
+		}
 
 
@@ -290,4 +298,5 @@
 	xfree((void**)&model->elementonbed);
 	xfree((void**)&model->elementonsurface);
+	xfree((void**)&model->elements_type);
 	xfree((void**)&model->geothermalflux);
 	xfree((void**)&model->n);
