[cig-commits] r4898 - in long/3D/Gale/trunk/src/StgFEM: .
plugins/VelicAnalyticSolutions
plugins/VelicAnalyticSolutions/Velic_solCA
walter at geodynamics.org
walter at geodynamics.org
Wed Oct 11 13:50:16 PDT 2006
Author: walter
Date: 2006-10-11 13:50:16 -0700 (Wed, 11 Oct 2006)
New Revision: 4898
Added:
long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/
long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/makefile
long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.c
long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.h
Modified:
long/3D/Gale/trunk/src/StgFEM/
Log:
r784 at earth: boo | 2006-10-11 13:49:35 -0700
r758 at earth (orig r637): JulianGiordani | 2006-09-11 19:17:28 -0700
Committing solCA of Mirko's analytic suite. It's an arbitary placed column of fluid of density sigma, in a free slip box with a surrounding fluid of density 0. The width of the column is [ (x0-dx) , (x0+dx) ].
Input params are:
<param name="solCA_sigma"> </param> ... sets column density
<param name="solCA_Z"> </param> ... sets viscosity ( is constant thoughout domain )
<param name="solCA_dx"> </param> ... sets half-width of column
<param name="solCA_x0"> </param> ... sets center of column
DaveM and I are planning on re-organising Mirko's analytic sols and how they combine with the code. So this might change soon in the future.
Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
- 38867592-cf10-0410-9e16-a142ea72ac34:/cig:783
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:636
+ 38867592-cf10-0410-9e16-a142ea72ac34:/cig:784
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:637
Added: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/makefile
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/makefile 2006-10-11 20:50:14 UTC (rev 4897)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/makefile 2006-10-11 20:50:16 UTC (rev 4898)
@@ -0,0 +1,59 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+## Melbourne, 3053, Australia.
+##
+## Primary Contributing Organisations:
+## Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+## Australian Computational Earth Systems Simulator - http://www.access.edu.au
+## Monash Cluster Computing - http://www.mcc.monash.edu.au
+## Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+##
+## Contributors:
+## Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+## Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+## Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+## David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+## Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+## Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+## Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+## Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+## Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+## Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library 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
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+## $Id: makefile 535 2006-04-11 13:07:34Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+modName := $(shell basename `pwd` )
+modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- )
+
+mod = ${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+packages = STGERMAIN PETSC MPI XML
+EXTERNAL_LIBS = -lStG_FEM
+
+include ${PROJ_ROOT}/Makefile.vmake
Added: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.c 2006-10-11 20:50:14 UTC (rev 4897)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.c 2006-10-11 20:50:16 UTC (rev 4898)
@@ -0,0 +1,235 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** * Redistributions of source code must retain the above copyright notice,
+** this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of the Monash University nor the names of its contributors
+** may be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*% Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+ Mirko Velic
+*+ Julian Giordani
+*+ Robert Turnbull
+*+ Vincent Lemiale
+*+ Louis Moresi
+*+ David May
+*+ David Stegman
+*+ Patrick Sunter
+** $Id: solA.c 565 2006-05-19 02:33:01Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <assert.h>
+#include "solCA.h"
+
+const Type Velic_solCA_Type = "Velic_solCA";
+
+#define PI 3.14159265358979323846264338328
+void Velic_solCA_MirkoFunction( void* analyticSolution, double* coord, int whatWeWant, double* result ) {
+ Velic_solCA* self = (Velic_solCA*)analyticSolution;
+
+ double Z,u1,u2,u3,u4,u5,u6;
+ double _C1,_C2,_C3,_C4;
+ double sum1,sum2,sum3,sum4,sum5,sum6,sum7,mag,x,z;
+ double sigma,del_rho,k,x0,dx;
+ int n;
+ double t1,t2,t3,t4,t5,t6,t7,t8,t10,t11;
+ double t12,t14,t16,t21;
+
+ // XML input and coord
+ /*************************************************************************/
+ /*************************************************************************/
+ sigma = self->sigma;
+ Z = self->Z;
+ x0 = self->x0;
+ dx = self->dx;
+ x = coord[ I_AXIS ];
+ z = coord[ J_AXIS ];
+ /*************************************************************************/
+ /*************************************************************************/
+ sum1=0.0;
+ sum2=0.0;
+ sum3=0.0;
+ sum4=0.0;
+ sum5=0.0;
+ sum6=0.0;
+ sum7=0.0;
+
+
+
+ for(n=1;n<155;n++){
+
+ k = (double)n*M_PI;
+ del_rho = 4.0*sigma*cos(k*x0)*sin(k*dx/2.0)/k;
+
+ t1 = exp(-k);
+ t7 = k * k;
+ t12 = pow(t1 + 0.1e1, 0.2e1);
+ _C1 = -del_rho * (-0.2e1 + k * t1 - 0.2e1 * t1) / Z / t7 / k / t12 / 0.2e1;
+
+ t1 = exp(-k);
+ t6 = k * k;
+ t11 = pow(t1 + 0.1e1, 0.2e1);
+ _C2 = del_rho * (k + 0.2e1 + 0.2e1 * t1) / Z / t6 / k / t11 / 0.2e1;
+
+ t3 = k * k;
+ t5 = exp(-k);
+ _C3 = del_rho / Z / t3 / (t5 + 0.1e1) / 0.2e1;
+
+ t3 = k * k;
+ t5 = exp(-k);
+ _C4 = -del_rho / Z / t3 / (t5 + 0.1e1) / 0.2e1;
+
+ /* Vz */
+ t4 = exp(-k * z);
+ t10 = exp(k * (z - 0.1e1));
+ t14 = k * k;
+ u1 = k * ((_C1 + z * _C3) * t4 + (_C2 + z * _C4) * t10 - del_rho / Z / t14 / k);
+ /* Vx */
+ t7 = exp(k * (z - 0.1e1));
+ t14 = exp(-k * z);
+ u2 = (-_C4 - (_C2 + z * _C4) * k) * t7 + (-_C3 + (_C1 + z * _C3) * k) * t14;
+ /* tzz */
+ t1 = Z * k;
+ t8 = exp(k * (z - 0.1e1));
+ t16 = exp(-k * z);
+ u3 = 0.2e1 * t1 * (_C4 + (_C2 + z * _C4) * k) * t8 + 0.2e1 * t1 * (_C3 - (_C1 + z * _C3) * k) * t16;
+ /* txz */
+ t2 = k * k;
+ t11 = exp(k * (z - 0.1e1));
+ t21 = exp(-k * z);
+ u4 = -Z * (0.2e1 * _C4 * k + 0.2e1 * t2 * (_C2 + z * _C4)) * t11 - Z * (-0.2e1 * _C3 * k + 0.2e1 * t2 * (_C1 + z * _C3)) * t21 + 0.1e1 / k * del_rho;
+ /* txx */
+ t1 = Z * k;
+ t8 = exp(k * (z - 0.1e1));
+ t16 = exp(-k * z);
+ u6 = -0.2e1 * t1 * (_C4 + (_C2 + z * _C4) * k) * t8 - 0.2e1 * t1 * (_C3 - (_C1 + z * _C3) * k) * t16;
+ /* pressure */
+ t1 = Z * k;
+ t4 = exp(k * (z - 0.1e1));
+ t8 = exp(-k * z);
+ u5 = 0.2e1 * t1 * _C4 * t4 + 0.2e1 * t1 * _C3 * t8;
+
+
+
+
+ u5 = u5*cos(n*PI*x); /* pressure */
+ u6 = u6*cos(n*PI*x); /* xx stress */
+ sum5 +=u5;
+ sum6 +=u6;
+
+ u1 *= cos(n*PI*x); /* z velocity */
+ sum1 += u1;
+ u2 *= sin(n*PI*x); /* x velocity */
+ sum2 += u2;
+ u3 *= 2*n*PI*cos(n*PI*x); /* zz stress */
+ sum3 += u3;
+ u4 *= 2*n*PI*sin(n*PI*x); /* zx stress */
+ sum4 += u4;
+ /* density */
+ sum7 += del_rho*cos(k*x);
+
+ }/* n */
+ /* n=0 term*/
+ sum7 += sigma*dx;
+ /* pressure 0th term integration constant is arbitrarily chosen so that this term is 0 at z=0.5 */
+ sum5 += sigma*dx*(0.5-z); /* now have total pressure */
+ sum3 += -sigma*dx*(0.5-z); /* now have total zz stress */
+ sum6 += -sigma*dx*(0.5-z); /* now have total xx stress */
+ mag=sqrt(sum1*sum1+sum2*sum2);
+ //printf("%0.7f %0.7f %0.7f %0.7f %0.7f %0.7f %0.7f %0.7f %0.7f %0.7f\n",x,z,sum1,sum2,sum3,sum4,sum5,sum6,mag,sum7);
+
+ if ( whatWeWant == 1 ) {
+ result[0] = sum2; //vx
+ result[1] = sum1; //vz
+ }else if( whatWeWant == 2 ) {
+ result[0] = sum6; //txx
+ result[1] = sum3; //tzz
+ result[2] = sum4; //txz
+ } else if (whatWeWant == 3 ) {
+ *result = sum5;
+ }
+}
+
+void Velic_solCA_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure ) {
+ Velic_solCA_MirkoFunction( analyticSolution, coord, 3, pressure );
+}
+
+void Velic_solCA_VelocityFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* velocity ){
+ Velic_solCA_MirkoFunction( analyticSolution, coord, 1, velocity );
+}
+
+void Velic_solCA_StressFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* stress ) {
+ Velic_solCA_MirkoFunction( analyticSolution, coord, 2, stress );
+}
+
+void _Velic_solCA_Construct( void* analyticSolution, Stg_ComponentFactory* cf ) {
+ Velic_solCA* self = (Velic_solCA*) analyticSolution;
+ FeVariable* velocityField;
+ FeVariable* pressureField;
+ FeVariable* stressField;
+ /* Construct Parent */
+ _AnalyticSolution_Construct( self, cf );
+
+ /* Create Analytic Fields */
+ velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True );
+ AnalyticSolution_CreateAnalyticVectorField( self, velocityField, Velic_solCA_VelocityFunction );
+
+ pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True );
+ AnalyticSolution_CreateAnalyticField( self, pressureField, Velic_solCA_PressureFunction );
+
+ stressField = Stg_ComponentFactory_ConstructByName( cf, "StressField", FeVariable, False );
+ if ( stressField )
+ AnalyticSolution_CreateAnalyticSymmetricTensorField( self, stressField, Velic_solCA_StressFunction );
+
+
+ self->sigma = Stg_ComponentFactory_GetRootDictDouble( cf, "solCA_sigma", 1.0 );
+ self->Z = Stg_ComponentFactory_GetRootDictDouble( cf, "solCA_Z", 1.0);
+ self->x0 = Stg_ComponentFactory_GetRootDictDouble( cf, "solCA_x0", 0.4 );
+ self->dx = Stg_ComponentFactory_GetRootDictDouble( cf, "solCA_dx", 0.2 );
+}
+
+void* _Velic_solCA_DefaultNew( Name name ) {
+ return _AnalyticSolution_New(
+ sizeof(Velic_solCA),
+ Velic_solCA_Type,
+ _AnalyticSolution_Delete,
+ _AnalyticSolution_Print,
+ _AnalyticSolution_Copy,
+ _Velic_solCA_DefaultNew,
+ _Velic_solCA_Construct,
+ _AnalyticSolution_Build,
+ _AnalyticSolution_Initialise,
+ _AnalyticSolution_Execute,
+ _AnalyticSolution_Destroy,
+ name );
+}
+
+Index _Velic_solCA_Register( PluginsManager* pluginsManager ) {
+ return PluginsManager_Submit( pluginsManager, Velic_solCA_Type, "0", _Velic_solCA_DefaultNew );
+}
Added: long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.h 2006-10-11 20:50:14 UTC (rev 4897)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/VelicAnalyticSolutions/Velic_solCA/solCA.h 2006-10-11 20:50:16 UTC (rev 4898)
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** * Redistributions of source code must retain the above copyright notice,
+** this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of the Monash University nor the names of its contributors
+** may be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*% Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+ Mirko Velic
+*+ Julian Giordani
+*+ Robert Turnbull
+*+ Vincent Lemiale
+*+ Louis Moresi
+*+ David May
+*+ David Stegman
+*+ Patrick Sunter
+** $Id: solA.c 565 2006-05-19 02:33:01Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#ifndef __StG_FEM_Velic_solCA_h__
+#define __StG_FEM_Velic_solCA_h__
+
+ extern const Type Velic_solCA_Type;
+
+ typedef struct {
+ __AnalyticSolution
+ double sigma;
+ double Z;
+ double x0;
+ double dx;
+ } Velic_solCA;
+
+ void Velic_solCA_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure );
+ void Velic_solCA_VelocityFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* velocity );
+ void Velic_solCA_StressFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* stress );
+
+#endif
More information about the cig-commits
mailing list