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

karpeev at mcs.anl.gov karpeev at mcs.anl.gov
Mon Oct 11 16:36:13 CDT 2010


Author: karpeev
Date: 2010-10-11 16:36:12 -0500 (Mon, 11 Oct 2010)
New Revision: 4210

Modified:
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.hpp
   MOAB/trunk/tools/mbcoupler/Makefile.am
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
Log:
Added moab::Element::Map,LinearHex,LinearTet to ElemUtils.  Compiles, but untested.


Modified: MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2010-10-09 14:26:29 UTC (rev 4209)
+++ MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2010-10-11 21:36:12 UTC (rev 4210)
@@ -24,6 +24,7 @@
     bool solve_inverse( const CartVect& x, CartVect& xi, double tol ) const ;
 };
 
+
 bool VolMap::solve_inverse( const CartVect& x, CartVect& xi, double tol ) const
 {
   const double error_tol_sqr = tol*tol;
@@ -470,4 +471,172 @@
 
 } // namespace ElemUtil
 
+
+namespace Element {
+
+
+  
+  inline const std::vector<CartVect>& Map::get_vertices() {
+    return this->vertex;
+  };
+  //
+  void Map::set_vertices(const std::vector<CartVect>& v) {
+    if(v.size() != this->vertex.size()) {
+      throw ArgError();
+    }
+    this->vertex = v;
+  };// Map::set_vertices()
+  //
+  CartVect Map::ievaluate(const CartVect& x, double tol, const CartVect& x0 = CartVect(0.0)) const {
+    const double error_tol_sqr = tol*tol;
+    double det;
+    CartVect xi = x0;
+    CartVect delta = evaluate(xi) - x;
+    Matrix3 J;
+    while (delta % delta > error_tol_sqr) {
+      J = jacobian(xi);
+      det = J.determinant();
+      if (det < std::numeric_limits<double>::epsilon())
+        throw Map::EvaluationError();
+      xi -= J.inverse(1.0/det) * delta;
+      delta = evaluate( xi ) - x;
+    }
+    return xi;
+  }// Map::ievaluate()
+
+
+


More information about the moab-dev mailing list