[MOAB-dev] r5501 - MOAB/trunk/tools/mbcoupler

iulian at mcs.anl.gov iulian at mcs.anl.gov
Thu Apr 26 13:33:44 CDT 2012


Author: iulian
Date: 2012-04-26 13:33:44 -0500 (Thu, 26 Apr 2012)
New Revision: 5501

Added:
   MOAB/trunk/tools/mbcoupler/conjTetPartiField.h5m
Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/Coupler.hpp
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
Log:
add interpolation for the case the target is spectral mesh
add also a small example, which can be run with

mbcoupler_test -meshes conjTetPartiField.h5m conjHexParti.h5m -itag vertex_field -outfile conjHexPartiTarField.h5m

the conjTetPartiField.h5m model is a tet mesh with source vertex_field tag
conjHexPart.h5m is the target, which will be populated with a new tag 
 (vertex_field_TAR), at GL points for each element

(the result, according to the above run, is saved in conjHexPartiTarField.h5m)


Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-04-26 11:51:01 UTC (rev 5500)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-04-26 18:33:44 UTC (rev 5501)
@@ -44,9 +44,6 @@
     // now initialize the tree
   if (init_tree) initialize_tree();
 
-
-
-
     // initialize tuple lists to indicate not initialized
   mappedPts = NULL;
   targetPts = NULL;
@@ -57,6 +54,7 @@
    */
 Coupler::~Coupler()
 {
+  // this will clear the cache
   delete (moab::Element::SpectralHex*)_spectralSource;
   delete (moab::Element::SpectralHex*)_spectralTarget;
 }
@@ -1633,4 +1631,43 @@
   return;
 }
 
+ErrorCode Coupler::get_gl_points_on_elements(Range & targ_elems, std::vector<double> & vpos, int & numPointsOfInterest)
+{
+  numPointsOfInterest = targ_elems.size() * _ntot;//
+  vpos.resize(3*numPointsOfInterest);
+  int ielem=0;
+  for (Range::iterator eit = targ_elems.begin(); eit!=targ_elems.end(); eit++, ielem +=_ntot*3)
+  {
+    EntityHandle eh = *eit;
+    const double * xval;
+    const double * yval;
+    const double * zval;
+    ErrorCode rval = mbImpl-> tag_get_by_ptr(_xm1Tag, &eh, 1,(const void **) &xval );
+    if (moab::MB_SUCCESS != rval)
+    {
+      std::cout << "can't get xm1 values \n";
+      return MB_FAILURE;
+    }
+    rval = mbImpl-> tag_get_by_ptr(_ym1Tag, &eh, 1, (const void **)&yval );
+    if (moab::MB_SUCCESS != rval)
+    {
+      std::cout << "can't get ym1 values \n";
+      return MB_FAILURE;
+    }
+    rval = mbImpl-> tag_get_by_ptr(_zm1Tag, &eh, 1, (const void **)&zval );
+    if (moab::MB_SUCCESS != rval)


More information about the moab-dev mailing list