[cig-commits] r6132 - in long/3D/Gale/trunk/src/StgFEM: .
Discretisation/src
walter at geodynamics.org
walter at geodynamics.org
Wed Feb 28 10:21:28 PST 2007
Author: walter
Date: 2007-02-28 10:21:28 -0800 (Wed, 28 Feb 2007)
New Revision: 6132
Added:
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.c
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.h
Modified:
long/3D/Gale/trunk/src/StgFEM/
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Discretisation.h
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/FeMesh.c
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h
Log:
r1020 at earth (orig r757): LukeHodkinson | 2007-02-27 22:19:31 -0800
Adding an element type optimised for regular bilinear
elements.
Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
- 38867592-cf10-0410-9e16-a142ea72ac34:/cig:880
db209038-57f2-0310-97fa-b160e0ae9d04:/branches/decomp3d:756
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:669
+ 38867592-cf10-0410-9e16-a142ea72ac34:/cig:880
db209038-57f2-0310-97fa-b160e0ae9d04:/branches/decomp3d:757
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:669
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Discretisation.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Discretisation.h 2007-02-28 18:21:25 UTC (rev 6131)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Discretisation.h 2007-02-28 18:21:28 UTC (rev 6132)
@@ -62,6 +62,7 @@
#include "BilinearElementType.h"
#include "TrilinearElementType.h"
#include "RegularTrilinear.h"
+ #include "RegularBilinear.h"
#include "LinearTriangleElementType.h"
#include "Element.h"
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/FeMesh.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/FeMesh.c 2007-02-28 18:21:25 UTC (rev 6131)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/FeMesh.c 2007-02-28 18:21:28 UTC (rev 6132)
@@ -148,10 +148,10 @@
unsigned nDims;
nDims = Mesh_GetDimSize( self );
- if( nDims == 2 )
+ if( nDims == 3 )
+ elType = (ElementType*)TrilinearElementType_New( "" );
+ else if( nDims == 2 )
elType = (ElementType*)BilinearElementType_New( "" );
- else if( nDims == 3 )
- elType = (ElementType*)TrilinearElementType_New( "" );
else
abort();
}
@@ -161,6 +161,8 @@
nDims = Mesh_GetDimSize( self );
if( nDims == 3 )
elType = (ElementType*)RegularTrilinear_New( "" );
+ else if( nDims == 2 )
+ elType = (ElementType*)RegularBilinear_New( "" );
else
abort();
}
Added: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.c 2007-02-28 18:21:25 UTC (rev 6131)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.c 2007-02-28 18:21:28 UTC (rev 6132)
@@ -0,0 +1,160 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: RegularBilinear.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 "StGermain/StGermain.h"
+#include "Discretisation.h"
+
+
+/* Textual name of this class */
+const Type RegularBilinear_Type = "RegularBilinear";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+RegularBilinear* RegularBilinear_New( Name name ) {
+ return _RegularBilinear_New( sizeof(RegularBilinear),
+ RegularBilinear_Type,
+ _RegularBilinear_Delete,
+ _RegularBilinear_Print,
+ NULL,
+ (void* (*)(Name))_RegularBilinear_New,
+ _RegularBilinear_Construct,
+ _RegularBilinear_Build,
+ _RegularBilinear_Initialise,
+ _RegularBilinear_Execute,
+ _RegularBilinear_Destroy,
+ name,
+ True,
+ _BilinearElementType_SF_allNodes,
+ _BilinearElementType_SF_allLocalDerivs_allNodes,
+ RegularBilinear_ConvertGlobalCoordToElLocal,
+ 4 );
+}
+
+RegularBilinear* _RegularBilinear_New( REGULARTRILINEAR_DEFARGS ) {
+ RegularBilinear* self;
+
+ /* Allocate memory */
+ assert( _sizeOfSelf >= sizeof(RegularBilinear) );
+ self = (RegularBilinear*)_BilinearElementType_New( ELEMENTTYPE_PASSARGS );
+
+ /* Virtual info */
+
+ /* RegularBilinear info */
+ _RegularBilinear_Init( self );
+
+ return self;
+}
+
+void _RegularBilinear_Init( RegularBilinear* self ) {
+ assert( self && Stg_CheckType( self, RegularBilinear ) );
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _RegularBilinear_Delete( void* elementType ) {
+ RegularBilinear* self = (RegularBilinear*)elementType;
+
+ /* Delete the parent. */
+ _BilinearElementType_Delete( self );
+}
+
+void _RegularBilinear_Print( void* elementType, Stream* stream ) {
+ RegularBilinear* self = (RegularBilinear*)elementType;
+
+ /* Set the Journal for printing informations */
+ Stream* elementTypeStream;
+ elementTypeStream = Journal_Register( InfoStream_Type, "RegularBilinearStream" );
+
+ /* Print parent */
+ Journal_Printf( stream, "RegularBilinear (ptr): (%p)\n", self );
+ _BilinearElementType_Print( self, stream );
+}
+
+void _RegularBilinear_Construct( void* elementType, Stg_ComponentFactory* cf, void* data ) {
+}
+
+void _RegularBilinear_Build( void* elementType, void* data ) {
+ _BilinearElementType_Build( elementType, data );
+}
+
+void _RegularBilinear_Initialise( void* elementType, void* data ) {
+ _BilinearElementType_Initialise( elementType, data );
+}
+
+void _RegularBilinear_Execute( void* elementType, void* data ) {
+}
+
+void _RegularBilinear_Destroy( void* elementType, void* data ) {
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void RegularBilinear_ConvertGlobalCoordToElLocal( void* elementType, void* mesh, unsigned element,
+ const double* globalCoord, double* localCoord )
+{
+ RegularBilinear* self = (RegularBilinear*)elementType;
+ unsigned nInc, *inc;
+ double* vert[2];
+ double w;
+
+ assert( self && Stg_CheckType( self, RegularBilinear ) );
+
+ Mesh_GetIncidence( mesh, MT_VOLUME, element, MT_VERTEX, &nInc, &inc );
+
+ vert[0] = Mesh_GetVertex( mesh, inc[0] );
+ vert[1] = Mesh_GetVertex( mesh, inc[3] );
+ w = vert[1][0] - vert[0][0];
+ localCoord[0] = 2.0 * (globalCoord[0] - vert[0][0]) / w - 1.0;
+ w = vert[1][1] - vert[0][1];
+ localCoord[1] = 2.0 * (globalCoord[1] - vert[0][1]) / w - 1.0;
+
+ assert( localCoord[0] >= -1.0 && localCoord[0] <= 1.0 );
+ assert( localCoord[1] >= -1.0 && localCoord[1] <= 1.0 );
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
Added: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.h 2007-02-28 18:21:25 UTC (rev 6131)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/RegularBilinear.h 2007-02-28 18:21:28 UTC (rev 6132)
@@ -0,0 +1,97 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: RegularBilinear.h 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisaton_Mesh_RegularBilinear_h__
+#define __Discretisaton_Mesh_RegularBilinear_h__
+
+ /** Textual name of this class */
+ extern const Type RegularBilinear_Type;
+
+ /** Virtual function types */
+
+ /** RegularBilinear class contents */
+ #define __RegularBilinear \
+ /* General info */ \
+ __BilinearElementType \
+ \
+ /* Virtual info */ \
+ \
+ /* RegularBilinear info */
+
+ struct RegularBilinear { __RegularBilinear };
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Constructors
+ */
+
+ #define REGULARBILINEAR_DEFARGS \
+ ELEMENTTYPE_DEFARGS
+
+ #define REGULARBILINEAR_PASSARGS \
+ ELEMENTTYPE_PASSARGS
+
+ RegularBilinear* RegularBilinear_New( Name name );
+ RegularBilinear* _RegularBilinear_New( REGULARBILINEAR_DEFARGS );
+ void _RegularBilinear_Init( RegularBilinear* self );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Virtual functions
+ */
+
+ void _RegularBilinear_Delete( void* elementType );
+ void _RegularBilinear_Print( void* elementType, Stream* stream );
+ void _RegularBilinear_Construct( void* elementType, Stg_ComponentFactory* cf, void* data );
+ void _RegularBilinear_Build( void* elementType, void* data );
+ void _RegularBilinear_Initialise( void* elementType, void* data );
+ void _RegularBilinear_Execute( void* elementType, void* data );
+ void _RegularBilinear_Destroy( void* elementType, void* data );
+
+ void RegularBilinear_ConvertGlobalCoordToElLocal( void* elementType, void* mesh, unsigned element,
+ const double* globalCoord, double* localCoord );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Public functions
+ */
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Private Member functions
+ */
+
+#endif /* __Discretisaton_Mesh_RegularBilinear_h__ */
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h 2007-02-28 18:21:25 UTC (rev 6131)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/types.h 2007-02-28 18:21:28 UTC (rev 6132)
@@ -58,6 +58,7 @@
typedef struct BilinearElementType BilinearElementType;
typedef struct TrilinearElementType TrilinearElementType;
typedef struct RegularTrilinear RegularTrilinear;
+ typedef struct RegularBilinear RegularBilinear;
typedef struct LinearTriangleElementType LinearTriangleElementType;
typedef struct FiniteElement_Element FiniteElement_Element;
typedef struct FeMesh FeMesh;
More information about the cig-commits
mailing list