[cig-commits] commit: Remove P1. It is the same as Biquadratic. Also remove P1Generator, as it is the same as Inner2DGenerator
Mercurial
hg at geodynamics.org
Sun Oct 2 11:02:50 PDT 2011
changeset: 800:e24206efa24e
user: Walter Landry <wlandry at caltech.edu>
date: Sun Oct 02 10:58:42 2011 -0700
files: Discretisation/src/Discretisation.h Discretisation/src/FeMesh.cxx Discretisation/src/Init.cxx Discretisation/src/P1.cxx Discretisation/src/P1.h Discretisation/src/P1.meta Discretisation/src/P1Generator.c.tmp Discretisation/src/P1Generator.h Discretisation/src/P1Generator.meta Discretisation/src/types.h
description:
Remove P1. It is the same as Biquadratic. Also remove P1Generator, as it is the same as Inner2DGenerator
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/Discretisation.h
--- a/Discretisation/src/Discretisation.h Thu Sep 29 15:08:56 2011 -0700
+++ b/Discretisation/src/Discretisation.h Sun Oct 02 10:58:42 2011 -0700
@@ -75,7 +75,6 @@
#include "RegularBilinear.h"
#include "Biquadratic.h"
#include "Triquadratic.h"
- #include "P1.h"
#include "LinearTriangleElementType.h"
#include "BilinearInnerElType.h"
#include "TrilinearInnerElType.h"
@@ -84,7 +83,6 @@
#include "FeMesh.h"
#include "C0Generator.h"
#include "C2Generator.h"
- #include "P1Generator.h"
#include "Inner2DGenerator.h"
#include "LinkedDofInfo.h"
#include "FeEquationNumber.h"
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/FeMesh.cxx
--- a/Discretisation/src/FeMesh.cxx Thu Sep 29 15:08:56 2011 -0700
+++ b/Discretisation/src/FeMesh.cxx Sun Oct 02 10:58:42 2011 -0700
@@ -198,9 +198,6 @@ void _FeMesh_Build( void* feMesh, void*
}
else if( !strcmp( self->feElFamily, "constant" ) ) {
elType = (ElementType*)ConstantElementType_New( "" );
- }
- else if( !strcmp( self->feElFamily, "p1" ) ) {
- elType = (ElementType*)P1_New( "" );
}
else
abort();
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/Init.cxx
--- a/Discretisation/src/Init.cxx Thu Sep 29 15:08:56 2011 -0700
+++ b/Discretisation/src/Init.cxx Sun Oct 02 10:58:42 2011 -0700
@@ -90,9 +90,6 @@ Bool StgFEM_Discretisation_Init( int* ar
(Stg_Component_DefaultConstructorFunction*)C0Generator_New );
Stg_ComponentRegister_Add( componentRegister, C2Generator_Type, (Name)"0",
(Stg_Component_DefaultConstructorFunction*)C2Generator_New );
-/*
- Stg_ComponentRegister_Add( componentRegister, P1Generator_Type, (Name)"0", P1Generator_New );
-*/
Stg_ComponentRegister_Add( componentRegister, Inner2DGenerator_Type, (Name)"0", (Stg_Component_DefaultConstructorFunction*)Inner2DGenerator_New );
Stg_ComponentRegister_Add( componentRegister, FieldTest_Type, (Name)"0", _FieldTest_DefaultNew );
@@ -104,7 +101,6 @@ Bool StgFEM_Discretisation_Init( int* ar
RegisterParent( TrilinearElementType_Type, ElementType_Type );
RegisterParent( Biquadratic_Type, ElementType_Type );
RegisterParent( Triquadratic_Type, ElementType_Type );
- RegisterParent( P1_Type, ElementType_Type );
RegisterParent( RegularTrilinear_Type, TrilinearElementType_Type );
RegisterParent( ConstantElementType_Type, ElementType_Type );
RegisterParent( LinearTriangleElementType_Type, ElementType_Type );
@@ -115,9 +111,6 @@ Bool StgFEM_Discretisation_Init( int* ar
RegisterParent( FeMesh_Type, Mesh_Type );
RegisterParent( C0Generator_Type, MeshGenerator_Type );
RegisterParent( C2Generator_Type, CartesianGenerator_Type );
-/*
- RegisterParent( P1Generator_Type, MeshGenerator_Type );
-*/
RegisterParent( Inner2DGenerator_Type, MeshGenerator_Type );
RegisterParent( FeVariable_Type, FieldVariable_Type );
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1.cxx
--- a/Discretisation/src/P1.cxx Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** 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: P1.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 <StgDomain/StgDomain.h>
-#include "Discretisation.h"
-
-
-/* Textual name of this class */
-const Type P1_Type = "P1";
-
-#define P1_NODECOUNT 3
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
-
-P1* P1_New( Name name ) {
- /* Variables set in this function */
- SizeT _sizeOfSelf = sizeof(P1);
- Type type = P1_Type;
- Stg_Class_DeleteFunction* _delete = _P1_Delete;
- Stg_Class_PrintFunction* _print = _P1_Print;
- Stg_Class_CopyFunction* _copy = NULL;
- Stg_Component_DefaultConstructorFunction* _defaultConstructor = (void* (*)(Name))_P1_New;
- Stg_Component_ConstructFunction* _construct = _P1_AssignFromXML;
- Stg_Component_BuildFunction* _build = _P1_Build;
- Stg_Component_InitialiseFunction* _initialise = _P1_Initialise;
- Stg_Component_ExecuteFunction* _execute = _P1_Execute;
- Stg_Component_DestroyFunction* _destroy = _P1_Destroy;
- AllocationType nameAllocationType = NON_GLOBAL;
- ElementType_EvaluateShapeFunctionsAtFunction* _evaluateShapeFunctionsAt = P1_EvalBasis;
- ElementType_EvaluateShapeFunctionLocalDerivsAtFunction* _evaluateShapeFunctionLocalDerivsAt = P1_EvalLocalDerivs;
- ElementType_ConvertGlobalCoordToElLocalFunction* _convertGlobalCoordToElLocal = NULL;
- ElementType_JacobianDeterminantSurfaceFunction* _jacobianDeterminantSurface = _ElementType_JacobianDeterminantSurface;
- ElementType_SurfaceNormalFunction* _surfaceNormal = _P1_SurfaceNormal;
-
- return _P1_New( P1_PASSARGS );
-}
-
-P1* _P1_New( P1_DEFARGS ) {
- P1* self;
-
- /* Allocate memory */
- assert( _sizeOfSelf >= sizeof(P1) );
- self = (P1*)_ElementType_New( ELEMENTTYPE_PASSARGS );
-
- /* Virtual info */
-
- /* P1 info */
- self->isConstructed = True;
- _ElementType_Init( (ElementType*)self, P1_NODECOUNT );
- _P1_Init( self );
-
- return self;
-}
-
-void _P1_Init( P1* self ) {
- assert( self && Stg_CheckType( self, P1 ) );
-}
-
-
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Virtual functions
-*/
-
-void _P1_Delete( void* elementType ) {
- P1* self = (P1*)elementType;
-
- /* Delete the parent. */
- _ElementType_Delete( self );
-}
-
-void _P1_Print( void* elementType, Stream* stream ) {
- P1* self = (P1*)elementType;
-
- /* Set the Journal for printing informations */
- Stream* elementTypeStream;
- elementTypeStream = Journal_Register( InfoStream_Type, (Name)"P1Stream" );
-
- /* Print parent */
- Journal_Printf( stream, "P1 (ptr): (%p)\n", self );
- _ElementType_Print( self, stream );
-}
-
-void _P1_AssignFromXML( void* elementType, Stg_ComponentFactory* cf, void* data ) {
-}
-
-void _P1_Build( void* elementType, void* data ) {
-}
-
-void _P1_Initialise( void* elementType, void* data ) {
-}
-
-void _P1_Execute( void* elementType, void* data ) {
-}
-
-void _P1_Destroy( void* elementType, void* data ) {
- P1* self = (P1*)elementType;
-
- _ElementType_Destroy( self, data );
-}
-
-
-/*--------------------------------------------------------------------------------------------------------------------------
-** Public Functions
-*/
-
-void P1_EvalBasis( void* elementType, const double* localCoord, double* basis ) {
- double xi = localCoord[0], eta = localCoord[1];
- double a0 = xi - 1.0, b0 = eta - 1.0;
- double a1 = 1.0 - xi * xi, b1 = 1.0 - eta * eta;
- double a2 = xi + 1.0, b2 = eta + 1.0;
- double m0 = 0.5 * xi;
- double m1 = 0.5 * eta;
- double m2 = 0.25 * xi * eta;
-
- basis[0] = m2 * a0 * b0;
- basis[1] = m1 * a1 * b0;
- basis[2] = m2 * a2 * b0;
-
- basis[3] = m0 * a0 * b1;
- basis[4] = a1 * b1;
- basis[5] = m0 * a2 * b1;
-
- basis[6] = m2 * a0 * b2;
- basis[7] = m1 * a1 * b2;
- basis[8] = m2 * a2 * b2;
-}
-
-void P1_EvalLocalDerivs( void* elementType, const double* localCoord, double** derivs ) {
- double xi = localCoord[0], eta = localCoord[1];
- double a0 = xi - 1.0, b0 = eta - 1.0;
- double a1 = xi + 1.0, b1 = eta + 1.0;
- double a2 = 2.0 * xi - 1.0, b2 = 2.0 * eta - 1.0;
- double a3 = 2.0 * xi + 1.0, b3 = 2.0 * eta + 1.0;
- double a4 = 1.0 - xi * xi, b4 = 1.0 - eta * eta;
- double m0 = 0.25 * xi;
- double m1 = 0.25 * eta;
- double m2 = -xi * eta;
-
- /* Corner nodes. */
- derivs[0][0] = m1 * a2 * b0;
- derivs[0][2] = m1 * a3 * b0;
- derivs[0][6] = m1 * a2 * b1;
- derivs[0][8] = m1 * a3 * b1;
- derivs[1][0] = m0 * a0 * b2;
- derivs[1][2] = m0 * a1 * b2;
- derivs[1][6] = m0 * a0 * b3;
- derivs[1][8] = m0 * a1 * b3;
-
- /* Side nodes. */
- derivs[0][1] = m2 * b0;
- derivs[0][7] = m2 * b1;
- derivs[0][3] = 0.5 * a2 * b4;
- derivs[0][5] = 0.5 * a3 * b4;
- derivs[1][1] = 0.5 * a4 * b2;
- derivs[1][7] = 0.5 * a4 * b3;
- derivs[1][3] = m2 * a0;
- derivs[1][5] = m2 * a1;
-
- /* Center node. */
- derivs[0][4] = -2.0 * xi * b4;
- derivs[1][4] = -2.0 * eta * a4;
-}
-
-int _P1_SurfaceNormal( void* elementType, unsigned element_I, unsigned dim, double* xi, double* normal ) {
- Stream* errStream = Journal_Register( ErrorStream_Type, (Name)ElementType_Type );
-
- Journal_Printf( errStream, "surface normal function not implemented for this element type.\n" );
- assert( 0 );
-
- normal = NULL;
-
- return -1;
-}
-
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Private Functions
-*/
-
-
-
-
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1.h
--- a/Discretisation/src/P1.h Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** 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: P1.h 3584 2006-05-16 11:11:07Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#ifndef __StgFEM_Discretisaton_P1_h__
-#define __StgFEM_Discretisaton_P1_h__
-
- /** Textual name of this class */
- extern const Type P1_Type;
-
- /** Virtual function types */
-
- /** P1 class contents */
- #define __P1 \
- /* General info */ \
- __ElementType \
- \
- /* Virtual info */ \
- \
- /* P1 info */
-
- struct P1 { __P1 };
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Constructors
- */
-
-
-
-
- #ifndef ZERO
- #define ZERO 0
- #endif
-
- #define P1_DEFARGS \
- ELEMENTTYPE_DEFARGS
-
- #define P1_PASSARGS \
- ELEMENTTYPE_PASSARGS
-
- P1* P1_New( Name name );
- P1* _P1_New( P1_DEFARGS );
- void _P1_Init( P1* self );
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Virtual functions
- */
-
- void _P1_Delete( void* elementType );
- void _P1_Print( void* elementType, Stream* stream );
- void _P1_AssignFromXML( void* elementType, Stg_ComponentFactory* cf, void* data );
- void _P1_Build( void* elementType, void* data );
- void _P1_Initialise( void* elementType, void* data );
- void _P1_Execute( void* elementType, void* data );
- void _P1_Destroy( void* elementType, void* data );
-
- void P1_EvalBasis( void* elementType, const double* localCoord, double* derivs );
- void P1_EvalLocalDerivs( void* elementType, const double* localCoord, double** derivs );
- int _P1_SurfaceNormal( void* elementType, unsigned element_I, unsigned dim, double* xi, double* normal );
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Public functions
- */
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Private Member functions
- */
-
-#endif /* __StgFEM_Discretisaton_P1_h__ */
-
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1.meta
--- a/Discretisation/src/P1.meta Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-<param name="Name">P1</param>
-<param name="Author">...</param>
-<param name="Organisation">VPAC</param>
-<param name="Project">StgFEM</param>
-<param name="Location">./StgFEM/Discretisation/src/</param>
-<param name="Project Web">http://www.stgermainproject.org/StgFEM.html</param>
-<param name="Copyright">Copyright (C) 2004-2005 VPAC.</param>
-<param name="License">The Gnu Lesser General Public License v2.1 - http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</param>
-<param name="Parent">ElementType</param>
-<param name="Reference">...</param>
-<param name="Summary">...</param>
-<param name="Description">...</param>
-
-<!--Now the interesting stuff-->
-
-
-<list name="Params">
-
-</list>
-
-<list name="Dependencies">
-
-</list>
-<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
-
-</StGermainData>
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1Generator.c.tmp
--- a/Discretisation/src/P1Generator.c.tmp Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** 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: P1Generator.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 P1Generator_Type = "P1Generator";
-
-
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
-
-P1Generator* P1Generator_New( Name name ) {
- return _P1Generator_New( sizeof(P1Generator),
- P1Generator_Type,
- _P1Generator_Delete,
- _P1Generator_Print,
- NULL,
- (void* (*)(Name))_P1Generator_New,
- _P1Generator_Construct,
- _P1Generator_Build,
- _P1Generator_Initialise,
- _P1Generator_Execute,
- _P1Generator_Destroy,
- name,
- NON_GLOBAL,
- _MeshGenerator_SetDimSize,
- P1Generator_Generate );
-}
-
-P1Generator* _P1Generator_New( P1GENERATOR_DEFARGS ) {
- P1Generator* self;
-
- /* Allocate memory */
- assert( sizeOfSelf >= sizeof(P1Generator) );
- self = (P1Generator*)_MeshGenerator_New( MESHGENERATOR_PASSARGS );
-
- /* Virtual info */
-
- /* P1Generator info */
- _P1Generator_Init( self );
-
- return self;
-}
-
-void _P1Generator_Init( P1Generator* self ) {
- assert( self && Stg_CheckType( self, P1Generator ) );
-
- self->elMesh = NULL;
-}
-
-
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Virtual functions
-*/
-
-void _P1Generator_Delete( void* generator ) {
- P1Generator* self = (P1Generator*)generator;
-
- /* Delete the parent. */
- _MeshGenerator_Delete( self );
-}
-
-void _P1Generator_Print( void* generator, Stream* stream ) {
- P1Generator* self = (P1Generator*)generator;
-
- /* Set the Journal for printing informations */
- Stream* generatorStream;
- generatorStream = Journal_Register( InfoStream_Type, "P1GeneratorStream" );
-
- /* Print parent */
- Journal_Printf( stream, "P1Generator (ptr): (%p)\n", self );
- _MeshGenerator_Print( self, stream );
-}
-
-void _P1Generator_Construct( void* generator, Stg_ComponentFactory* cf, void* data ) {
- P1Generator* self = (P1Generator*)generator;
- FeMesh* elMesh;
-
- assert( self );
- assert( cf );
-
- _MeshGenerator_Construct( self, cf, data );
-
- elMesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "elementMesh", FeMesh, True, data );
- P1Generator_SetElementMesh( self, elMesh );
-}
-
-void _P1Generator_Build( void* generator, void* data ) {
- _MeshGenerator_Build( generator, data );
-}
-
-void _P1Generator_Initialise( void* generator, void* data ) {
- _MeshGenerator_Initialise( generator, data );
-}
-
-void _P1Generator_Execute( void* generator, void* data ) {
-}
-
-void _P1Generator_Destroy( void* generator, void* data ) {
-}
-
-void P1Generator_Generate( void* generator, void* _mesh ) {
- P1Generator* self = (P1Generator*)generator;
- FeMesh* mesh = (FeMesh*)_mesh;
-
- assert( self && Stg_CheckType( self, P1Generator ) );
- assert( mesh && Stg_CheckType( mesh, FeMesh ) );
-
- P1Generator_BuildTopology( self, mesh );
- P1Generator_BuildGeometry( self, mesh );
- P1Generator_BuildElementTypes( self, mesh );
-}
-
-
-/*--------------------------------------------------------------------------------------------------------------------------
-** Public Functions
-*/
-
-void P1Generator_SetElementMesh( void* generator, void* mesh ) {
- P1Generator* self = (P1Generator*)generator;
-
- assert( self && Stg_CheckType( self, P1Generator ) );
-
- self->elMesh = mesh;
-}
-
-
-/*----------------------------------------------------------------------------------------------------------------------------------
-** Private Functions
-*/
-
-void P1Generator_BuildTopology( P1Generator* self, FeMesh* mesh ) {
- FeMesh* elMesh;
- MeshTopology *topo, *elTopo;
- Decomp_Sync* elSync;
- unsigned nDims;
- unsigned *nIncEls, **incEls;
- unsigned nLocalEls;
- Decomp* nodeDecomp;
- Decomp_Sync* nodeSync;
- unsigned nNodes, *nodes;
- unsigned globalEl;
- unsigned e_i;
-
- assert( self );
- assert( mesh );
-
- elMesh = self->elMesh;
- nDims = Mesh_GetDimSize( elMesh );
- elTopo = Mesh_GetTopology( elMesh );
- elSync = MeshTopology_GetSync( elTopo, nDims );
-
- topo = Mesh_GetTopology( mesh );
- MeshTopology_SetDimSize( topo, nDims );
- MeshTopology_SetSync( topo, nDims, elSync );
- topo->shadowDepth = elTopo->shadowDepth;
-
- /* Generate the vertices. */
- nLocalEls = FeMesh_GetElementLocalSize( elMesh );
- nodeDecomp = Decomp_New();
- Decomp_SetComm( nodeDecomp, Decomp_GetComm( Decomp_Sync_GetDecomp( elSync ) ) );
- nNodes = nLocalEls * 3;
- nodes = AllocArray( unsigned, nNodes );
- for( e_i = 0; e_i < nLocalEls; e_i++ ) {
- globalEl = FeMesh_ElementDomainToGlobal( mesh, e_i );
- nodes[3 * e_i + 0] = 3 * globalEl + 0;
- nodes[3 * e_i + 1] = 3 * globalEl + 1;
- nodes[3 * e_i + 2] = 3 * globalEl + 2;
- }
- Decomp_SetLocals( nodeDecomp, nNodes, nodes );
- FreeArray( nodes );
- nodeSync = Decomp_Sync_New();
- Decomp_Sync_SetDecomp( nodeSync, nodeDecomp );
- MeshTopology_SetSync( topo, MT_VERTEX, nodeSync );
-
- /* Generate the incidence. */
- nIncEls = AllocArray( unsigned, nLocalEls );
- incEls = AllocArray2D( unsigned, nLocalEls, 3 );
- for( e_i = 0; e_i < nLocalEls; e_i++ ) {
- nIncEls[e_i] = 3;
- incEls[e_i][0] = e_i * 3 + 0;
- incEls[e_i][1] = e_i * 3 + 1;
- incEls[e_i][2] = e_i * 3 + 2;
- }
- MeshTopology_SetIncidence( topo, nDims, MT_VERTEX, nIncEls, incEls );
- FreeArray( nIncEls );
- FreeArray( incEls );
-
- MeshTopology_Invert( topo, MT_VERTEX, nDims );
-}
-
-void P1Generator_BuildGeometry( P1Generator* self, FeMesh* mesh ) {
- FeMesh* elMesh;
- double localCrds[4][3] = {{-0.5, -0.5, -0.5}, {0.5, -0.5, -0.5},
- {0.0, 0.707106, 0.0},
- {0.0, 0.0, 0.707106}};
- double *globalCrd, *vert;
- unsigned nDims;
- unsigned nLocalEls;
- unsigned e_i, c_i;
-
- assert( self );
- assert( mesh );
-
- elMesh = self->elMesh;
- nDims = Mesh_GetDimSize( elMesh );
- nLocalEls = FeMesh_GetElementDomainSize( elMesh );
- mesh->verts = AllocArray2D( double, nLocalEls * 3, nDims );
- globalCrd = AllocArray( double, nDims );
- for( e_i = 0; e_i < nLocalEls; e_i++ ) {
- for( c_i = 0; c_i < 3; c_i++ ) {
- FeMesh_CoordLocalToGlobal( elMesh, e_i, localCrds[c_i], globalCrd );
- vert = Mesh_GetVertex( mesh, 3 * e_i + c_i );
- memcpy( vert, globalCrd, nDims * sizeof(double) );
- }
- }
- FreeArray( globalCrd );
-}
-
-void P1Generator_BuildElementTypes( P1Generator* self, FeMesh* mesh ) {
- unsigned nLocalEls;
- Mesh_Algorithms* algs;
- unsigned e_i;
-
- assert( self );
- assert( mesh );
-
- mesh->nElTypes = 1;
- mesh->elTypes = AllocArray( Mesh_ElementType*, mesh->nElTypes );
- mesh->elTypes[0] = (Mesh_ElementType*)Mesh_CentroidType_New();
- Mesh_ElementType_SetMesh( mesh->elTypes[0], mesh );
- Mesh_CentroidType_SetElementMesh( mesh->elTypes[0], self->elMesh );
- nLocalEls = FeMesh_GetElementLocalSize( mesh );
- mesh->elTypeMap = AllocArray( unsigned, nLocalEls );
- for( e_i = 0; e_i < nLocalEls; e_i++ )
- mesh->elTypeMap[e_i] = 0;
-
- algs = (Mesh_Algorithms*)Mesh_CentroidAlgorithms_New( "" );
- Mesh_CentroidAlgorithms_SetElementMesh( algs, self->elMesh );
- Mesh_SetAlgorithms( mesh, algs );
-}
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1Generator.h
--- a/Discretisation/src/P1Generator.h Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** 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: P1Generator.h 3584 2006-05-16 11:11:07Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#ifndef __StgFEM_Discretisaton_P1Generator_h__
-#define __StgFEM_Discretisaton_P1Generator_h__
-
- /** Textual name of this class */
- extern const Type P1Generator_Type;
-
- /** Virtual function types */
-
- /** P1Generator class contents */
- #define __P1Generator \
- /* General info */ \
- __MeshGenerator \
- \
- /* Virtual info */ \
- \
- /* P1Generator info */ \
- FeMesh* elMesh;
-
- struct P1Generator { __P1Generator };
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Constructors
- */
-
- #define P1GENERATOR_DEFARGS \
- MESHGENERATOR_DEFARGS
-
- #define P1GENERATOR_PASSARGS \
- MESHGENERATOR_PASSARGS
-
- P1Generator* P1Generator_New( Name name );
- P1Generator* _P1Generator_New( P1GENERATOR_DEFARGS );
- void _P1Generator_Init( P1Generator* self );
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Virtual functions
- */
-
- void _P1Generator_Delete( void* generator );
- void _P1Generator_Print( void* generator, Stream* stream );
- void _P1Generator_AssignFromXML( void* generator, Stg_ComponentFactory* cf, void* data );
- void _P1Generator_Build( void* generator, void* data );
- void _P1Generator_Initialise( void* generator, void* data );
- void _P1Generator_Execute( void* generator, void* data );
- void _P1Generator_Destroy( void* generator, void* data );
-
- void P1Generator_Generate( void* generator, void* _mesh );
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Public functions
- */
-
- void P1Generator_SetElementMesh( void* generator, void* mesh );
-
- /*--------------------------------------------------------------------------------------------------------------------------
- ** Private Member functions
- */
-
- void P1Generator_BuildTopology( P1Generator* self, FeMesh* mesh );
- void P1Generator_BuildGeometry( P1Generator* self, FeMesh* mesh );
- void P1Generator_BuildElementTypes( P1Generator* self, FeMesh* mesh );
-
-#endif /* __StgFEM_Discretisaton_P1Generator_h__ */
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/P1Generator.meta
--- a/Discretisation/src/P1Generator.meta Thu Sep 29 15:08:56 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-<param name="Name">P1Generator</param>
-<param name="Organisation">VPAC</param>
-<param name="Project">StgFEM</param>
-<param name="Location">./StgFEM/Discretisation/src/</param>
-<param name="Project Web">http://www.stgermainproject.org/StgFEM.html</param>
-<param name="Copyright">Copyright (C) 2004-2005 VPAC.</param>
-<param name="License">The Gnu Lesser General Public License v2.1 - http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</param>
-<param name="Parent">ElementType</param>
-<param name="Description">...</param>
-
-<!--Now the interesting stuff-->
-
-
-<list name="Params">
-
-</list>
-
-<list name="Dependencies">
-
-</list>
-<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
-
-</StGermainData>
diff -r 1f51209c8647 -r e24206efa24e Discretisation/src/types.h
--- a/Discretisation/src/types.h Thu Sep 29 15:08:56 2011 -0700
+++ b/Discretisation/src/types.h Sun Oct 02 10:58:42 2011 -0700
@@ -62,13 +62,11 @@
typedef struct RegularTrilinear RegularTrilinear;
typedef struct RegularBilinear RegularBilinear;
typedef struct Biquadratic Biquadratic;
- typedef struct P1 P1;
typedef struct LinearTriangleElementType LinearTriangleElementType;
typedef struct FiniteElement_Element FiniteElement_Element;
typedef struct FeMesh FeMesh;
typedef struct C0Generator C0Generator;
typedef struct C2Generator C2Generator;
- typedef struct P1Generator P1Generator;
typedef struct Inner2DGenerator Inner2DGenerator;
typedef struct LinkedDofInfo LinkedDofInfo;
typedef struct FeEquationNumber FeEquationNumber;
More information about the CIG-COMMITS
mailing list