[MOAB-dev] commit/MOAB: iulian07: fix the mergemesh test

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Sep 20 14:00:59 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/ee0504329853/
Changeset:   ee0504329853
Branch:      master
User:        iulian07
Date:        2013-09-20 20:56:15
Summary:     fix the mergemesh test
MergeMesh, by default, it will not create new skin entities
add a new parameter to one of the find_skin methods, which will
be by default true (create skin entities)
from inside MergeMesh, call the version of find_skin with "false" for this new
flag, so no new entities should be created.

note:
merging higher dimensional entities needs more work;

Affected #:  5 files

diff --git a/src/MergeMesh.cpp b/src/MergeMesh.cpp
index 4cc8158..7293e17 100644
--- a/src/MergeMesh.cpp
+++ b/src/MergeMesh.cpp
@@ -61,7 +61,7 @@ moab::ErrorCode MergeMesh::merge_entities(moab::Range &elems,
   // get the skin of the entities
   moab::Skinner skinner(mbImpl);
   moab::Range skin_range;
-  moab::ErrorCode result = skinner.find_skin(0, elems, 0, skin_range);
+  moab::ErrorCode result = skinner.find_skin(0, elems, 0, skin_range, false, false);
   if (moab::MB_SUCCESS != result) return result;
 
   // create a tag to mark merged-to entity; reuse tree_root
@@ -232,16 +232,16 @@ moab::ErrorCode MergeMesh::merge_higher_dimensions(moab::Range &elems)
   for(int dim = 1; dim <3; dim++){
     skinEnts.clear();
     moreDeadEnts.clear();
-    result = skinner.find_skin(0, elems, dim, skinEnts);
+    result = skinner.find_skin(0, elems, dim, skinEnts, false, false);
     //Go through each skin entity and see if it shares adjacancies with another entity
     for(moab::Range::iterator skinIt = skinEnts.begin(); skinIt != skinEnts.end(); skinIt++){
       adj.clear();
       //Get the adjacencies 1 dimension lower
-      result = mbImpl->get_adjacencies(&(*skinIt), 1, dim-1, true, adj);
+      result = mbImpl->get_adjacencies(&(*skinIt), 1, dim-1, false, adj);
       if(result != moab::MB_SUCCESS) return result;
       //See what other entities share these adjacencies
       matches.clear();
-      result = mbImpl->get_adjacencies(adj, dim, true, matches, moab::Interface::INTERSECT);
+      result = mbImpl->get_adjacencies(adj, dim, false, matches, moab::Interface::INTERSECT);
       if(result != moab::MB_SUCCESS) return result;
       //If there is more than one entity, then we have some to merge and erase
       if(matches.size() > 1){

diff --git a/src/Skinner.cpp b/src/Skinner.cpp
index b5fd24e..c3c6b1b 100644
--- a/src/Skinner.cpp
+++ b/src/Skinner.cpp
@@ -1015,11 +1015,12 @@ ErrorCode Skinner::find_skin(const EntityHandle this_set,
                              const Range &entities,
                                  int dim,
                                  Range &skin_entities,
-                                 bool create_vert_elem_adjs) 
+                                 bool create_vert_elem_adjs,
+                                 bool create_skin_elements)
 {
   Range tmp_skin;
   ErrorCode result = find_skin(this_set, entities, (dim==0), tmp_skin, 0,
-                                 create_vert_elem_adjs, true);
+                                 create_vert_elem_adjs, create_skin_elements);
   if (MB_SUCCESS != result || tmp_skin.empty()) return result;
   
   if (tmp_skin.all_of_dimension(dim)) {
@@ -1029,7 +1030,7 @@ ErrorCode Skinner::find_skin(const EntityHandle this_set,
       skin_entities.merge(tmp_skin);
   }
   else {
-    result = thisMB->get_adjacencies( tmp_skin, dim, true, skin_entities, 
+    result = thisMB->get_adjacencies( tmp_skin, dim, create_skin_elements, skin_entities,
                                       Interface::UNION );
   }
   

diff --git a/src/moab/Skinner.hpp b/src/moab/Skinner.hpp
index 7ec5450..4eb2f51 100644
--- a/src/moab/Skinner.hpp
+++ b/src/moab/Skinner.hpp
@@ -119,7 +119,8 @@ public:
                       const Range &entities,
                       int dim,
                       Range &skin_entities,
-                      bool create_vert_elem_adjs = false);
+                      bool create_vert_elem_adjs = false,
+                      bool create_skin_elements = true);
 
   ErrorCode classify_2d_boundary( const Range &boundary,
                                      const Range &bar_elements,

diff --git a/test/Makefile.am b/test/Makefile.am
index 100285b..99c5211 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -76,6 +76,7 @@ MOSTLYCLEANFILES = mb_write.g \
                    tri_mid_edge_face_nodes.g \
                    mb_stress_out.g \
                    merge_test.g \
+                   mm_out.h5m \
                    tree.h5m 
 
 # Tests and such

diff --git a/test/mergemesh_test.cpp b/test/mergemesh_test.cpp
index 0b382e6..fca5304 100644
--- a/test/mergemesh_test.cpp
+++ b/test/mergemesh_test.cpp
@@ -38,11 +38,11 @@ int main( int argc, char* argv[] )
     }
 
     // Fixed for now
-//    const char *outfile = "mm_out.h5m";
-//    rval = iface->write_mesh( outfile);
-//    if (MB_SUCCESS != rval) {
-//        std::cerr << "Error saving file: " << outfile << std::endl;
-//        exit(2);
-//    }
+    const char *outfile = "mm_out.h5m";
+    rval = iface->write_mesh( outfile);
+    if (MB_SUCCESS != rval) {
+        std::cerr << "Error saving file: " << outfile << std::endl;
+        exit(2);
+    }
     return 0;
 }

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list