[cig-commits] r14977 - in long/3D/SNAC/trunk/Snac: plugins plugins/tractionBC tests tests/traction

echoi at geodynamics.org echoi at geodynamics.org
Mon May 11 08:27:44 PDT 2009


Author: echoi
Date: 2009-05-11 08:27:43 -0700 (Mon, 11 May 2009)
New Revision: 14977

Added:
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.c
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.h
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Make.mm
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Makefile.def
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.c
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.h
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/makefile
   long/3D/SNAC/trunk/Snac/plugins/tractionBC/types.h
   long/3D/SNAC/trunk/Snac/tests/traction/
   long/3D/SNAC/trunk/Snac/tests/traction/README
   long/3D/SNAC/trunk/Snac/tests/traction/traction.xml
Log:
A plugin for applying traction BCs created.
	- No control through input files available yet.
	- Works only for the "wall" type boundaries.
	- Tested with a uniaxial problem
		(see tests/traction/README).



Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.c	2009-05-11 15:27:43 UTC (rev 14977)
@@ -0,0 +1,270 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: VariableConditions.c 1410 2004-05-17 00:49:44Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Force.h"
+#include "Register.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+void _SnacTractionBC_Force_Apply(
+		void*				_context,
+		Node_LocalIndex			node_lI,
+		double				speedOfSound,
+		Mass*				mass,
+		Mass*				inertialMass,
+		Force*				force,
+		Force*				balance )
+{
+	Snac_Context*			context = (Snac_Context*)_context;
+	MeshLayout*				meshLayout = (MeshLayout*)context->meshLayout;
+	double					area, normal1[3], normal2[3], normal[3];
+	Node_ElementIndex		nodeElement_I, nodeElementCount;
+	const double			factor4 = 1.0f / 4.0f;
+
+	/* loop over all the elements surrounding node_dI */
+	HexaMD*					decomp = (HexaMD*)meshLayout->decomp;
+	Node_GlobalIndex		node_gI = context->mesh->nodeL2G[node_lI];
+	IJK						ijk;
+	
+	double 				 	pressure;
+	StressTensor 			stress;
+	Force					traction;	
+
+	pressure = 1.0e+08;
+	stress[0][0] = 1.0e+08;
+	stress[0][1] = 0.0;
+	stress[0][2] = 0.0;
+	stress[1][0] = 0.0;
+	stress[1][1] = 0.0;
+	stress[1][2] = 0.0;
+	stress[2][0] = 0.0;
+	stress[2][1] = 0.0;
+	stress[2][2] = 0.0;
+	
+	RegularMeshUtils_Node_1DTo3D( decomp, node_gI, &ijk[0], &ijk[1], &ijk[2] );
+
+#if 0
+	if(ijk[0]==0) { /* for the "left" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "left" face of the elements on the "left" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											   Snac_Element_NodeCoord( context, element_lI, 7 ),
+											   Snac_Element_NodeCoord( context, element_lI, 3 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											Snac_Element_NodeCoord( context, element_lI, 4 ),
+											Snac_Element_NodeCoord( context, element_lI, 7 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 7 ),
+										  Snac_Element_NodeCoord( context, element_lI, 3 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 4 ),
+										  Snac_Element_NodeCoord( context, element_lI, 7 ),
+										  &normal2 );
+#endif
+#if 0
+	if(ijk[1]==0) { /* for the "bottom" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "bottom" face of the elements on the "bottom" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											   Snac_Element_NodeCoord( context, element_lI, 1 ),
+											   Snac_Element_NodeCoord( context, element_lI, 5 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											Snac_Element_NodeCoord( context, element_lI, 5 ),
+											Snac_Element_NodeCoord( context, element_lI, 4 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 1 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  Snac_Element_NodeCoord( context, element_lI, 4 ),
+										  &normal2 );
+#endif
+#if 0
+	if(ijk[1]==0) { /* for the "bottom" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "bottom" face of the elements on the "bottom" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											   Snac_Element_NodeCoord( context, element_lI, 1 ),
+											   Snac_Element_NodeCoord( context, element_lI, 5 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											Snac_Element_NodeCoord( context, element_lI, 5 ),
+											Snac_Element_NodeCoord( context, element_lI, 4 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 1 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  Snac_Element_NodeCoord( context, element_lI, 4 ),
+										  &normal2 );
+#endif
+#if 0
+	if(ijk[1]==(decomp->nodeGlobal3DCounts[1]-1)) { /* for the "top" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "top" face of the elements on the "top" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 2 ),
+											   Snac_Element_NodeCoord( context, element_lI, 3 ),
+											   Snac_Element_NodeCoord( context, element_lI, 7 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 2 ),
+											Snac_Element_NodeCoord( context, element_lI, 7 ),
+											Snac_Element_NodeCoord( context, element_lI, 6 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 2 ),
+										  Snac_Element_NodeCoord( context, element_lI, 3 ),
+										  Snac_Element_NodeCoord( context, element_lI, 7 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 2 ),
+										  Snac_Element_NodeCoord( context, element_lI, 7 ),
+										  Snac_Element_NodeCoord( context, element_lI, 6 ),
+										  &normal2 );
+#endif
+#if 0
+	if(ijk[2]==0)) { /* for the "back" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "back" face of the elements on the "back" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											   Snac_Element_NodeCoord( context, element_lI, 2 ),
+											   Snac_Element_NodeCoord( context, element_lI, 1 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 0 ),
+											Snac_Element_NodeCoord( context, element_lI, 3 ),
+											Snac_Element_NodeCoord( context, element_lI, 2 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 2 ),
+										  Snac_Element_NodeCoord( context, element_lI, 1 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 0 ),
+										  Snac_Element_NodeCoord( context, element_lI, 3 ),
+										  Snac_Element_NodeCoord( context, element_lI, 2 ),
+										  &normal2 );
+#endif
+#if 0
+	if(ijk[2]==(decomp->nodeGlobal3DCounts[2]-1)) { /* for the "front" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "front" face of the elements on the "front" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 4 ),
+											   Snac_Element_NodeCoord( context, element_lI, 5 ),
+											   Snac_Element_NodeCoord( context, element_lI, 6 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 4 ),
+											Snac_Element_NodeCoord( context, element_lI, 6 ),
+											Snac_Element_NodeCoord( context, element_lI, 7 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 4 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  Snac_Element_NodeCoord( context, element_lI, 6 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 4 ),
+										  Snac_Element_NodeCoord( context, element_lI, 6 ),
+										  Snac_Element_NodeCoord( context, element_lI, 7 ),
+										  &normal2 );
+#endif
+	if(ijk[0]==(decomp->nodeGlobal3DCounts[0]-1)) { /* for the "right" wall. */
+		nodeElementCount = context->mesh->nodeElementCountTbl[node_lI];
+		for( nodeElement_I = 0; nodeElement_I < nodeElementCount; nodeElement_I++ ) {
+			Element_LocalIndex		element_lI = context->mesh->nodeElementTbl[node_lI][nodeElement_I];
+
+			if( element_lI < context->mesh->elementDomainCount ) {
+				/* for the "right" face of the elements on the "right" wall. */
+				area = Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 1 ),
+											   Snac_Element_NodeCoord( context, element_lI, 2 ),
+											   Snac_Element_NodeCoord( context, element_lI, 6 ) ) +
+					Tetrahedra_SurfaceArea( Snac_Element_NodeCoord( context, element_lI, 1 ),
+											Snac_Element_NodeCoord( context, element_lI, 6 ),
+											Snac_Element_NodeCoord( context, element_lI, 5 ) );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 1 ),
+										  Snac_Element_NodeCoord( context, element_lI, 2 ),
+										  Snac_Element_NodeCoord( context, element_lI, 6 ),
+										  &normal1 );
+				Tetrahedra_SurfaceNormal( Snac_Element_NodeCoord( context, element_lI, 1 ),
+										  Snac_Element_NodeCoord( context, element_lI, 6 ),
+										  Snac_Element_NodeCoord( context, element_lI, 5 ),
+										  &normal2 );
+				
+				normal[0] = 0.5f * ( normal1[0] + normal2[0] );
+				normal[1] = 0.5f * ( normal1[1] + normal2[1] );
+				normal[2] = 0.5f * ( normal1[2] + normal2[2] );
+				
+#if 0
+				/* Directly applying tractions [N/m^2]. */
+				(*force)[0] += factor4 * area * traction[0];
+				(*force)[1] += factor4 * area * traction[1];
+				(*force)[2] += factor4 * area * traction[2];
+#endif
+#if 0
+				/* When a pressure is the source. */
+				(*force)[0] += factor4 * ( pressure * area * normal[0] );
+				(*force)[1] += factor4 * ( pressure * area * normal[1] );
+				(*force)[2] += factor4 * ( pressure * area * normal[2] );
+#endif
+				/* When a full stress tensor is the source. */
+				(*force)[0] += factor4 * area *
+					( stress[0][0]*normal[0]+stress[0][1]*normal[1]+stress[0][2]*normal[2] );
+				(*force)[1] += factor4 * area *
+					( stress[1][0]*normal[0]+stress[1][1]*normal[1]+stress[1][2]*normal[2] );
+				(*force)[2] += factor4 * area *
+					( stress[2][0]*normal[0]+stress[2][1]*normal[1]+stress[2][2]*normal[2] );
+				
+				(*balance)[0] += fabs( (*force)[0] );
+				(*balance)[1] += fabs( (*force)[1] );
+				(*balance)[2] += fabs( (*force)[2] );
+			}
+		}
+	}
+}

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Force.h	2009-05-11 15:27:43 UTC (rev 14977)
@@ -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
+**
+** Role:
+**	Handles the temperature initial and boundary conditions
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: VariableConditions.h 1247 2004-04-20 00:40:15Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacTractionBC_Force_h__
+#define __SnacTractionBC_Force_h__
+
+	void _SnacTractionBC_Force_Apply(
+		void*				context,
+		Node_LocalIndex			node_lI,
+		double				speedOfSound,
+		Mass*				mass,
+		Mass*				inertialMass,
+		Force*				force,
+		Force*				balance );
+
+#endif /* __SnacTractionBC_Forc_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Make.mm
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Make.mm	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Make.mm	2009-05-11 15:27:43 UTC (rev 14977)
@@ -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::

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Makefile.def
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Makefile.def	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Makefile.def	2009-05-11 15:27:43 UTC (rev 14977)
@@ -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.
+##	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 1431 2004-05-18 07:19:21Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_mod = SnacTractionBC
+def_inc = Snac/TractionBC
+
+def_srcs = \
+	Force.c \
+	Register.c
+
+def_hdrs = \
+	types.h \
+	Force.h \
+	Register.h

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.c	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.c	2009-05-11 15:27:43 UTC (rev 14977)
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 1431 2004-05-18 07:19:21Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StGermain/FD/FD.h>
+#include "Snac/Snac.h"
+#include "types.h"
+#include "Force.h"
+#include "Register.h"
+
+/* Textual name of this class */
+const Type SnacTractionBC_Type = "SnacTractionBC";
+
+
+Index _SnacTractionBC_Register( PluginsManager* pluginsMgr ) {
+	return PluginsManager_Submit( pluginsMgr, 
+				      SnacTractionBC_Type, 
+				      "0", 
+				      _SnacTractionBC_DefaultNew );
+}
+
+
+void* _SnacTractionBC_DefaultNew( Name name ) {
+	return _Codelet_New( sizeof(Codelet), 
+			     SnacTractionBC_Type, 
+			     _Codelet_Delete, 
+			     _Codelet_Print, 
+			     _Codelet_Copy, 
+			     _SnacTractionBC_DefaultNew, 
+			     _SnacTractionBC_Construct, 
+			     _Codelet_Build, 
+			     _Codelet_Initialise, 
+			     _Codelet_Execute, 
+			     _Codelet_Destroy, 
+			     name );
+}
+
+void _SnacTractionBC_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	Snac_Context*	context;
+
+	/* Retrieve context. */
+	context = (Snac_Context*)Stg_ComponentFactory_ConstructByName( cf, "context", Snac_Context, True, data ); 
+
+	#ifdef DEBUG
+		printf( "In: _SnacTractionBC_Register( void* )\n" );
+	#endif
+
+	/* Add extensions to nodes, elements and the context */
+	EntryPoint_Append(
+		Context_GetEntryPoint( context, Snac_EP_Force ),
+		SnacTractionBC_Type,
+		_SnacTractionBC_Force_Apply,
+		SnacTractionBC_Type );
+}

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/Register.h	2009-05-11 15:27:43 UTC (rev 14977)
@@ -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:
+**	Only one can be registered at the time (limitation).
+**
+** Comments:
+**
+** $Id: Register.h 1431 2004-05-18 07:19:21Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacTractionBC_Register_h__
+#define __SnacTractionBC_Register_h__
+
+	/* Textual name of this class */
+	extern const Type SnacTractionBC_Type;
+
+	Index _SnacTractionBC_Register( PluginsManager* pluginsMgr );
+
+	void* _SnacTractionBC_DefaultNew( Name name );
+
+	void _SnacTractionBC_Construct( void* component, Stg_ComponentFactory* cf, void* data );
+
+#endif /* __SnacTractionBC_Register_h__ */

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/makefile
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/makefile	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/makefile	2009-05-11 15:27:43 UTC (rev 14977)
@@ -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 716 2004-01-29 12:56:12Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# 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

Added: long/3D/SNAC/trunk/Snac/plugins/tractionBC/types.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/tractionBC/types.h	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/plugins/tractionBC/types.h	2009-05-11 15:27:43 UTC (rev 14977)
@@ -0,0 +1,46 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 1431 2004-05-18 07:19:21Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __SnacTractionBC_types_h__
+#define __SnacTractionBC_types_h__
+
+#endif /* __SnacTractionBC_types_h__ */

Added: long/3D/SNAC/trunk/Snac/tests/traction/README
===================================================================
--- long/3D/SNAC/trunk/Snac/tests/traction/README	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/tests/traction/README	2009-05-11 15:27:43 UTC (rev 14977)
@@ -0,0 +1,15 @@
+An extremely simple 1D benchmark for the tractionBC plugin.
+	- EChoi 2009/05/08
+
+An elastic bar of 2x1x1 (2x1x1 m) elements is stretched by a given traction (specified in Snac/plugins/tractionBC/Force.c). The traction is applied on the "right" wall, while the "left" wall is fixed in the x direction. All the other surfaces are free to move, making the solution that of 1D stretching.
+
+Verification can be made by the elastic constitutive equation:
+sigma_xx = E * epsilon_xx,
+where simga_xx is the resultant stress, E is the Young's modulus, and epsilon_xx is the total strain.
+
+Noting that sigma_xx should have the same magnitude with the applied traction,
+results for the default values are supposed to have the following values:
+1.0e+08 Pa = 2.5e+10 Pa * 0.004.
+
+Strain from SNAC's solution can be computed by running "snac2vtk ./ 1 5000" and comparing the coordinates in snac.0.000001.vts and snac.0.005001.vts.
+Also, the stress values can be viewed by "od -f stressTensor.0".

Added: long/3D/SNAC/trunk/Snac/tests/traction/traction.xml
===================================================================
--- long/3D/SNAC/trunk/Snac/tests/traction/traction.xml	                        (rev 0)
+++ long/3D/SNAC/trunk/Snac/tests/traction/traction.xml	2009-05-11 15:27:43 UTC (rev 14977)
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<!-- StGermain-Snac input file-->
+<!--  This file is the simplest input file... no BCs but geometry and velocity intialised  -->
+<!-- $Id: basic.xml 3219 2006-06-14 23:27:59Z EunseoChoi $ -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<!-- StGermain simulation parameters -->
+	<param name="start"> 0 </param>
+	<param name="maxTimeSteps"> 5000 </param>
+	<param name="outputPath">./data</param>
+	<param name="dumpEvery"> 100 </param>
+	<param name="checkpointEvery"> 0 </param>
+	<param name="restartTimeStep"> 0 </param>
+	
+	<!-- Snac variables -->
+	<param name="density"> 2700 </param>
+	<param name="gravity"> 0 </param>
+	<param name="demf"> 0.8 </param>
+	<param name="dtType"> constant </param>
+	<param name="timeStep"> 3.1536e+07 </param>
+	<param name="forceCalcType"> complete </param>
+	<param name="decomposedAxis"> 0 </param> <!-- hack: 0=X, 1=Y, 2=Z. Should and will eventually be automatically discovered-->
+	<param name="storeForces"> no </param>
+	<param name="forceCheckSum"> no </param>
+	<param name="topo_kappa"> 0.0 </param>
+	<param name="alpha"> 0 </param>
+	
+	<!-- Extension modules -->
+	<!--
+	  -->
+	<list name="plugins">
+		<param> SnacElastic </param>
+		<param> SnacTractionBC </param>
+	</list>
+
+	<param name="journal.verbose"> on </param>
+	<param name="journal.debug"> on </param>
+	<param name="journal.debug.Context"> on </param>
+	<param name="journal.debug.Snac_Parallel"> on </param>
+
+	<struct name="mesh">
+		<!-- Mesh size -->
+		<param name="meshSizeI"> 3 </param>
+		<param name="meshSizeJ"> 2 </param>
+		<param name="meshSizeK"> 2 </param>
+		
+		<!-- Initial geometry -->
+		<param name="minX"> 0 </param>
+		<param name="minY"> 0 </param>
+		<param name="minZ"> 0 </param>
+		<param name="maxX"> 2 </param>
+		<param name="maxY"> 1 </param>
+		<param name="maxZ"> 1 </param>
+
+ 		<param name="buildNodeNeighbourTbl"> True </param>
+	</struct>
+	
+	<!-- Elastic material parameters -->
+	<param name="lambda"> 1.0e+10 </param>
+	<param name="mu"> 1.0e+10 </param>
+
+	<!-- node ICs -->
+	<struct name="nodeICs">
+		<list name="vcList">
+			<struct>
+				<param name="type"> AllNodesVC </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vx</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+					<struct>
+						<param name="name">vy</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+					<struct>
+						<param name="name">vz</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+		</list>
+	</struct>
+
+	<!-- element ICs -->
+	<struct name="elementICs">
+		<list name="vcList">
+			<struct>
+				<param name="type"> AllElementsVC </param>
+				<list name="variables">
+					<struct>
+						<param name="name">elementMaterial</param>
+						<param name="type">int</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+		</list>
+	</struct>
+
+	<!-- Velocity BCs -->
+	<struct name="velocityBCs">
+		<list name="vcList">
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> left </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vx</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+		</list>
+	</struct>
+</StGermainData>



More information about the CIG-COMMITS mailing list