[MOAB-dev] r5687 - MOAB/trunk/src/moab/point_locater

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Wed Aug 8 14:41:21 CDT 2012


Author: rhl6856
Date: 2012-08-08 14:41:21 -0500 (Wed, 08 Aug 2012)
New Revision: 5687

Added:
   MOAB/trunk/src/moab/point_locater/parametrizer.hpp
Log:
parametrizer.hpp

Added: MOAB/trunk/src/moab/point_locater/parametrizer.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/parametrizer.hpp	                        (rev 0)
+++ MOAB/trunk/src/moab/point_locater/parametrizer.hpp	2012-08-08 19:41:21 UTC (rev 5687)
@@ -0,0 +1,96 @@
+#ifndef MOAB_PARAMETRIZER_HPP
+#define MOAB_PARAMETRIZER_HPP
+#include "moab/Matrix3.hpp"
+#include "moab/CartVect.hpp"
+#include "moab/point_locater/linear_hex_map.hpp"
+#include "moab/point_locater/linear_tet_map.hpp"
+namespace moab { 
+
+namespace element_utility {
+//non-exported functionality
+namespace { 
+
+template< typename Moab, 
+	  typename Entity_handle, typename Points>
+void get_moab_points( Moab & moab, 
+		      Entity_handle eh, 
+		      Points & points){
+	const Entity_handle* connectivity_begin;
+	int num_vertices;
+	moab.get_connectivity( eh, connectivity_begin, num_vertices);
+	//TODO: This is hacky, it works correctly since
+	//CartVect is only double d[ 3], with a default
+	//constructor.. get_coords() should be
+	//flexible enough to allow other types..
+	points.resize( num_vertices);
+	moab.get_coords( connectivity_begin, num_vertices, &(points[ 0][ 0]));
+}
+
+} // non-exported functionality
+
+template< typename Element_map> 
+class Element_parametrizer{
+	public:
+		//public types
+		typedef Element_map Map;
+	private: 
+		typedef Element_parametrizer< Map> Self;
+	public: //public functionality
+	Element_parametrizer(): map(){}
+ 	Element_parametrizer( const Self & f): map( f.map) {}
+	public:
+		template< typename Moab, typename Entity_handle, typename Point>
+		std::pair< bool, Point> operator()( Moab & moab,
+						    const Entity_handle & eh, 
+						    const Point & point, 
+						    const double tol=1e-10){


More information about the moab-dev mailing list