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

smithrm at mcs.anl.gov smithrm at mcs.anl.gov
Tue Nov 2 11:28:18 CDT 2010


Author: smithrm
Date: 2010-11-02 11:28:18 -0500 (Tue, 02 Nov 2010)
New Revision: 4246

Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/Coupler.hpp
   MOAB/trunk/tools/mbcoupler/ssn_test.cpp
Log:
Coupler.hpp
  o Changed interp_field_for_hex() to interp_field().
  o Remove AREA as a value of IntegType.

Coupler.cpp
  o Changed interp_field_for_hex() to interp_field().  Now works on tets also.
  o Changed nat_param to work on test meshes also.
  o Fixed errors in get_matching_entities().
  o Changed get_group_integ_vals() to work on tet meshes also.
  o Fixed bug in unpack_tuples().

ssn_test.cpp
  o Cleanup and fixes for Coupler changes.


Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2010-11-02 15:50:59 UTC (rev 4245)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2010-11-02 16:28:18 UTC (rev 4246)
@@ -368,7 +368,7 @@
 
     result = MB_FAILURE;
     if(LINEAR_FE == method){
-      result = interp_field_for_hex(mappedPts->vul[mindex],
+      result = interp_field(mappedPts->vul[mindex],
 				    CartVect(mappedPts->vr+3*mindex), 
 				    tag, tl_tmp->vr[i]);
     }else if (PLAIN_FE == method){
@@ -394,9 +394,9 @@
 
       result = MB_FAILURE;
       if(LINEAR_FE == method){
-	result = interp_field_for_hex(mappedPts->vul[mindex],
-				      CartVect(mappedPts->vr+3*mindex), 
-				      tag, interp_vals[*vit]);
+	result = interp_field(mappedPts->vul[mindex],
+			      CartVect(mappedPts->vr+3*mindex), 
+			      tag, interp_vals[*vit]);
       }else if (PLAIN_FE == method){
 	result = plain_field_map(mappedPts->vul[mindex],
 				 tag, interp_vals[*vit]);
@@ -455,54 +455,96 @@
       coords_vert[j][2] = coords[3*j+2];
     }
 
-      //test to find out in which hex the point is
-		
-      // get natural coordinates
-    if (ElemUtil::nat_coords_trilinear_hex(&coords_vert[0], CartVect(xyz), 
-                                             tmp_nat_coords, 1e-10)) {
-      entities.push_back(*iter);
-      nat_coords.push_back(tmp_nat_coords);
-      return MB_SUCCESS;
+      //test to find out in which entity the point is
+      //get the EntityType and create the appropriate Element::Map subtype
+    EntityType etype = mbImpl->type_from_handle(*iter);
+
+    if (etype == MBHEX) {
+      Element::LinearHex hexmap(coords_vert);
+      try {
+        tmp_nat_coords = hexmap.ievaluate(CartVect(xyz), 1e-10);
+      }
+      catch (Element::Map::EvaluationError) {
+        continue;
+      }
     }


More information about the moab-dev mailing list