[MOAB-dev] r5673 - MOAB/trunk/src/moab/point_locater
rhl6856 at mcs.anl.gov
rhl6856 at mcs.anl.gov
Fri Aug 3 13:37:29 CDT 2012
Author: rhl6856
Date: 2012-08-03 13:37:29 -0500 (Fri, 03 Aug 2012)
New Revision: 5673
Added:
MOAB/trunk/src/moab/point_locater/linear_hex_map.hpp
MOAB/trunk/src/moab/point_locater/linear_tet_map.hpp
Log:
new natural parameter classes. still in development
Added: MOAB/trunk/src/moab/point_locater/linear_hex_map.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/linear_hex_map.hpp (rev 0)
+++ MOAB/trunk/src/moab/point_locater/linear_hex_map.hpp 2012-08-03 18:37:29 UTC (rev 5673)
@@ -0,0 +1,86 @@
+#ifndef MOAB_LINEAR_HEX_HPP
+#define MOAB_LINEAR_HEX_HPP
+namespace moab {
+
+namespace element_utility {
+
+namespace {
+template< typename Point, typename Points, typename Field>
+Field & evaluate_field( const Point & xi,
+ const Point & field_values,
+ Field & f){
+ //TODO: Field should default construct, F _f, use _f instead of f,
+ //then f = _f later..
+ for (unsigned i = 0; i < 8; ++i) {
+ const double N_i = (1 + xi[0]*corner_xi[i][0])
+ * (1 + xi[1]*corner_xi[i][1])
+ * (1 + xi[2]*corner_xi[i][2]);
+ f += N_i * f_vals[i];
+ }
+ f *= 0.125;
+ return f;
+}
+} //anonymous namespace
+
+template< typename Point, typename Matrix>
+class Linear_hex_map {
+ private:
+ typedef Linear_hex_map< Point, Matrix> Self;
+ public:
+ //Constructor
+ template< typename Points>
+ Linear_hex_map( const Points & corners_ ) : corners( corners_) {}
+ //Copy constructor
+ Linear_hex_map( const Self & f ) : corners( f.corners) {}
+ //Initial Condition
+ Point& center_xi() const{ return Point(3, 0.0); }
+ Point& operator()( const Point & p) const{
+ Point x(3, 0.0);
+ return evaluate_field( xi, x, corners);
+ }
+ Point& operator()( const Point & p, const Point & f_vals) const{
+ double f=0.0;
+ return evaluate_field( xi, f_vals, f);
+ }
+ Matrix& jacobian( Point & p) const{
+ Matrix J;
More information about the moab-dev
mailing list