[MOAB-dev] r2029 - MOAB/trunk/refiner
dcthomp at mcs.anl.gov
dcthomp at mcs.anl.gov
Mon Jul 28 16:37:37 CDT 2008
Author: dcthomp
Date: 2008-07-28 16:37:37 -0500 (Mon, 28 Jul 2008)
New Revision: 2029
Modified:
MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp
MOAB/trunk/refiner/MBEdgeSizeSimpleImplicit.hpp
MOAB/trunk/refiner/MBEntityRefiner.hpp
MOAB/trunk/refiner/MBMeshOutputFunctor.hpp
MOAB/trunk/refiner/MBMeshRefiner.hpp
MOAB/trunk/refiner/MBProcessSet.cpp
MOAB/trunk/refiner/MBProcessSet.hpp
MOAB/trunk/refiner/MBRefinerTagManager.hpp
MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp
MOAB/trunk/refiner/MBSimplexTemplateTagAssigner.hpp
MOAB/trunk/refiner/MBSplitVertices.cpp
MOAB/trunk/refiner/MBSplitVertices.hpp
Log:
ENH: Global IDs, parallel status, and parallel shared process tags
are now properly set on output vertices. Still to do: tags on
new regions and handle exchange.
Modified: MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp
===================================================================
--- MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBEdgeSizeEvaluator.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,7 @@
*
*/
-/** \class MBEdgeSizeEvaluator
+/**\class MBEdgeSizeEvaluator
*
* This is an abstract class that embodies the rule used during edge-based mesh
* refinement to decide whether an edge should be subdivided or not.
Modified: MOAB/trunk/refiner/MBEdgeSizeSimpleImplicit.hpp
===================================================================
--- MOAB/trunk/refiner/MBEdgeSizeSimpleImplicit.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBEdgeSizeSimpleImplicit.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,7 @@
*
*/
-/** \class MBEdgeSizeSimpleImplicit
+/**\class MBEdgeSizeSimpleImplicit
*
* This is an simple example edge evaluator tha subdivides edges based
* on their midpoint's distance to a simple, fixed-form implicit surface
Modified: MOAB/trunk/refiner/MBEntityRefiner.hpp
===================================================================
--- MOAB/trunk/refiner/MBEntityRefiner.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBEntityRefiner.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -44,7 +44,8 @@
*
* \date 24 December 2007
*/
-/** \class MBEntityRefinerOutputFunctor
+
+/**\class MBEntityRefinerOutputFunctor
*
* This is an abstract class used by MBEntityRefiner to output entities that are the product of refinement.
* The parenthesis operator is overloaded with two forms:
Modified: MOAB/trunk/refiner/MBMeshOutputFunctor.hpp
===================================================================
--- MOAB/trunk/refiner/MBMeshOutputFunctor.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBMeshOutputFunctor.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,3 +1,30 @@
+/*
+ * MOAB, a Mesh-Oriented datABase, is a software component for creating,
+ * storing and accessing finite element mesh data.
+ *
+ * Copyright 2007 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Coroporation, the U.S. Government
+ * retains certain rights in this software.
+ *
+ * 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.
+ *
+ */
+
+/**\class MBMeshOutputFunctor
+ *\brief Implements the abstract MBEntityRefinerOutputFunctor class.
+ *
+ * This class is a concrete implementation of the MBEntityRefinerOutputFunctor.
+ * It creates new vertices and regions in a new or existing mesh as
+ * the input entities are streamed through the refiner.
+ *
+ * \author David Thompson
+ * \author Philippe Pebay
+ *
+ * \date 28 July 2008
+ */
#ifndef MB_MESHOUTPUTFUNCTOR_HPP
#define MB_MESHOUTPUTFUNCTOR_HPP
Modified: MOAB/trunk/refiner/MBMeshRefiner.hpp
===================================================================
--- MOAB/trunk/refiner/MBMeshRefiner.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBMeshRefiner.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,8 @@
*
*/
-/** \class MBMeshRefiner
+/**\class MBMeshRefiner
+ *\brief Refine a mesh using a streaming operation.
*
* This is an class that contains the method used for mesh refinement.
*
Modified: MOAB/trunk/refiner/MBProcessSet.cpp
===================================================================
--- MOAB/trunk/refiner/MBProcessSet.cpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBProcessSet.cpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -38,13 +38,24 @@
memset( this->processes, 0, SHARED_PROC_BYTES );
}
-void MBProcessSet::set_process_member( int i )
+/**\brief Add a process to this process set.
+ *
+ * This does not verify that \a proc is within the range [0,MAX_SHARING_PROCS[ .
+ * You are responsible for that.
+ */
+void MBProcessSet::set_process_member( int proc )
{
- int byte = i / 8;
- int bitmask = 1 << ( i % 8 );
+ int byte = proc / 8;
+ int bitmask = 1 << ( proc % 8 );
this->processes[byte] |= bitmask;
}
+/**\brief Add each process in the input vector to this process set.
+ *
+ * This is a convenience routine that calls set_process_member() for each entry in the vector.
+ * This does not verify that \a proc is within the range [0,MAX_SHARING_PROCS[ .
+ * You are responsible for that.
+ */
void MBProcessSet::set_process_members( const std::vector<int>& procs )
{
for ( std::vector<int>::const_iterator it = procs.begin(); it != procs.end() && *it != -1; ++ it )
@@ -67,20 +78,20 @@
bool rank_owner = false;
for ( int byte = 0; byte < SHARED_PROC_BYTES; ++ byte )
{
- char val = this->processes[byte];
- for ( int bit = 0; val && ( bit < 8 ); ++ bit, ++ i )
+ i = byte * 8;
+ for ( char val = this->processes[byte]; val; ++ i, val >>= 1 )
{
- if ( ! val )
+ if ( val & 0x1 )
{
- i += 8 - bit;
- break;
- }
- else if ( val & 0x1 )
- {
if ( i != rank )
+ {
+ std::cout << " " << i;
procs.push_back( i );
+ }
else if ( ! procs.size() )
+ {
rank_owner = true;
+ }
}
}
}
Modified: MOAB/trunk/refiner/MBProcessSet.hpp
===================================================================
--- MOAB/trunk/refiner/MBProcessSet.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBProcessSet.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,3 +1,26 @@
+/*
+ * MOAB, a Mesh-Oriented datABase, is a software component for creating,
+ * storing and accessing finite element mesh data.
+ *
+ * Copyright 2007 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Coroporation, the U.S. Government
+ * retains certain rights in this software.
+ *
+ * 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.
+ *
+ */
+
+/**\class MBProcessSet
+ *\brief Represent a set of processes using a bit vector.
+ *
+ * This is used by the mesh refiner when determining where to record
+ * split vertices so that labeling can be inferred across process
+ * boundaries without communicating anything other than the number of
+ * entities in a given partition.
+ */
#ifndef MB_PROCESSSET_HPP
#define MB_PROCESSSET_HPP
@@ -7,13 +30,6 @@
#include <iostream>
#include <vector>
-/**\brief Represent a set of processes using a bit vector.
- *
- * This is used by the mesh refiner when determining where to record
- * split vertices so that labeling can be inferred across process
- * boundaries without communicating anything other than the number of
- * entities in a given partition.
- */
class MBProcessSet
{
public:
Modified: MOAB/trunk/refiner/MBRefinerTagManager.hpp
===================================================================
--- MOAB/trunk/refiner/MBRefinerTagManager.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBRefinerTagManager.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,7 @@
*
*/
-/** \class MBRefinerTagManager
+/**\class MBRefinerTagManager
*
* This a class that manages which tags an edge refiner should include
* on output vertices created during mesh refinement.
Modified: MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp
===================================================================
--- MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBSimplexTemplateRefiner.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,7 @@
*
*/
-/** \class MBSimplexTemplateRefiner
+/**\class MBSimplexTemplateRefiner
*
* This is a concrete subclass of MBEntityRefiner that implements
* refinement using templates applied to simplices.
Modified: MOAB/trunk/refiner/MBSimplexTemplateTagAssigner.hpp
===================================================================
--- MOAB/trunk/refiner/MBSimplexTemplateTagAssigner.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBSimplexTemplateTagAssigner.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,4 +1,4 @@
-/**
+/*
* MOAB, a Mesh-Oriented datABase, is a software component for creating,
* storing and accessing finite element mesh data.
*
@@ -13,7 +13,7 @@
*
*/
-/** \class MBSimplexTemplateTagAssigner
+/**\class MBSimplexTemplateTagAssigner
*
* This is an class that embodies the process of assigning tag
* values to new vertices based on some pre-existing neighbors in a
Modified: MOAB/trunk/refiner/MBSplitVertices.cpp
===================================================================
--- MOAB/trunk/refiner/MBSplitVertices.cpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBSplitVertices.cpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -8,7 +8,7 @@
this->tag_manager = tag_mgr;
this->mesh_in = tag_mgr->get_input_mesh();
this->mesh_out = tag_mgr->get_output_mesh();
- this->shared_procs_val.resize( MAX_SHARING_PROCS );
+ this->shared_procs_in.resize( MAX_SHARING_PROCS );
MBParallelComm* ipcomm = MBParallelComm::get_pcomm( this->mesh_in, 0 );
this->rank = ipcomm ? ipcomm->proc_config().proc_rank() : 0;
int zero = 0;
@@ -49,26 +49,26 @@
bool got = false;
this->current_shared_procs.clear();
stat = this->mesh_in->tag_get_data(
- this->tag_manager->shared_proc(), &vert_in, 1, &this->shared_procs_val[0] );
- if ( stat == MB_SUCCESS && this->shared_procs_val[0] != -1 )
+ this->tag_manager->shared_proc(), &vert_in, 1, &this->shared_procs_in[0] );
+ if ( stat == MB_SUCCESS && this->shared_procs_in[0] != -1 )
{
got = true;
- std::cout << " s" << this->rank << " s" << this->shared_procs_val[0] << " | ";
- this->shared_procs_val[1] = -1;
+ std::cout << " s" << this->rank << " s" << this->shared_procs_in[0] << " | ";
+ this->shared_procs_in[1] = -1;
}
stat = this->mesh_in->tag_get_data(
- this->tag_manager->shared_procs(), &vert_in, 1, &this->shared_procs_val[0] );
- if ( stat == MB_SUCCESS && this->shared_procs_val[0] != -1 )
+ this->tag_manager->shared_procs(), &vert_in, 1, &this->shared_procs_in[0] );
+ if ( stat == MB_SUCCESS && this->shared_procs_in[0] != -1 )
{
got = true;
int i;
- for ( i = 0; i < MAX_SHARING_PROCS && this->shared_procs_val[i] != -1; ++ i )
- std::cout << " m" << this->shared_procs_val[i];
+ for ( i = 0; i < MAX_SHARING_PROCS && this->shared_procs_in[i] != -1; ++ i )
+ std::cout << " m" << this->shared_procs_in[i];
std::cout << " | ";
}
if ( got )
{
- this->current_shared_procs.set_process_members( this->shared_procs_val );
+ this->current_shared_procs.set_process_members( this->shared_procs_in );
this->current_shared_procs.set_process_member( this->rank );
if ( this->first_vertex )
{
@@ -97,21 +97,22 @@
void MBSplitVerticesBase::set_sharing( MBEntityHandle ent_handle, MBProcessSet& procs )
{
int pstat;
- if ( procs.get_process_members( this->rank, this->shared_procs_val ) )
+ if ( procs.get_process_members( this->rank, this->shared_procs_out ) )
+ pstat = PSTATUS_SHARED | PSTATUS_INTERFACE;
+ else
pstat = PSTATUS_SHARED | PSTATUS_INTERFACE | PSTATUS_NOT_OWNED;
- else
- pstat = PSTATUS_SHARED | PSTATUS_INTERFACE;
- int sps = this->shared_procs_val.size();
+ int sps = this->shared_procs_out.size();
+ std::cout << " new pstat: " << pstat << " sps: " << sps << "\n";
switch ( sps )
{
case 0:
break;
case 1:
- this->mesh_out->tag_set_data( this->tag_manager->shared_proc(), &ent_handle, 1, &this->shared_procs_val[0] );
+ this->mesh_out->tag_set_data( this->tag_manager->shared_proc(), &ent_handle, 1, &this->shared_procs_out[0] );
this->mesh_out->tag_set_data( this->tag_manager->parallel_status(), &ent_handle, 1, &pstat );
break;
default:
- this->mesh_out->tag_set_data( this->tag_manager->shared_procs(), &ent_handle, sps, &this->shared_procs_val[0] );
+ this->mesh_out->tag_set_data( this->tag_manager->shared_procs(), &ent_handle, sps, &this->shared_procs_out[0] );
this->mesh_out->tag_set_data( this->tag_manager->parallel_status(), &ent_handle, 1, &pstat );
break;
}
Modified: MOAB/trunk/refiner/MBSplitVertices.hpp
===================================================================
--- MOAB/trunk/refiner/MBSplitVertices.hpp 2008-07-28 17:44:43 UTC (rev 2028)
+++ MOAB/trunk/refiner/MBSplitVertices.hpp 2008-07-28 21:37:37 UTC (rev 2029)
@@ -1,3 +1,23 @@
+/*
+ * MOAB, a Mesh-Oriented datABase, is a software component for creating,
+ * storing and accessing finite element mesh data.
+ *
+ * Copyright 2007 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Coroporation, the U.S. Government
+ * retains certain rights in this software.
+ *
+ * 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.
+ *
+ */
+
+/**\class MBSplitVertices
+ *\brief A dictionary of new vertices.
+ *
+ * An array of existing vertex handles used as a key in a dictionary of new vertices.
+ */
#ifndef MB_SPLITVERTICES_HPP
#define MB_SPLITVERTICES_HPP
@@ -10,8 +30,6 @@
class MBRefinerTagManager;
-/** An array of existing vertex handles used as a key in a dictionary of new vertices.
- */
template< int _n >
class MBSplitVertexIndex
{
@@ -97,10 +115,11 @@
MBInterface* mesh_in; // Input mesh. Needed to determine tag values on split_src verts
MBInterface* mesh_out; // Output mesh. Needed for new vertex set in vert_handle
MBRefinerTagManager* tag_manager;
- std::vector<int> shared_procs_val; // Used to hold procs sharing an input vert.
+ std::vector<int> shared_procs_in; // Used to hold procs sharing an input vert.
+ std::vector<int> shared_procs_out; // Used to hold procs sharing an output vert.
std::vector<int> split_gids; // Used to hold global IDs of split vertices
MBProcessSet current_shared_procs; // Holds process list as it is being accumulated
- MBProcessSet common_shared_procs; // Holds intersection of several shared_procs_vals.
+ MBProcessSet common_shared_procs; // Holds intersection of several shared_procs_ins.
int rank; // This process' rank.
bool first_vertex; // True just after begin_vertex_procs() is called.
MBTag tag_gid;
@@ -136,7 +155,7 @@
MBSplitVertices<_n>::MBSplitVertices( MBRefinerTagManager* tag_mgr )
: MBSplitVerticesBase( tag_mgr )
{
- this->shared_procs_val.resize( _n * MAX_SHARING_PROCS );
+ this->shared_procs_in.resize( _n * MAX_SHARING_PROCS );
this->split_gids.resize( _n );
}
More information about the moab-dev
mailing list