[cig-commits] r4885 - in long/3D/Gale/trunk/src/StGermain: .
Discretisation/Mesh/src
walter at geodynamics.org
walter at geodynamics.org
Wed Oct 11 13:48:31 PDT 2006
Author: walter
Date: 2006-10-11 13:48:30 -0700 (Wed, 11 Oct 2006)
New Revision: 4885
Added:
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.meta
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.meta
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Init.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Mesh.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/types.h
Log:
r2942 at earth: boo | 2006-10-11 13:42:49 -0700
r2858 at earth (orig r3846): LukeHodkinson | 2006-10-10 17:18:58 -0700
Adding classes to allow for adaptation of standard
mesh generations. SurfaceAdaptor allows for simple
modifications to a cartesian mesh's geometry (at
the moment it only supports adding a wedge to the
top surface, needed for Gale).
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2941
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3845
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2942
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3846
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Init.c 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Init.c 2006-10-11 20:48:30 UTC (rev 4885)
@@ -71,6 +71,8 @@
MeshTopology_Type, "0", (void*)MeshTopology_New );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(),
CartesianGenerator_Type, "0", (void*)CartesianGenerator_New );
+ Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(),
+ SurfaceAdaptor_Type, "0", (void*)SurfaceAdaptor_New );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), BodyNL_Type, "0", (void*)BodyNL_DefaultNew );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), CornerNL_Type, "0", (void*)CornerNL_DefaultNew );
@@ -85,6 +87,7 @@
RegisterParent( MeshTopology_Type, Stg_Component_Type );
RegisterParent( CartesianGenerator_Type, MeshGenerator_Type );
+ RegisterParent( SurfaceAdaptor_Type, MeshAdaptor_Type );
RegisterParent( NodeLayout_Type, Stg_Component_Type );
RegisterParent( BodyNL_Type, NodeLayout_Type );
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Mesh.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Mesh.h 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/Mesh.h 2006-10-11 20:48:30 UTC (rev 4885)
@@ -53,6 +53,8 @@
#include "MeshTopology.h"
#include "MeshGenerator.h"
#include "CartesianGenerator.h"
+ #include "MeshAdaptor.h"
+ #include "SurfaceAdaptor.h"
#include "ElementLayout.h"
#include "HexaEL.h"
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.c 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.c 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,168 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+** Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+** Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+** Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+** Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+** Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+** Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** 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: MeshAdaptor.c 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include <mpi.h>
+#include "Base/Base.h"
+
+#include "Discretisation/Geometry/Geometry.h"
+#include "Discretisation/Shape/Shape.h"
+
+#include "types.h"
+#include "shortcuts.h"
+#include "MeshClass.h"
+#include "MeshGenerator.h"
+#include "MeshAdaptor.h"
+
+
+/* Textual name of this class */
+const Type MeshAdaptor_Type = "MeshAdaptor";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+MeshAdaptor* _MeshAdaptor_New( MESHADAPTOR_DEFARGS ) {
+ MeshAdaptor* self;
+
+ /* Allocate memory */
+ assert( sizeOfSelf >= sizeof(MeshAdaptor) );
+ self = (MeshAdaptor*)_MeshGenerator_New( MESHGENERATOR_PASSARGS );
+
+ /* Virtual info */
+
+ /* MeshAdaptor info */
+ _MeshAdaptor_Init( self );
+
+ return self;
+}
+
+void _MeshAdaptor_Init( MeshAdaptor* self ) {
+ self->generator = NULL;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _MeshAdaptor_Delete( void* meshAdaptor ) {
+ MeshAdaptor* self = (MeshAdaptor*)meshAdaptor;
+
+ /* Delete the parent. */
+ _MeshGenerator_Delete( self );
+}
+
+void _MeshAdaptor_Print( void* meshAdaptor, Stream* stream ) {
+ MeshAdaptor* self = (MeshAdaptor*)meshAdaptor;
+
+ /* Set the Journal for printing informations */
+ Stream* meshAdaptorStream;
+ meshAdaptorStream = Journal_Register( InfoStream_Type, "MeshAdaptorStream" );
+
+ /* Print parent */
+ Journal_Printf( stream, "MeshAdaptor (ptr): (%p)\n", self );
+ _Stg_Component_Print( self, stream );
+}
+
+void* _MeshAdaptor_Copy( void* meshAdaptor, void* destProc_I, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+#if 0
+ MeshAdaptor* self = (MeshAdaptor*)meshAdaptor;
+ MeshAdaptor* newMeshAdaptor;
+ PtrMap* map = ptrMap;
+ Bool ownMap = False;
+
+ /* Damn me for making copying so difficult... what was I thinking? */
+
+ /* We need to create a map if it doesn't already exist. */
+ if( !map ) {
+ map = PtrMap_New( 10 );
+ ownMap = True;
+ }
+
+ newMeshAdaptor = (MeshAdaptor*)_Mesh_Copy( self, destProc_I, deep, nameExt, map );
+
+ /* Copy the virtual methods here. */
+
+ /* Deep or shallow? */
+ if( deep ) {
+ }
+ else {
+ }
+
+ /* If we own the map, get rid of it here. */
+ if( ownMap ) Stg_Class_Delete( map );
+
+ return (void*)newMeshAdaptor;
+#endif
+
+ return NULL;
+}
+
+void _MeshAdaptor_Construct( void* meshAdaptor, Stg_ComponentFactory* cf ) {
+ MeshAdaptor* self = (MeshAdaptor*)meshAdaptor;
+
+ _MeshGenerator_Construct( self, cf );
+
+ /* Read the source generator. */
+ self->generator = Stg_ComponentFactory_ConstructByKey( cf, self->name, "sourceGenerator",
+ MeshGenerator, True );
+}
+
+void _MeshAdaptor_Build( void* meshAdaptor, void* data ) {
+ _MeshGenerator_Build( meshAdaptor, data );
+}
+
+void _MeshAdaptor_Initialise( void* meshAdaptor, void* data ) {
+}
+
+void _MeshAdaptor_Execute( void* meshAdaptor, void* data ) {
+}
+
+void _MeshAdaptor_Destroy( void* meshAdaptor, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void MeshAdaptor_SetGenerator( void* meshAdaptor, void* generator ) {
+ MeshAdaptor* self = (MeshAdaptor*)meshAdaptor;
+
+ self->generator = generator;
+}
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.h 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.h 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,103 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+** Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+** Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+** Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+** Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+** Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+** Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** 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:
+**
+** Invariants:
+**
+** Comments:
+**
+** $Id: MeshAdaptor.h 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisaton_Mesh_MeshAdaptor_h__
+#define __Discretisaton_Mesh_MeshAdaptor_h__
+
+ /** Textual name of this class */
+ extern const Type MeshAdaptor_Type;
+
+ /** Virtual function types */
+
+ /** MeshAdaptor class contents */
+ #define __MeshAdaptor \
+ /* General info */ \
+ __MeshGenerator \
+ \
+ /* Virtual info */ \
+ \
+ /* MeshAdaptor info */ \
+ MeshGenerator* generator;
+
+ struct MeshAdaptor { __MeshAdaptor };
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Constructors
+ */
+
+ #define MESHADAPTOR_DEFARGS \
+ MESHGENERATOR_DEFARGS
+
+ #define MESHADAPTOR_PASSARGS \
+ MESHGENERATOR_PASSARGS
+
+ MeshAdaptor* _MeshAdaptor_New( MESHADAPTOR_DEFARGS );
+ void _MeshAdaptor_Init( MeshAdaptor* self );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Virtual functions
+ */
+
+ void _MeshAdaptor_Delete( void* meshAdaptor );
+ void _MeshAdaptor_Print( void* meshAdaptor, Stream* stream );
+
+ #define MeshAdaptor_Copy( self ) \
+ (Mesh*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+ #define MeshAdaptor_DeepCopy( self ) \
+ (Mesh*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+ void* _MeshAdaptor_Copy( void* meshAdaptor, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+
+ void _MeshAdaptor_Construct( void* meshAdaptor, Stg_ComponentFactory* cf );
+ void _MeshAdaptor_Build( void* meshAdaptor, void* data );
+ void _MeshAdaptor_Initialise( void* meshAdaptor, void* data );
+ void _MeshAdaptor_Execute( void* meshAdaptor, void* data );
+ void _MeshAdaptor_Destroy( void* meshAdaptor, void* data );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Public functions
+ */
+
+ void MeshAdaptor_SetGenerator( void* meshAdaptor, void* generator );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Private Member functions
+ */
+
+#endif /* __Discretisaton_Mesh_MeshAdaptor_h__ */
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.meta
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.meta 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshAdaptor.meta 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MeshAdaptor</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Mesh/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent"></param>
+<param name="Description">...</param>
+
+</StGermainData>
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,238 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+** Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+** Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+** Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+** Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+** Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+** Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** 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: SurfaceAdaptor.c 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include <mpi.h>
+#include "Base/Base.h"
+
+#include "Discretisation/Geometry/Geometry.h"
+#include "Discretisation/Shape/Shape.h"
+
+#include "types.h"
+#include "shortcuts.h"
+#include "Grid.h"
+#include "Decomp.h"
+#include "Decomp_Sync.h"
+#include "MeshTopology.h"
+#include "MeshClass.h"
+#include "MeshGenerator.h"
+#include "MeshAdaptor.h"
+#include "SurfaceAdaptor.h"
+
+
+/* Textual name of this class */
+const Type SurfaceAdaptor_Type = "SurfaceAdaptor";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+SurfaceAdaptor* SurfaceAdaptor_New( Name name ) {
+ return _SurfaceAdaptor_New( sizeof(SurfaceAdaptor),
+ SurfaceAdaptor_Type,
+ _SurfaceAdaptor_Delete,
+ _SurfaceAdaptor_Print,
+ _SurfaceAdaptor_Copy,
+ (void* (*)(Name))_SurfaceAdaptor_New,
+ _SurfaceAdaptor_Construct,
+ _SurfaceAdaptor_Build,
+ _SurfaceAdaptor_Initialise,
+ _SurfaceAdaptor_Execute,
+ _SurfaceAdaptor_Destroy,
+ name,
+ NON_GLOBAL,
+ SurfaceAdaptor_Generate );
+}
+
+SurfaceAdaptor* _SurfaceAdaptor_New( SURFACEADAPTOR_DEFARGS ) {
+ SurfaceAdaptor* self;
+
+ /* Allocate memory */
+ assert( sizeOfSelf >= sizeof(SurfaceAdaptor) );
+ self = (SurfaceAdaptor*)_MeshGenerator_New( MESHADAPTOR_PASSARGS );
+
+ /* Virtual info */
+
+ /* SurfaceAdaptor info */
+ _SurfaceAdaptor_Init( self );
+
+ return self;
+}
+
+void _SurfaceAdaptor_Init( SurfaceAdaptor* self ) {
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _SurfaceAdaptor_Delete( void* adaptor ) {
+ SurfaceAdaptor* self = (SurfaceAdaptor*)adaptor;
+
+ /* Delete the parent. */
+ _MeshGenerator_Delete( self );
+}
+
+void _SurfaceAdaptor_Print( void* adaptor, Stream* stream ) {
+ SurfaceAdaptor* self = (SurfaceAdaptor*)adaptor;
+
+ /* Set the Journal for printing informations */
+ Stream* adaptorStream;
+ adaptorStream = Journal_Register( InfoStream_Type, "SurfaceAdaptorStream" );
+
+ /* Print parent */
+ Journal_Printf( stream, "SurfaceAdaptor (ptr): (%p)\n", self );
+ _MeshGenerator_Print( self, stream );
+}
+
+void* _SurfaceAdaptor_Copy( void* adaptor, void* destProc_I, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+#if 0
+ SurfaceAdaptor* self = (SurfaceAdaptor*)adaptor;
+ SurfaceAdaptor* newSurfaceAdaptor;
+ PtrMap* map = ptrMap;
+ Bool ownMap = False;
+
+ /* Damn me for making copying so difficult... what was I thinking? */
+
+ /* We need to create a map if it doesn't already exist. */
+ if( !map ) {
+ map = PtrMap_New( 10 );
+ ownMap = True;
+ }
+
+ newSurfaceAdaptor = (SurfaceAdaptor*)_Mesh_Copy( self, destProc_I, deep, nameExt, map );
+
+ /* Copy the virtual methods here. */
+
+ /* Deep or shallow? */
+ if( deep ) {
+ }
+ else {
+ }
+
+ /* If we own the map, get rid of it here. */
+ if( ownMap ) Stg_Class_Delete( map );
+
+ return (void*)newSurfaceAdaptor;
+#endif
+
+ return NULL;
+}
+
+void _SurfaceAdaptor_Construct( void* adaptor, Stg_ComponentFactory* cf ) {
+ SurfaceAdaptor* self = (SurfaceAdaptor*)adaptor;
+ Dictionary* dict;
+
+ assert( self );
+ assert( cf );
+
+ /* Call parent construct. */
+ _MeshAdaptor_Construct( self, cf );
+
+ /* Read the parameters. */
+ self->offs = Stg_ComponentFactory_GetDouble( cf, self->name, "offset", 0.0 );
+ self->grad = Stg_ComponentFactory_GetDouble( cf, self->name, "gradient", 0.5 );
+}
+
+void _SurfaceAdaptor_Build( void* adaptor, void* data ) {
+ _MeshAdaptor_Build( adaptor, data );
+}
+
+void _SurfaceAdaptor_Initialise( void* adaptor, void* data ) {
+}
+
+void _SurfaceAdaptor_Execute( void* adaptor, void* data ) {
+}
+
+void _SurfaceAdaptor_Destroy( void* adaptor, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void SurfaceAdaptor_Generate( void* adaptor, void* _mesh ) {
+ SurfaceAdaptor* self = (SurfaceAdaptor*)adaptor;
+ Mesh* mesh = (Mesh*)_mesh;
+ unsigned* gSize;
+ Grid* grid;
+ unsigned* inds;
+ unsigned d_i, n_i;
+
+ /* Build base mesh, which is assumed to be cartesian. */
+ MeshGenerator_Generate( self->generator, mesh );
+
+ /* If we're not 2D or 3D, forget about it. */
+ if( mesh->topo->nDims != 2 && mesh->topo->nDims != 3 )
+ return;
+
+ /* Extract the cartesian information. */
+ gSize = (unsigned*)ExtensionManager_Get( mesh->info, mesh,
+ ExtensionManager_GetHandle( mesh->info, "cartesianGlobalSize" ) );
+
+ /* Build grid and space for indices. */
+ grid = Grid_New();
+ Grid_SetNDims( grid, mesh->topo->nDims );
+ for( d_i = 0; d_i < mesh->topo->nDims; d_i++ )
+ gSize[d_i]++;
+ Grid_SetSizes( grid, gSize );
+ for( d_i = 0; d_i < mesh->topo->nDims; d_i++ )
+ gSize[d_i]--;
+ inds = Memory_Alloc_Array_Unnamed( unsigned, mesh->topo->nDims );
+
+ /* Loop over domain nodes. */
+ for( n_i = 0; n_i < MeshTopology_GetDomainSize( mesh->topo, MT_VERTEX ); n_i++ ) {
+ unsigned gNode;
+ double height;
+
+ gNode = MeshTopology_DomainToGlobal( mesh->topo, MT_VERTEX, n_i );
+ Grid_Lift( grid, gNode, inds );
+
+ /* Calculate a height percentage. */
+ height = (double)inds[1] / (double)(gSize[1] - 1);
+
+ /* Deform this node. */
+ if( mesh->nodeCoord[n_i][0] >= self->offs )
+ mesh->nodeCoord[n_i][1] += height * (mesh->nodeCoord[n_i][0] - self->offs) * self->grad;
+ }
+
+ /* Free resources. */
+ FreeArray( inds );
+ FreeObject( grid );
+}
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,105 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+** Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+** Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+** Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+** Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+** Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+** Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** 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:
+**
+** Invariants:
+**
+** Comments:
+**
+** $Id: SurfaceAdaptor.h 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisaton_Mesh_SurfaceAdaptor_h__
+#define __Discretisaton_Mesh_SurfaceAdaptor_h__
+
+ /** Textual name of this class */
+ extern const Type SurfaceAdaptor_Type;
+
+ /** Virtual function types */
+
+ /** SurfaceAdaptor class contents */
+ #define __SurfaceAdaptor \
+ /* General info */ \
+ __MeshAdaptor \
+ \
+ /* Virtual info */ \
+ \
+ /* SurfaceAdaptor info */ \
+ double offs; \
+ double grad;
+
+ struct SurfaceAdaptor { __SurfaceAdaptor };
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Constructors
+ */
+
+ #define SURFACEADAPTOR_DEFARGS \
+ MESHADAPTOR_DEFARGS
+
+ #define SURFACEADAPTOR_PASSARGS \
+ MESHADAPTOR_PASSARGS
+
+ SurfaceAdaptor* SurfaceAdaptor_New( Name name );
+ SurfaceAdaptor* _SurfaceAdaptor_New( SURFACEADAPTOR_DEFARGS );
+ void _SurfaceAdaptor_Init( SurfaceAdaptor* self );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Virtual functions
+ */
+
+ void _SurfaceAdaptor_Delete( void* adaptor );
+ void _SurfaceAdaptor_Print( void* adaptor, Stream* stream );
+
+ #define SurfaceAdaptor_Copy( self ) \
+ (Mesh*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+ #define SurfaceAdaptor_DeepCopy( self ) \
+ (Mesh*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+ void* _SurfaceAdaptor_Copy( void* adaptor, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+
+ void _SurfaceAdaptor_Construct( void* adaptor, Stg_ComponentFactory* cf );
+ void _SurfaceAdaptor_Build( void* adaptor, void* data );
+ void _SurfaceAdaptor_Initialise( void* adaptor, void* data );
+ void _SurfaceAdaptor_Execute( void* adaptor, void* data );
+ void _SurfaceAdaptor_Destroy( void* adaptor, void* data );
+
+ void SurfaceAdaptor_Generate( void* adaptor, void* _mesh );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Public functions
+ */
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Private Member functions
+ */
+
+#endif /* __Discretisaton_Mesh_SurfaceAdaptor_h__ */
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.meta
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.meta 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.meta 2006-10-11 20:48:30 UTC (rev 4885)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SurfaceAdaptor</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Mesh/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent"></param>
+<param name="Description">...</param>
+
+</StGermainData>
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/types.h 2006-10-11 20:48:27 UTC (rev 4884)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/types.h 2006-10-11 20:48:30 UTC (rev 4885)
@@ -135,6 +135,8 @@
typedef struct MeshTopology MeshTopology;
typedef struct MeshGenerator MeshGenerator;
typedef struct CartesianGenerator CartesianGenerator;
+ typedef struct MeshAdaptor MeshAdaptor;
+ typedef struct SurfaceAdaptor SurfaceAdaptor;
typedef struct ProcNbrInfo ProcNbrInfo;
typedef struct ShadowInfo ShadowInfo;
More information about the cig-commits
mailing list