[MOAB-dev] r1495 - MOAB/trunk/refiner
pebay at mcs.anl.gov
pebay at mcs.anl.gov
Thu Dec 27 17:40:02 CST 2007
Author: pebay
Date: 2007-12-27 17:40:02 -0600 (Thu, 27 Dec 2007)
New Revision: 1495
Modified:
MOAB/trunk/refiner/MBEdgeSizeEvaluator.cpp
MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp
MOAB/trunk/refiner/MBSimplexTemplateRefiner.cpp
MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp
Log:
ENH: checkpoint: refiner is in place -- with the exception of the tags
ENH: modified attribute names in EdgeSizeEvaluator to make them conform
to the MOAB style
Modified: MOAB/trunk/refiner/MBEdgeSizeEvaluator.cpp
===================================================================
--- MOAB/trunk/refiner/MBEdgeSizeEvaluator.cpp 2007-12-27 23:05:55 UTC (rev 1494)
+++ MOAB/trunk/refiner/MBEdgeSizeEvaluator.cpp 2007-12-27 23:40:02 UTC (rev 1495)
@@ -30,17 +30,17 @@
* Be careful to ensure that all calls to evaluate_edge() perform identical modifications
* given identical input values!
*
- * A list of tags passed in \a t0, \a t1, and \a t2 is stored in the vertexTags member.
+ * A list of tags passed in \a t0, \a t1, and \a t2 is stored in the vertex_tags member.
* The vertexSize member stores the total length of data associated with each pointer (in bytes).
- * Subclasses may access vertexTags and vertexSize directly; the refiner uses public methods to
- * populate vertexTags before evaluate_edge() is called.
+ * Subclasses may access vertex_tags and vertexSize directly; the refiner uses public methods to
+ * populate vertex_tags before evaluate_edge() is called.
*/
/// Clear the list of tag values that will appear past the vertex coordinates in \a p0, \a p1, and \a p2.
void MBEdgeSizeEvaluator::reset_vertex_tags()
{
- this->vertexSize = 0;
- this->vertexTags.clear();
+ this->vertex_size = 0;
+ this->vertex_tags.clear();
}
/** Add a tag to the list of tag values that will appear past the vertex coordinates.
@@ -49,10 +49,10 @@
*/
int MBEdgeSizeEvaluator::add_vertex_tag( MBTag tag_handle )
{
- int offset = this->vertexSize; // old size is offset of tag being added
- int tagSize;
+ int offset = this->vertex_size; // old size is offset of tag being added
+ int tag_size;
MBTagType tagType;
- if ( this->mesh->tag_get_size( tag_handle, tagSize ) != MB_SUCCESS )
+ if ( this->mesh->tag_get_size( tag_handle, tag_size ) != MB_SUCCESS )
return -1;
if ( this->mesh->tag_get_type( tag_handle, tagType ) != MB_SUCCESS )
@@ -61,16 +61,16 @@
if ( tagType == MB_TAG_BIT )
{
// Pad any bit tags to a size in full bytes.
- tagSize = ( tagSize % 8 ? 1 : 0 ) + ( tagSize / 8 );
+ tag_size = ( tag_size % 8 ? 1 : 0 ) + ( tag_size / 8 );
}
// Now pad so that the next tag will be word-aligned:
- while ( tagSize % sizeof(int) )
- ++tagSize;
+ while ( tag_size % sizeof(int) )
+ ++tag_size;
- this->vertexSize += tagSize;
+ this->vertex_size += tag_size;
- this->vertexTags.push_back( std::pair< MBTag, int >( tag_handle, offset ) );
+ this->vertex_tags.push_back( std::pair< MBTag, int >( tag_handle, offset ) );
return offset;
}
Modified: MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp
===================================================================
--- MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp 2007-12-27 23:05:55 UTC (rev 1494)
+++ MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp 2007-12-27 23:40:02 UTC (rev 1495)
@@ -45,15 +45,15 @@
void reset_vertex_tags();
int add_vertex_tag( MBTag tag_handle );
- int get_vertex_tag_size() { return this->vertexSize; }
+ int get_vertex_tag_size() { return this->vertex_size; }
void evaluate_tags_at_midpoint(
const double* c0, const void* t0,
const double* cm, void* tm,
const double* c1, const void* t1 ) const;
protected:
- std::vector< std::pair< MBTag, int > > vertexTags;
- int vertexSize;
+ std::vector< std::pair< MBTag, int > > vertex_tags;
+ int vertex_size;
MBInterface* mesh;
};
Modified: MOAB/trunk/refiner/MBSimplexTemplateRefiner.cpp
===================================================================
--- MOAB/trunk/refiner/MBSimplexTemplateRefiner.cpp 2007-12-27 23:05:55 UTC (rev 1494)
+++ MOAB/trunk/refiner/MBSimplexTemplateRefiner.cpp 2007-12-27 23:40:02 UTC (rev 1495)
@@ -38,7 +38,7 @@
std::vector<double> entity_coords;
entity_coords.resize( 6 * num_nodes );
// Have to make num_nodes calls to get_coords() because we need xyz interleaved with rst coords.
- for ( int n = 0; n < num_nodes; ++n )
+ for ( int n = 0; n < num_nodes; ++ n )
{
if ( this->mesh->get_coords( &conn[n], 1, &entity_coords[3 * n + 3] ) != MB_SUCCESS )
{
@@ -350,12 +350,12 @@
}
double edge_length2[6];
- edge_length2[0]
- = edge_length2[1]
- = edge_length2[2]
+ edge_length2[0]
+ = edge_length2[1]
+ = edge_length2[2]
= edge_length2[3]
- = edge_length2[4]
- = edge_length2[5]
+ = edge_length2[4]
+ = edge_length2[5]
= 0;
for ( int c = 0; c < 3; ++ c )
@@ -386,7 +386,7 @@
return false;
}
-
+
double* facept0c;
double* facept1c;
double* facept2c;
@@ -465,14 +465,14 @@
break;
case 2: // Ruprecht-Müller Case 2a
comparison_bits =
- (permlen[0] <= permlen[1] ? 1 : 0) | (permlen[0] >= permlen[1] ? 2 : 0) |
+ ( permlen[0] <= permlen[1] ? 1 : 0 ) | ( permlen[0] >= permlen[1] ? 2 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[0][i] + permuted_coords[2][i]) * .375 + permuted_coords[1][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[0][i] + permuted_coords[2][i] ) * .375 + permuted_coords[1][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(1);
@@ -511,32 +511,32 @@
break;
case 4: // Ruprecht-Müller Case 3a
comparison_bits =
- (permlen[0] <= permlen[3] ? 1 : 0) | (permlen[0] >= permlen[3] ? 2 : 0) |
- (permlen[2] <= permlen[3] ? 4 : 0) | (permlen[2] >= permlen[3] ? 8 : 0) |
- (permlen[0] <= permlen[2] ? 16 : 0) | (permlen[0] >= permlen[2] ? 32 : 0) |
+ ( permlen[0] <= permlen[3] ? 1 : 0 ) | ( permlen[0] >= permlen[3] ? 2 : 0 ) |
+ ( permlen[2] <= permlen[3] ? 4 : 0 ) | ( permlen[2] >= permlen[3] ? 8 : 0 ) |
+ ( permlen[0] <= permlen[2] ? 16 : 0 ) | ( permlen[0] >= permlen[2] ? 32 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[1][i] + permuted_coords[3][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[1][i] + permuted_coords[3][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[13][i] = (permuted_coords[2][i] + permuted_coords[3][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[13][i] = ( permuted_coords[2][i] + permuted_coords[3][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
- if ( (comparison_bits & 48) == 48 )
+ if ( ( comparison_bits & 48 ) == 48 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[1][i] + permuted_coords[2][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[1][i] + permuted_coords[2][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(3);
@@ -635,23 +635,23 @@
break;
case 6: // Ruprecht-Müller Case 3c
comparison_bits =
- (permlen[0] <= permlen[1] ? 1 : 0) | (permlen[0] >= permlen[1] ? 2 : 0) |
- (permlen[0] <= permlen[3] ? 4 : 0) | (permlen[0] >= permlen[3] ? 8 : 0) |
+ ( permlen[0] <= permlen[1] ? 1 : 0 ) | ( permlen[0] >= permlen[1] ? 2 : 0 ) |
+ ( permlen[0] <= permlen[3] ? 4 : 0 ) | ( permlen[0] >= permlen[3] ? 8 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[0][i] + permuted_coords[2][i]) * .375 + permuted_coords[1][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[0][i] + permuted_coords[2][i] ) * .375 + permuted_coords[1][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[1][i] + permuted_coords[3][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[1][i] + permuted_coords[3][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(5);
@@ -715,23 +715,23 @@
break;
case 7: // Ruprecht-Müller Case 3d
comparison_bits =
- (permlen[0] <= permlen[2] ? 1 : 0) | (permlen[0] >= permlen[2] ? 2 : 0) |
- (permlen[0] <= permlen[4] ? 4 : 0) | (permlen[0] >= permlen[4] ? 8 : 0) |
+ ( permlen[0] <= permlen[2] ? 1 : 0 ) | ( permlen[0] >= permlen[2] ? 2 : 0 ) |
+ ( permlen[0] <= permlen[4] ? 4 : 0 ) | ( permlen[0] >= permlen[4] ? 8 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[1][i] + permuted_coords[2][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[1][i] + permuted_coords[2][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[0][i] + permuted_coords[3][i]) * .375 + permuted_coords[1][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[0][i] + permuted_coords[3][i] ) * .375 + permuted_coords[1][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(6);
@@ -795,23 +795,23 @@
break;
case 8: // Ruprecht-Müller Case 4a
comparison_bits =
- (permlen[4] <= permlen[5] ? 1 : 0) | (permlen[4] >= permlen[5] ? 2 : 0) |
- (permlen[3] <= permlen[4] ? 4 : 0) | (permlen[3] >= permlen[4] ? 8 : 0) |
+ ( permlen[4] <= permlen[5] ? 1 : 0 ) | ( permlen[4] >= permlen[5] ? 2 : 0 ) |
+ ( permlen[3] <= permlen[4] ? 4 : 0 ) | ( permlen[3] >= permlen[4] ? 8 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[12][i] = (permuted_coords[1][i] + permuted_coords[2][i]) * .375 + permuted_coords[3][i] * .25;
+ permuted_coords[12][i] = ( permuted_coords[1][i] + permuted_coords[2][i] ) * .375 + permuted_coords[3][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[0][i] + permuted_coords[1][i]) * .375 + permuted_coords[3][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[0][i] + permuted_coords[1][i] ) * .375 + permuted_coords[3][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(7);
@@ -879,41 +879,41 @@
break;
case 9: // Ruprecht-Müller Case 4b
comparison_bits =
- (permlen[1] <= permlen[2] ? 1 : 0) | (permlen[1] >= permlen[2] ? 2 : 0) |
- (permlen[2] <= permlen[3] ? 4 : 0) | (permlen[2] >= permlen[3] ? 8 : 0) |
- (permlen[3] <= permlen[4] ? 16 : 0) | (permlen[3] >= permlen[4] ? 32 : 0) |
- (permlen[1] <= permlen[4] ? 64 : 0) | (permlen[1] >= permlen[4] ? 128 : 0) |
+ ( permlen[1] <= permlen[2] ? 1 : 0 ) | ( permlen[1] >= permlen[2] ? 2 : 0 ) |
+ ( permlen[2] <= permlen[3] ? 4 : 0 ) | ( permlen[2] >= permlen[3] ? 8 : 0 ) |
+ ( permlen[3] <= permlen[4] ? 16 : 0 ) | ( permlen[3] >= permlen[4] ? 32 : 0 ) |
+ ( permlen[1] <= permlen[4] ? 64 : 0 ) | ( permlen[1] >= permlen[4] ? 128 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[1][i] + permuted_coords[0][i]) * .375 + permuted_coords[2][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[1][i] + permuted_coords[0][i] ) * .375 + permuted_coords[2][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[13][i] = (permuted_coords[2][i] + permuted_coords[3][i]) * .375 + permuted_coords[0][i] * .25;
+ permuted_coords[13][i] = ( permuted_coords[2][i] + permuted_coords[3][i] ) * .375 + permuted_coords[0][i] * .25;
}
}
- if ( (comparison_bits & 48) == 48 )
+ if ( ( comparison_bits & 48 ) == 48 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[0][i] + permuted_coords[1][i]) * .375 + permuted_coords[3][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[0][i] + permuted_coords[1][i] ) * .375 + permuted_coords[3][i] * .25;
}
}
- if ( (comparison_bits & 192) == 192 )
+ if ( ( comparison_bits & 192 ) == 192 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[12][i] = (permuted_coords[2][i] + permuted_coords[3][i]) * .375 + permuted_coords[1][i] * .25;
+ permuted_coords[12][i] = ( permuted_coords[2][i] + permuted_coords[3][i] ) * .375 + permuted_coords[1][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(8);
@@ -1241,23 +1241,23 @@
break;
case 10: // Ruprecht-Müller Case 5
comparison_bits =
- (permlen[1] <= permlen[2] ? 1 : 0) | (permlen[1] >= permlen[2] ? 2 : 0) |
- (permlen[3] <= permlen[4] ? 4 : 0) | (permlen[3] >= permlen[4] ? 8 : 0) |
+ ( permlen[1] <= permlen[2] ? 1 : 0 ) | ( permlen[1] >= permlen[2] ? 2 : 0 ) |
+ ( permlen[3] <= permlen[4] ? 4 : 0 ) | ( permlen[3] >= permlen[4] ? 8 : 0 ) |
0;
- if ( (comparison_bits & 3) == 3 )
+ if ( ( comparison_bits & 3 ) == 3 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[10][i] = (permuted_coords[1][i] + permuted_coords[0][i]) * .375 + permuted_coords[2][i] * .25;
+ permuted_coords[10][i] = ( permuted_coords[1][i] + permuted_coords[0][i] ) * .375 + permuted_coords[2][i] * .25;
}
}
- if ( (comparison_bits & 12) == 12 )
+ if ( ( comparison_bits & 12 ) == 12 )
{
// Compute face point
for ( int i = 0; i < 6; ++ i )
{
- permuted_coords[11][i] = (permuted_coords[0][i] + permuted_coords[1][i]) * .375 + permuted_coords[3][i] * .25;
+ permuted_coords[11][i] = ( permuted_coords[0][i] + permuted_coords[1][i] ) * .375 + permuted_coords[3][i] * .25;
}
}
MB_TESSELLATOR_INCR_CASE_COUNT(9);
@@ -1440,6 +1440,12 @@
return sq_mag_a < sq_mag_b;
}
+void MBSimplexTemplateRefiner::evaluate_tags_at_facepoint( const double* c0, const void* t0,
+ const double* c1, const void* t1,
+ const double* c2, const void* t2,
+ const double* cm, void* tm ) const
+{
+}
/*
* The array below is indexed by the edge code for a tetrahedron.
Modified: MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp
===================================================================
--- MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp 2007-12-27 23:05:55 UTC (rev 1494)
+++ MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp 2007-12-27 23:40:02 UTC (rev 1495)
@@ -56,6 +56,10 @@
double* v2, void* t2,
double* v3, void* t3 );
static bool compare_Hopf_cross_string_dist( const double* v00, const double* v01, const double* v10, const double* v11 );
+ void evaluate_tags_at_facepoint( const double* c0, const void* t0,
+ const double* c1, const void* t1,
+ const double* c2, const void* t2,
+ const double* cm, void* tm ) const;
int best_tets( int* alternates, double*[14], int, int ) { return alternates[0]; }
};
More information about the moab-dev
mailing list