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

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed Apr 25 18:37:02 CDT 2012


Author: iulian
Date: 2012-04-25 18:37:02 -0500 (Wed, 25 Apr 2012)
New Revision: 5499

Added:
   MOAB/trunk/tools/mbcoupler/conjHexParti.h5m
   MOAB/trunk/tools/mbcoupler/conjTetParti.h5m
Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/Coupler.hpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/mbcoupler/findpt.c
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
Log:

first example of coupling with spectral elements, for interpolation
right now, it is triggered with 

mbcoupler_test -meshes  conjHexParti.h5m conjTetParti.h5m -itag TEMP -outfile tetWithTemp.h5m

source is spectral mesh, with a TEMP tag , coresponding to values at the GL
points, it will be written to a target mesh at nodes, as a tag TEMP_TAR

coupling with spectral "source" is triggered when the SEM_DIMS tag is identified
on source mesh

still to do:
 target spectral mesh

 normalize 
 
 (integrate over spectral elements)




Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-04-25 18:10:07 UTC (rev 5498)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-04-25 23:37:02 UTC (rev 5499)
@@ -50,12 +50,16 @@
     // initialize tuple lists to indicate not initialized
   mappedPts = NULL;
   targetPts = NULL;
+  _spectralSource = _spectralTarget = NULL;
 }
 
   /* destructor
    */
 Coupler::~Coupler()
-{}
+{
+  delete (moab::Element::SpectralHex*)_spectralSource;
+  delete (moab::Element::SpectralHex*)_spectralTarget;
+}
 
 
 ErrorCode Coupler::initialize_tree()
@@ -128,6 +132,91 @@
   else return MB_FAILURE;
 }
 
+ErrorCode Coupler::initialize_spectral_elements(EntityHandle rootSource, EntityHandle rootTarget,
+    bool & specSou, bool & specTar)
+{
+  /*void * _spectralSource;
+    void * _spectralTarget;*/
+
+  moab::Range spectral_sets;
+  moab::Tag  sem_tag;
+  int sem_dims[3];
+  ErrorCode rval = mbImpl->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 MB_SUCCESS; // nothing to do, no spectral elements
+  }
+  rval = mbImpl->get_entities_by_type_and_tag(rootSource, moab::MBENTITYSET, &sem_tag, NULL, 1, spectral_sets);
+  if (moab::MB_SUCCESS != rval || spectral_sets.empty())
+  {
+    std::cout<< "can't get sem set on source\n";
+  }
+  else
+  {
+    moab::EntityHandle firstSemSet=spectral_sets[0];
+    rval = mbImpl->tag_get_data(sem_tag, &firstSemSet, 1, (void*)sem_dims);
+    if (moab::MB_SUCCESS != rval)


More information about the moab-dev mailing list