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

echoi at geodynamics.org echoi at geodynamics.org
Sat Nov 12 21:29:55 PST 2011


Author: echoi
Date: 2011-11-12 21:29:55 -0800 (Sat, 12 Nov 2011)
New Revision: 19190

Added:
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Make.mm
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Makefile.def
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Plastic.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.c
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.h
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/make.log
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/makefile
   long/3D/SNAC/trunk/Snac/plugins/plastic_BI/types.h
Log:
Preparing a new plastic plugin that will utilize barycentric interpolation for the plastic strain mapping at the time of remeshing.


Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,478 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: 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 "types.h"
+#include "Element.h"
+#include "Constitutive.h"
+#include "Register.h"
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+#ifndef PI
+#ifndef M_PIl
+#ifndef M_PI
+#define PI 3.14159265358979323846
+#else
+#define PI M_PI
+#endif
+#else
+#define PI M_PIl
+#endif
+#endif
+
+//#define DEBUG
+
+void SnacPlastic_Constitutive( void* _context, Element_LocalIndex element_lI ) {
+	Snac_Context			*context = (Snac_Context*)_context;
+	Snac_Element			*element = Snac_Element_At( context, element_lI );
+	SnacPlastic_Element		*plasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element, SnacPlastic_ElementHandle );
+	const Snac_Material		*material = &context->materialProperty[element->material_I];
+
+	MeshLayout*			meshLayout = (MeshLayout*)context->meshLayout;
+	HexaMD*				decomp = (HexaMD*)meshLayout->decomp;
+	IJK				ijk;
+	Element_GlobalIndex		element_gI = _MeshDecomp_Element_LocalToGlobal1D( decomp, element_lI );
+	RegularMeshUtils_Element_1DTo3D( decomp, element_gI, &ijk[0], &ijk[1], &ijk[2] );
+
+	if ( material->rheology & Snac_Material_Plastic ) {
+		Tetrahedra_Index	tetra_I;
+		double			cohesion = 0.0f;
+		double			frictionAngle = 0.0f;
+		double			dilationAngle = 0.0f;
+		double			hardening = 0.0f;
+		double			sphi = 0.0f;
+		double			spsi = 0.0f;
+		double			st = 0.0f;
+		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.0f;
+		double		        anphi = 0.0f;
+		double		        anpsi = 0.0f;
+		const double		a1 = material->lambda + 2.0f * material->mu ;
+		const double		a2 = material->lambda ;
+		int                     ind=0;
+
+                static char             plasticStrainReportedFlag=0;
+
+		/* 
+		 *   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=0.0f, dep1, dep2, dep3, depm;
+			double			fs,ft,aP,sP,h;
+			unsigned int		k, m, n;
+			double		        trace_strain;
+			StressTensor*		stress = &element->tetra[tetra_I].stress;
+			StrainTensor*		strain = &element->tetra[tetra_I].strain;
+			/*  
+			 *  CPS bug fix:  was set to zero, thus not picking up plastic strain weakening except at t=0
+			 */
+			Strain		        plasticStrain = plasticElement->plasticStrain[tetra_I];
+
+
+			/* 
+			 *  Compute elastic stress first 
+			 */
+			trace_strain = (*strain)[0][0] + (*strain)[1][1] + (*strain)[2][2];
+
+			(*stress)[0][0] += (2.0f * material->mu) * (*strain)[0][0] + material->lambda * (trace_strain );
+			(*stress)[1][1] += (2.0f * material->mu) * (*strain)[1][1] + material->lambda * (trace_strain );
+			(*stress)[2][2] += (2.0f * material->mu) * (*strain)[2][2] + material->lambda * (trace_strain );
+			(*stress)[0][1] += (2.0f * material->mu) * (*strain)[0][1];
+			(*stress)[0][2] += (2.0f * material->mu) * (*strain)[0][2];
+			(*stress)[1][2] += (2.0f * material->mu) * (*strain)[1][2];
+
+			principal_stresses(stress,s,cn);
+
+			/*
+			 *  Calculate material props (friction angle, cohesion, etc) from piecewise-linear
+			 *    functions defined in terms of plastic strain.
+			 */
+			Journal_DFirewall( (material->plstrain[0]==0.0), context->snacError, "The initial segment should start from the plastic strain of 0.0" );
+			Journal_OFirewall( (material->plstrain[0]==0.0), context->snacError,  __FILE__, __func__, __LINE__,
+							   "timeStep=%u rank=%u: The initial segment should start from the plastic strain of 0.0.",
+							   context->timeStep, context->rank );
+			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;
+					break;
+				} else if(i==material->nsegments-1 && plasticStrain > pl2) {
+				    /*
+				     *  CPS mod:  one extra test if pl strain is outside piecewise range, is last piece, and 
+				     *    has pl strain larger than piece  -  then set physical params to maxima for this piece
+				     *  Purpose:  to prevent crazy behavior for extreme plastic strains
+				     */
+				    frictionAngle = material->frictionAngle[material->nsegments];
+				    dilationAngle = material->dilationAngle[material->nsegments];
+				    cohesion = material->cohesion[material->nsegments];
+				    hardening = 0.0;
+					break;
+				}
+			}
+
+			sphi = sin( frictionAngle * degrad );
+			spsi = sin( dilationAngle * degrad );
+			anphi = (1.0f + sphi) / (1.0f - sphi);
+			anpsi = (1.0f + spsi) / (1.0f - spsi);
+			
+			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 */
+				abort();
+			}
+			
+			
+			/* CHECK FOR COMPOSITE YIELD CRITERION  */
+			fs = s[0] - s[2] * anphi + 2 * cohesion * sqrt( anphi );
+			ft = s[2] - st;
+                        ind=0;
+			if( fs < 0.0f || ft > 0.0f ) {
+                                if(!plasticStrainReportedFlag) {
+                                        plasticStrainReportedFlag=1;
+                                }
+				/*! Failure: shear or tensile */
+				ind=1;
+				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 increament */
+
+				dep1 = 0.0f;
+				dep2 = 0.0f;
+				dep3 = 0.0f;
+			}
+
+			depm=0.0;
+			if(ind) {
+				/* Second invariant of accumulated plastic increament  */
+				depm = ( dep1 + dep2 + dep3 ) / 3.0f;
+				plasticElement->plasticStrain[tetra_I] += sqrt( 0.5f * ((dep1-depm) * (dep1-depm) + (dep2-depm) * (dep2-depm) + (dep3-depm) * (dep3-depm) + depm*depm) );
+
+				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];
+						}
+					}
+				}
+			}
+			depls += plasticElement->plasticStrain[tetra_I]*element->tetra[tetra_I].volume;
+			totalVolume += element->tetra[tetra_I].volume;
+/* 			if(element_lI==738) fprintf(stderr,"   *****  %d: depm=%g  acc plastic strain=%g\n", tetra_I, depm, element->tetra[tetra_I].volume); */
+		}
+		/* volume-averaged accumulated plastic strain, aps */
+		plasticElement->aps = depls/totalVolume;
+/* 		if(element_lI==738) fprintf(stderr,"   *****  acc plastic strain=%g\n", plasticElement->aps); */
+	}
+}
+
+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));
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Constitutive.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	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 __SnacPlastic_h__
+#define __SnacPlastic_h__
+	
+	void SnacPlastic_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 /* __SnacPlastic_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,97 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 2498 2005-01-07 03:57:00Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#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 "ConstructExtensions.h"
+#include <assert.h>
+#include <limits.h>
+#ifndef PATH_MAX
+	#define PATH_MAX 1024
+#endif
+
+void _SnacVelocity_VariableCondition( Index node_dI, Variable_Index var_I, void* _context, void* result ){
+	Snac_Context*			context = (Snac_Context*)_context;
+	Mesh*				mesh = context->mesh;
+	MeshLayout*			layout = (MeshLayout*)mesh->layout;
+	HexaMD*				decomp = (HexaMD*)layout->decomp;
+	
+	double*				velComponent = (double*)result;
+	IJK				ijk;
+	Node_GlobalIndex		node_gI = _MeshDecomp_Node_LocalToGlobal1D( decomp, node_dI );
+	Index              oneThird = (unsigned int)((11.0/30.0)*decomp->nodeGlobal3DCounts[0]);
+	Index              twoThirds = (unsigned int)((19.0/30.0)*decomp->nodeGlobal3DCounts[0]);
+
+	const double vmag = 1.4e-06;
+
+	RegularMeshUtils_Node_1DTo3D( decomp, node_gI, &ijk[0], &ijk[1], &ijk[2] );
+	
+	if( ijk[0] < oneThird )
+		(*velComponent) = -1.0*vmag;
+	else if( ijk[0] >= oneThird && ijk[0] <= twoThirds )
+		(*velComponent) =  -1.0*vmag + 2.0*vmag*((double)(ijk[0])-(double)oneThird)/((double)twoThirds-(double)oneThird);
+	else
+		(*velComponent) = vmag;
+}
+
+void _SnacPlastic_ConstructExtensions( void* _context, void* data ) {
+	Snac_Context*				context = (Snac_Context*)_context;
+	SnacPlastic_Context*			contextExt = ExtensionManager_Get(
+							context->extensionMgr,
+							context,
+							SnacPlastic_ContextHandle );
+	char					tmpBuf[PATH_MAX];
+
+	#if DEBUG
+		printf( "In %s()\n", __func__ );
+	#endif
+
+		ConditionFunction_Register_Add(
+									   context->condFunc_Register,
+									   ConditionFunction_New( _SnacVelocity_VariableCondition, "variableVelBC" ) );
+
+	/* Prepare the dump and checkpoint 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();
+	}
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/ConstructExtensions.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 1677 2004-07-20 10:30:34Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_ConstructExtensions_h__
+#define __SnacPlastic_ConstructExtensions_h__
+	
+	void _SnacPlastic_ConstructExtensions( void* _context, void* data );
+	
+#endif /* __SnacPlastic_ConstructExtensions_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 1792 2004-07-30 05:42:39Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#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 SnacPlastic_Context_Print( void* _context ) {
+	SnacPlastic_Context*	self = (SnacPlastic_Context*)_context;
+	
+	printf( "SnacPlastic_Context:\n" );
+	printf( "\tplstrain (ptr): %p", self->plStrainOut );
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Context.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Context.h 1677 2004-07-20 10:30:34Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_Context_h__
+#define __SnacPlastic_Context_h__
+	
+	/* Context Information */
+	struct _SnacPlastic_Context {
+		/* Dumping */
+		FILE*				plStrainOut;
+		FILE*				plStrainCheckpoint;
+	};
+	
+	/* Print the contents of the context extension */
+	void SnacPlastic_Context_Print( void* _context );
+	
+#endif /* __SnacPlastic_Context_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 1792 2004-07-30 05:42:39Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#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 SnacPlastic_Element_Print( void* element ) {
+	SnacPlastic_Element*	self = (SnacPlastic_Element*)element;
+	Tetrahedra_Index	tetra_I;
+	
+	printf( "SnacPlastic_Element:\n" );
+	printf( "\tplasticStrain: " );
+	for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+		printf( "%g, ", self->plasticStrain[tetra_I] );
+	}
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Element.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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
+**
+*/
+/** \file
+** Role:
+**	Snac plastic properties for an element.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Element.h 1720 2004-07-22 18:33:41Z EunseoChoi $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_Element_h__
+#define __SnacPlastic_Element_h__
+
+	/* Element Information */
+	struct _SnacPlastic_Element {
+		Strain			plasticStrain[Tetrahedra_Count];
+		Strain		        aps;
+	};
+
+	/* Print the contents of an Element */
+	void SnacPlastic_Element_Print( void* element );
+
+#endif /* __SnacPlastic_Element_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,114 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 2498 2005-01-07 03:57:00Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Element.h"
+#include "InitialConditions.h"
+#include "Register.h"
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+void SnacPlastic_InitialConditions( void* _context ) {
+	Snac_Context*			context = (Snac_Context*)_context;
+	Element_LocalIndex		element_lI;
+	Dictionary_Entry_Value* materialList = Dictionary_Get( context->dictionary, "materials" );
+	int						PhaseI = 0;
+#ifdef DEBUG
+	printf( "In: _SnacPlastic_InitialConditions( void* )\n" );
+#endif
+
+	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_Plastic;
+			PhaseI++;
+			materialEntry                               = materialEntry->next;
+		}
+	}
+	else
+		context->materialProperty[PhaseI].rheology |= Snac_Material_Plastic;
+
+	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 );
+			SnacPlastic_Element*		plasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element,
+															SnacPlastic_ElementHandle );
+			const Snac_Material* 		material = &context->materialProperty[element->material_I];
+
+			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;
+
+					fscanf( plStrainIn, "%le", &tetraPlStrain );
+					plasticElement->plasticStrain[tetra_I] = tetraPlStrain;
+					depls += plasticElement->plasticStrain[tetra_I]*element->tetra[tetra_I].volume;
+					totalVolume += element->tetra[tetra_I].volume;
+				}
+				/* volume-averaged accumulated plastic strain, aps */
+				plasticElement->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 );
+			SnacPlastic_Element*	plasticElement = ExtensionManager_Get( context->mesh->elementExtensionMgr, element, 
+																		   SnacPlastic_ElementHandle );
+			Tetrahedra_Index	tetra_I;
+			
+			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+				plasticElement->plasticStrain[tetra_I] = 0.0f;
+			}
+			plasticElement->aps = 0.0f;
+		}
+	}
+}
+		

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/InitialConditions.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 1084 2004-03-26 11:17:10Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_InitialConditions_h__
+#define __SnacPlastic_InitialConditions_h__
+	
+	void SnacPlastic_InitialConditions( void* _context );
+	
+#endif /* __SnacPlastic_InitialConditions_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Make.mm
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Make.mm	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Make.mm	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 2921 2005-05-10 06:44:06Z EunseoChoi $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+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::

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Makefile.def
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Makefile.def	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Makefile.def	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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.
+##	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 2713 2005-03-01 19:14:08Z EunseoChoi $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+def_mod = SnacPlastic
+def_inc = Snac/Plastic
+
+def_srcs = \
+	Element.c \
+	Context.c \
+	ConstructExtensions.c \
+	Constitutive.c \
+	Output.c \
+	Register.c \
+	InitialConditions.c \
+	Remesh.c \
+
+def_hdrs = \
+	Element.h \
+	Context.h \
+	ConstructExtensions.h \
+	Constitutive.h \
+	Output.h \
+	Register.h \
+	InitialConditions.h \
+	Remesh.h \
+	Plastic.h \
+	types.h
+

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,108 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 2498 2005-01-07 03:57:00Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#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>
+
+
+
+void _SnacPlastic_WritePlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+
+	if( isTimeToDump( context ) )
+		_SnacPlastic_DumpPlasticStrain( context );
+
+	if( isTimeToCheckpoint( context ) )
+		_SnacPlastic_CheckpointPlasticStrain( context );
+
+}
+
+
+void _SnacPlastic_DumpPlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacPlastic_Context*		contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacPlastic_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 );
+		SnacPlastic_Element*		elementExt = ExtensionManager_Get(
+													context->mesh->elementExtensionMgr,
+													element,
+													SnacPlastic_ElementHandle );
+		float plasticStrain = elementExt->aps;
+		/* Take average of tetra plastic strain for the element */
+		fwrite( &plasticStrain, sizeof(float), 1, contextExt->plStrainOut );
+	}
+	fflush( contextExt->plStrainOut );
+}
+
+
+void _SnacPlastic_CheckpointPlasticStrain( void* _context ) {
+	Snac_Context*				context = (Snac_Context*) _context;
+	SnacPlastic_Context*		contextExt = ExtensionManager_Get(
+												context->extensionMgr,
+												context,
+												SnacPlastic_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 );
+		SnacPlastic_Element*		plasticElement = ExtensionManager_Get(
+														context->mesh->elementExtensionMgr,
+														element,
+														SnacPlastic_ElementHandle );
+		Tetrahedra_Index	tetra_I;
+		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+			float plasticStrain = plasticElement->plasticStrain[tetra_I];
+			fwrite( &plasticStrain, sizeof(float), 1, contextExt->plStrainCheckpoint );
+		}
+	}
+	fflush( contextExt->plStrainCheckpoint );
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Output.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,39 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 1677 2004-07-20 10:30:34Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef _SnacPlastic_Output_
+#define _SnacPlastic_Output_
+
+	void _SnacPlastic_WritePlasticStrain( void* _context );
+	void _SnacPlastic_DumpPlasticStrain( void* _context );
+	void _SnacPlastic_CheckpointPlasticStrain( void* _context );
+
+#endif

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Plastic.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Plastic.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Plastic.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,55 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Plastic.h 2202 2004-10-19 08:43:09Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_h__
+#define __SnacPlastic_h__
+	
+#include "Constitutive.h"
+#include "ConstructExtensions.h"
+#include "Context.h"
+#include "Element.h"
+#include "InitialConditions.h"
+#include "Output.h"
+#include "Plastic.h"
+#include "Register.h" 
+#include "Remesh.h"
+#include "types.h"
+
+#endif /* __SnacPlastic_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,134 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 SnacPlastic_Type = "SnacPlastic";
+
+ExtensionInfo_Index SnacPlastic_ElementHandle;
+ExtensionInfo_Index SnacPlastic_ContextHandle;
+
+
+Index _SnacPlastic_Register( PluginsManager* pluginsMgr ) {
+	return PluginsManager_Submit( pluginsMgr, 
+				      SnacPlastic_Type, 
+				      "0", 
+				      _SnacPlastic_DefaultNew );
+}
+
+
+void* _SnacPlastic_DefaultNew( Name name ) {
+	return _Codelet_New( sizeof(Codelet), 
+			     SnacPlastic_Type, 
+			     _Codelet_Delete, 
+			     _Codelet_Print, 
+			     _Codelet_Copy, 
+			     _SnacPlastic_DefaultNew, 
+			     _SnacPlastic_Construct, 
+			     _Codelet_Build, 
+			     _Codelet_Initialise, 
+			     _Codelet_Execute, 
+			     _Codelet_Destroy, 
+			     name );
+}
+
+
+void _SnacPlastic_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: _SnacPlastic_Register( void*, void* )\n" );
+	#endif
+	
+	/* Add extensions to nodes, elements and the context */
+	SnacPlastic_ElementHandle = ExtensionManager_Add( context->mesh->elementExtensionMgr, SnacPlastic_Type, sizeof(SnacPlastic_Element) );
+	SnacPlastic_ContextHandle = ExtensionManager_Add( context->extensionMgr, SnacPlastic_Type, sizeof(SnacPlastic_Context) );
+	
+	#ifdef DEBUG
+		printf( "\tcontext extension handle: %u\n", SnacPlastic_ContextHandle );
+		printf( "\telement extension handle: %u\n", SnacPlastic_ElementHandle );
+	#endif
+	
+	/* Add extensions to the entry points */
+	EntryPoint_Append( 
+		Context_GetEntryPoint( context,	Snac_EP_Constitutive ),
+		SnacPlastic_Type, 
+		SnacPlastic_Constitutive, 
+		SnacPlastic_Type );
+	EntryPoint_InsertBefore( 
+		Context_GetEntryPoint( context,	AbstractContext_EP_Initialise ),
+		"SnacTimeStepZero",
+		SnacPlastic_Type, 
+		SnacPlastic_InitialConditions,
+		SnacPlastic_Type );
+	EntryPoint_Prepend( /* Dump the initial plastic strain */
+		Context_GetEntryPoint( context, AbstractContext_EP_Execute ),
+		"SnacPlastic_Write",
+		_SnacPlastic_WritePlasticStrain,
+		SnacPlastic_Type );
+	EntryPoint_Append( /* and dump each loop */
+		Context_GetEntryPoint( context, Snac_EP_CalcStresses ),
+		"SnacPlastic_Write",
+		_SnacPlastic_WritePlasticStrain,
+		SnacPlastic_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,
+			SnacPlastic_Type, 
+			_SnacPlastic_InterpolateElement, 
+			SnacPlastic_Type );
+	}
+
+
+	/* Construct. */
+	_SnacPlastic_ConstructExtensions( context, data );
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Register.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 __SnacPlastic_Register_h__
+#define __SnacPlastic_Register_h__
+	
+	/* Textual name of this class */
+	extern const Type SnacPlastic_Type;
+	
+	extern ExtensionInfo_Index SnacPlastic_ElementHandle;
+	
+	extern ExtensionInfo_Index SnacPlastic_ContextHandle;
+	
+	Index _SnacPlastic_Register( PluginsManager* pluginsMgr );
+
+	void* _SnacPlastic_DefaultNew( Name name );
+
+	void _SnacPlastic_Construct( void* component, Stg_ComponentFactory* cf, void* data );
+	
+#endif /* __SnacPlastic_Register_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.c	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,103 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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/Remesher.h"
+#include "Snac/Remesher/Mesh.h"
+#include "types.h"
+#include "Element.h"
+#include "Remesh.h"
+#include "Register.h"
+
+void _SnacPlastic_InterpolateElement( void*				 	_context, 
+									  Element_LocalIndex 	dstEltInd, 
+									  Tetrahedra_Index	 	dstTetInd, 
+									  Snac_Element*	 		dstElements, 
+									  Element_DomainIndex 	srcEltInd, 
+									  Tetrahedra_Index		 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;
+	Snac_Element*			element = (Snac_Element*)ExtensionManager_At( context->mesh->elementExtensionMgr, 
+										      dstElements, 
+										      dstEltInd );
+	SnacPlastic_Element*	elementExt = ExtensionManager_Get( context->mesh->elementExtensionMgr, 
+									   element, 
+									   SnacPlastic_ElementHandle );
+	Element_DomainIndex 	eltdI[8],eldI,eldJ,eldK;
+	Index 					coef_I;
+	Element_DomainIndex		neldI =  decomp->elementDomain3DCounts[0];
+	Element_DomainIndex		neldJ =  decomp->elementDomain3DCounts[1];
+
+#ifdef DEBUG
+	printf( "element_lI: %u, fromElement_lI: %u\n", dstEltInd, srcEltInd );
+#endif
+	
+	/* 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] = eldI     + eldJ*neldI     + eldK*neldI*neldJ;
+	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;
+
+	elementExt->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*)ExtensionManager_At( context->mesh->elementExtensionMgr, 
+												dstElements, 
+												meshExt->orderedToDomain[eltdI[TetraToNode[srcTetInd][coef_I]]] );
+		SnacPlastic_Element*	srcEltExt = ExtensionManager_Get( context->mesh->elementExtensionMgr, 
+																  srcElt, 
+																  SnacPlastic_ElementHandle );
+		elementExt->plasticStrain[dstTetInd] += meshExt->barcord[dstEltInd].L[coef_I]*srcEltExt->plasticStrain[dstTetInd];
+	}
+	/* if( (context->rank==1 && (dstElementInd <=7 && dstElementInd >= 6) ) ) //(context->rank==2 && dstElementInd <=2 ) */
+	/* 	fprintf(stderr, "element_lI: (%u %u %e), fromElement_lI: (%u %u %e)\n",  */
+	/* 			dstElementInd, dstTetInd, elementExt->plasticStrain[dstTetInd], */
+	/* 			srcElementInd, srcTetInd, fromElementExt->plasticStrain[srcTetInd] ); */
+}

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/Remesh.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Remesh.h 3250 2006-10-23 06:15:18Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_Remesh_h__
+#define __SnacPlastic_Remesh_h__
+	void _SnacPlastic_InterpolateElement( void*				 	_context, 
+										  Element_LocalIndex 	dstEltInd, 
+										  Tetrahedra_Index	 	dstTetInd, 
+										  Snac_Element*	 		dstElements, 
+										  Element_DomainIndex 	srcEltInd, 
+										  Tetrahedra_Index		 srcTetInd );
+	
+#endif /* __SnacPlastic_Remesh_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/make.log
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/make.log	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/make.log	2011-11-13 05:29:55 UTC (rev 19190)
@@ -0,0 +1,5 @@
+make[1]: Entering directory `/home/echoi/opt/SNAC_realclean/Snac/plugins/plastic_BI'
+/usr/bin/cc -pipe  -DVERSION=\"0\" -DCURR_MODULE_NAME=\"SnacPlastic\" -DPLUGIN_NAME=SnacPlastic -Wall -g   -fPIC -c -o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Remesh.o -I/home/echoi/opt/SNAC_realclean/build/include   -I/home/echoi/opt/SNAC_realclean/build/include/StGermain -I/home/echoi/opt/SNAC_realclean/build/include   -I/usr/lib/openmpi/include   -I/usr/include/libxml2     -I/usr/local/include -DHAVE_GSL=1    Remesh.c
+/usr/bin/cc -pipe  -DVERSION=\"0\" -DCURR_MODULE_NAME=\"SnacPlastic\" -DPLUGIN_NAME=SnacPlastic -Wall -g   -o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/SnacPlasticmodule.so /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Element.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Context.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/ConstructExtensions.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Constitutive.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Output.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Register.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/InitialConditions.o /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/Remesh.o  -shared  -L/home/echoi/opt/SNAC_realclean/build/lib   -L/home/echoi/opt/SNAC_realclean/build/lib  -lSnac -lStGermain   -L/usr/lib/openmpi/lib -lmpi   -lxml2   -lm   -L/usr/local/lib -lgsl -lgslcblas   -Xlinker -rpath -Xlinker /usr/lib/openmpi/lib         -Xlinker -rpath -Xlinker /usr/local/lib   
+/bin/cp -f /home/echoi/opt/SNAC_realclean/build/tmp/mod-SnacPlasticmodule.so/SnacPlasticmodule.so /home/echoi/opt/SNAC_realclean/build/lib/SnacPlasticmodule.so
+make[1]: Leaving directory `/home/echoi/opt/SNAC_realclean/Snac/plugins/plastic_BI'

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/makefile
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/makefile	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/makefile	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 3049 2005-06-22 07:46:15Z AlanLo $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# 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 GSL
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/SNAC/trunk/Snac/plugins/plastic_BI/types.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/plastic_BI/types.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/plastic_BI/types.h	2011-11-13 05:29:55 UTC (rev 19190)
@@ -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 1677 2004-07-20 10:30:34Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacPlastic_types_h__
+#define __SnacPlastic_types_h__
+	
+	/* Plastic */
+	typedef struct _SnacPlastic_Element	SnacPlastic_Element;
+	typedef struct _SnacPlastic_Context	SnacPlastic_Context;
+	
+#endif /* __SnacPlastic_types_h__ */



More information about the CIG-COMMITS mailing list