[MOAB-dev] commit/MOAB: rajeeja: Added testcase mergemesh_test.cpp, MergeMesh algorithm needs changes when merging higher dimension entities

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Sep 18 13:30:43 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/af3ded8b3f89/
Changeset:   af3ded8b3f89
Branch:      master
User:        rajeeja
Date:        2013-09-18 20:30:33
Summary:     Added testcase mergemesh_test.cpp, MergeMesh algorithm needs changes when merging higher dimension entities

Affected #:  2 files

diff --git a/MeshFiles/unittest/16_unmerged_hex.h5m b/MeshFiles/unittest/16_unmerged_hex.h5m
new file mode 100644
index 0000000..9667f23
Binary files /dev/null and b/MeshFiles/unittest/16_unmerged_hex.h5m differ

diff --git a/test/mergemesh_test.cpp b/test/mergemesh_test.cpp
new file mode 100644
index 0000000..5982453
--- /dev/null
+++ b/test/mergemesh_test.cpp
@@ -0,0 +1,46 @@
+#include "moab/Core.hpp"
+#include "moab/Range.hpp"
+#include "moab/MergeMesh.hpp"
+#include <iostream>
+
+#define STRINGIFY_(A) #A
+#define STRINGIFY(A) STRINGIFY_(A)
+
+using namespace moab;
+
+const char* meshfile = STRINGIFY(MESHDIR) "/16_unmerged_hex.h5m";
+
+
+int main( int argc, char* argv[] )
+{
+    Core moab_core;
+    ErrorCode rval;
+    Interface* iface = &moab_core;
+    std::cout << "loading mesh file " << (std::string) meshfile << std::endl;
+    rval = iface->load_mesh(meshfile);
+    if (MB_SUCCESS != rval) {
+        std::cerr << "Error reading file: " << meshfile << std::endl;
+        exit(2);
+    }
+    int dim = 3;
+    moab::Range ents;
+    iface->get_entities_by_dimension(0, dim, ents);
+
+    MergeMesh mm(iface);
+    double merge_tol = 1e-3;
+    bool merge_higher_dim_entities = true;
+
+    rval = mm.merge_entities(ents, merge_tol, merge_higher_dim_entities);
+    if (MB_SUCCESS != rval) {
+        std::cerr << "Error in MergeMesh during merging entities" << 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