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

vijaysm at mcs.anl.gov vijaysm at mcs.anl.gov
Mon Jan 21 02:54:53 CST 2013


Author: vijaysm
Date: 2013-01-21 02:54:53 -0600 (Mon, 21 Jan 2013)
New Revision: 5945

Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.hpp
Log:
Adding the hooks and interfaces for linear QUAD elements that enable 2-D solution projections.

-- A LinearQuad class was created that implements the jacobian, evaluate_scalar_field and 
   integrate_scalar_field along with ability to find a point in reference space element. 
-- Tested with MBCoupler to project a 2-D solution and initial tests for point-location and 
   interpolation do succeed.


Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2013-01-19 01:25:05 UTC (rev 5944)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2013-01-21 08:54:53 UTC (rev 5945)
@@ -743,8 +743,19 @@
         if (!tetmap.inside_nat_space(tmp_nat_coords, epsilon))
           continue;
       }
+      else if (etype == MBQUAD){
+        Element::LinearQuad quadmap(coords_vert);
+        try {
+          tmp_nat_coords = quadmap.ievaluate(CartVect(xyz), epsilon);
+        }
+        catch (Element::Map::EvaluationError) {
+          continue;
+        }
+        if (!quadmap.inside_nat_space(tmp_nat_coords, epsilon))
+          continue;
+      }
       else {
-        std::cout << "Entity not Hex or Tet" << std::endl;
+        std::cout << "Entity not Hex or Tet or Quad" << std::endl;
         continue;
       }
     }
@@ -792,23 +803,28 @@
       return result;
     }
     EntityType etype = mbImpl->type_from_handle(elem);
-    if (etype == MBHEX && num_connect==8){
+    if (etype == MBHEX) {
+      if (num_connect==8) {
       elemMap = new moab::Element::LinearHex();
       num_verts = 8;
     }
-    else if (etype == MBHEX && num_connect==27){
+      else { /* (etype == MBHEX && num_connect==27) */
       elemMap = new moab::Element::QuadraticHex();
       num_verts = 27;
     }
+    }
     else if (etype == MBTET) {
       elemMap = new moab::Element::LinearTet();
       num_verts = 4;
     }
+    else if (etype == MBQUAD) {
+      elemMap = new moab::Element::LinearQuad();
+      num_verts = 4;
+    }
     else {
       return MB_FAILURE;


More information about the moab-dev mailing list