Index: /issm/trunk-jpl/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 20197)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 20198)
@@ -1953,95 +1953,65 @@
 void       Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int* parray_size, int output_enum){/*{{{*/
 
+	/*Some intputs need to be computed, even if they are already in inputs, they might not be up to date!*/
+	switch(output_enum){
+		case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
+		case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
+		case StressTensorxxEnum: 
+		case StressTensorxyEnum: 
+		case StressTensorxzEnum: 
+		case StressTensoryyEnum: 
+		case StressTensoryzEnum: 
+		case StressTensorzzEnum: this->ComputeStressTensor(); break;
+		case StrainRatexxEnum:
+		case StrainRatexyEnum:
+		case StrainRatexzEnum:
+		case StrainRateyyEnum:
+		case StrainRateyzEnum:
+		case StrainRatezzEnum:
+		case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
+		case DeviatoricStressxxEnum: 
+		case DeviatoricStressxyEnum: 
+		case DeviatoricStressxzEnum: 
+		case DeviatoricStressyyEnum: 
+		case DeviatoricStressyzEnum: 
+		case DeviatoricStresszzEnum: 
+		case DeviatoricStresseffectiveEnum: this->ComputeDeviatoricStressTensor(); break;
+		case SigmaNNEnum: this->ComputeSigmaNN(); break;
+		case NewDamageEnum: this->ComputeNewDamage(); break;
+		case StressIntensityFactorEnum: this->StressIntensityFactor(); break;
+		case CalvingratexEnum:
+		case CalvingrateyEnum:
+		case CalvingCalvingrateEnum:
+			this->StrainRateparallel();
+			this->StrainRateperpendicular();
+			int calvinglaw;
+			this->FindParam(&calvinglaw,CalvingLawEnum);
+			switch(calvinglaw){
+				case DefaultCalvingEnum:
+					//do nothing
+					break;
+				case CalvingLevermannEnum:
+					this->CalvingRateLevermann();
+					break;
+				case CalvingPiEnum:
+					this->CalvingRatePi();
+					break;
+				default:
+					_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+			}
+			break;
+		case StrainRateparallelEnum: this->StrainRateparallel(); break;
+		case StrainRateperpendicularEnum: this->StrainRateperpendicular(); break;
+		default:
+													 /*Nothing to do*/
+	}
+
+	/*Find input*/
 	Input* input=this->inputs->GetInput(output_enum);
 
 	/*If this input is not already in Inputs, maybe it needs to be computed?*/
-	if(!input){
-		switch(output_enum){
-			case ViscousHeatingEnum:
-				this->ViscousHeatingCreateInput();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StressMaxPrincipalEnum:
-				this->StressMaxPrincipalCreateInput();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StressTensorxxEnum: 
-			case StressTensorxyEnum: 
-			case StressTensorxzEnum: 
-			case StressTensoryyEnum: 
-			case StressTensoryzEnum: 
-			case StressTensorzzEnum: 
-				this->ComputeStressTensor();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StrainRatexxEnum:
-			case StrainRatexyEnum:
-			case StrainRatexzEnum:
-			case StrainRateyyEnum:
-			case StrainRateyzEnum:
-			case StrainRatezzEnum:
-			case StrainRateeffectiveEnum:
-				this->ComputeStrainRate();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case DeviatoricStressxxEnum: 
-			case DeviatoricStressxyEnum: 
-			case DeviatoricStressxzEnum: 
-			case DeviatoricStressyyEnum: 
-			case DeviatoricStressyzEnum: 
-			case DeviatoricStresszzEnum: 
-			case DeviatoricStresseffectiveEnum: 
-				this->ComputeDeviatoricStressTensor();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case SigmaNNEnum: 
-				this->ComputeSigmaNN();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case NewDamageEnum:
-				this->ComputeNewDamage();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StressIntensityFactorEnum:
-				this->StressIntensityFactor();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case CalvingratexEnum:
-			case CalvingrateyEnum:
-			case CalvingCalvingrateEnum:
-				this->StrainRateparallel();
-				this->StrainRateperpendicular();
-				int calvinglaw;
-				this->FindParam(&calvinglaw,CalvingLawEnum);
-					switch(calvinglaw){
-						case DefaultCalvingEnum:
-							//do nothing
-							break;
-						case CalvingLevermannEnum:
-							this->CalvingRateLevermann();
-							break;
-						case CalvingPiEnum:
-							this->CalvingRatePi();
-							break;
-						default:
-							_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
-				}
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StrainRateparallelEnum:
-				this->StrainRateparallel();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			case StrainRateperpendicularEnum:
-				this->StrainRateperpendicular();
-				input=this->inputs->GetInput(output_enum);
-				break;
-			default:
-				_error_("input "<<EnumToStringx(output_enum)<<" not found in element");
-		}
-	}
+	if(!input) _error_("input "<<EnumToStringx(output_enum)<<" not found in element");
 
 	/*Assign output pointer*/
-	_assert_(input);
 	*pinterpolation   = input->GetResultInterpolation();
 	*pnodesperelement = input->GetResultNumberOfNodes();
