[cig-commits] r14143 - in long/3D/Gale/trunk: . src/StGermain/Discretisation/Utils/src
walter at geodynamics.org
walter at geodynamics.org
Wed Feb 25 06:05:52 PST 2009
Author: walter
Date: 2009-02-25 06:05:52 -0800 (Wed, 25 Feb 2009)
New Revision: 14143
Added:
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.meta
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Init.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SConscript
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Utils.h
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/types.h
Log:
r2500 at dante: boo | 2009-02-24 16:27:58 -0800
Add InsideWallVC
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2497
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2500
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Init.c 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Init.c 2009-02-25 14:05:52 UTC (rev 14143)
@@ -45,6 +45,7 @@
VariableCondition_Register_Add( variableCondition_Register, AllElementsVC_Type, AllElementsVC_Factory );
VariableCondition_Register_Add( variableCondition_Register, AllNodesVC_Type, AllNodesVC_Factory );
VariableCondition_Register_Add( variableCondition_Register, WallVC_Type, WallVC_Factory );
+ VariableCondition_Register_Add( variableCondition_Register, InsideWallVC_Type, InsideWallVC_Factory );
VariableCondition_Register_Add( variableCondition_Register, CornerVC_Type, CornerVC_Factory );
VariableCondition_Register_Add( variableCondition_Register, InnerWallVC_Type, InnerWallVC_Factory );
VariableCondition_Register_Add( variableCondition_Register, ShapeVC_Type, ShapeVC_Factory );
@@ -61,6 +62,8 @@
"0", (void* (*)(Name))OperatorFieldVariable_DefaultNew );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), WallVC_Type,
"0", (void* (*)(Name))WallVC_DefaultNew );
+ Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), InsideWallVC_Type,
+ "0", (void* (*)(Name))InsideWallVC_DefaultNew );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), CornerVC_Type,
"0", (void* (*)(Name))CornerVC_DefaultNew );
Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), InnerWallVC_Type,
@@ -87,6 +90,7 @@
RegisterParent( AllElementsVC_Type, VariableCondition_Type );
RegisterParent( AllNodesVC_Type, VariableCondition_Type );
RegisterParent( WallVC_Type, VariableCondition_Type );
+ RegisterParent( InsideWallVC_Type, VariableCondition_Type );
RegisterParent( CornerVC_Type, VariableCondition_Type );
RegisterParent( InnerWallVC_Type, VariableCondition_Type );
RegisterParent( ShapeVC_Type, VariableCondition_Type );
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.c (rev 0)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.c 2009-02-25 14:05:52 UTC (rev 14143)
@@ -0,0 +1,729 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: /cig/src/StGermain/Discretisation/Utils/src/InsideWallVC.c 1494 2007-01-23T22:49:35.683866Z boo $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "Base/Base.h"
+
+#include "Discretisation/Geometry/Geometry.h"
+#include "Discretisation/Shape/Shape.h"
+#include "Discretisation/Mesh/Mesh.h"
+
+#include "types.h"
+#include "InsideWallVC.h"
+#include "RegularMeshUtils.h"
+
+#include <string.h>
+#include <assert.h>
+
+
+const Type InsideWallVC_Type = "InsideWallVC";
+const Name defaultInsideWallVCName = "defaultInsideWallVCName";
+
+const char* InsideWallVC_WallEnumToStr[WallVC_Wall_Size] = {
+ "back",
+ "left",
+ "bottom",
+ "right",
+ "top",
+ "front" };
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Constructor
+*/
+
+VariableCondition* InsideWallVC_Factory(
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* data )
+{
+ return (VariableCondition*)InsideWallVC_New( defaultInsideWallVCName, NULL, variable_Register, conFunc_Register, dictionary, (Mesh*)data );
+}
+
+
+InsideWallVC* InsideWallVC_DefaultNew( Name name )
+{
+ return _InsideWallVC_New(
+ sizeof(InsideWallVC),
+ InsideWallVC_Type,
+ _InsideWallVC_Delete,
+ _InsideWallVC_Print,
+ _InsideWallVC_Copy,
+ (Stg_Component_DefaultConstructorFunction*)InsideWallVC_DefaultNew,
+ _InsideWallVC_Construct,
+ _InsideWallVC_Build,
+ _VariableCondition_Initialise,
+ _VariableCondition_Execute,
+ _VariableCondition_Destroy,
+ name,
+ False,
+ _InsideWallVC_BuildSelf,
+ _InsideWallVC_PrintConcise,
+ _InsideWallVC_ReadDictionary,
+ _InsideWallVC_GetSet,
+ _InsideWallVC_GetVariableCount,
+ _InsideWallVC_GetVariableIndex,
+ _InsideWallVC_GetValueIndex,
+ _InsideWallVC_GetValueCount,
+ _InsideWallVC_GetValue,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+}
+
+InsideWallVC* InsideWallVC_New(
+ Name name,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh )
+{
+ return _InsideWallVC_New(
+ sizeof(InsideWallVC),
+ InsideWallVC_Type,
+ _InsideWallVC_Delete,
+ _InsideWallVC_Print,
+ _InsideWallVC_Copy,
+ (Stg_Component_DefaultConstructorFunction*)InsideWallVC_DefaultNew,
+ _InsideWallVC_Construct,
+ _InsideWallVC_Build,
+ _VariableCondition_Initialise,
+ _VariableCondition_Execute,
+ _VariableCondition_Destroy,
+ name,
+ True,
+ _InsideWallVC_BuildSelf,
+ _InsideWallVC_PrintConcise,
+ _InsideWallVC_ReadDictionary,
+ _InsideWallVC_GetSet,
+ _InsideWallVC_GetVariableCount,
+ _InsideWallVC_GetVariableIndex,
+ _InsideWallVC_GetValueIndex,
+ _InsideWallVC_GetValueCount,
+ _InsideWallVC_GetValue,
+ _dictionaryEntryName,
+ variable_Register,
+ conFunc_Register,
+ dictionary,
+ _mesh );
+}
+
+
+void InsideWallVC_Init(
+ InsideWallVC* self,
+ Name name,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh )
+{
+ /* General info */
+ self->type = InsideWallVC_Type;
+ self->_sizeOfSelf = sizeof(InsideWallVC);
+ self->_deleteSelf = False;
+
+ /* Virtual info */
+ self->_delete = _InsideWallVC_Delete;
+ self->_print = _InsideWallVC_Print;
+ self->_copy = _InsideWallVC_Copy;
+ self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)InsideWallVC_DefaultNew;
+ self->_construct = _InsideWallVC_Construct;
+ self->_build = _InsideWallVC_Build;
+ self->_initialise = _VariableCondition_Initialise;
+ self->_execute = _VariableCondition_Execute;
+ self->_destroy = _VariableCondition_Destroy;
+ self->_buildSelf = _InsideWallVC_BuildSelf;
+ self->_printConcise = _InsideWallVC_PrintConcise;
+ self->_readDictionary = _InsideWallVC_ReadDictionary;
+ self->_getSet = _InsideWallVC_GetSet;
+ self->_getVariableCount = _InsideWallVC_GetVariableCount;
+ self->_getVariableIndex = _InsideWallVC_GetVariableIndex;
+ self->_getValueIndex = _InsideWallVC_GetValueIndex;
+ self->_getValueCount = _InsideWallVC_GetValueCount;
+ self->_getValue = _InsideWallVC_GetValue;
+
+ _Stg_Class_Init( (Stg_Class*)self );
+ _Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+ _Stg_Component_Init( (Stg_Component*)self );
+ _VariableCondition_Init( (VariableCondition*)self, variable_Register, conFunc_Register, dictionary );
+
+ /* Stg_Class info */
+ _InsideWallVC_Init( self, _dictionaryEntryName, _mesh );
+}
+
+
+InsideWallVC* _InsideWallVC_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,
+ VariableCondition_BuildSelfFunc* _buildSelf,
+ VariableCondition_PrintConciseFunc* _printConcise,
+ VariableCondition_ReadDictionaryFunc* _readDictionary,
+ VariableCondition_GetSetFunc* _getSet,
+ VariableCondition_GetVariableCountFunc* _getVariableCount,
+ VariableCondition_GetVariableIndexFunc* _getVariableIndex,
+ VariableCondition_GetValueIndexFunc* _getValueIndex,
+ VariableCondition_GetValueCountFunc* _getValueCount,
+ VariableCondition_GetValueFunc* _getValue,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh)
+{
+ InsideWallVC* self;
+
+ /* Allocate memory/General info */
+ assert(_sizeOfSelf >= sizeof(InsideWallVC));
+ self = (InsideWallVC*)_VariableCondition_New(
+ _sizeOfSelf,
+ type,
+ _delete,
+ _print,
+ _copy,
+ _defaultConstructor,
+ _construct,
+ _build,
+ _initialise,
+ _execute,
+ _destroy,
+ name,
+ initFlag,
+ _buildSelf,
+ _printConcise,
+ _readDictionary,
+ _getSet,
+ _getVariableCount,
+ _getVariableIndex,
+ _getValueIndex,
+ _getValueCount,
+ _getValue,
+ variable_Register,
+ conFunc_Register,
+ dictionary );
+
+ /* Virtual info */
+
+ /* Stg_Class info */
+ if( initFlag ){
+ _InsideWallVC_Init( self, _dictionaryEntryName, _mesh );
+ }
+
+ return self;
+}
+
+
+void _InsideWallVC_Init(
+ void* wallVC,
+ Name _dictionaryEntryName,
+ void* _mesh )
+{
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+
+ self->isConstructed = True;
+ self->_dictionaryEntryName = _dictionaryEntryName;
+ self->_mesh = (Mesh*)_mesh;
+ self->_wall = WallVC_Wall_Size;
+ self->_entryTbl = 0;
+ self->_entryCount = 0;
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** General virtual functions
+*/
+
+void _InsideWallVC_ReadDictionary( void* variableCondition, void* dictionary ) {
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+ Dictionary_Entry_Value* vcDictVal;
+ Dictionary_Entry_Value _vcDictVal;
+ Dictionary_Entry_Value* varsVal;
+ InsideWallVC_Entry_Index entry_I;
+
+ /* Find dictionary entry */
+ if (self->_dictionaryEntryName)
+ vcDictVal = Dictionary_Get(dictionary, self->_dictionaryEntryName);
+ else
+ {
+ vcDictVal = &_vcDictVal;
+ Dictionary_Entry_Value_InitFromStruct(vcDictVal, dictionary);
+ }
+
+ if (vcDictVal)
+ {
+ char* wallStr;
+
+ /* Obtain which wall */
+ wallStr = Dictionary_Entry_Value_AsString(Dictionary_Entry_Value_GetMember(vcDictVal, "wall" ));
+ if (!strcasecmp(wallStr, "back"))
+ self->_wall = WallVC_Wall_Back;
+ else if (!strcasecmp(wallStr, "left"))
+ self->_wall = WallVC_Wall_Left;
+ else if (!strcasecmp(wallStr, "bottom"))
+ self->_wall = WallVC_Wall_Bottom;
+ else if (!strcasecmp(wallStr, "right"))
+ self->_wall = WallVC_Wall_Right;
+ else if (!strcasecmp(wallStr, "top"))
+ self->_wall = WallVC_Wall_Top;
+ else if (!strcasecmp(wallStr, "front"))
+ self->_wall = WallVC_Wall_Front;
+ else {
+ assert( 0 );
+ self->_wall = WallVC_Wall_Size; /* invalid entry */
+ }
+
+ /* Obtain the variable entries */
+ self->_entryCount = Dictionary_Entry_Value_GetCount(Dictionary_Entry_Value_GetMember(vcDictVal, "variables"));
+ self->_entryTbl = Memory_Alloc_Array( InsideWallVC_Entry, self->_entryCount, "InsideWallVC->_entryTbl" );
+ varsVal = Dictionary_Entry_Value_GetMember(vcDictVal, "variables");
+
+ for (entry_I = 0; entry_I < self->_entryCount; entry_I++)
+ {
+ char* valType;
+ Dictionary_Entry_Value* valueEntry;
+ Dictionary_Entry_Value* varDictListVal;
+
+ varDictListVal = Dictionary_Entry_Value_GetElement(varsVal, entry_I);
+ valueEntry = Dictionary_Entry_Value_GetMember(varDictListVal, "value");
+
+ self->_entryTbl[entry_I].varName = Dictionary_Entry_Value_AsString(
+ Dictionary_Entry_Value_GetMember(varDictListVal, "name"));
+
+ valType = Dictionary_Entry_Value_AsString(Dictionary_Entry_Value_GetMember(varDictListVal, "type"));
+ if (0 == strcasecmp(valType, "func"))
+ {
+ char* funcName = Dictionary_Entry_Value_AsString(valueEntry);
+ Index cfIndex;
+
+ self->_entryTbl[entry_I].value.type = VC_ValueType_CFIndex;
+ cfIndex = ConditionFunction_Register_GetIndex( self->conFunc_Register, funcName);
+ if ( cfIndex == (unsigned)-1 ) {
+ Stream* errorStr = Journal_Register( Error_Type, self->type );
+
+ Journal_Printf( errorStr, "Error- in %s: While parsing "
+ "definition of wallVC \"%s\" (applies to wall \"%s\"), the cond. func. applied to "
+ "variable \"%s\" - \"%s\" - wasn't found in the c.f. register.\n",
+ __func__, self->_dictionaryEntryName, InsideWallVC_WallEnumToStr[self->_wall],
+ self->_entryTbl[entry_I].varName, funcName );
+ Journal_Printf( errorStr, "(Available functions in the C.F. register are: ");
+ ConditionFunction_Register_PrintNameOfEachFunc( self->conFunc_Register, errorStr );
+ Journal_Printf( errorStr, ")\n");
+ assert(0);
+ }
+ self->_entryTbl[entry_I].value.as.typeCFIndex = cfIndex;
+ }
+ else if (0 == strcasecmp(valType, "array"))
+ {
+ Dictionary_Entry_Value* valueElement;
+ Index i;
+
+ self->_entryTbl[entry_I].value.type = VC_ValueType_DoubleArray;
+ self->_entryTbl[entry_I].value.as.typeArray.size = Dictionary_Entry_Value_GetCount(valueEntry);
+ self->_entryTbl[entry_I].value.as.typeArray.array = Memory_Alloc_Array( double,
+ self->_entryTbl[entry_I].value.as.typeArray.size, "InsideWallVC->_entryTbl[].value.as.typeArray.array" );
+
+ for (i = 0; i < self->_entryTbl[entry_I].value.as.typeArray.size; i++)
+ {
+ valueElement = Dictionary_Entry_Value_GetElement(valueEntry, i);
+ self->_entryTbl[entry_I].value.as.typeArray.array[i] =
+ Dictionary_Entry_Value_AsDouble(valueElement);
+ }
+ }
+ else if( 0 == strcasecmp( valType, "double" ) || 0 == strcasecmp( valType, "d" ) ||
+ 0 == strcasecmp( valType, "float" ) || 0 == strcasecmp( valType, "f" ) )
+ {
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Double;
+ self->_entryTbl[entry_I].value.as.typeDouble = Dictionary_Entry_Value_AsDouble( valueEntry );
+ }
+ else if( 0 == strcasecmp( valType, "integer" ) || 0 == strcasecmp( valType, "int" ) || 0 == strcasecmp( valType, "i" ) ) {
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Int;
+ self->_entryTbl[entry_I].value.as.typeInt = Dictionary_Entry_Value_AsUnsignedInt( valueEntry );
+ }
+ else if( 0 == strcasecmp( valType, "short" ) || 0 == strcasecmp( valType, "s" ) ) {
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Short;
+ self->_entryTbl[entry_I].value.as.typeShort = Dictionary_Entry_Value_AsUnsignedInt( valueEntry );
+ }
+ else if( 0 == strcasecmp( valType, "char" ) || 0 == strcasecmp( valType, "c" ) ) {
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Char;
+ self->_entryTbl[entry_I].value.as.typeChar = Dictionary_Entry_Value_AsUnsignedInt( valueEntry );
+ }
+ else if( 0 == strcasecmp( valType, "pointer" ) || 0 == strcasecmp( valType, "ptr" ) || 0 == strcasecmp( valType, "p" ) ) {
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Ptr;
+ self->_entryTbl[entry_I].value.as.typePtr = (void*) ( (ArithPointer)Dictionary_Entry_Value_AsUnsignedInt( valueEntry ));
+ }
+ else {
+ /* Assume double */
+ Journal_DPrintf(
+ Journal_Register( InfoStream_Type, "myStream" ),
+ "Type to variable on variable condition not given, assuming double\n" );
+ self->_entryTbl[entry_I].value.type = VC_ValueType_Double;
+ self->_entryTbl[entry_I].value.as.typeDouble = Dictionary_Entry_Value_AsDouble( valueEntry );
+ }
+ }
+ }
+ else
+ {
+ self->_wall = WallVC_Wall_Size;
+ self->_entryCount = 0;
+ self->_entryTbl = NULL;
+ }
+}
+
+
+void _InsideWallVC_Delete(void* wallVC)
+{
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+
+ if (self->_entryTbl) Memory_Free(self->_entryTbl);
+
+ /* Stg_Class_Delete parent */
+ _VariableCondition_Delete(self);
+}
+
+
+void _InsideWallVC_Print(void* wallVC, Stream* stream)
+{
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+ InsideWallVC_Entry_Index entry_I;
+ Index i;
+
+ /* Set the Journal for printing informations */
+ Stream* info = stream;
+
+ /* General info */
+ Journal_Printf( info, "InsideWallVC (ptr): %p\n", self);
+
+ /* Virtual info */
+
+ /* Stg_Class info */
+ Journal_Printf( info, "\tdictionary (ptr): %p\n", self->dictionary);
+ Journal_Printf( info, "\t_dictionaryEntryName (ptr): %p\n", self->_dictionaryEntryName);
+ if (self->_dictionaryEntryName)
+ Journal_Printf( info, "\t\t_dictionaryEntryName: %s\n", self->_dictionaryEntryName);
+ Journal_Printf( info, "\t_wall: %s\n", self->_wall == WallVC_Wall_Front ? "Front" :
+ self->_wall == WallVC_Wall_Back ? "Back" : self->_wall == WallVC_Wall_Left ? "Left" :
+ self->_wall == WallVC_Wall_Right ? "Right" : self->_wall == WallVC_Wall_Top ? "Top" :
+ self->_wall == WallVC_Wall_Bottom ? "Bottom" : "None");
+ Journal_Printf( info, "\t_entryCount: %u\n", self->_entryCount);
+ Journal_Printf( info, "\t_entryTbl (ptr): %p\n", self->_entryTbl);
+ if (self->_entryTbl)
+ for (entry_I = 0; entry_I < self->_entryCount; entry_I++)
+ {
+ Journal_Printf( info, "\t\t_entryTbl[%u]:\n", entry_I);
+ Journal_Printf( info, "\t\t\tvarName (ptr): %p\n", self->_entryTbl[entry_I].varName);
+ if (self->_entryTbl[entry_I].varName)
+ Journal_Printf( info, "\t\t\t\tvarName: %s\n", self->_entryTbl[entry_I].varName);
+ Journal_Printf( info, "\t\t\tvalue:\n");
+ switch (self->_entryTbl[entry_I].value.type)
+ {
+ case VC_ValueType_Double:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_Double\n" );
+ Journal_Printf( info, "\t\t\t\tasDouble: %g\n", self->_entryTbl[entry_I].value.as.typeDouble );
+ break;
+
+ case VC_ValueType_Int:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_Int\n" );
+ Journal_Printf( info, "\t\t\t\tasInt: %i\n", self->_entryTbl[entry_I].value.as.typeInt );
+ break;
+
+ case VC_ValueType_Short:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_Short\n" );
+ Journal_Printf( info, "\t\t\t\tasShort: %i\n", self->_entryTbl[entry_I].value.as.typeShort );
+ break;
+
+ case VC_ValueType_Char:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_Char\n");
+ Journal_Printf( info, "\t\t\t\tasChar: %c\n", self->_entryTbl[entry_I].value.as.typeChar );
+ break;
+
+ case VC_ValueType_Ptr:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_Ptr\n");
+ Journal_Printf( info, "\t\t\t\tasPtr: %g\n", self->_entryTbl[entry_I].value.as.typePtr );
+ break;
+
+ case VC_ValueType_DoubleArray:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_DoubleArray\n");
+ Journal_Printf( info, "\t\t\t\tarraySize: %u\n", self->_entryTbl[entry_I].value.as.typeArray.size);
+ Journal_Printf( info, "\t\t\t\tasDoubleArray (ptr): %p\n",
+ self->_entryTbl[entry_I].value.as.typeArray.array);
+ if (self->_entryTbl[entry_I].value.as.typeArray.array)
+ for (i = 0; i < self->_entryTbl[entry_I].value.as.typeArray.size; i++)
+ Journal_Printf( info, "\t\t\t\tasDoubleArray[%u]: %g\n", i,
+ self->_entryTbl[entry_I].value.as.typeArray.array[i]);
+ break;
+
+ case VC_ValueType_CFIndex:
+ Journal_Printf( info, "\t\t\t\ttype: VC_ValueType_CFIndex\n");
+ Journal_Printf( info, "\t\t\t\tasCFIndex: %u\n", self->_entryTbl[entry_I].value.as.typeCFIndex);
+ break;
+ }
+ }
+ Journal_Printf( info, "\t_mesh (ptr): %p\n", self->_mesh);
+
+ /* Print parent */
+ _VariableCondition_Print(self);
+}
+
+
+void* _InsideWallVC_Copy( void* wallVC, void* dest, Bool deep, Name nameExt, struct PtrMap* ptrMap ) {
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+ InsideWallVC* newInsideWallVC;
+ PtrMap* map = ptrMap;
+ Bool ownMap = False;
+
+ if( !map ) {
+ map = PtrMap_New( 10 );
+ ownMap = True;
+ }
+
+ newInsideWallVC = (InsideWallVC*)_VariableCondition_Copy( self, dest, deep, nameExt, map );
+
+ newInsideWallVC->_dictionaryEntryName = self->_dictionaryEntryName;
+ newInsideWallVC->_wall = self->_wall;
+ newInsideWallVC->_entryCount = self->_entryCount;
+
+ if( deep ) {
+ newInsideWallVC->_mesh = (Mesh*)Stg_Class_Copy( self->_mesh, NULL, deep, nameExt, map );
+
+ if( (newInsideWallVC->_entryTbl = PtrMap_Find( map, self->_entryTbl )) == NULL && self->_entryTbl ) {
+ newInsideWallVC->_entryTbl = Memory_Alloc_Array( InsideWallVC_Entry, newInsideWallVC->_entryCount, "InsideWallVC->_entryTbl");
+ memcpy( newInsideWallVC->_entryTbl, self->_entryTbl, sizeof(InsideWallVC_Entry) * newInsideWallVC->_entryCount );
+ PtrMap_Append( map, newInsideWallVC->_entryTbl, self->_entryTbl );
+ }
+ }
+ else {
+ newInsideWallVC->_mesh = self->_mesh;
+ newInsideWallVC->_entryTbl = self->_entryTbl;
+ }
+
+ if( ownMap ) {
+ Stg_Class_Delete( map );
+ }
+
+ return (void*)newInsideWallVC;
+}
+
+
+void _InsideWallVC_Build( void* wallVC, void* data ) {
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+
+ _InsideWallVC_BuildSelf( self, data );
+
+ _VariableCondition_Build( self, data );
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Macros
+*/
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _InsideWallVC_Construct( void* wallVC, Stg_ComponentFactory* cf, void* data )
+{
+
+}
+
+void _InsideWallVC_BuildSelf( void* wallVC, void* data ) {
+ InsideWallVC* self = (InsideWallVC*)wallVC;
+
+ if( self->_mesh ) {
+ Build( self->_mesh, data, False );
+ }
+}
+
+
+IndexSet* _InsideWallVC_GetSet(void* variableCondition)
+{
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+ IndexSet* set = NULL;
+ Stream* warningStr = Journal_Register( Error_Type, self->type );
+ unsigned nDims;
+ Grid* vertGrid;
+
+ nDims = Mesh_GetDimSize( self->_mesh );
+ vertGrid = *(Grid**)ExtensionManager_Get( self->_mesh->info, self->_mesh,
+ ExtensionManager_GetHandle( self->_mesh->info,
+ "vertexGrid" ) );
+
+ switch (self->_wall) {
+ case WallVC_Wall_Front:
+ if ( nDims < 3 || !vertGrid->sizes[2] ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideFrontSet( self->_mesh );
+ }
+ break;
+
+ case WallVC_Wall_Back:
+ if ( nDims < 3 || !vertGrid->sizes[2] ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideBackSet( self->_mesh );
+ }
+ break;
+
+ case WallVC_Wall_Top:
+ if ( nDims < 2 || !vertGrid->sizes[1] ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideTopSet(self->_mesh);
+ }
+ break;
+
+ case WallVC_Wall_Bottom:
+ if ( nDims < 2 || !vertGrid->sizes[1] ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideBottomSet(self->_mesh);
+ }
+ break;
+
+ case WallVC_Wall_Left:
+ if ( nDims < 1 ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideLeftSet(self->_mesh);
+ }
+ break;
+
+ case WallVC_Wall_Right:
+ if( nDims < 1 ) {
+ set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
+ }
+ else {
+ set = RegularMeshUtils_CreateGlobalInsideRightSet(self->_mesh);
+ }
+ break;
+
+ case WallVC_Wall_Size:
+ default:
+ assert(0);
+ break;
+ }
+
+ return set;
+}
+
+
+VariableCondition_VariableIndex _InsideWallVC_GetVariableCount(void* variableCondition, Index globalIndex)
+{
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+
+ return self->_entryCount;
+}
+
+
+Variable_Index _InsideWallVC_GetVariableIndex(void* variableCondition, Index globalIndex, VariableCondition_VariableIndex varIndex)
+{
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+ Variable_Index searchedIndex = 0;
+ Stream* errorStr = Journal_Register( Error_Type, self->type );
+ Name varName;
+
+ varName = self->_entryTbl[varIndex].varName;
+ searchedIndex = Variable_Register_GetIndex(self->variable_Register, varName );
+
+ Journal_Firewall( ( searchedIndex < self->variable_Register->count ), errorStr, "Error- in %s: searching for index of "
+ "varIndex %u (\"%s\") at global node number %u failed - register returned index %u, greater than "
+ "count %u.\n", __func__, varIndex, varName, globalIndex, searchedIndex, self->variable_Register->count );
+
+ return searchedIndex;
+}
+
+
+VariableCondition_ValueIndex _InsideWallVC_GetValueIndex(
+ void* variableCondition,
+ Index globalIndex,
+ VariableCondition_VariableIndex varIndex)
+{
+ return varIndex;
+}
+
+
+VariableCondition_ValueIndex _InsideWallVC_GetValueCount(void* variableCondition)
+{
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+
+ return self->_entryCount;
+}
+
+
+VariableCondition_Value _InsideWallVC_GetValue(void* variableCondition, VariableCondition_ValueIndex valIndex)
+{
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+
+ return self->_entryTbl[valIndex].value;
+}
+
+void _InsideWallVC_PrintConcise( void* variableCondition, Stream* stream ) {
+ InsideWallVC* self = (InsideWallVC*)variableCondition;
+
+ Journal_Printf( stream, "\ttype: %s, set: ", self->type );
+ Journal_Printf( stream, "%s\n",
+ self->_wall == WallVC_Wall_Front ? "Front" :
+ self->_wall == WallVC_Wall_Back ? "Back" :
+ self->_wall == WallVC_Wall_Left ? "Left" :
+ self->_wall == WallVC_Wall_Right ? "Right" :
+ self->_wall == WallVC_Wall_Top ? "Top" :
+ self->_wall == WallVC_Wall_Bottom ? "Bottom" : "None" );
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Build functions
+*/
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.h (rev 0)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.h 2009-02-25 14:05:52 UTC (rev 14143)
@@ -0,0 +1,198 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Comments:
+**
+** $Id: /cig/src/StGermain/Discretisation/Utils/src/InsideWallVC.h 945 2006-10-14T18:52:18.897525Z boo $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisation_Utils_InsideWallVC_h__
+#define __Discretisation_Utils_InsideWallVC_h__
+
+
+ extern const Type InsideWallVC_Type;
+
+ extern const char* InsideWallVC_WallEnumToStr[WallVC_Wall_Size];
+
+ #define __InsideWallVC_Entry \
+ Name varName; \
+ VariableCondition_Value value; \
+
+ struct _InsideWallVC_Entry { __InsideWallVC_Entry };
+
+
+ #define __InsideWallVC \
+ /* General info */ \
+ __VariableCondition \
+ \
+ /* Virtual info */ \
+ \
+ /* Stg_Class info */ \
+ Name _dictionaryEntryName; \
+ WallVC_Wall _wall; \
+ InsideWallVC_Entry_Index _entryCount; \
+ InsideWallVC_Entry* _entryTbl; \
+ Mesh* _mesh;
+
+ struct _InsideWallVC { __InsideWallVC };
+
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Constructor
+ */
+
+ VariableCondition* InsideWallVC_Factory(
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* data );
+
+ InsideWallVC* InsideWallVC_DefaultNew( Name name );
+
+ InsideWallVC* InsideWallVC_New(
+ Name name,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh );
+
+ void InsideWallVC_Init(
+ InsideWallVC* self,
+ Name name,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh );
+
+ InsideWallVC* _InsideWallVC_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,
+ VariableCondition_BuildSelfFunc* _buildSelf,
+ VariableCondition_PrintConciseFunc* _printConcise,
+ VariableCondition_ReadDictionaryFunc* _readDictionary,
+ VariableCondition_GetSetFunc* _getSet,
+ VariableCondition_GetVariableCountFunc* _getVariableCount,
+ VariableCondition_GetVariableIndexFunc* _getVariableIndex,
+ VariableCondition_GetValueIndexFunc* _getValueIndex,
+ VariableCondition_GetValueCountFunc* _getValueCount,
+ VariableCondition_GetValueFunc* _getValue,
+ Name _dictionaryEntryName,
+ Variable_Register* variable_Register,
+ ConditionFunction_Register* conFunc_Register,
+ Dictionary* dictionary,
+ void* _mesh );
+
+ void _InsideWallVC_Init(
+ void* wallVC,
+ Name _dictionaryEntryName,
+ void* _mesh );
+
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** General virtual functions
+ */
+
+ void _InsideWallVC_Delete( void* wallVC );
+
+ void _InsideWallVC_Print( void* wallVC, Stream* stream );
+
+ /* Copy */
+ #define InsideWallVC_Copy( self ) \
+ (VariableCondition*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+ #define InsideWallVC_Copy( self ) \
+ (VariableCondition*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+
+ void* _InsideWallVC_Copy( void* wallVC, void* dest, Bool deep, Name nameExt, struct PtrMap* ptrMap );
+
+ void _InsideWallVC_Build( void* wallVC, void* data );
+
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Macros
+ */
+
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Virtual functions
+ */
+
+ void _InsideWallVC_Construct( void* wallVC, Stg_ComponentFactory* cf, void* data );
+
+ void _InsideWallVC_BuildSelf( void* wallVC, void* data );
+
+ void _InsideWallVC_ReadDictionary( void* variableCondition, void* dictionary );
+
+ IndexSet* _InsideWallVC_GetSet( void* variableCondition );
+
+ VariableCondition_VariableIndex _InsideWallVC_GetVariableCount( void* variableCondition, Index globalIndex );
+
+ Variable_Index _InsideWallVC_GetVariableIndex(
+ void* variableCondition,
+ Index globalIndex,
+ VariableCondition_VariableIndex varIndex );
+
+ VariableCondition_ValueIndex _InsideWallVC_GetValueIndex(
+ void* variableCondition,
+ Index globalIndex,
+ VariableCondition_VariableIndex varIndex );
+
+ VariableCondition_ValueIndex _InsideWallVC_GetValueCount( void* variableCondition );
+
+ VariableCondition_Value _InsideWallVC_GetValue( void* variableCondition, VariableCondition_ValueIndex valIndex );
+
+ void _InsideWallVC_PrintConcise( void* variableCondition, Stream* stream );
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Build functions
+ */
+
+
+ /*--------------------------------------------------------------------------------------------------------------------------
+ ** Functions
+ */
+
+
+#endif /* __Discretisation_Utils_InsideWallVC_h__ */
Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.meta
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.meta (rev 0)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/InsideWallVC.meta 2009-02-25 14:05:52 UTC (rev 14143)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">InsideWallVC</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Utils/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">VariableCondition</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>
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.c 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.c 2009-02-25 14:05:52 UTC (rev 14143)
@@ -249,6 +249,148 @@
return set;
}
+IndexSet* RegularMeshUtils_CreateGlobalInsideTopSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ Grid* grid;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+ assert( Mesh_GetDimSize( mesh ) >= 2 );
+
+ grid = *(Grid**)ExtensionManager_Get( mesh->info, mesh,
+ ExtensionManager_GetHandle( mesh->info, "vertexGrid" ) );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[1] == grid->sizes[1] - 2 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
+IndexSet* RegularMeshUtils_CreateGlobalInsideBottomSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+ assert( Mesh_GetDimSize( mesh ) >= 2 );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[1] == 1 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
+IndexSet* RegularMeshUtils_CreateGlobalInsideLeftSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[0] == 1 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
+IndexSet* RegularMeshUtils_CreateGlobalInsideRightSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ Grid* grid;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+
+ grid = *(Grid**)ExtensionManager_Get( mesh->info, mesh,
+ ExtensionManager_GetHandle( mesh->info, "vertexGrid" ) );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[0] == grid->sizes[0] - 2 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
+IndexSet* RegularMeshUtils_CreateGlobalInsideFrontSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ Grid* grid;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+ assert( Mesh_GetDimSize( mesh ) >= 3 );
+
+ grid = *(Grid**)ExtensionManager_Get( mesh->info, mesh,
+ ExtensionManager_GetHandle( mesh->info, "vertexGrid" ) );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[2] == grid->sizes[2] - 2 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
+IndexSet* RegularMeshUtils_CreateGlobalInsideBackSet( void* _mesh ) {
+ Mesh* mesh = (Mesh*)_mesh;
+ unsigned nNodes;
+ IndexSet* set;
+ IJK ijk;
+ unsigned n_i;
+
+ assert( mesh );
+ assert( Mesh_GetDimSize( mesh ) >= 3 );
+
+ nNodes = Mesh_GetDomainSize( mesh, MT_VERTEX );
+ set = IndexSet_New( nNodes );
+
+ for( n_i = 0; n_i < nNodes; n_i++ ) {
+ RegularMeshUtils_Node_1DTo3D( mesh, Mesh_DomainToGlobal( mesh, MT_VERTEX, n_i ), ijk );
+ if( ijk[2] == 1 )
+ IndexSet_Add( set, n_i );
+ }
+
+ return set;
+}
+
IndexSet* RegularMeshUtils_CreateGlobalInnerTopSet( void* _mesh ) {
Mesh* mesh = (Mesh*)_mesh;
Grid* grid;
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.h 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/RegularMeshUtils.h 2009-02-25 14:05:52 UTC (rev 14143)
@@ -75,6 +75,25 @@
IndexSet* RegularMeshUtils_CreateGlobalBackSet( void* _mesh );
+ /** Create a new set, based on node indices, of nodes one element inside of the top of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideTopSet( void* _mesh );
+
+ /** Create a new set, based on node indices, of nodes one element inside of the bottom of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideBottomSet( void* _mesh );
+
+ /** Create a new set, based on node indices, of nodes one element inside of the left of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideLeftSet( void* _mesh );
+
+ /** Create a new set, based on node indices, of nodes one element inside of the right of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideRightSet( void* _mesh );
+
+ /** Create a new set, based on node indices, of nodes one element inside of the front of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideFrontSet( void* _mesh );
+
+ /** Create a new set, based on node indices, of nodes one element inside of the back of the global regular mesh */
+ IndexSet* RegularMeshUtils_CreateGlobalInsideBackSet( void* _mesh );
+
+
/** Create a new set, based on node indices, of nodes on the top without the corners of the global regular mesh */
IndexSet* RegularMeshUtils_CreateGlobalInnerTopSet( void* _mesh );
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SConscript 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SConscript 2009-02-25 14:05:52 UTC (rev 14143)
@@ -23,6 +23,7 @@
"AllElementsVC.h",
"AllNodesVC.h",
"WallVC.h",
+ "InsideWallVC.h",
"InnerWallVC.h",
"CornerVC.h",
"ShapeVC.h",
@@ -49,6 +50,7 @@
c_files=["AllElementsVC.c",
"AllNodesVC.c",
"WallVC.c",
+ "InsideWallVC.c",
"InnerWallVC.c",
"CornerVC.c",
"ShapeVC.c",
@@ -87,7 +89,8 @@
StripRemesher.meta
TimeIntegratee.meta
TimeIntegrator.meta
-WallVC.meta""")
+WallVC.meta
+InsideWallVC.meta""")
c_files+=[local_env.Meta(meta_files)]
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Utils.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Utils.h 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Utils.h 2009-02-25 14:05:52 UTC (rev 14143)
@@ -47,6 +47,7 @@
#include "AllElementsVC.h"
#include "AllNodesVC.h"
#include "WallVC.h"
+ #include "InsideWallVC.h"
#include "CornerVC.h"
#include "InnerWallVC.h"
#include "ShapeVC.h"
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/types.h 2009-02-25 05:21:45 UTC (rev 14142)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/types.h 2009-02-25 14:05:52 UTC (rev 14143)
@@ -46,6 +46,7 @@
typedef struct _AllElementsVC AllElementsVC;
typedef struct _AllNodesVC AllNodesVC;
typedef struct _WallVC WallVC;
+ typedef struct _InsideWallVC InsideWallVC;
typedef struct _InnerWallVC InnerWallVC;
typedef struct _CornerVC CornerVC;
typedef struct ShapeVC ShapeVC;
@@ -112,6 +113,10 @@
typedef struct _WallVC_Entry WallVC_Entry;
typedef Index WallVC_Entry_Index;
+
+ typedef struct _InsideWallVC_Entry InsideWallVC_Entry;
+ typedef Index InsideWallVC_Entry_Index;
+
typedef Index ShapeVC_Entry_Index;
typedef struct _CornerVC_Entry CornerVC_Entry;
More information about the CIG-COMMITS
mailing list