[cig-commits] commit:

Mercurial hg at geodynamics.org
Mon Nov 24 11:59:31 PST 2008


changeset:   148:4b33c2403285
user:        LukeHodkinson
date:        Thu Aug 28 17:45:00 2008 +0000
files:       Utils/src/ContactVC.c Utils/src/ContactVC.h Utils/src/RegularMeshUtils.c Utils/src/RegularMeshUtils.h
description:
Modifying the contact VC to be able
to specify boundary depths using values
stored on mesh generators.


diff -r 154a85ccbdcf -r 4b33c2403285 Utils/src/ContactVC.c
--- a/Utils/src/ContactVC.c	Thu Aug 28 17:44:03 2008 +0000
+++ b/Utils/src/ContactVC.c	Thu Aug 28 17:45:00 2008 +0000
@@ -217,8 +217,7 @@ void _ContactVC_Init(
 {
    ContactVC*			self = (ContactVC*)wallVC;
 
-   self->depth = 0;
-   self->includeTop = False;
+   self->deep = False;
 }
 
 
@@ -241,19 +240,14 @@ void _ContactVC_ReadDictionary( void* va
       Dictionary_Entry_Value_InitFromStruct(vcDictVal, dictionary);
    }
 
-#if 0
    if (vcDictVal) {
-      self->depth = Dictionary_Entry_Value_AsInt(
-         Dictionary_Entry_Value_GetMember( vcDictVal, "depth" ) );
-      entryVal = Dictionary_Entry_Value_GetMember( vcDictVal, "includeTop" );
+      entryVal = Dictionary_Entry_Value_GetMember( vcDictVal, "deep" );
       if( entryVal )
-         self->includeTop = Dictionary_Entry_Value_AsBool( entryVal );
+         self->deep = Dictionary_Entry_Value_AsBool( entryVal );
    }
    else {
-      self->depth = 0;
-      self->includeTop = False;
-   }
-#endif
+      self->deep = False;
+   }
 }
 
 
@@ -349,7 +343,15 @@ IndexSet* _ContactVC_GetSet(void* variab
             set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
          }
          else {
-            set = RegularMeshUtils_CreateContactBottomSet(self->_mesh, gen->contactDepth[0][0], gen->contactDepth[0][1]);
+            if( self->deep ) {
+               set = RegularMeshUtils_CreateContactBottomSet(
+                  self->_mesh, gen->contactDepth[0][0], gen->contactDepth[0][1],
+                  gen->contactDepth[1][0] );
+            }
+            else {
+               set = RegularMeshUtils_CreateContactBottomSet(
+                  self->_mesh, gen->contactDepth[0][0], gen->contactDepth[0][1], 0 );
+            }
          }	
          break;
 			
@@ -373,7 +375,15 @@ IndexSet* _ContactVC_GetSet(void* variab
             set = IndexSet_New( Mesh_GetDomainSize( self->_mesh, MT_VERTEX ) );
          }
          else {
-            set = RegularMeshUtils_CreateContactRightSet(self->_mesh, gen->contactDepth[1][0], gen->contactDepth[1][1]);
+            if( self->deep ) {
+               set = RegularMeshUtils_CreateContactRightSet(
+                  self->_mesh, gen->contactDepth[1][0], gen->contactDepth[1][1],
+                  gen->contactDepth[0][1] );
+            }
+            else {
+               set = RegularMeshUtils_CreateContactRightSet(
+                  self->_mesh, gen->contactDepth[1][0], gen->contactDepth[1][1], 0 );
+            }
          }
          break;
 			
diff -r 154a85ccbdcf -r 4b33c2403285 Utils/src/ContactVC.h
--- a/Utils/src/ContactVC.h	Thu Aug 28 17:44:03 2008 +0000
+++ b/Utils/src/ContactVC.h	Thu Aug 28 17:45:00 2008 +0000
@@ -50,8 +50,7 @@
 		/* Virtual info */ \
 		\
 		/* Stg_Class info */ \
-		int depth; \
-		Bool includeTop;
+		Bool deep;
 
 	struct _ContactVC { __ContactVC };
 	
diff -r 154a85ccbdcf -r 4b33c2403285 Utils/src/RegularMeshUtils.c
--- a/Utils/src/RegularMeshUtils.c	Thu Aug 28 17:44:03 2008 +0000
+++ b/Utils/src/RegularMeshUtils.c	Thu Aug 28 17:45:00 2008 +0000
@@ -865,7 +865,7 @@ IndexSet* RegularMeshUtils_CreateContact
    return set;
 }
 
-IndexSet* RegularMeshUtils_CreateContactBottomSet( void* _mesh, int lowDepth, int uppDepth ) {
+IndexSet* RegularMeshUtils_CreateContactBottomSet( void* _mesh, int lowDepth, int uppDepth, int inDepth ) {
    Mesh* mesh = (Mesh*)_mesh;
    Grid* grid;
    int nNodes;
@@ -888,12 +888,13 @@ IndexSet* RegularMeshUtils_CreateContact
 */
    left = lowDepth;
    right = grid->sizes[0] - 1 - uppDepth;
-   bottom = 0;
-   top = 0;
+   bottom = inDepth;
+   top = inDepth;
    for( ii = 0; ii < nNodes; ii++ ) {
       Grid_Lift( grid, Mesh_DomainToGlobal( mesh, 0, ii ), ijk );
-      if( ijk[0] >= left && ijk[0] <= right && ijk[1] >= bottom && ijk[1] <= top )
+      if( ijk[0] >= left && ijk[0] <= right && ijk[1] >= bottom && ijk[1] <= top ) {
 	 IndexSet_Add( set, ii );
+      }
    }
 
    return set;
@@ -933,7 +934,7 @@ IndexSet* RegularMeshUtils_CreateContact
    return set;
 }
 
-IndexSet* RegularMeshUtils_CreateContactRightSet( void* _mesh, int lowDepth, int uppDepth ) {
+IndexSet* RegularMeshUtils_CreateContactRightSet( void* _mesh, int lowDepth, int uppDepth, int inDepth ) {
    Mesh* mesh = (Mesh*)_mesh;
    Grid* grid;
    int nNodes;
@@ -954,10 +955,10 @@ IndexSet* RegularMeshUtils_CreateContact
    bottom = depth + 1;
    top = grid->sizes[1] - 2;
 */
-   left = grid->sizes[0] - 1;
+   left = grid->sizes[0] - 1 - inDepth;
    right = grid->sizes[0] - 1;
-   bottom = lowDepth;
-   top = grid->sizes[1] - uppDepth - 1;
+   bottom = 0;
+   top = grid->sizes[1] - 1;
    for( ii = 0; ii < nNodes; ii++ ) {
       Grid_Lift( grid, Mesh_DomainToGlobal( mesh, 0, ii ), ijk );
       if( ijk[0] >= left && ijk[0] <= right && ijk[1] >= bottom && ijk[1] <= top )
diff -r 154a85ccbdcf -r 4b33c2403285 Utils/src/RegularMeshUtils.h
--- a/Utils/src/RegularMeshUtils.h	Thu Aug 28 17:44:03 2008 +0000
+++ b/Utils/src/RegularMeshUtils.h	Thu Aug 28 17:45:00 2008 +0000
@@ -138,9 +138,9 @@
 	IndexSet* RegularMeshUtils_CreateLocalInGlobalBackSet( void* _mesh );
 
 IndexSet* RegularMeshUtils_CreateContactTopSet( void* _mesh, int lowDepth, int uppDepth );
-IndexSet* RegularMeshUtils_CreateContactBottomSet( void* _mesh, int lowDepth, int uppDepth );
+IndexSet* RegularMeshUtils_CreateContactBottomSet( void* _mesh, int lowDepth, int uppDepth, int inDepth );
 IndexSet* RegularMeshUtils_CreateContactLeftSet( void* _mesh, int lowDepth, int uppDepth );
-IndexSet* RegularMeshUtils_CreateContactRightSet( void* _mesh, int lowDepth, int uppDepth );
+IndexSet* RegularMeshUtils_CreateContactRightSet( void* _mesh, int lowDepth, int uppDepth, int inDepth );
 
 	Node_DomainIndex RegularMeshUtils_GetDiagOppositeAcrossElementNodeIndex( void* _mesh, 
 										 Element_DomainIndex refElement_dI, 



More information about the CIG-COMMITS mailing list