[cig-commits] r4890 - in long/3D/Gale/trunk/src/StgFEM: .
Discretisation/src
walter at geodynamics.org
walter at geodynamics.org
Wed Oct 11 13:49:56 PDT 2006
Author: walter
Date: 2006-10-11 13:49:56 -0700 (Wed, 11 Oct 2006)
New Revision: 4890
Added:
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.c
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.h
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.meta
Modified:
long/3D/Gale/trunk/src/StgFEM/
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Init.c
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h
Log:
r776 at earth: boo | 2006-10-11 13:49:32 -0700
r750 at earth (orig r629): JustinFreeman | 2006-08-23 23:38:31 -0700
(Pat and Justin)
Adding a new ShapeFeVariable -
* Populates a nodal field with 1s or 0s depending on
whether each node is within the shape or not.
* Can be used for gLucifer's isoSurface component
to plot the isosurface of a Shape (eg in pure FEM
where rheology is based on static Shapes rather than
particles)
Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
- 38867592-cf10-0410-9e16-a142ea72ac34:/cig:775
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:628
+ 38867592-cf10-0410-9e16-a142ea72ac34:/cig:776
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:629
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Init.c 2006-10-11 20:49:54 UTC (rev 4889)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Init.c 2006-10-11 20:49:56 UTC (rev 4890)
@@ -49,6 +49,7 @@
#include "FeEquationNumber.h"
#include "FeVariable.h"
#include "OperatorFeVariable.h"
+#include "ShapeFeVariable.h"
#include "FeSwarmVariable.h"
#include "Mesh.h"
#include "ElementType.h"
@@ -88,6 +89,7 @@
Stg_ComponentRegister_Add( componentRegister, FeVariable_Type, "0", FeVariable_DefaultNew );
Stg_ComponentRegister_Add( componentRegister, LinkedDofInfo_Type, "0", LinkedDofInfo_DefaultNew );
Stg_ComponentRegister_Add( componentRegister, OperatorFeVariable_Type, "0", OperatorFeVariable_DefaultNew );
+ Stg_ComponentRegister_Add( componentRegister, ShapeFeVariable_Type, "0", ShapeFeVariable_DefaultNew );
Stg_ComponentRegister_Add( componentRegister, FeSwarmVariable_Type, "0", _FeSwarmVariable_DefaultNew );
Stg_ComponentRegister_Add( componentRegister, FiniteElement_Mesh_Type, "0", FiniteElement_Mesh_DefaultNew );
@@ -105,6 +107,7 @@
RegisterParent( FeVariable_Type, FieldVariable_Type );
RegisterParent( OperatorFeVariable_Type, FeVariable_Type );
+ RegisterParent( ShapeFeVariable_Type, FeVariable_Type );
RegisterParent( FeSwarmVariable_Type, SwarmVariable_Type );
/* initialise new MPI types */
Added: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.c 2006-10-11 20:49:54 UTC (rev 4889)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.c 2006-10-11 20:49:56 UTC (rev 4890)
@@ -0,0 +1,239 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: ShapeFeVariable.c 532 2006-04-04 00:21:59Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <string.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "Mesh.h"
+#include "FeVariable.h"
+#include "ShapeFeVariable.h"
+
+#include <assert.h>
+
+const Type ShapeFeVariable_Type = "ShapeFeVariable";
+
+void* ShapeFeVariable_DefaultNew( Name name ) {
+ return (ShapeFeVariable*)
+ _ShapeFeVariable_New(
+ sizeof(ShapeFeVariable),
+ ShapeFeVariable_Type,
+ _ShapeFeVariable_Delete,
+ _ShapeFeVariable_Print,
+ _ShapeFeVariable_Copy,
+ (Stg_Component_DefaultConstructorFunction*)ShapeFeVariable_DefaultNew,
+ _ShapeFeVariable_Construct,
+ _ShapeFeVariable_Build,
+ _ShapeFeVariable_Initialise,
+ _ShapeFeVariable_Execute,
+ _ShapeFeVariable_Destroy,
+ name,
+ False,
+ _FeVariable_InterpolateValueAt,
+ _FeVariable_GetMinGlobalFieldMagnitude,
+ _FeVariable_GetMaxGlobalFieldMagnitude,
+ _FeVariable_GetMinAndMaxLocalCoords,
+ _FeVariable_GetMinAndMaxGlobalCoords,
+ _FeVariable_InterpolateNodeValuesToElLocalCoord,
+ _FeVariable_GetValueAtNode,
+ NULL,
+ NULL,
+ NULL,
+ 0, /* dim */
+ 0, /* communicator */
+ NULL /* fv_Register */
+ );
+}
+
+ShapeFeVariable* _ShapeFeVariable_New(
+ SizeT _sizeOfSelf,
+ Type type,
+ Stg_Class_DeleteFunction* _delete,
+ Stg_Class_PrintFunction* _print,
+ Stg_Class_CopyFunction* _copy,
+ Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+ Stg_Component_ConstructFunction* _construct,
+ Stg_Component_BuildFunction* _build,
+ Stg_Component_InitialiseFunction* _initialise,
+ Stg_Component_ExecuteFunction* _execute,
+ Stg_Component_DestroyFunction* _destroy,
+ Name name,
+ Bool initFlag,
+ FieldVariable_InterpolateValueAtFunction* _interpolateValueAt,
+ FieldVariable_GetValueFunction* _getMinGlobalFeMagnitude,
+ FieldVariable_GetValueFunction* _getMaxGlobalFeMagnitude,
+ FieldVariable_GetCoordFunction* _getMinAndMaxLocalCoords,
+ FieldVariable_GetCoordFunction* _getMinAndMaxGlobalCoords,
+ FeVariable_InterpolateWithinElementFunction* _interpolateWithinElement,
+ FeVariable_GetValueAtNodeFunction* _getValueAtNode,
+ void* feMesh,
+ void* geometryMesh,
+ void* dofLayout,
+ Dimension_Index dim,
+ MPI_Comm communicator,
+ FieldVariable_Register* fV_Register
+ )
+{
+ ShapeFeVariable* self;
+
+ /* Allocate memory */
+ assert( _sizeOfSelf >= sizeof(ShapeFeVariable) );
+ self = (ShapeFeVariable*)
+ _FeVariable_New(
+ _sizeOfSelf,
+ type,
+ _delete,
+ _print,
+ _copy,
+ _defaultConstructor,
+ _construct,
+ _build,
+ _initialise,
+ _execute,
+ _destroy,
+ name,
+ False,
+ _interpolateValueAt,
+ _getMinGlobalFeMagnitude,
+ _getMaxGlobalFeMagnitude,
+ _getMinAndMaxLocalCoords,
+ _getMinAndMaxGlobalCoords,
+ _interpolateWithinElement,
+ _getValueAtNode,
+ feMesh,
+ geometryMesh,
+ dofLayout, /* dofLayout */
+ NULL, /* bcs */
+ NULL, /* ics */
+ NULL, /* linkedDofInfo */
+ NULL, /* templateFeVariable */
+ 1, /* fieldComponentCount */
+ dim, /* dim */
+ StgFEM_Native_ImportExportType, /* import format type */
+ StgFEM_Native_ImportExportType, /* export format type */
+ communicator, /* communicator */
+ fV_Register /* fv_Register */
+ );
+
+ return self;
+}
+
+void _ShapeFeVariable_Init( void* shapeFeVariable, Stg_Shape* shape ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+
+ self->shape = shape;
+
+ //EP_AppendClassHook( Context_GetEntryPoint( context, AbstractContext_EP_UpdateClass ), ParticleFeVariable_Update, self );
+}
+
+void _ShapeFeVariable_Delete( void* _shapeFeVariable ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) _shapeFeVariable;
+
+ _FeVariable_Delete( self );
+}
+
+void _ShapeFeVariable_Print( void* _shapeFeVariable, Stream* stream ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) _shapeFeVariable;
+
+ /* Print parent */
+ _FeVariable_Print( self, stream );
+
+ Journal_PrintPointer( stream, self->shape );
+}
+
+
+void* _ShapeFeVariable_Copy( void* shapeFeVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+ //ShapeFeVariable* self = (ShapeFeVariable*)shapeFeVariable;
+ ShapeFeVariable* newShapeFeVariable;
+
+ assert(0);
+ return (void*)newShapeFeVariable;
+}
+
+void _ShapeFeVariable_Construct( void* shapeFeVariable, Stg_ComponentFactory* cf ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+
+ _FeVariable_Construct( self, cf );
+
+ _ShapeFeVariable_Init(
+ self,
+ Stg_ComponentFactory_ConstructByKey( cf, self->name, "Shape", Stg_Shape, True ) ) ;
+}
+
+void _ShapeFeVariable_Build( void* shapeFeVariable, void* data ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+
+ Stg_Component_Build( self->shape, data, False );
+ _FeVariable_Build( self, data );
+}
+
+void _ShapeFeVariable_Initialise( void* shapeFeVariable, void* data ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+ Node_DomainIndex node_dI = 0;
+
+ Stg_Component_Initialise( self->shape, data, False );
+ _FeVariable_Initialise( self, data );
+
+ /* Set up the basic "level set" describiing if nodes are inside the shape or not */
+ for ( node_dI = 0; node_dI < self->feMesh->nodeDomainCount; node_dI++ ) {
+ if ( True == Stg_Shape_IsCoordInside( self->shape, self->feMesh->nodeCoord[node_dI] ) ) {
+ //set value = 1
+ FeVariable_SetComponentAtNode( self, node_dI, 0, 1 );
+ }
+ else {
+ //set value = 0
+ FeVariable_SetComponentAtNode( self, node_dI, 0, 0 );
+ }
+ }
+}
+
+void _ShapeFeVariable_Execute( void* shapeFeVariable, void* data ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+
+ _FeVariable_Execute( self, data );
+}
+
+void _ShapeFeVariable_Destroy( void* shapeFeVariable, void* data ) {
+ ShapeFeVariable* self = (ShapeFeVariable*) shapeFeVariable;
+
+ _FeVariable_Destroy( self, data );
+}
Property changes on: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.c
___________________________________________________________________
Name: svn:eol-style
+ native
Added: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.h 2006-10-11 20:49:54 UTC (rev 4889)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.h 2006-10-11 20:49:56 UTC (rev 4890)
@@ -0,0 +1,116 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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
+**
+*/
+/** \file
+** Role:
+**
+** Assumptions:
+**
+** $Id: ShapeFeVariable.h 532 2006-04-04 00:21:59Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisation_ShapeFeVariable_h__
+#define __Discretisation_ShapeFeVariable_h__
+
+ /** Textual name of this class */
+ extern const Type ShapeFeVariable_Type;
+
+ /** ShapeFeVariable contents */
+ #define __ShapeFeVariable \
+ /* General info */ \
+ __FeVariable \
+ \
+ /* Virtual info */ \
+ Stg_Shape* shape;
+
+ struct ShapeFeVariable { __ShapeFeVariable };
+
+ /* Public Constructor */
+
+ /** Private Constructor */
+
+ void* ShapeFeVariable_DefaultNew( Name name );
+
+ ShapeFeVariable* _ShapeFeVariable_New(
+ SizeT _sizeOfSelf,
+ Type type,
+ Stg_Class_DeleteFunction* _delete,
+ Stg_Class_PrintFunction* _print,
+ Stg_Class_CopyFunction* _copy,
+ Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+ Stg_Component_ConstructFunction* _construct,
+ Stg_Component_BuildFunction* _build,
+ Stg_Component_InitialiseFunction* _initialise,
+ Stg_Component_ExecuteFunction* _execute,
+ Stg_Component_DestroyFunction* _destroy,
+ Name name,
+ Bool initFlag,
+ FieldVariable_InterpolateValueAtFunction* _interpolateValueAt,
+ FieldVariable_GetValueFunction* _getMinGlobalFeMagnitude,
+ FieldVariable_GetValueFunction* _getMaxGlobalFeMagnitude,
+ FieldVariable_GetCoordFunction* _getMinAndMaxLocalCoords,
+ FieldVariable_GetCoordFunction* _getMinAndMaxGlobalCoords,
+ FeVariable_InterpolateWithinElementFunction* _interpolateWithinElement,
+ FeVariable_GetValueAtNodeFunction* _getValueAtNode,
+ void* feMesh,
+ void* geometryMesh,
+ void* dofLayout,
+ Dimension_Index dim,
+ MPI_Comm communicator,
+ FieldVariable_Register* fV_Register
+ );
+
+ /* 'Stg_Class' Virtual Implementations */
+ void _ShapeFeVariable_Delete( void* variable ) ;
+ void _ShapeFeVariable_Print( void* _swarmVariable, Stream* stream ) ;
+ void* _ShapeFeVariable_Copy( void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+ /* 'Stg_Component' Virtual Implementations */
+ void _ShapeFeVariable_Construct( void* swarmVariable, Stg_ComponentFactory* cf ) ;
+ void _ShapeFeVariable_Build( void* swarmVariable, void* data ) ;
+ void _ShapeFeVariable_Execute( void* variable, void* data ) ;
+ void _ShapeFeVariable_Destroy( void* variable, void* data ) ;
+ void _ShapeFeVariable_Initialise( void* variable, void* data ) ;
+
+ /* FeVariable Virtual Implementations */
+
+ /** Private Functions */
+
+
+#endif /* __Discretisation_ShapeFeVariable_h__ */
Property changes on: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Added: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.meta
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.meta 2006-10-11 20:49:54 UTC (rev 4889)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/ShapeFeVariable.meta 2006-10-11 20:49:56 UTC (rev 4890)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">ShapeFeVariable</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StgFEM</param>
+<param name="Location">./StgFEM/Discretisation/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgfem/WebHome</param>
+<param name="Copyright">Copyright (C) 2004-2005 VPAC.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense</param>
+<param name="Parent">FeVariable</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+ <struct>
+ <param name="Name">Shape</param>
+ <param name="Type">String</param>
+ <param name="Default">""</param>
+ <param name="Description">...</param>
+ </struct>
+
+</list>
+
+<list name="Dependencies">
+<!-- This component calls in another directory so the info above/below may not be complete-->
+ <struct>
+ <param name="Essential">True</param>
+ <param name="Name">FeVariable</param>
+ <param name="Type">FeVariable</param>
+ <param name="Description">...</param>
+ </struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 358 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h 2006-10-11 20:49:54 UTC (rev 4889)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h 2006-10-11 20:49:56 UTC (rev 4890)
@@ -63,6 +63,7 @@
typedef struct LinkedDofInfo LinkedDofInfo;
typedef struct FeEquationNumber FeEquationNumber;
typedef struct FeVariable FeVariable;
+ typedef struct ShapeFeVariable ShapeFeVariable;
typedef struct OperatorFeVariable OperatorFeVariable;
typedef struct FeSwarmVariable FeSwarmVariable;
typedef struct AnalyticSolution AnalyticSolution;
More information about the cig-commits
mailing list