[MOAB-dev] r5496 - MOAB/trunk/tools/mbcoupler
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Tue Apr 24 22:53:47 CDT 2012
Author: iulian
Date: 2012-04-24 22:53:46 -0500 (Tue, 24 Apr 2012)
New Revision: 5496
Added:
MOAB/trunk/tools/mbcoupler/spectral.h5m
Modified:
MOAB/trunk/tools/mbcoupler/ElementTest.cpp
Log:
small example with spectral element
loads a small model, evaluate some fields, computes inverse
Modified: MOAB/trunk/tools/mbcoupler/ElementTest.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElementTest.cpp 2012-04-24 22:02:08 UTC (rev 5495)
+++ MOAB/trunk/tools/mbcoupler/ElementTest.cpp 2012-04-25 03:53:46 UTC (rev 5496)
@@ -6,12 +6,14 @@
void test_tet();
void test_hex();
+void test_spectral_hex();
int main()
{
int rval = 0;
rval += RUN_TEST(test_tet);
rval += RUN_TEST(test_hex);
+ rval += RUN_TEST(test_spectral_hex);
return rval;
}
@@ -22,3 +24,133 @@
void test_hex() {
moab::Element::LinearHex hex;
}// test_hex()
+#include "moab/Core.hpp"
+#include "moab/Range.hpp"
+
+void test_spectral_hex()
+{
+ // first load a model that has spectral elements
+ moab::Core *mb = new moab::Core();
+ moab::ErrorCode rval = mb->load_mesh("spectral.h5m");
+ if (moab::MB_SUCCESS != rval) return ;
+
+ // get the ent set with SEM_DIMS tag
+ moab::Range spectral_sets;
+ moab::Tag sem_tag;
+ rval = mb->tag_get_handle("SEM_DIMS", 3, moab::MB_TYPE_INTEGER, sem_tag);
+ if (moab::MB_SUCCESS != rval)
+ {
+ std::cout<< "can't find tag, no spectral set\n";
+ return ;
+ }
+ rval = mb->get_entities_by_type_and_tag(0, moab::MBENTITYSET, &sem_tag, NULL, 1, spectral_sets);
+ if (moab::MB_SUCCESS != rval || spectral_sets.empty())
+ {
+ std::cout<< "can't get sem set\n";
+ return ;
+ }
+
+ moab::Range ents;
+
More information about the moab-dev
mailing list