[cig-commits] r19049 - in long/3D/SNAC/trunk/Snac/plugins: . viscoplastic_BI

echoi at geodynamics.org echoi at geodynamics.org
Fri Oct 7 17:51:04 PDT 2011


Author: echoi
Date: 2011-10-07 17:51:03 -0700 (Fri, 07 Oct 2011)
New Revision: 19049

Added:
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Make.mm
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Makefile.def
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.c
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ViscoPlastic.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/makefile
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/types.h
   long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/units.h
Log:
A new plugin for viscoplastic rheology that uses barycentric interpolation for plastic strain mapping.
  --If the BI scheme works well, this will replace the existing viscoplastic plugin. 



Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,758 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ **
+ ** Copyright (C), 2004,
+ **       Pururav Thoutireddy, Center for Advanced Computing Research, Caltech.
+ **	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+ **	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+ **	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+ **
+ ** Authors:
+ **      Pururav Thoutireddy, Center for Advanced Computing Research, Caltech. ( puru at cacr.caltech.edu)
+ **	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+ **	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+ **	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+ **	Luc Lavier, Research Scientist, Caltech.
+ **
+ ** This program is free software; you can redistribute it and/or modify it
+ ** under the terms of the GNU General Public License as published by the
+ ** Free Software Foundation; either version 2, or (at your option) any
+ ** later version.
+ **
+ ** This program is distributed in the hope that it will be useful,
+ ** but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ** GNU General Public License for more details.
+ **
+ ** You should have received a copy of the GNU General Public License
+ ** along with this program; if not, write to the Free Software
+ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ **
+ ** $Id: Constitutive.c 3274 2007-03-27 20:25:29Z EunseoChoi $
+ **
+ **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "units.h"
+#include "types.h"
+#include "Element.h"
+#include "Constitutive.h"
+#include "Register.h"
+#include <math.h>
+#include "Snac/Temperature/Temperature.h"
+#include <string.h>
+#include <assert.h>
+
+#ifndef PI
+#ifndef M_PIl
+#ifndef M_PI
+#define PI 4.0*atan(1.0)
+#else
+#define PI M_PI
+#endif
+#else
+#define PI M_PIl
+#endif
+#endif
+
+
+void SnacViscoPlastic_Constitutive( void* _context, Element_LocalIndex element_lI ) {
+	Snac_Context* context = (Snac_Context*)_context;
+	Snac_Element* element = Snac_Element_At( context, element_lI );
+	SnacViscoPlastic_Element* viscoplasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element, SnacViscoPlastic_ElementHandle );
+	SnacTemperature_Element* temperatureElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element, SnacTemperature_ElementHandle );
+	const Snac_Material* material = &context->materialProperty[element->material_I];
+
+	/*ccccc*/
+	MeshLayout*			meshLayout = (MeshLayout*)context->meshLayout;
+	HexaMD*				decomp = (HexaMD*)meshLayout->decomp;
+	IJK				ijk;
+	Element_GlobalIndex		element_gI = _MeshDecomp_Element_LocalToGlobal1D( decomp, element_lI );
+	EntryPoint* 			temperatureEP;
+
+	RegularMeshUtils_Element_1DTo3D( decomp, element_gI, &ijk[0], &ijk[1], &ijk[2] );
+	/*ccccc*/
+
+	temperatureEP = Context_GetEntryPoint( context,	"Snac_EP_LoopElementsEnergy" );
+
+	/* If this is a ViscoPlastic material, calculate its stress. */
+	if ( material->rheology & Snac_Material_ViscoPlastic ) {
+		Tetrahedra_Index	tetra_I;
+		Node_LocalIndex         node_lI;
+
+		/* viscoplastic material properties */
+		const double			bulkm = material->lambda + 2.0f * material->mu/3.0f;
+		StressTensor*			stress;
+		StrainTensor*			strain;
+		StrainTensor*                   plasticstrainTensor;
+		StrainTensor*                   creepstrainTensor;
+		Strain		                plasticStrain;
+		ViscoPlastic*			viscosity;
+		double				straind0,straind1,straind2,stressd0,stressd1,stressd2;
+		double                          Stress0[3][3];
+		double				trace_strain;
+		double				trace_stress;
+		double				temp;
+		double				vic1;
+		double				vic2;
+		double				VolumicStress;
+		double				rviscosity=material->refvisc;
+		double                          rmu= material->mu;
+		double				srJ2;
+		double				avgTemp;
+		plModel                         yieldcriterion=material->yieldcriterion;
+
+		/* For now reference values of viscosity, second invariant of deviatoric */
+		/* strain rate and reference temperature  are being hard wired ( these specific */
+		/* values are from paper by Hall et. al., EPSL, 2003 */
+		double				rstrainrate = material->refsrate;
+		double				rTemp = material->reftemp;
+		double				H = material->activationE; // kJ/mol
+		double				srexponent = material->srexponent;
+		double				srexponent1 = material->srexponent1;
+		double				srexponent2 = material->srexponent2;
+		const double			R=8.31448;  // J/mol/K
+		/* elasto-plastic material properties */
+		double			cohesion = 0.0f;
+		double			frictionAngle = 0.0f;
+		double			dilationAngle = 0.0f;
+		double			hardening = 0.0f;
+		double			sphi=0.0;
+		double			spsi=0.0;
+		double			st=0.0;
+		double                  tolerance;
+		const double		degrad = PI / 180.0f;
+		double			totalVolume=0.0f,depls=0.0f;
+		int principal_stresses(StressTensor* stress,double sp[],double cn[3][3]);
+		unsigned int	        i;
+		double                  tmp=0.0;
+		double		        anphi=0.0,anpsi=0.0;/* for mohr-coulomb model */
+		double                  qphi=0.0,qpsi=0.0,kphi=0.0; /* for drucker-prager model */
+		const double		a1 = material->lambda + 2.0f * material->mu ;
+		const double		a2 = material->lambda ;
+		double                  J2,I1; /* Stress Invariants for drucker-prager model */
+		int                     ind=0,ite,mite;
+		int                     shearfailure,tensilefailure;
+		double                  tolerf,previousfs,previousft,palam;
+
+		/*    printf("Entered ViscoPlastic update \n"); */
+
+		/* Work out the plastic material properties of this element */
+		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+			double		        cn[3][3] = {{0.0,0.0,0.0},{0.0,0.0,0.0},{0.0,0.0,0.0}};
+			double		        s[3] = {0.0,0.0,0.0};
+			double			alam, dep0,dep1, dep2, dep3, dep01, dep02, dep12, depm;
+			double			fs,ft,fs0,ft0,aP,sP,h;
+			unsigned int		k, m, n;
+			/*ccccc*/
+
+			stress = &element->tetra[tetra_I].stress;
+			strain = &element->tetra[tetra_I].strain;
+			plasticStrain = viscoplasticElement->plasticStrain[tetra_I];
+			viscosity = &viscoplasticElement->viscosity[tetra_I];
+			plasticstrainTensor = &viscoplasticElement->plasticstrainTensor[tetra_I];
+			creepstrainTensor = &viscoplasticElement->creepstrainTensor[tetra_I];
+
+			if( context->computeThermalStress ) {
+				(*stress)[0][0] += temperatureElement->thermalStress[tetra_I];
+				(*stress)[1][1] += temperatureElement->thermalStress[tetra_I];
+				(*stress)[2][2] += temperatureElement->thermalStress[tetra_I];
+			}
+
+			/* storing original stress in local array */
+			Stress0[0][0] = (*stress)[0][0];
+			Stress0[1][1] = (*stress)[1][1];
+			Stress0[2][2] = (*stress)[2][2];
+			Stress0[0][1] = (*stress)[0][1];
+			Stress0[0][2] = (*stress)[0][2];
+			Stress0[1][2] = (*stress)[1][2];
+			trace_stress = (*stress)[0][0] + (*stress)[1][1] + (*stress)[2][2];
+			/*  trace_strain = element->tetra[tetra_I].volume/element->tetra[tetra_I].old_volume-1.0f; */
+			trace_strain = (*strain)[0][0] + (*strain)[1][1] + (*strain)[2][2];
+
+			/*     printf(" Trace strain=%g\t Trace Stress=%g\n",trace_strain,trace_stress); */
+
+			/* Deviatoric Stresses and Strains */
+			straind0 =  (*strain)[0][0] -  (trace_strain) / 3.0f;
+			straind1 =  (*strain)[1][1] -  (trace_strain) / 3.0f;
+			straind2 =  (*strain)[2][2] -  (trace_strain) / 3.0f;
+
+			stressd0 =  (*stress)[0][0] -  (trace_stress) / 3.0f;
+			stressd1 =  (*stress)[1][1] -  (trace_stress) / 3.0f;
+			stressd2 =  (*stress)[2][2] -  (trace_stress) / 3.0f;
+
+			/* compute viscosity and add thermal stress */
+			if( temperatureEP ) {
+
+				srJ2 = sqrt(fabs(straind1*straind2+straind2*straind0+straind0*straind1 -(*strain[0][1])*(*strain[0][1])-(*strain[0][2])*(*strain[0][2])-(*strain[1][2])*(*strain[1][2])))/context->dt;
+				if(srJ2 == 0.0f) srJ2 = rstrainrate; // temporary. should be vmax/length_scale
+
+				avgTemp=0.0;
+				for(node_lI=0; node_lI<4; node_lI++) {
+					Snac_Node* contributingNode = Snac_Element_Node_P(
+							context,
+							element_lI,
+							TetraToNode[tetra_I][node_lI] );
+					SnacTemperature_Node* temperatureNodeExt = ExtensionManager_Get(
+							context->mesh->nodeExtensionMgr,contributingNode,
+							SnacTemperature_NodeHandle );
+
+					avgTemp += 0.25 * temperatureNodeExt->temperature;
+					assert( !isnan(avgTemp) && !isinf(avgTemp) );
+				}
+				// Hall et. al., 2004, G3
+				(*viscosity)= rviscosity*pow((srJ2/rstrainrate),(1./srexponent-1.))
+					*exp(H/R*(1./(avgTemp+273.15)-1./(rTemp+273.15)));
+				if((*viscosity) < material->vis_min) (*viscosity) = material->vis_min;
+				if((*viscosity) > material->vis_max) (*viscosity) = material->vis_max;
+				Journal_Firewall(
+						!isnan((*viscosity)) && !isinf((*viscosity)),
+						context->snacError,
+						"rvisc=%e Erattio=%e pow(E)=%e, dT=%e exp=%e\n",
+						rviscosity,
+						(srJ2/rstrainrate),
+						pow((srJ2/rstrainrate),
+							(1./srexponent-1.)),
+						exp(H/R*(1./(avgTemp+273.15)-1./(rTemp+273.15))),
+						(1./(avgTemp+273.15)-1./(rTemp+273.15)) );
+#if 0
+				// Lavier and Buck, JGR, 2002
+				(*viscosity) = pow(rviscosity,-1.0/srexponent1)*pow(srJ2,1.0/srexponent2-1)*exp(H/R/(avgTemp+273.15));
+#endif
+			}
+			else {
+				(*viscosity) = rviscosity;
+				Journal_Firewall(
+						!isnan((*viscosity)) && !isinf((*viscosity)),
+						context->snacError,
+						"(*viscosity) is nan or inf\n" );
+			}
+
+			/* Non dimensional parameters elastic/viscous */
+			temp = rmu / (2.0f* (*viscosity)) * context->dt;
+
+			vic1 = 1.0f - temp;
+			vic2 = 1.0f / (1.0f + temp);
+			/*    printf("temp=%g\t rmu=%g\t viscosity=%g\t\n",temp,rmu,*viscosity); */
+			/*                          printf("trace_stress=%g\t trace_strain=%g\t vic1=%g\t vic2=%g\n",trace_stress,trace_strain,vic1,vic2); */
+			/* Deviatoric Stress Update */
+
+			stressd0 =  (stressd0 * vic1 + 2.0f * rmu * straind0) * vic2 ;
+			stressd1 =  (stressd1 * vic1 + 2.0f * rmu * straind1) * vic2 ;
+			stressd2 =  (stressd2 * vic1 + 2.0f * rmu * straind2) * vic2 ;
+
+			(*stress)[0][1] =((*stress)[0][1] * vic1 + 2.0f * rmu * (*strain)[0][1]) * vic2;
+			(*stress)[0][2] =((*stress)[0][2] * vic1 + 2.0f * rmu * (*strain)[0][2]) * vic2;
+			(*stress)[1][2] =((*stress)[1][2] * vic1 + 2.0f * rmu * (*strain)[1][2]) * vic2;
+
+			/* Isotropic stress is elastic,
+WARNING:volumic Strain may be better defined as
+volumique change in the mesh */
+			VolumicStress = trace_stress / 3.0f + bulkm * trace_strain;
+
+			(*stress)[0][0] = stressd0 + VolumicStress;
+			(*stress)[1][1] = stressd1 + VolumicStress;
+			(*stress)[2][2] = stressd2 + VolumicStress;
+
+			principal_stresses(stress,s,cn);
+
+			/* compute friction and dilation angles based on accumulated plastic strain in tetrahedra */
+			/* Piece-wise linear softening */
+			/* Find current properties from linear interpolation */
+#if 0
+			/*ccccc*/
+			if(material->putSeeds && context->loop <= 1) {
+				if(ijk[1] >= decomp->elementGlobal3DCounts[1]-2)
+					if(ijk[0] == decomp->elementGlobal3DCounts[0]/2 ) {
+						//if(ijk[0] >= 10 && ijk[0] <= 14 ) {
+						viscoplasticElement->plasticStrain[tetra_I] = 1.1*material->plstrain[1];
+						plasticStrain = viscoplasticElement->plasticStrain[tetra_I];
+						fprintf(stderr,"loop=%d ijk=%d %d %d aps=%e plasticE=%e\n",
+								context->loop,ijk[0],ijk[1],ijk[2],plasticStrain,
+								viscoplasticElement->plasticStrain[tetra_I]);
+					}
+					}
+				/*ccccc*/
+#endif
+				for( i = 0; i < material->nsegments; i++ ) {
+					const double pl1 = material->plstrain[i];
+					const double pl2 = material->plstrain[i+1];
+
+					if( plasticStrain >= pl1 && plasticStrain <= pl2 ) {
+						const double	tgf = (material->frictionAngle[i+1] - material->frictionAngle[i]) / (pl2 - pl1);
+						const double	tgd = (material->dilationAngle[i+1] - material->dilationAngle[i]) / (pl2 - pl1);
+						const double	tgc = (material->cohesion[i+1] - material->cohesion[i]) / (pl2 - pl1);
+
+						frictionAngle = material->frictionAngle[i] + tgf * (plasticStrain - pl1);
+						dilationAngle = material->dilationAngle[i] + tgd * (plasticStrain - pl1);
+						cohesion = material->cohesion[i] + tgc * (plasticStrain - pl1);
+						hardening = tgc;
+					}
+				}
+				if( frictionAngle > 0.0f ) {
+					st = material->ten_off;
+					if( frictionAngle > 0.0) {
+						tmp = cohesion / tan( frictionAngle * degrad);
+						if(tmp < st)st=tmp;
+					}
+				}
+				else {
+					/* frictionAngle < 0.0 violates second law of thermodynamics */
+					assert(0);
+				}
+
+				if( yieldcriterion == mohrcoulomb )
+				{
+					sphi = sin( frictionAngle * degrad );
+					spsi = sin( dilationAngle * degrad );
+					anphi = (1.0f + sphi) / (1.0f - sphi);
+					anpsi = (1.0f + spsi) / (1.0f - spsi);
+					fs = s[0] - s[2] * anphi + 2 * cohesion * sqrt( anphi );
+					ft = s[2] - st;
+					/* CHECK FOR COMPOSITE YIELD CRITERION  */
+					ind=0;
+					if( fs < 0.0f || ft > 0.0f ) {
+						ind=1;
+
+						/*! Failure: shear or tensile */
+
+						aP = sqrt( 1.0f + anphi * anphi ) + anphi;
+						sP = st * anphi - 2 * cohesion * sqrt( anphi );
+						h = s[2] - st + aP * ( s[0] - sP );
+
+						if( h < 0.0f ) {
+							/* !shear failure  */
+							alam = fs / ( a1 - a2 * anpsi + a1 * anphi * anpsi - a2 * anphi + 2.0*sqrt(anphi)*hardening );
+							s[0] -= alam * ( a1 - a2 * anpsi );
+							s[1] -= alam * a2 * ( 1.0f - anpsi );
+							s[2] -= alam * ( a2 - a1 * anpsi );
+							dep1 = alam;
+							dep2 = 0.0f;
+							dep3 = -alam * anpsi;
+						}
+						else {
+							/* tensile failure */
+							alam = ft / a1;
+							s[0] -= alam * a2;
+							s[1] -= alam * a2;
+							s[2] -= alam * a1;
+							dep1 = 0.0f;
+							dep2 = 0.0f;
+							dep3 = alam;
+						}
+					}
+					else {
+						/* ! no failure - just elastic increment */
+
+						dep1 = 0.0f;
+						dep2 = 0.0f;
+						dep3 = 0.0f;
+					}
+					if(ind)
+					{
+						/* Second invariant of accumulated plastic increment  */
+						depm = ( dep1 + dep2 + dep3 ) / 3.0f;
+						viscoplasticElement->plasticStrain[tetra_I] += sqrt( 0.5f * ((dep1-depm) * (dep1-depm) + (dep2-depm) * (dep2-depm) + (dep3-depm) * (dep3-depm) + depm*depm) );
+
+						/* Stress projection back to euclidean coordinates */
+						memset( stress, 0, sizeof((*stress)) );
+						/* Resolve back to global axes  */
+						for( m = 0; m < 3; m++ ) {
+							for( n = m; n < 3; n++ ) {
+								for( k = 0; k < 3; k++ ) {
+									(*stress)[m][n] += cn[k][m] * cn[k][n] * s[k];
+								}
+							}
+						}
+					}
+				}
+
+				if( yieldcriterion == druckerprager )
+				{
+					qphi = tan( frictionAngle * degrad);
+					qpsi = tan( dilationAngle * degrad);
+					kphi = cohesion;
+					/*    qphi = 0.5*(6*sin(frictionAngle * degrad)/(sqrt(3.)*(3.-sin(frictionAngle * degrad)))+6*sin(frictionAngle * degrad)/(sqrt(3.)*(3.+sin(frictionAngle * degrad)))); */
+					/*                              kphi =  0.5*(6*cohesion*cos(frictionAngle * degrad)/(sqrt(3.)*(3.-sin(frictionAngle * degrad)))+6*cohesion*cos(frictionAngle * degrad)/(sqrt(3.)*(3.+sin(frictionAngle * degrad)))); */
+					/*                              qpsi = 0.5*(6*sin(dilationAngle * degrad)/(sqrt(3.)*(3.-sin(dilationAngle * degrad)))+6*sin(dilationAngle * degrad)/(sqrt(3.)*(3.+sin(dilationAngle * degrad)))); */
+
+					I1 = ((*stress)[0][0]+(*stress)[1][1]+(*stress)[2][2])/3.;
+					J2 = sqrt(0.5*(stressd0*stressd0+stressd1*stressd1+stressd2*stressd2)
+							+(*stress)[0][1]*(*stress)[0][1]+(*stress)[0][2]*(*stress)[0][2]+(*stress)[1][2]*(*stress)[1][2]);
+					fs = J2 + I1 * qphi - kphi;
+					ft = I1 - st;
+
+					/* CHECK FOR COMPOSITE YIELD CRITERION  */
+					ind=0;
+					if( fs > 0.0f || ft > 0.0f )
+					{
+						fs0=fs;
+						ft0=ft;
+
+						ind=1;
+						dep0=dep1=dep2=dep01=dep02=dep12=0.0;
+						tolerance = material->constitutivetolerance;
+						if(fs > ft)
+						{
+							tolerf=tolerance*fs;
+						}
+						else
+						{
+							tolerf=tolerance*ft;
+						}
+
+						printf(" ENTERED PLASTIC UPDATE \n");
+						mite = material->maxiterations;
+						previousfs=fs;
+						previousft=ft;
+						for(ite=0;ite<mite;ite++)
+						{
+							/*! Failure: shear or tensile */
+
+							aP = sqrt( 1.0f + qphi * qphi ) - qphi;
+							sP = kphi - qphi*st;
+							h = J2 - sP - aP * ( I1 - st );
+							shearfailure=tensilefailure=0;
+							if( h > 0.0f )
+							{
+								shearfailure=1;
+								/* !shear failure  */
+								alam = fs / (bulkm*qphi*qpsi + rmu);
+								if(alam < 0.0)alam=palam*(previousfs/(previousfs-fs));
+								if(isnan(alam) || isinf(alam))printf("alam = %g \n",alam);
+								if(isnan(J2) || isinf(J2))printf("alam = %g \n",alam);
+								dep0  = alam*(0.5*stressd0/J2+qpsi/3.);
+								dep1  = alam*(0.5*stressd1/J2+qpsi/3.);
+								dep2  = alam*(0.5*stressd2/J2+qpsi/3.);
+								dep01 = alam*0.5*((*stress)[0][1])/J2;
+								dep02 = alam*0.5*((*stress)[0][2])/J2;
+								dep12 = alam*0.5*((*stress)[1][2])/J2;
+							}
+							else
+							{
+								tensilefailure=1;
+								/* tensile failure */
+								alam = ft / bulkm;
+								if(alam < 0.0)alam=palam*(previousft/(previousfs-ft));
+								dep0 =alam/3.;
+								dep1 =alam/3.;
+								dep2 =alam/3.;
+							}
+							if(mite==1) break;
+							/* newly added stuff */
+
+							depm = (dep0 + dep1 + dep2) / 3.0f;
+
+							trace_strain = (*strain)[0][0] + (*strain)[1][1] + (*strain)[2][2];
+							/* Deviatoric Stresses and Strains */
+							straind0 =  (*strain)[0][0] - dep0 -  (trace_strain) / 3.0f+depm;
+							straind1 =  (*strain)[1][1] - dep1 -  (trace_strain) / 3.0f+depm;
+							straind2 =  (*strain)[2][2] - dep2 -  (trace_strain) / 3.0f+depm;
+
+							trace_stress= Stress0[0][0]+Stress0[1][1]+Stress0[2][2];
+
+							stressd0 = Stress0[0][0] - trace_stress/3.;
+							stressd1 = Stress0[1][1] - trace_stress/3.;
+							stressd2 = Stress0[2][2] - trace_stress/3.;
+
+							/* viscous relaxation with reduced plastic strain to account for plasticity */
+							stressd0 =  (stressd0 * vic1 + 2.0f * rmu * straind0) * vic2 ;
+							stressd1 =  (stressd1 * vic1 + 2.0f * rmu * straind1) * vic2 ;
+							stressd2 =  (stressd2 * vic1 + 2.0f * rmu * straind2) * vic2 ;
+
+							(*stress)[0][1] =(Stress0[0][1] * vic1 + 2.0f * rmu * ((*strain)[0][1]-dep01)) * vic2;
+							(*stress)[0][2] =(Stress0[0][2] * vic1 + 2.0f * rmu * ((*strain)[0][2]-dep02)) * vic2;
+							(*stress)[1][2] =(Stress0[1][2] * vic1 + 2.0f * rmu * ((*strain)[1][2]-dep12)) * vic2;
+
+							VolumicStress = trace_stress / 3.0f + bulkm * (trace_strain - 3.*depm);
+
+							(*stress)[0][0] = stressd0 + VolumicStress;
+							(*stress)[1][1] = stressd1 + VolumicStress;
+							(*stress)[2][2] = stressd2 + VolumicStress;
+							I1 = ((*stress)[0][0]+(*stress)[1][1]+(*stress)[2][2])/3.;
+							stressd0=(*stress)[0][0]-I1;
+							stressd1=(*stress)[1][1]-I1;
+							stressd2=(*stress)[2][2]-I1;
+							J2 = sqrt(0.5*(stressd0*stressd0+stressd1*stressd1+stressd2*stressd2)
+									+(*stress)[0][1]*(*stress)[0][1]+(*stress)[0][2]*(*stress)[0][2]+(*stress)[1][2]*(*stress)[1][2]);
+							previousfs=fs;
+							previousft=ft;
+							palam=alam;
+							fs = J2 + I1 * qphi - kphi;
+							ft = I1 - st;
+							if(fs < tolerf && ft < tolerf) break;
+
+						}
+						plasticStrain=viscoplasticElement->plasticStrain[tetra_I]+sqrt( 0.5f * ((dep0-depm) * (dep0-depm) + (dep1-depm) * (dep1-depm) + (dep2-depm) * (dep2-depm)) + dep01*dep01 + dep02*dep02 + dep12*dep12);
+
+
+						if(isnan((*stress)[0][0])||isinf((*stress)[0][0]))printf("stress[0][0]=%g\n",(*stress)[0][0]);
+						if(isnan((*stress)[1][1])||isinf((*stress)[1][1]))printf("stress[1][1]=%g\n",(*stress)[1][1]);
+						if(isnan((*stress)[2][2])||isinf((*stress)[2][2]))printf("stress[2][2]=%g\n",(*stress)[2][2]);
+						if(isnan((*stress)[0][1])||isinf((*stress)[0][1]))printf("stress[0][1]=%g\n",(*stress)[0][1]);
+						if(isnan((*stress)[0][2])||isinf((*stress)[0][2]))printf("stress[0][2]=%g\n",(*stress)[0][2]);
+						if(isnan((*stress)[1][2])||isinf((*stress)[1][2]))printf("stress[1][2]=%g\n",(*stress)[1][2]);
+					}
+					else
+					{
+						/* ! no failure - just elastic increment */
+
+						dep0 = dep1 = dep2 = dep01 = dep02 = 0.0f;
+					}
+
+					if(ind)
+					{
+						(*plasticstrainTensor)[0][0]+=dep0;
+						(*plasticstrainTensor)[1][1]+=dep1;
+						(*plasticstrainTensor)[2][2]+=dep2;
+						(*plasticstrainTensor)[0][1]+=dep01;
+						(*plasticstrainTensor)[0][2]+=dep02;
+						(*plasticstrainTensor)[1][2]+=dep12;
+						/* Second invariant of plastic strain  */
+						depm = ( (*plasticstrainTensor)[0][0]+(*plasticstrainTensor)[1][1]+(*plasticstrainTensor)[2][2] ) / 3.0f;
+						viscoplasticElement->plasticStrain[tetra_I]
+							= sqrt(0.5f*(((*plasticstrainTensor)[0][0]-depm) * ((*plasticstrainTensor)[0][0]-depm) + ((*plasticstrainTensor)[1][1]-depm) * ((*plasticstrainTensor)[1][1]-depm) + ((*plasticstrainTensor)[2][2]-depm) * ((*plasticstrainTensor)[2][2]-depm)) + (*plasticstrainTensor)[0][1]*(*plasticstrainTensor)[0][1] + (*plasticstrainTensor)[0][2]*(*plasticstrainTensor)[0][2] + (*plasticstrainTensor)[1][2]*(*plasticstrainTensor)[1][2]);
+					}
+				}
+				depls += viscoplasticElement->plasticStrain[tetra_I]*element->tetra[tetra_I].volume;
+				totalVolume += element->tetra[tetra_I].volume;
+			}
+			/* volume-averaged accumulated plastic strain, aps */
+			viscoplasticElement->aps = depls/totalVolume;
+		}
+	}
+
+
+	int principal_stresses(StressTensor* stress, double sp[3], double cn[3][3])
+	{
+
+		double **a,**v,*d;
+		int i,j;
+
+		a = dmatrix(1,3,1,3);
+		v = dmatrix(1,3,1,3);
+		d = dvector(1,3);
+
+		a[1][1] = (*stress)[0][0];
+		a[2][2] = (*stress)[1][1];
+		a[3][3] = (*stress)[2][2];
+		a[1][2] = (*stress)[0][1];
+		a[1][3] = (*stress)[0][2];
+		a[2][3] = (*stress)[1][2];
+		a[2][1] = a[1][2];
+		a[3][1] = a[1][3];
+		a[3][2] = a[2][3];
+
+		jacobi(a,d,v);
+
+		d[1] *= -1.0f;
+		d[2] *= -1.0f;
+		d[3] *= -1.0f;
+
+		eigsrt(d,v);
+
+		d[1] *= -1.0f;
+		d[2] *= -1.0f;
+		d[3] *= -1.0f;
+
+		for(i=0;i<3;i++) {
+			sp[i] = d[i+1];
+			for(j=0;j<3;j++) {
+				cn[i][j] = v[j+1][i+1];
+			}
+		}
+
+		free_dmatrix(a,1,3,1,3);
+		free_dmatrix(v,1,3,1,3);
+		free_dvector(d,1,3);
+
+		return(1);
+	}
+
+	int jacobi(double** a, double* d, double** v)
+	{
+
+		int nrot = 0;
+		const unsigned int nmax = 100, n = 3;
+		double b[nmax], z[nmax], tresh,sm,g,h,t,theta,c,s,tau;
+
+		int i,j,ip,iq;
+
+		for(ip=1;ip<=n;ip++) {
+			for(iq=1;iq<=n;iq++) v[ip][iq] = 0.0f;
+			v[ip][ip] = 1.0f;
+		}
+
+		for(ip=1;ip<=n;ip++) {
+			b[ip] = d[ip] = a[ip][ip];
+			z[ip] = 0.0f;
+		}
+
+		for(i=1;i<=50;i++) {
+			sm = 0.0f;
+			for(ip=1;ip<=n-1;ip++) {
+				for(iq=ip+1;iq<=n;iq++)
+					sm += fabs(a[ip][iq]);
+			}
+			if(sm == 0.0f)
+				return(0);
+
+			if(i < 4) {
+				tresh = 0.2f * sm / ( n*n );
+			}
+			else {
+				tresh = 0.0f;
+			}
+
+			for(ip=1;ip<=n-1;ip++) {
+				for(iq=ip+1;iq<=n;iq++) {
+					g = 100.0f*fabs(a[ip][iq]);
+					if( (i > 4) && (double)(fabs(d[ip])+g) == (double)fabs(d[ip]) && (double)(fabs(d[iq])+g) == (double)fabs(d[iq]))
+						a[ip][iq] = 0.0f;
+					else if( fabs(a[ip][iq]) > tresh ) {
+						h = d[iq] - d[ip];
+						if( (fabs(h)+g) == fabs(h) )
+							t = a[ip][iq] / h;
+						else {
+							theta = 0.5f * h / (a[ip][iq]);
+							t = 1.0f / (fabs(theta) + sqrt(1.0f + theta*theta));
+							if(theta < 0.0f) t *= -1.0f;
+						}
+						c = 1.0f / sqrt(1.0f + t*t);
+						s = t * c;
+						tau = s / (1.0f + c);
+						h = t * a[ip][iq];
+						z[ip] -= h;
+						z[iq] += h;
+						d[ip] -= h;
+						d[iq] += h;
+						a[ip][iq] = 0.0f;
+						for(j=1;j<=ip-1;j++) {
+							ROTATE(a,j,ip,j,iq);
+						}
+						for(j=ip+1;j<=iq-1;j++) {
+							ROTATE(a,ip,j,j,iq);
+						}
+						for(j=iq+1;j<=n;j++) {
+							ROTATE(a,ip,j,iq,j);
+						}
+						for(j=1;j<=n;j++) {
+							ROTATE(v,j,ip,j,iq);
+						}
+
+						++nrot;
+					}
+				}
+			}
+			for(ip=1;ip<=n;ip++) {
+				b[ip] += z[ip];
+				d[ip] = b[ip];
+				z[ip] = 0.0f;
+			}
+		}
+		assert(i<50);
+
+		return 1;
+	}
+
+
+	int eigsrt(double* d, double** v)
+	{
+
+		const unsigned int n = 3;
+		int i,j,k;
+		double p;
+
+		for(i=1;i<n;i++) {
+			k = i;
+			p = d[i];
+
+			for(j=i+1;j<=n;j++) {
+				if(d[j] >= p) {
+					k = j;
+					p = d[j];
+				}
+			}
+			if(k != i) {
+				d[k] = d[i];
+				d[i] = p;
+				for(j=1;j<=n;j++) {
+					p = v[j][i];
+					v[j][i] = v[j][k];
+					v[j][k] = p;
+				}
+			}
+		}
+		return(0);
+	}
+
+	double **dmatrix(long nrl, long nrh, long ncl, long nch)
+		/* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
+	{
+		long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
+		double **m;
+
+		/* allocate pointers to rows */
+		m=(double **) malloc((size_t)((nrow+NR_END)*sizeof(double*)));
+		if (!m) nrerror("allocation failure 1 in matrix()");
+		m += NR_END;
+		m -= nrl;
+		/* allocate rows and set pointers to them */
+		m[nrl]=(double *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double)));
+		if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
+		m[nrl] += NR_END;
+		m[nrl] -= ncl;
+		for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
+		/* return pointer to array of pointers to rows */
+		return m;
+	}
+
+
+	void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch)
+		/* free a double matrix allocated by dmatrix() */
+	{
+		free((FREE_ARG) (m[nrl]+ncl-NR_END));
+		free((FREE_ARG) (m+nrl-NR_END));
+	}
+
+
+	void nrerror(char error_text[])
+	{
+		fprintf(stderr,"Numerical Recipes run-time error...\n");
+		fprintf(stderr,"%s\n",error_text);
+		fprintf(stderr,"...now exiting to system...\n");
+		exit(1);
+	}
+
+
+	double *dvector(long nl, long nh)
+		/* allocate a double vector with subscript range v[nl..nh] */
+	{
+		double *v;
+		v=(double *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(double)));
+		if (!v) nrerror("allocation failure in dvector()");
+		return v-nl+NR_END;
+	}
+
+	int *ivector(long nl, long nh)
+		/* allocate an int vector with subscript range v[nl..nh] */
+	{
+		int *v;
+		v=(int *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(int)));
+		if (!v) nrerror("allocation failure in ivector()");
+		return v-nl+NR_END;
+	}
+
+	void free_dvector(double *v, long nl, long nh)
+		/* free a double vector allocated with dvector() */
+	{
+		free((FREE_ARG) (v+nl-NR_END));
+	}
+
+	void free_ivector(int *v, long nl, long nh)
+		/* free an int vector allocated with ivector() */
+	{
+		free((FREE_ARG) (v+nl-NR_END));
+	}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,70 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2004,
+**       Pururav Thoutireddy, Center for Advanced Computing Research, Caltech.
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**      Pururav Thoutireddy, Center for Advanced Computing Research, Caltech. ( puru at cacr.caltech.edu)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**	Calculates the plastic properties for a given element. 
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Constitutive.h 3274 2007-03-27 20:25:29Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#define ROTATE(a,i,j,k,l) g=a[i][j];h=a[k][l];a[i][j]=g-s*(h+g*tau);\
+    a[k][l]=h+s*(g-h*tau);
+#define SWAP(g,h) {y=(g);(g)=(h);(h)=y;}
+#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
+
+
+#define TINY 1.0e-20
+#define RADIX 2.0
+#define NR_END 1
+#define FREE_ARG char*	
+ 
+#ifndef __SnacViscoPlastic_h__
+#define __SnacViscoPlastic_h__
+	
+	void SnacViscoPlastic_Constitutive( void* context, Element_LocalIndex element_lI );
+	
+	double** dmatrix(long nrl, long nrh, long ncl, long nch);
+	double *dvector(long nl, long nh);
+	int *ivector(long nl, long nh);
+	void free_ivector(int *v, long nl, long nh);
+	void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch);
+	void free_dvector(double *v, long nl, long nh);
+	void nrerror(char error_text[]);
+	int jacobi(double** a, double* d, double** v);
+	int eigsrt(double* d, double** v);
+#endif /* __SnacViscoPlastic_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Constitutive.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,128 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: ConstructExtensions.c 3234 2006-06-23 04:12:40Z LaetitiaLePourhiet $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Context.h"
+#include "Register.h"
+#include "Element.h"
+#include "ConstructExtensions.h"
+#include <assert.h>
+#include <limits.h>
+#ifndef PATH_MAX
+	#define PATH_MAX 1024
+#endif
+
+void _SnacVelocity_VariableCondition( Index index, Variable_Index var_I, void* _context, void* result ){
+	Snac_Context*			context = (Snac_Context*)_context;
+
+	double*				vy = (double*)result;
+        if(context->timeStep > 0.02 * context->maxTimeSteps) 
+            (*vy)=0.0;
+        else 
+            (*vy) = 0.005*erfc(context->currentTime*4.0);
+        
+}
+
+
+void _SnacViscoPlastic_ConstructExtensions( void* _context, void* data ) {
+	Snac_Context*				context = (Snac_Context*)_context;
+	SnacViscoPlastic_Context*			contextExt = ExtensionManager_Get(
+							context->extensionMgr,
+							context,
+							SnacViscoPlastic_ContextHandle );
+        Snac_Element                            tmpElement;
+        SnacViscoPlastic_Element*               tmpElementExt = ExtensionManager_Get(
+                                                        context->mesh->elementExtensionMgr,
+                                                        &tmpElement,
+                                                        SnacViscoPlastic_ElementHandle );
+	char					tmpBuf[PATH_MAX];
+        /* Because plastic strain is not an array by itself, we must the "complex" constructor for Variable... the info needs to be
+         * wrapped this generic way... */
+        Index                                   viscoplasticOffsetCount = 1;
+        SizeT                                   viscoplasticOffsets[] = { 
+                   (SizeT)((char*)&tmpElementExt->aps - (char*)&tmpElement) };
+        Variable_DataType                       viscoplasticDataTypes[] = { Variable_DataType_Double };
+        Index                                   viscoplasticDataTypeCounts[] = { 1 };
+
+      //	#if DEBUG
+         if( context->rank == 0 )		printf( "In %s()\n", __func__ );
+      //	#endif
+        /* Create the StGermain variable aps, which is stored on an element extension */
+        Variable_New(
+                "plStrain",
+                viscoplasticOffsetCount,
+                viscoplasticOffsets,
+                viscoplasticDataTypes,
+                viscoplasticDataTypeCounts,
+                0,
+                &ExtensionManager_GetFinalSize( context->mesh->elementExtensionMgr ),
+                &context->mesh->layout->decomp->elementDomainCount,
+                (void**)&context->mesh->element,
+                context->variable_Register );
+        int element_lI;        
+        for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+                        Snac_Element*           element = Snac_Element_At( context, element_lI );
+                        SnacViscoPlastic_Element*       viscoplasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element,
+                                                                                                                SnacViscoPlastic_ElementHandle );
+                        viscoplasticElement->aps = 0.0f;
+                }//for
+
+
+        ConditionFunction_Register_Add(
+		context->condFunc_Register,
+		ConditionFunction_New( _SnacVelocity_VariableCondition, "variablevelBC" ) );
+
+	/* Prepare the dump file */
+	sprintf( tmpBuf, "%s/plStrain.%u", context->outputPath, context->rank );
+	if( (contextExt->plStrainOut = fopen( tmpBuf, "w+" )) == NULL ) {
+		assert( contextExt->plStrainOut /* failed to open file for writing */ );
+		abort();
+	}
+	sprintf( tmpBuf, "%s/plStrainCP.%u", context->outputPath, context->rank );
+	if( (contextExt->plStrainCheckpoint = fopen( tmpBuf, "w+" )) == NULL ) {
+		assert( contextExt->plStrainCheckpoint /* failed to open file for writing */ );
+		abort();
+	}
+	sprintf( tmpBuf, "%s/viscosity.%u", context->outputPath, context->rank );
+	if( (contextExt->viscOut = fopen( tmpBuf, "w+" )) == NULL ) {
+		assert( contextExt->viscOut /* failed to open file for writing */ );
+		abort();
+	}
+	sprintf( tmpBuf, "%s/viscosityCP.%u", context->outputPath, context->rank );
+	if( (contextExt->viscCheckpoint = fopen( tmpBuf, "w+" )) == NULL ) {
+		assert( contextExt->viscCheckpoint /* failed to open file for writing */ );
+		abort();
+	}
+}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,45 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ConstructExtensions.h 1958 2004-08-26 19:08:58Z puru $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_ConstructExtensions_h__
+#define __SnacViscoPlastic_ConstructExtensions_h__
+	
+	void _SnacViscoPlastic_ConstructExtensions( void* _context, void* data );
+	
+#endif /* __SnacViscoPlastic_ConstructExtensions_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ConstructExtensions.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,45 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Context.c 1958 2004-08-26 19:08:58Z puru $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Context.h"
+#include <stdio.h>
+
+void SnacViscoPlastic_Context_Print( void* _context ) {
+	SnacViscoPlastic_Context*	self = (SnacViscoPlastic_Context*)_context;
+	
+	printf( "SnacViscoPlastic_Context:\n" );
+	printf( "\tplstrain (ptr): %p", self->plStrainOut );
+}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Context.h 3104 2005-07-14 22:16:41Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_Context_h__
+#define __SnacViscoPlastic_Context_h__
+	
+	/* Context Information */
+	struct _SnacViscoPlastic_Context {
+		/* Dumping */
+		FILE*				plStrainOut;
+		FILE*				viscOut;
+		FILE*				plStrainCheckpoint;
+		FILE*				viscCheckpoint;
+		FILE*				plstrainTensorOut;
+	};
+	
+	/* Print the contents of the context extension */
+	void SnacViscoPlastic_Context_Print( void* _context );
+	
+#endif /* __SnacViscoPlastic_Context_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Context.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,49 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Element.c 1958 2004-08-26 19:08:58Z puru $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Element.h"
+#include <stdio.h>
+
+void SnacViscoPlastic_Element_Print( void* element ) {
+	SnacViscoPlastic_Element*	self = (SnacViscoPlastic_Element*)element;
+	Tetrahedra_Index	tetra_I;
+	
+	printf( "SnacViscoPlastic_Element:\n" );
+	printf( "\tplasticStrain: " );
+	for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+		printf( "%g, ", self->plasticStrain[tetra_I] );
+	}
+}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**	Snac plastic properties for an element.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Element.h 3274 2007-03-27 20:25:29Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_Element_h__
+#define __SnacViscoPlastic_Element_h__
+
+	/* Element Information */
+	struct _SnacViscoPlastic_Element {
+		Strain			plasticStrain[Tetrahedra_Count];
+		double			viscosity[Tetrahedra_Count];
+		Strain			aps;
+		StrainTensor	plasticstrainTensor[Tetrahedra_Count];
+		StrainTensor	creepstrainTensor[Tetrahedra_Count];
+	};
+
+	/* Print the contents of an Element */
+	void SnacViscoPlastic_Element_Print( void* element );
+
+#endif /* __SnacViscoPlastic_Element_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Element.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,139 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: InitialConditions.c 3261 2006-11-14 21:18:05Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "units.h"
+#include "types.h"
+#include "Element.h"
+#include "InitialConditions.h"
+#include "Register.h"
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+#define min(a,b) ((a)<(b) ? (a):(b))
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+void SnacViscoPlastic_InitialConditions( void* _context, void* data ) {
+	Snac_Context*		context = (Snac_Context*)_context;
+	Element_LocalIndex	element_lI;
+	double                  mu,vis_min,dt_maxwellI;
+	double                  dt_maxwell = 0;
+	const double            mfrac      = 9.0e-01;
+	
+	// loop over the phase using the dictionary
+    
+	Dictionary_Entry_Value* materialList = Dictionary_Get( context->dictionary, "materials" );
+	int                           PhaseI = 0;
+	if( materialList ) {
+		Dictionary_Entry_Value* materialEntry = Dictionary_Entry_Value_GetFirstElement( materialList );
+		/* loop around the  phases to initialize rheology */
+		while( materialEntry ) {
+			context->materialProperty[PhaseI].rheology |= Snac_Material_ViscoPlastic;
+			mu                                          = context->materialProperty[PhaseI].mu;
+			vis_min                                     = context->materialProperty[PhaseI].vis_min;
+			dt_maxwellI                                 = mfrac*vis_min/mu;
+			dt_maxwell                                  = (PhaseI==0)?dt_maxwellI:min(dt_maxwellI,dt_maxwell);
+			PhaseI++;
+			materialEntry                               = materialEntry->next;
+			
+		}
+	}
+	else {
+		context->materialProperty[PhaseI].rheology |= Snac_Material_ViscoPlastic;
+		mu                                          = context->materialProperty[PhaseI].mu;
+		vis_min                                      = context->materialProperty[PhaseI].vis_min;
+		dt_maxwell                                   = mfrac*vis_min/mu;
+	}
+	if( context->dt > dt_maxwell) {
+		if(context->dtType == Snac_DtType_Constant) {
+			fprintf(stderr,"dt(%e) should be smaller than dt_maxwell(%e) (mu=%e vis_min=%e mfrac=%e)\n",context->dt,dt_maxwell,mu,vis_min,mfrac);
+		}
+		else    context->dt = dt_maxwell;
+	}
+	if( context->restartTimestep > 0 ) {
+		FILE*				plStrainIn;
+		char				path[PATH_MAX];
+		
+		sprintf(path, "%s/snac.plStrain.%d.%06d.restart",context->outputPath,context->rank,context->restartTimestep);
+		Journal_Firewall( (plStrainIn = fopen(path,"r")) != NULL, "Can't find %s", path );
+		
+		/* read in restart file to reconstruct the previous plastic strain.*/
+		for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+			Snac_Element*				element = Snac_Element_At( context, element_lI );
+			SnacViscoPlastic_Element*	viscoplasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element,
+																SnacViscoPlastic_ElementHandle );
+			const Snac_Material* 		material = &context->materialProperty[element->material_I];
+
+			vis_min = context->materialProperty[element->material_I].vis_min;
+			if( material->yieldcriterion == mohrcoulomb ) {
+				Tetrahedra_Index	tetra_I;
+				double              depls = 0.0f;
+				double              totalVolume = 0.0f;
+				
+				for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+					double			tetraPlStrain;
+
+					/* not the actual viscosity at restartTimestep, but doesn't affect the calculation afterwards */
+					viscoplasticElement->viscosity[tetra_I] = vis_min;
+
+					fscanf( plStrainIn, "%le", &tetraPlStrain );
+					viscoplasticElement->plasticStrain[tetra_I] = tetraPlStrain;
+					depls += viscoplasticElement->plasticStrain[tetra_I]*element->tetra[tetra_I].volume;
+					totalVolume += element->tetra[tetra_I].volume;
+				}//for tets
+				/* volume-averaged accumulated plastic strain, aps */
+				viscoplasticElement->aps = depls/totalVolume;
+			}//if(mohrcoulomb)
+		}//for elements
+		if( plStrainIn )
+			fclose( plStrainIn );
+	}// if restarting.
+	else {
+		/* Set the plastic element initial conditions */
+		for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+			Snac_Element*		element = Snac_Element_At( context, element_lI );
+			SnacViscoPlastic_Element*	viscoplasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element,
+																					SnacViscoPlastic_ElementHandle );
+			viscoplasticElement->aps = 0.0;
+			vis_min = context->materialProperty[element->material_I].vis_min;
+			Tetrahedra_Index	tetra_I;
+			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+				viscoplasticElement->plasticStrain[tetra_I] = 0.0;
+				viscoplasticElement->viscosity[tetra_I] = vis_min;
+			}//for tets
+		}//for elements
+	}//else
+}//function


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,45 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: InitialConditions.h 3131 2005-08-13 01:48:13Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_InitialConditions_h__
+#define __SnacViscoPlastic_InitialConditions_h__
+
+	void SnacViscoPlastic_InitialConditions( void* _context, void* data );
+
+#endif /* __SnacViscoPlastic_InitialConditions_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/InitialConditions.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Make.mm
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Make.mm	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Make.mm	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,67 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, 
+##	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+##	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+##	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+##	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+##	Luc Lavier, Research Scientist, Caltech.
+##
+## This program is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+## $Id: Make.mm 955 2004-03-04 18:43:37Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+include Makefile.def
+
+PROJECT = Snac
+PACKAGE = ${def_mod}module
+
+PROJ_LIB = $(BLD_LIBDIR)/$(PACKAGE).a
+PROJ_DLL = $(BLD_LIBDIR)/$(PACKAGE).$(EXT_SO)
+PROJ_TMPDIR = $(BLD_TMPDIR)/$(PROJECT)/$(PACKAGE)
+PROJ_CLEAN += $(PROJ_LIB) $(PROJ_DLL)
+PROJ_INCDIR = $(BLD_INCDIR)/${def_inc}
+
+PROJ_SRCS = ${def_srcs}
+PROJ_CC_FLAGS += -I$(BLD_INCDIR)/$(PROJECT) -I$(BLD_INCDIR)/Snac -I$(BLD_INCDIR)/StGermain -I$(STGERMAIN_INCDIR)/ -I$(STGERMAIN_INCDIR)/StGermain `xml2-config --cflags` -DCURR_MODULE_NAME=\"${def_mod}\"
+PROJ_LIBRARIES = -L$(BLD_LIBDIR) -L$(STGERMAIN_LIBDIR)/ -lSnac -lStGermain `xml2-config --libs` $(MPI_LIBPATH) $(MPI_LIBS)
+LCCFLAGS = 
+
+# I keep file lists to build a monolith .so from a set of .a's
+PROJ_OBJS_IN_TMP = ${addprefix $(PROJECT)/$(PACKAGE)/, ${addsuffix .o, ${basename $(PROJ_SRCS)}}}
+PROJ_OBJLIST = $(BLD_TMPDIR)/$(PROJECT).$(PACKAGE).objlist
+
+all: $(PROJ_LIB) DLL createObjList export
+
+DLL: product_dirs $(PROJ_OBJS)
+	$(CC) -o $(PROJ_DLL) $(PROJ_OBJS) $(COMPILER_LCC_SOFLAGS) $(LCCFLAGS) $(PROJ_LIBRARIES) $(EXTERNAL_LIBPATH) $(EXTERNAL_LIBS)
+
+
+
+createObjList:: 
+	@echo ${PROJ_OBJS_IN_TMP} | cat > ${PROJ_OBJLIST}
+
+#export:: export-headers
+export:: export-headers export-libraries
+EXPORT_HEADERS = ${def_hdrs}
+EXPORT_LIBS = $(PROJ_LIB) $(PROJ_DLL)
+
+check::


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Make.mm
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Makefile.def
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Makefile.def	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Makefile.def	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,58 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, 
+##	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+##	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+##	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+##	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+##	Luc Lavier, Research Scientist, Caltech.
+##	Luc Lavier, Caltech.
+##
+## This program is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+## $Id: Makefile.def 1677 2004-07-20 10:30:34Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+def_mod = SnacViscoPlastic
+def_inc = Snac/ViscoPlastic
+
+def_srcs = \
+	Element.c \
+	Context.c \
+	ConstructExtensions.c \
+	Constitutive.c \
+	Output.c \
+	Register.c \
+	InitialConditions.c \
+	Remesh.c \
+
+def_hdrs = \
+	types.h \
+        units.h \
+	Element.h \
+	Context.h \
+	ConstructExtensions.h \
+	Constitutive.h \
+	Output.h \
+	Register.h \
+	InitialConditions.h \
+	Remesh.h \
+	ViscoPlastic.h
+


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Makefile.def
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,235 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Output.c 3125 2005-07-25 21:32:45Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Output.h"
+#include "Context.h"
+#include "Element.h"
+#include "Register.h"
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+
+
+void _SnacViscoPlastic_WritePlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+
+	if( isTimeToDump( context ) )
+		_SnacViscoPlastic_DumpPlasticStrain( context );
+
+	if( isTimeToCheckpoint( context ) )
+		_SnacViscoPlastic_CheckpointPlasticStrain( context );
+}
+
+
+void _SnacViscoPlastic_DumpPlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacViscoPlastic_Context*	contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacViscoPlastic_ContextHandle );
+	Element_LocalIndex			element_lI;
+
+#if DEBUG
+	printf( "In %s()\n", __func__ );
+#endif
+	
+	for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+		Snac_Element* 				element = Snac_Element_At( context, element_lI );
+		SnacViscoPlastic_Element*	elementExt = ExtensionManager_Get(
+													context->mesh->elementExtensionMgr,
+													element,
+													SnacViscoPlastic_ElementHandle );
+		float plasticStrain = elementExt->aps;
+		fwrite( &plasticStrain, sizeof(float), 1, contextExt->plStrainOut );
+	}
+	fflush( contextExt->plStrainOut );
+}
+
+
+void _SnacViscoPlastic_CheckpointPlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacViscoPlastic_Context*	contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacViscoPlastic_ContextHandle );
+	Element_LocalIndex			element_lI;
+
+#if DEBUG
+	printf( "In %s()\n", __func__ );
+#endif
+	
+	for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+		Snac_Element* 				element = Snac_Element_At( context, element_lI );
+		SnacViscoPlastic_Element*	elementExt = ExtensionManager_Get(
+													context->mesh->elementExtensionMgr,
+													element,
+													SnacViscoPlastic_ElementHandle );
+		Tetrahedra_Index	tetra_I;
+		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+			float plasticStrain = elementExt->plasticStrain[tetra_I];
+			fwrite( &plasticStrain, sizeof(float), 1, contextExt->plStrainCheckpoint );
+		}
+		fflush( contextExt->plStrainCheckpoint );
+	}
+}
+
+
+void _SnacViscoPlastic_WriteViscosity( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+
+	if( isTimeToDump( context ) )
+		_SnacViscoPlastic_DumpViscosity( context );
+
+	if( isTimeToCheckpoint( context ) )
+		_SnacViscoPlastic_CheckpointViscosity( context );
+}
+
+
+void _SnacViscoPlastic_DumpViscosity( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacViscoPlastic_Context*	contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacViscoPlastic_ContextHandle );
+	Element_LocalIndex			element_lI;
+
+#if DEBUG
+	printf( "In %s()\n", __func__ );
+#endif
+	
+	for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+		Snac_Element* 				element = Snac_Element_At( context, element_lI );
+		SnacViscoPlastic_Element*	elementExt = ExtensionManager_Get(
+													context->mesh->elementExtensionMgr,
+													element,
+													SnacViscoPlastic_ElementHandle );
+		Tetrahedra_Index			tetra_I;
+		double					    viscosity = 0.0f;
+		float						logviscosity = 0.0f;
+
+		/* Take average of tetra viscosity for the element */
+		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ )
+			viscosity += elementExt->viscosity[tetra_I]/Tetrahedra_Count;
+		assert(viscosity>0.0);
+		logviscosity = log10(viscosity);
+		fwrite( &logviscosity, sizeof(float), 1, contextExt->viscOut );
+	}
+	fflush( contextExt->viscOut );
+}
+
+
+void _SnacViscoPlastic_CheckpointViscosity( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacViscoPlastic_Context*	contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacViscoPlastic_ContextHandle );
+	Element_LocalIndex			element_lI;
+	
+#if DEBUG
+	printf( "In %s()\n", __func__ );
+#endif
+	
+	for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+		Snac_Element* 					element = Snac_Element_At( context, element_lI );
+		SnacViscoPlastic_Element*		elementExt = ExtensionManager_Get(
+														context->mesh->elementExtensionMgr,
+														element,
+														SnacViscoPlastic_ElementHandle );
+		Tetrahedra_Index		tetra_I;
+		double					viscosity = 0.0f;
+		float					logviscosity = 0.0f;
+
+		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+			viscosity = elementExt->viscosity[tetra_I];
+			assert(viscosity>0.0);
+			logviscosity = log10(viscosity);
+			fwrite( &logviscosity, sizeof(float), 1, contextExt->viscCheckpoint );
+		}
+	}
+	fflush( contextExt->viscCheckpoint );
+}
+
+
+#if 0
+void _SnacViscoPlastic_DumpPlasticStrainTensor( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacViscoPlastic_Context*			contextExt = ExtensionManager_Get(
+							context->extensionMgr,
+							context,
+							SnacViscoPlastic_ContextHandle );
+
+#if DEBUG
+	printf( "In %s()\n", __func__ );
+#endif
+
+
+	if( context->timeStep ==0 || (context->timeStep-1) % context->dumpEvery == 0 ) {
+		Element_LocalIndex			element_lI;
+
+		for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
+			Snac_Element* 				element = Snac_Element_At( context, element_lI );
+			SnacViscoPlastic_Element*			elementExt = ExtensionManager_Get(
+																				  context->mesh->elementExtensionMgr,
+																				  element,
+																				  SnacViscoPlastic_ElementHandle );
+			const Snac_Material* material = &context->materialProperty[element->material_I];
+			Tetrahedra_Index tetra_I;
+
+
+			if( material->yieldcriterion == druckerprager ) {
+				for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+					Index i,j;
+					float tensor[3][3];
+					for(i=0;i<3;i++)
+						for(j=0;j<3;j++) {
+							tensor[i][j] = elementExt->plasticstrainTensor[tetra_I][i][j];
+							fwrite( &tensor[i][j], sizeof(float), 1, contextExt->plstrainTensorOut );
+						}
+				}
+			}
+			else if( material->yieldcriterion == mohrcoulomb ) {
+				for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+					float tetraStrain;
+					tetraStrain = elementExt->plasticStrain[tetra_I];
+					fwrite( &tetraStrain, sizeof(float), 1, contextExt->plstrainTensorOut );
+				}
+			}
+		}
+		fflush( contextExt->plstrainTensorOut );
+	}
+}
+#endif


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,43 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Output.h 3104 2005-07-14 22:16:41Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef _SnacViscoPlastic_Output_
+#define _SnacViscoPlastic_Output_
+
+	void _SnacViscoPlastic_WritePlasticStrain( void* _context );
+	void _SnacViscoPlastic_WriteViscosity( void* _context );
+	void _SnacViscoPlastic_DumpPlasticStrain( void* _context );
+	void _SnacViscoPlastic_CheckpointPlasticStrain( void* _context );
+	void _SnacViscoPlastic_DumpViscosity( void* _context );
+	void _SnacViscoPlastic_CheckpointViscosity( void* _context );
+	void _SnacViscoPlastic_DumpPlasticStrainTensor( void* _context );
+
+#endif


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Output.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,143 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Register.c 3243 2006-10-12 09:04:00Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Element.h"
+#include "Context.h"
+#include "Constitutive.h"
+#include "ConstructExtensions.h"
+#include "Output.h"
+#include "InitialConditions.h"
+#include "Remesh.h"
+#include "Register.h"
+#include <stdio.h>
+
+/* Textual name of this class */
+const Type SnacViscoPlastic_Type = "SnacViscoPlastic";
+
+ExtensionInfo_Index SnacViscoPlastic_ElementHandle;
+ExtensionInfo_Index SnacViscoPlastic_ContextHandle;
+
+
+Index _SnacViscoPlastic_Register( PluginsManager* pluginsMgr ) {
+	return PluginsManager_Submit( pluginsMgr, 
+				      SnacViscoPlastic_Type, 
+				      "0", 
+				      _SnacViscoPlastic_DefaultNew );
+}
+
+
+void* _SnacViscoPlastic_DefaultNew( Name name ) {
+	return _Codelet_New( sizeof(Codelet), 
+			     SnacViscoPlastic_Type, 
+			     _Codelet_Delete, 
+			     _Codelet_Print, 
+			     _Codelet_Copy, 
+			     _SnacViscoPlastic_DefaultNew, 
+			     _SnacViscoPlastic_Construct, 
+			     _Codelet_Build, 
+			     _Codelet_Initialise, 
+			     _Codelet_Execute, 
+			     _Codelet_Destroy, 
+			     name );
+}
+
+
+void _SnacViscoPlastic_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	Snac_Context*	context;
+	EntryPoint* 	interpolateElementEP;
+
+	/* Retrieve context. */
+	context = (Snac_Context*)Stg_ComponentFactory_ConstructByName( cf, "context", Snac_Context, True, data ); 
+
+	#ifdef DEBUG
+		printf( "In: _SnacViscoPlastic_Register( void*, void* )\n" );
+	#endif
+
+	/* Add extensions to nodes, elements and the context */
+	SnacViscoPlastic_ElementHandle = ExtensionManager_Add( context->mesh->elementExtensionMgr, SnacViscoPlastic_Type, sizeof(SnacViscoPlastic_Element) );
+	SnacViscoPlastic_ContextHandle = ExtensionManager_Add( context->extensionMgr, SnacViscoPlastic_Type, sizeof(SnacViscoPlastic_Context) );
+
+	#ifdef DEBUG
+		printf( "\tcontext extension handle: %u\n", SnacViscoPlastic_ContextHandle );
+		printf( "\telement extension handle: %u\n", SnacViscoPlastic_ElementHandle );
+	#endif
+
+	/* Add extensions to the entry points */
+	EntryPoint_Append(
+		Context_GetEntryPoint( context,	Snac_EP_Constitutive ),
+		SnacViscoPlastic_Type,
+		SnacViscoPlastic_Constitutive,
+		SnacViscoPlastic_Type );
+	EntryPoint_InsertBefore(
+		Context_GetEntryPoint( context,	AbstractContext_EP_Initialise ),
+		"SnacTimeStepZero",
+		SnacViscoPlastic_Type,
+		SnacViscoPlastic_InitialConditions,
+		SnacViscoPlastic_Type );
+	EntryPoint_Prepend( /* Dump the initial plastic strain */
+		Context_GetEntryPoint( context, AbstractContext_EP_Execute ),
+		"SnacViscoPlastic_WritePlasticStrain",
+		_SnacViscoPlastic_WritePlasticStrain,
+		SnacViscoPlastic_Type );
+	EntryPoint_Append( /* and dump each loop */
+		Context_GetEntryPoint( context, Snac_EP_CalcStresses ),
+		"SnacViscoPlastic_WritePlasticStrain",
+		_SnacViscoPlastic_WritePlasticStrain,
+		SnacViscoPlastic_Type );
+	EntryPoint_Prepend( /* Dump the initial viscosity */
+		Context_GetEntryPoint( context, AbstractContext_EP_Execute ),
+		"SnacViscoPlastic_WriteViscosity",
+		_SnacViscoPlastic_WriteViscosity,
+		SnacViscoPlastic_Type );
+	EntryPoint_Append( /* and dump visocisty each loop */
+		Context_GetEntryPoint( context, Snac_EP_CalcStresses ),
+		"SnacViscoPlastic_WriteViscosity",
+		_SnacViscoPlastic_WriteViscosity,
+		SnacViscoPlastic_Type );
+
+	/* Add extensions to the interpolate element entry point, but it will only exist if the remesher is loaded. */
+	interpolateElementEP = Context_GetEntryPoint( context,	"SnacRemesher_EP_InterpolateElement" );
+	if( interpolateElementEP ) {
+		EntryPoint_Append(
+			interpolateElementEP,
+			SnacViscoPlastic_Type,
+			_SnacViscoPlastic_InterpolateElement,
+			SnacViscoPlastic_Type );
+	}
+
+	/* Construct. */
+	_SnacViscoPlastic_ConstructExtensions( context, data );
+}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,57 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**	Only one can be registered at the time (limitation).
+**
+** Comments:
+**
+** $Id: Register.h 3243 2006-10-12 09:04:00Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_Register_h__
+#define __SnacViscoPlastic_Register_h__
+	
+	/* Textual name of this class */
+	extern const Type SnacViscoPlastic_Type;
+	
+	extern ExtensionInfo_Index SnacViscoPlastic_ElementHandle;
+	
+	extern ExtensionInfo_Index SnacViscoPlastic_ContextHandle;
+	
+	Index _SnacViscoPlastic_Register( PluginsManager* pluginsMgr );
+
+	void* _SnacViscoPlastic_DefaultNew( Name name );
+
+	void _SnacViscoPlastic_Construct( void* component, Stg_ComponentFactory* cf, void* data );
+	
+#endif /* __SnacViscoPlastic_Register_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Register.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.c	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,94 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003,
+**	Pururav Thoutireddy, 
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**      110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Pururav Thoutireddy, Staff Scientist, Caltech
+**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+** $Id: Remesh.c 3250 2006-10-23 06:15:18Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "Snac/Remesher/Register.h"
+#include "Snac/Remesher/Mesh.h"
+#include "Snac/Remesher/types.h"
+#include "types.h"
+#include "Element.h"
+#include "Remesh.h"
+#include "Register.h"
+
+void _SnacViscoPlastic_InterpolateElement( void* _context, 
+					   unsigned dstEltInd, unsigned dstTetInd, 
+					   Snac_Element* dstElements, 
+					   unsigned srcEltInd, unsigned srcTetInd )
+{
+	Snac_Context*				context = (Snac_Context*)_context;
+	Mesh*						mesh = context->mesh;
+	SnacRemesher_Mesh*			meshExt = ExtensionManager_Get( context->meshExtensionMgr,
+															mesh, 
+															SnacRemesher_MeshHandle );
+	HexaMD*						decomp = (HexaMD*)mesh->layout->decomp;
+	Element_DomainIndex 		eltdI[8],eldI,eldJ,eldK;
+	Index 						coef_I;
+
+	Element_DomainIndex			neldI =  decomp->elementDomain3DCounts[0];
+	Element_DomainIndex			neldJ =  decomp->elementDomain3DCounts[1];
+	Snac_Element*				dstElt = (Snac_Element*)ExtensionManager_At( 
+											context->mesh->elementExtensionMgr, 
+											dstElements, 
+											dstEltInd );
+	SnacViscoPlastic_Element*	dstEltExt = ExtensionManager_Get( context->mesh->elementExtensionMgr, 
+																  dstElt, 
+																  SnacViscoPlastic_ElementHandle );
+
+	/* Decompose srcEltInd into ijk indexes. */
+	eldI = srcEltInd % neldI;
+	eldJ = ((srcEltInd-eldI)/neldI) % neldJ;
+	eldK = (srcEltInd-eldI-eldJ*neldI)/(neldI*neldJ);
+	
+	/* Eight-node hex defined on the old barycenter grid. */
+	eltdI[0] = srcEltInd;
+	eltdI[1] = (eldI+1) + eldJ*neldI     + eldK*neldI*neldJ;
+	eltdI[2] = (eldI+1) + (eldJ+1)*neldI + eldK*neldI*neldJ;
+	eltdI[3] = eldI     + (eldJ+1)*neldI + eldK*neldI*neldJ;
+	eltdI[4] = eldI     + eldJ*neldI     + (eldK+1)*neldI*neldJ;
+	eltdI[5] = (eldI+1) + eldJ*neldI     + (eldK+1)*neldI*neldJ;
+	eltdI[6] = (eldI+1) + (eldJ+1)*neldI + (eldK+1)*neldI*neldJ;
+	eltdI[7] = eldI     + (eldJ+1)*neldI + (eldK+1)*neldI*neldJ;
+
+	dstEltExt->plasticStrain[dstTetInd] = 0.0;
+	for(coef_I=0;coef_I<4;coef_I++) {
+		/* The actual src elements are the apexes of the tet in the old barycenter grid. */
+		Snac_Element* 				srcElt = Snac_Element_At( context, eltdI[TetraToNode[srcTetInd][coef_I]] );
+		SnacViscoPlastic_Element* 	srcEltExt = ExtensionManager_Get( context->mesh->elementExtensionMgr, 
+														srcElt, 
+														SnacViscoPlastic_ElementHandle );
+		dstEltExt->plasticStrain[dstTetInd] += meshExt->barcord[dstEltInd].L[coef_I]*srcEltExt->plasticStrain[dstTetInd];
+	}
+}


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.c
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,48 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Remesh.h 3250 2006-10-23 06:15:18Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_Remesh_h__
+#define __SnacViscoPlastic_Remesh_h__
+	
+	void _SnacViscoPlastic_InterpolateElement( void* _context, 
+						   unsigned dstElementInd, unsigned dstTetInd, 
+						   Snac_Element* dstElements, 
+						   unsigned srcElementInd, unsigned srcTetInd );
+	
+#endif /* __SnacViscoPlastic_Remesh_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/Remesh.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ViscoPlastic.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ViscoPlastic.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ViscoPlastic.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**	Only one can be registered at the time (limitation).
+**
+** Comments:
+**
+** $Id: ViscoPlastic.h 2202 2004-10-19 08:43:09Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_h__
+#define __SnacViscoPlastic_h__
+	
+#include "units.h"
+#include "types.h"
+#include "Element.h"
+#include "Context.h"
+#include "InitialConditions.h"
+#include "Constitutive.h"
+#include "Output.h"
+#include "ConstructExtensions.h"
+#include "ViscoPlastic.h"
+#include "Remesh.h"
+#include "Register.h"
+
+#endif /* __SnacViscoPlastic_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/ViscoPlastic.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/makefile
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/makefile	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/makefile	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, 
+##	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+##	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+##	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+##	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+##	Luc Lavier, Research Scientist, Caltech.
+##
+## This program is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+## $Id: Makefile.rules 1792 2004-07-30 05:42:39Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=../..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+include Makefile.def
+
+mod = ${def_mod}
+includes = ${def_inc}
+
+SRCS = ${def_srcs}
+
+HDRS = ${def_hdrs}
+
+PROJ_LIBS = ${def_libs}
+EXTERNAL_LIBS = -L${STGERMAIN_LIBDIR}  -lSnac -lStGermain
+EXTERNAL_INCLUDES = -I${STGERMAIN_INCDIR}/StGermain -I${STGERMAIN_INCDIR} 
+
+packages = MPI XML MATH
+
+include ${PROJ_ROOT}/Makefile.vmake


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/makefile
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/types.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/types.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/types.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,50 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**	Plastic types.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 1958 2004-08-26 19:08:58Z puru $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_types_h__
+#define __SnacViscoPlastic_types_h__
+	
+	/* Plastic */
+	typedef struct _SnacViscoPlastic_Element	SnacViscoPlastic_Element;
+	typedef struct _SnacViscoPlastic_Context	SnacViscoPlastic_Context;
+	
+#endif /* __SnacViscoPlastic_types_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/types.h
___________________________________________________________________
Name: svn:executable
   + *

Added: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/units.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/units.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/units.h	2011-10-08 00:51:03 UTC (rev 19049)
@@ -0,0 +1,47 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, 
+**	Steve Quenette, 110 Victoria Street, Melbourne, Victoria, 3053, Australia.
+**	Californian Institute of Technology, 1200 East California Boulevard, Pasadena, California, 91125, USA.
+**	University of Texas, 1 University Station, Austin, Texas, 78712, USA.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+**	Luc Lavier, Research Scientist, The University of Texas. (luc at utig.ug.utexas.edu)
+**	Luc Lavier, Research Scientist, Caltech.
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2, or (at your option) any
+** later version.
+** 
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: units.h 1968 2004-08-27 21:55:29Z puru $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacViscoPlastic_units_h__
+#define __SnacViscoPlastic_units_h__
+	
+	typedef double				ViscoPlastic;
+	
+#endif /* __SnacViscoPlastic_units_h__ */


Property changes on: long/3D/SNAC/trunk/Snac/plugins/viscoplastic_BI/units.h
___________________________________________________________________
Name: svn:executable
   + *



More information about the CIG-COMMITS mailing list