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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Dec 8 16:04:22 CST 2011


Author: tautges
Date: 2011-12-08 16:04:21 -0600 (Thu, 08 Dec 2011)
New Revision: 5249

Modified:
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.hpp
Log:
Fix a bug with Tet interpolation in the coupler.



Modified: MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2011-12-08 21:46:42 UTC (rev 5248)
+++ MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2011-12-08 22:04:21 UTC (rev 5249)
@@ -565,12 +565,12 @@
 
   void LinearTet::set_vertices(const std::vector<CartVect>& v) {
     this->Map::set_vertices(v);
-    this->T = Matrix3(v[1][0]-v[0][0],v[1][0]-v[0][0],v[2][0]-v[0][0],
-                      v[1][1]-v[0][1],v[1][1]-v[0][1],v[2][1]-v[0][1],
-                      v[1][2]-v[0][2],v[1][2]-v[0][2],v[2][2]-v[0][2]);
+    this->T = Matrix3(v[1][0]-v[0][0],v[2][0]-v[0][0],v[3][0]-v[0][0],
+                      v[1][1]-v[0][1],v[2][1]-v[0][1],v[3][1]-v[0][1],
+                      v[1][2]-v[0][2],v[2][2]-v[0][2],v[3][2]-v[0][2]);
     this->T_inverse = this->T.inverse();
     this->det_T = this->T.determinant();
-    this->det_T_inverse = 1.0/this->det_T;
+    this->det_T_inverse = (0.0 == this->det_T ? HUGE : 1.0/this->det_T);
   }// LinearTet::set_vertices()
 
 

Modified: MOAB/trunk/tools/mbcoupler/ElemUtil.hpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElemUtil.hpp	2011-12-08 21:46:42 UTC (rev 5248)
+++ MOAB/trunk/tools/mbcoupler/ElemUtil.hpp	2011-12-08 22:04:21 UTC (rev 5249)
@@ -61,7 +61,7 @@
     class Map {
     public:
       /**\brief Construct a Map defined by the given std::vector of vertices. */
-      Map(const std::vector<CartVect>& v) {this->vertex = v;};
+      Map(const std::vector<CartVect>& v) {this->vertex.resize(v.size()); this->set_vertices(v);};
       /**\brief Construct a Map defined by n vertices. */
       Map(const unsigned int n) {this->vertex = std::vector<CartVect>(n);};
       /**\brief Evaluate the map on \xi (calculate $\vec x = F($\vec \xi)$ )*/


















More information about the moab-dev mailing list