[cig-commits] r4909 - in long/3D/Gale/trunk/src/StgFEM: . plugins/VelicAnalyticSolutions/Velic_solCx

walter at geodynamics.org walter at geodynamics.org
Wed Oct 11 13:50:43 PDT 2006


Author: walter
Date: 2006-10-11 13:50:42 -0700 (Wed, 11 Oct 2006)
New Revision: 4909

Modified:
   long/3D/Gale/trunk/src/StgFEM/
   long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/Analytic_solCx.c
   long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/solCx.c
Log:
 r795 at earth:  boo | 2006-10-11 13:49:39 -0700
  r769 at earth (orig r648):  JulianGiordani | 2006-10-04 20:38:11 -0700
  
  * All of the interface functions for the analytic solutions will need to be updated for the name change of the recovered stress field. So i'm making the change to Velic_solCx/Analytic_solCx.c. (This seems a bit 'hardcoded', i'll try figure out a better solution later)
  * Cleaning up the original solCx.c for strainRate; and adding a sanity check in there that the analytic pressure corressponds to the pressure value calculated from the stress tensor.
  
 



Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
   - 38867592-cf10-0410-9e16-a142ea72ac34:/cig:794
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:647
   + 38867592-cf10-0410-9e16-a142ea72ac34:/cig:795
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:648

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/Analytic_solCx.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/Analytic_solCx.c	2006-10-11 20:50:39 UTC (rev 4908)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/Analytic_solCx.c	2006-10-11 20:50:42 UTC (rev 4909)
@@ -74,10 +74,12 @@
 	Velic_solCx* self = (Velic_solCx*) analyticSolution;
 	FeVariable*              velocityField;
 	FeVariable*              pressureField;
+	FeVariable*              recoveredPressureField;
 	FeVariable*              stressField;
 	FeVariable*              strainRateField;
 	FeVariable*              recoverdStrainRateField;
 	FeVariable*              recoveredStressField;
+	Bool                     correctInput = True;
 
 	/* Construct Parent */
 	_AnalyticSolution_Construct( self, cf );
@@ -102,9 +104,12 @@
 	if ( recoverdStrainRateField )
 		AnalyticSolution_CreateAnalyticSymmetricTensorField( self, recoverdStrainRateField, Velic_solCx_StrainRateFunction );
 
-	recoveredStressField = Stg_ComponentFactory_ConstructByName( cf, "recoveredStress", FeVariable, False );
+	recoveredStressField = Stg_ComponentFactory_ConstructByName( cf, "recoveredStressField", FeVariable, False );
 	if ( recoveredStressField )
 		AnalyticSolution_CreateAnalyticSymmetricTensorField( self, recoveredStressField, Velic_solCx_StressFunction );
+	recoveredPressureField = Stg_ComponentFactory_ConstructByName( cf, "recoveredPressureField", FeVariable, False );
+	if ( recoveredPressureField )
+		AnalyticSolution_CreateAnalyticField( self, recoveredPressureField, Velic_solCx_PressureFunction );
 	
 
 //	self->sigma = Stg_ComponentFactory_GetRootDictDouble( cf, "solCx_sigma", 1.0 );
@@ -112,6 +117,13 @@
 	self->etaB = Stg_ComponentFactory_GetRootDictDouble( cf, "solCx_etaB", 2.0 );
 	self->xc = Stg_ComponentFactory_GetRootDictDouble( cf, "solCx_xc", 0.25 );
 	self->n = Stg_ComponentFactory_GetRootDictInt( cf, "solCx_n", 1 );
+
+	if( (self->xc < 0.0) || self->xc > 1.0 ) 
+	      correctInput = False;	
+
+	Journal_Firewall( correctInput,  Journal_Register( Error_Type, "solCx_ErrorStream") ,
+			"Error: In func %s. The input parameters you supplied to the analytic Solution are incorrect.\nValid range of xc values is [0,1]. Currently it is %f\n", __func__, self->xc );
+	
 }
 
 void* _Velic_solCx_DefaultNew( Name name ) {

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/solCx.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/solCx.c	2006-10-11 20:50:39 UTC (rev 4908)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCx/solCx.c	2006-10-11 20:50:42 UTC (rev 4909)
@@ -1,6 +1,8 @@
+#include "Analytic_solCx.h"
 #include <math.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <assert.h>
 
 #define PI 3.14159265358979323846264338328
 
@@ -2309,7 +2311,7 @@
 	}
 	if( total_stress != NULL ) {
 		total_stress[0] = sum3;
-		total_stress[1] = sum6;
+		total_stress[1] = sum6; 
 		total_stress[2] = sum4;
 	}
 	if( strain_rate != NULL ) {
@@ -2321,6 +2323,10 @@
 		}
 		strain_rate[0] = (sum3+sum5)/(2.0*Z);
 		strain_rate[1] = (sum6+sum5)/(2.0*Z);
-		strain_rate[2] = (sum4+sum5)/(2.0*Z);
+		strain_rate[2] = (sum4)/(2.0*Z);
 	}
+	/* Value checks, could be cleaned up if needed. Julian Giordani 2-Oct-2006*/
+	if( fabs( sum5 - ( -0.5*(sum6+sum3) ) ) > 1e-5 ) {
+		assert(0);
+	}
 }



More information about the cig-commits mailing list