[cig-commits] commit: Remove mapSize from Mesh_HexType since it is not needed for quad elements anymore
Mercurial
hg at geodynamics.org
Thu Sep 29 01:31:57 PDT 2011
changeset: 617:69d6988b0f7a
tag: tip
user: Walter Landry <wlandry at caltech.edu>
date: Thu Sep 29 01:30:24 2011 -0700
files: Mesh/src/Mesh_HexType.cxx Mesh/src/Mesh_HexType.h
description:
Remove mapSize from Mesh_HexType since it is not needed for quad elements anymore
diff -r 08b87a3544aa -r 69d6988b0f7a Mesh/src/Mesh_HexType.cxx
--- a/Mesh/src/Mesh_HexType.cxx Thu Sep 29 01:11:05 2011 -0700
+++ b/Mesh/src/Mesh_HexType.cxx Thu Sep 29 01:30:24 2011 -0700
@@ -94,7 +94,7 @@ void _Mesh_HexType_Init( Mesh_HexType* s
self->num_simplexes[1]=10;
self->vertMap = AllocArray( unsigned, max_vertices );
self->inc = AllocArray( unsigned, max_vertices );
- Mesh_HexType_SetVertexMap( self, NULL );
+ Mesh_HexType_SetVertexMap( self );
self->elementHasPoint = NULL;
@@ -294,21 +294,14 @@ double Mesh_HexType_GetMinimumSeparation
** Public Functions
*/
-void Mesh_HexType_SetVertexMap( void* hexType, unsigned* map ) {
- Mesh_HexType* self = (Mesh_HexType*)hexType;
- int v_i;
+void Mesh_HexType_SetVertexMap( void* hexType ) {
+ Mesh_HexType* self = (Mesh_HexType*)hexType;
+ int v_i;
- assert( self && Stg_CheckType( self, Mesh_HexType ) );
+ assert( self && Stg_CheckType( self, Mesh_HexType ) );
- if( map ) {
- self->mapSize = (Mesh_GetDimSize( self->mesh ) == 3) ? 8 : 4;
- memcpy( self->vertMap, map, self->mapSize * sizeof(unsigned) );
- }
- else {
- self->mapSize = 0;
- for( v_i = 0; v_i < max_vertices; v_i++ )
- self->vertMap[v_i] = v_i;
- }
+ for( v_i = 0; v_i < max_vertices; v_i++ )
+ self->vertMap[v_i] = v_i;
}
/* Modify triInds and tetInds for Q2 elements */
@@ -381,28 +374,13 @@ Bool Mesh_HexType_ElementHasPoint3DGener
inc = IArray_GetPtr( self->incArray );
/* Search for tetrahedra. */
- if( self->mapSize ) {
- unsigned v_i;
-
- for( v_i = 0; v_i < self->mapSize; v_i++ )
- self->inc[v_i] = inc[self->vertMap[v_i]];
- if( Simplex_Search3D( mesh->verts, self->inc,
- self->num_simplexes[1], self->tetInds,
- point, bc, &inside ) ) {
- *dim = MT_VOLUME;
- *ind = elInd;
- return True;
- }
- }
- else {
- if( Simplex_Search3D( mesh->verts, (unsigned*)inc,
- self->num_simplexes[1], self->tetInds,
- point, bc, &inside ) ) {
- *dim = MT_VOLUME;
- *ind = elInd;
- return True;
- }
- }
+ if( Simplex_Search3D( mesh->verts, (unsigned*)inc,
+ self->num_simplexes[1], self->tetInds,
+ point, bc, &inside ) ) {
+ *dim = MT_VOLUME;
+ *ind = elInd;
+ return True;
+ }
return False;
}
@@ -526,19 +504,9 @@ Bool Mesh_HexType_ElementHasPoint3DWithI
inc = IArray_GetPtr( self->incArray );
/* Search for tetrahedra. */
- if( self->mapSize ) {
- unsigned v_i;
-
- for( v_i = 0; v_i < self->mapSize; v_i++ )
- self->inc[v_i] = inc[self->vertMap[v_i]];
- fnd = Simplex_Search3D( mesh->verts, self->inc,
- self->num_simplexes[1], self->tetInds,
- point, bc, &inside );
- }
- else
- fnd = Simplex_Search3D( mesh->verts, (unsigned*)inc,
- self->num_simplexes[1], self->tetInds,
- point, bc, &inside );
+ fnd = Simplex_Search3D( mesh->verts, (unsigned*)inc,
+ self->num_simplexes[1], self->tetInds,
+ point, bc, &inside );
if( fnd ) {
unsigned* inds = self->tetInds[inside];
@@ -718,15 +686,6 @@ Bool Mesh_HexType_ElementHasPoint2DGener
fnd=Side_Search2D(inc,mesh->verts,point,on_edge);
}
/* Search for triangle. */
- else if( self->mapSize ) {
- unsigned v_i;
-
- for( v_i = 0; v_i < self->mapSize; v_i++ )
- self->inc[v_i] = inc[self->vertMap[v_i]];
- fnd = Simplex_Search2D( mesh->verts, self->inc,
- self->num_simplexes[0], self->triInds,
- point, bc, &inside );
- }
else
fnd = Simplex_Search2D( mesh->verts, (unsigned*)inc,
self->num_simplexes[0], self->triInds,
@@ -831,20 +790,9 @@ bool Mesh_HexType_ElementHasPoint2DWithI
else
{
/* Search for triangle. */
- if( self->mapSize ) {
- unsigned v_i;
-
- for( v_i = 0; v_i < self->mapSize; v_i++ )
- self->inc[v_i] = inc[self->vertMap[v_i]];
- fnd = Simplex_Search2D( mesh->verts, self->inc,
- self->num_simplexes[0],
- self->triInds, point, bc,
- &inside );
- }
- else
- fnd = Simplex_Search2D( mesh->verts, (unsigned*)inc,
- self->num_simplexes[0],
- self->triInds, point, bc, &inside );
+ fnd = Simplex_Search2D( mesh->verts, (unsigned*)inc,
+ self->num_simplexes[0],
+ self->triInds, point, bc, &inside );
if( fnd ) {
unsigned *inds = self->triInds[inside];
diff -r 08b87a3544aa -r 69d6988b0f7a Mesh/src/Mesh_HexType.h
--- a/Mesh/src/Mesh_HexType.h Thu Sep 29 01:11:05 2011 -0700
+++ b/Mesh/src/Mesh_HexType.h Thu Sep 29 01:30:24 2011 -0700
@@ -54,7 +54,6 @@
/* Virtual info */ \
\
/* Mesh_HexType info */ \
- unsigned mapSize; \
unsigned* vertMap; \
unsigned* inc; \
Mesh_ElementType_ElementHasPointFunc* elementHasPoint; \
@@ -102,7 +101,7 @@
** Public functions
*/
- void Mesh_HexType_SetVertexMap( void* hexType, unsigned* map );
+ void Mesh_HexType_SetVertexMap( void* hexType );
void Mesh_HexType_SetQ2Inds( void* hexType);
/*--------------------------------------------------------------------------------------------------------------------------
** Private Member functions
More information about the CIG-COMMITS
mailing list