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

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


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

Added:
   long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.h
Modified:
   long/3D/Gale/trunk/src/StgFEM/
   long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.c
Log:
 r782 at earth:  boo | 2006-10-11 13:49:34 -0700
  r756 at earth (orig r635):  JulianGiordani | 2006-09-03 18:39:29 -0700
  
  Making changes to solA.c to help benchmark the REP method. Also adding .h file so I can reference analytic functions from other .c
  
 



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

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.c	2006-10-11 20:50:08 UTC (rev 4895)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.c	2006-10-11 20:50:12 UTC (rev 4896)
@@ -44,16 +44,17 @@
 #include <mpi.h>
 #include <StGermain/StGermain.h>
 #include <StG_FEM/StG_FEM.h>
+#include "solA.h"
 
 const Type Velic_solA_Type = "Velic_solA";
-
+/*
 typedef struct {
 	__AnalyticSolution
 	double sigma;
 	double Z;
 } Velic_solA;
+*/
 
-
 double Calculate__C1 ( Velic_solA* self, double x, double z, double y, double n ) {
 	double t1, t3, t4, t5, t10, t17, t21, t24;
 	double sigma = self->sigma;
@@ -246,23 +247,25 @@
 	double n    = 1;
 	double kn   = n * M_PI;
 	double pp, txx, txz, tzz;
-	double ss_zzz, ss_z, ss;
+	double ss_zz, ss_z, ss;
+	double mean;
 
-	ss_zzz = Calculate_ss_zzz( self, x, z, y, n );
+	ss_zz = Calculate_ss_zz( self, x, z, y, n );
 	ss_z   = Calculate_ss_z( self, x, z, y, n );
 	ss     = Calculate_ss( self, x, z, y, n );
 	
-	pp  = self->Z*(ss_zzz-kn*kn*ss_z)/kn;
+	pp  = self->Z*(ss_zz-kn*kn*ss_z)/kn;
 	tzz = 2.0*kn*ss_z - pp;
-	txz = -self->Z*(ss_zzz + kn*kn*ss);
+	txz = -self->Z*(ss_zz + kn*kn*ss);
 	txx = -2.0*self->Z*kn*ss_z - pp;
 
 	tzz *= cos(n*M_PI*x);
 	txz *= sin(n*M_PI*x);
 	txx *= cos(n*M_PI*x);
 
-	stress[ 0 ] = txx;
-	stress[ 1 ] = tzz;
+	mean = 0.5 * ( txx + tzz );
+	stress[ 0 ] = txx - mean;
+	stress[ 1 ] = tzz - mean;
 	if ( analyticFeVariable->dim == 2 ) {
 		stress[ 2 ] = txz;
 	}
@@ -313,6 +316,7 @@
 	FeVariable*              stressField;
 	FeVariable*              strainRateField;
 	FeVariable*              recoverdStrainRateField;
+	FeVariable*              recoveredStressField;
 
 	/* Construct Parent */
 	_AnalyticSolution_Construct( self, cf );
@@ -337,6 +341,11 @@
 	if ( recoverdStrainRateField )
 		AnalyticSolution_CreateAnalyticSymmetricTensorField( self, recoverdStrainRateField, Velic_solA_StrainRateFunction );
 
+	recoveredStressField = Stg_ComponentFactory_ConstructByName( cf, "recoveredStress", FeVariable, True );
+	if ( recoveredStressField )
+		AnalyticSolution_CreateAnalyticSymmetricTensorField( self, recoveredStressField, Velic_solA_StressFunction );
+	
+
 	self->sigma = Stg_ComponentFactory_GetRootDictDouble( cf, "sigma", 1.0 );
 	self->Z = Stg_ComponentFactory_GetRootDictDouble( cf, "Z", 1.0 );
 }

Added: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.h	2006-10-11 20:50:08 UTC (rev 4895)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solA/solA.h	2006-10-11 20:50:12 UTC (rev 4896)
@@ -0,0 +1,17 @@
+#ifndef __StG_FEM_Velic_solA_h__
+#define __StG_FEM_Velic_solA_h__
+
+	extern const Type Velic_solA_Type;
+
+	typedef struct {
+		__AnalyticSolution
+		double sigma;
+		double Z;
+	} Velic_solA;
+
+	void Velic_solA_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure );
+	void Velic_solA_VelocityFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* velocity );
+	void Velic_solA_StressFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* stress );
+	void Velic_solA_StrainRateFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* strainRate );
+
+#endif



More information about the cig-commits mailing list