[cig-commits] r5023 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Mesh/src

walter at geodynamics.org walter at geodynamics.org
Sat Oct 14 11:31:14 PDT 2006


Author: walter
Date: 2006-10-14 11:31:14 -0700 (Sat, 14 Oct 2006)
New Revision: 5023

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.c
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.h
Log:
 r3050 at earth:  boo | 2006-10-14 11:08:06 -0700
  r3038 at earth (orig r3858):  LukeHodkinson | 2006-10-14 11:08:55 -0700
  Adding capacity for 1D mesh generation.
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3049
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3857
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3050
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3858

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.c	2006-10-14 18:31:07 UTC (rev 5022)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.c	2006-10-14 18:31:14 UTC (rev 5023)
@@ -262,8 +262,11 @@
 		self->pointSize[ K_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeK", 2 );
 	}
 
-	if ( dim == 2 )
+	if ( dim <= 2 ) {
 		self->pointSize[ K_AXIS ] = 1;
+		if( dim == 1 )
+			self->pointSize[J_AXIS] = 1;
+	}
 	assert( self->pointSize[0] * self->pointSize[1] * self->pointSize[2] );
 	
 	if ( elementSize ) {
@@ -274,13 +277,21 @@
 		self->elementSize[1] = self->pointSize[1] - 1;
 		self->elementSize[2] = self->pointSize[2] - 1;
 	}
-	if ( dim == 2 )
+	if ( dim <= 2 ) {
 		self->elementSize[ K_AXIS ] = 1;
+		if( dim == 1 )
+			self->elementSize[J_AXIS] = 1;
+	}
 	self->elementCount = self->elementSize[0] * self->elementSize[1] * self->elementSize[2];
 	assert( self->elementCount );
 	
 	self->cornerCount = self->geometry->pointCount;
-	if ( dim == 2 ) {
+	if( dim == 1 ) {
+		self->elementCornerCount = 2;
+		self->elementEdgeCount = 0;
+		self->edgeCount = 0;
+	}
+	else if ( dim == 2 ) {
 		self->elementCornerCount = 4;
 		self->elementEdgeCount = 4;
 		self->edgeCount = self->elementSize[0] * self->pointSize[1] + self->elementSize[1] * self->pointSize[0];
@@ -462,17 +473,32 @@
 
 Element_GlobalIndex _HexaEL_CornerElementCount( void* hexaEL, Index corner ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
-	return ( self->dim == 2 ? 4 : 8 );
+	return ( self->dim == 1 ? 2 : self->dim == 2 ? 4 : 8 );
 }
 
 void _HexaEL_BuildCornerElements( void* hexaEL, Index corner, Element_GlobalIndex* elements ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 
-	self->buildCornerElements = (self->dim == 2 ? _HexaEL_BuildCornerElements2D : _HexaEL_BuildCornerElements3D );
+	self->buildCornerElements = (self->dim == 1 ? _HexaEL_BuildCornerElements1D : 
+				     self->dim == 2 ? _HexaEL_BuildCornerElements2D : _HexaEL_BuildCornerElements3D );
 
 	ElementLayout_BuildCornerElements( self, corner, elements );
 }
 
+void _HexaEL_BuildCornerElements1D( void* hexaEL, Index corner, Element_GlobalIndex* elements ) {
+	HexaEL*		self = (HexaEL*)hexaEL;
+
+	if( corner > 0 )
+		elements[0] = corner;
+	else
+		elements[0] = self->elementCount;
+
+	if( corner < self->elementCount - 1 )
+		elements[1] = corner + 1;
+	else
+		elements[1] = self->elementCount;
+}
+
 void _HexaEL_BuildCornerElements2D( void* hexaEL, Index corner, Element_GlobalIndex* elements ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 	IJK		ij;
@@ -550,11 +576,16 @@
 void _HexaEL_BuildEdgeIndices( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 
-	self->buildEdgeIndices = ( self->dim == 2 ? _HexaEL_BuildEdgeIndices2D : _HexaEL_BuildEdgeIndices3D );
+	self->buildEdgeIndices = (self->dim == 1 ? _HexaEL_BuildEdgeIndices1D : 
+				  self->dim == 2 ? _HexaEL_BuildEdgeIndices2D : _HexaEL_BuildEdgeIndices3D );
 
 	ElementLayout_BuildEdgeIndices( self, globalIndex, edges );
 }
 
+void _HexaEL_BuildEdgeIndices1D( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges ) {
+	abort();
+}
+
 void _HexaEL_BuildEdgeIndices2D( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 	IJK		ij;
@@ -615,7 +646,7 @@
 Element_GlobalIndex _HexaEL_EdgeElementCount( void* hexaEL, Index edge ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 
-	return ( self->dim == 2 ? 2 : 4 );
+	return (self->dim == 1 ? 0 : self->dim == 2 ? 2 : 4 );
 }
 
 
@@ -628,10 +659,15 @@
 void _HexaEL_EdgeAt( void* hexaEL, Index index, Edge edge ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 
-	self->edgeAt = (self->dim == 2 ? _HexaEL_EdgeAt2D : _HexaEL_EdgeAt3D );
+	self->edgeAt = (self->dim == 1 ? _HexaEL_EdgeAt1D : 
+			self->dim == 2 ? _HexaEL_EdgeAt2D : _HexaEL_EdgeAt3D );
 	ElementLayout_EdgeAt( self, index, edge );
 }
 
+void _HexaEL_EdgeAt1D( void* hexaEL, Index index, Edge edge ) {
+	abort();
+}
+
 void _HexaEL_EdgeAt2D( void* hexaEL, Index index, Edge edge ) {
 	HexaEL*		self = (HexaEL*)hexaEL;
 	
@@ -707,7 +743,8 @@
 {		
 	HexaEL*			self = (HexaEL*)hexaEL;
 
-	self->elementWithPoint = ( self->dim == 2 ? _HexaEL_ElementWithPoint2D : _HexaEL_ElementWithPoint3D );
+	self->elementWithPoint = (self->dim == 1 ? _HexaEL_ElementWithPoint1D : 
+				  self->dim == 2 ? _HexaEL_ElementWithPoint2D : _HexaEL_ElementWithPoint3D );
 
 	return ElementLayout_ElementWithPoint( self, decomp, point, mesh, boundaryStatus, nHints, hints );
 }
@@ -1339,6 +1376,11 @@
 	return False;
 }
 
+Element_DomainIndex _HexaEL_ElementWithPoint1D( void* hexaEL, void* _decomp, Coord point, void* _mesh, 
+						PartitionBoundaryStatus boundaryStatus, unsigned nHints, unsigned* hints )
+{
+	abort();
+}
 
 Element_DomainIndex _HexaEL_ElementWithPoint2D( void* hexaEL, void* _decomp, Coord point, void* _mesh, 
 						PartitionBoundaryStatus boundaryStatus, unsigned nHints, unsigned* hints )

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.h	2006-10-14 18:31:07 UTC (rev 5022)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/HexaEL.h	2006-10-14 18:31:14 UTC (rev 5023)
@@ -148,10 +148,12 @@
 	Element_GlobalIndex _HexaEL_CornerElementCount( void* hexaEL, Index corner );
 	
 	void _HexaEL_BuildCornerElements( void* hexaEL, Index corner, Element_GlobalIndex* elements );
+	void _HexaEL_BuildCornerElements1D( void* hexaEL, Index corner, Element_GlobalIndex* elements ) ;
 	void _HexaEL_BuildCornerElements2D( void* hexaEL, Index corner, Element_GlobalIndex* elements ) ;
 	void _HexaEL_BuildCornerElements3D( void* hexaEL, Index corner, Element_GlobalIndex* elements ) ;
 	
 	void _HexaEL_BuildEdgeIndices( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges );
+	void _HexaEL_BuildEdgeIndices1D( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges );
 	void _HexaEL_BuildEdgeIndices2D( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges ) ;
 	void _HexaEL_BuildEdgeIndices3D( void* hexaEL, Element_GlobalIndex globalIndex, Index* edges ) ;
 	
@@ -160,6 +162,7 @@
 	void _HexaEL_BuildEdgeElements( void* hexaEL, Index edge, Element_GlobalIndex* elements );
 	
 	void _HexaEL_EdgeAt( void* hexaEL, Index index, Edge edge );
+	void _HexaEL_EdgeAt1D( void* hexaEL, Index index, Edge edge ) ;
 	void _HexaEL_EdgeAt2D( void* hexaEL, Index index, Edge edge ) ;
 	void _HexaEL_EdgeAt3D( void* hexaEL, Index index, Edge edge ) ;
 
@@ -174,6 +177,8 @@
 		PatrickSunter, 7 Mar 2006 */
 	Element_GlobalIndex _HexaEL_ElementWithPoint( void* hexaEL, void* decomp, Coord point, void* mesh, 
 						      PartitionBoundaryStatus boundaryStatus, unsigned nHints, unsigned* hints );
+	Element_DomainIndex _HexaEL_ElementWithPoint1D( void* hexaEL, void* _decomp, Coord point, void* _mesh, 
+							PartitionBoundaryStatus boundaryStatus, unsigned nHints, unsigned* hints );
 	Element_DomainIndex _HexaEL_ElementWithPoint2D( void* hexaEL, void* decomp, Coord point, void* mesh, 
 							PartitionBoundaryStatus boundaryStatus, unsigned nHints, unsigned* hints );
 	Element_DomainIndex _HexaEL_ElementWithPoint3D( void* hexaEL, void* decomp, Coord point, void* mesh, 



More information about the cig-commits mailing list