[MOAB-dev] r5685 - in MOAB/trunk: src/moab src/moab/point_locater tools tools/mbcoupler

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Wed Aug 8 14:29:16 CDT 2012


Author: rhl6856
Date: 2012-08-08 14:29:16 -0500 (Wed, 08 Aug 2012)
New Revision: 5685

Modified:
   MOAB/trunk/src/moab/Matrix3.hpp
   MOAB/trunk/src/moab/point_locater/bvh_tree.hpp
   MOAB/trunk/src/moab/point_locater/common_tree.hpp
   MOAB/trunk/src/moab/point_locater/element_utility.hpp
   MOAB/trunk/src/moab/point_locater/linear_hex_map.hpp
   MOAB/trunk/src/moab/point_locater/linear_tet_map.hpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/point_search.cpp
Log:
working towards new natural parametrization in new point locator

Modified: MOAB/trunk/src/moab/Matrix3.hpp
===================================================================
--- MOAB/trunk/src/moab/Matrix3.hpp	2012-08-07 20:24:16 UTC (rev 5684)
+++ MOAB/trunk/src/moab/Matrix3.hpp	2012-08-08 19:29:16 UTC (rev 5685)
@@ -52,6 +52,7 @@
 	         m( 8) = i * (d(0) * d(4) - d(3) * d(1));
 		return m;
 	}
+
 	template< typename Matrix>
 	inline bool positive_definite( const Matrix & d, 
 				       double& det ){
@@ -89,7 +90,22 @@
 	                    u[2] * v[0], u[2] * v[1], u[2] * v[2] );
 		return m;
 	}
+	template< typename Matrix>
+	inline double determinant3( const Matrix & d){
+		return d(0) * d(4) * d(8) 
+		     + d(1) * d(5) * d(6)
+		     + d(2) * d(3) * d(7)
+		     - d(0) * d(5) * d(8)
+		     - d(1) * d(3) * d(8)
+		     - d(2) * d(4) * d(6); 
+	}
 	
+	template< typename Matrix>
+	inline const Matrix inverse( const Matrix & d){
+		const double det = 1.0/determinant3( d);
+		return inverse( d, det);
+	}
+	
 	template< typename Vector, typename Matrix>
 	inline Vector vector_matrix( const Vector& v, const Matrix& m ) {
 	  return Vector( v[0] * m(0,0) + v[1] * m(1,0) + v[2] * m(2,0),
@@ -99,9 +115,11 @@
 	
 	template< typename Vector, typename Matrix>
 	inline Vector matrix_vector( const Matrix& m, const Vector& v ){
-	  return Vector( v[0] * m(0,0) + v[1] * m(0,1) + v[2] * m(0,2),
-	                 v[0] * m(1,0) + v[1] * m(1,1) + v[2] * m(1,2),
-	                 v[0] * m(2,0) + v[1] * m(2,1) + v[2] * m(2,2) );
+	   Vector res = v;
+	   res[ 0] = v[0] * m(0,0) + v[1] * m(0,1) + v[2] * m(0,2);
+	   res[ 1] = v[0] * m(1,0) + v[1] * m(1,1) + v[2] * m(1,2);
+	   res[ 2] = v[0] * m(2,0) + v[1] * m(2,1) + v[2] * m(2,2);
+	   return res;
 	} 
 } //namespace Matrix
 
@@ -227,12 +245,7 @@


More information about the moab-dev mailing list