moab
|
Class representing a map (diffeomorphism) F parameterizing a 3D element by its canonical preimage. More...
#include <ElemUtil.hpp>
Classes | |
class | ArgError |
class | EvaluationError |
Public Member Functions | |
Map (const std::vector< CartVect > &v) | |
Construct a Map defined by the given std::vector of vertices. | |
Map (const unsigned int n) | |
Construct a Map defined by n vertices. | |
virtual | ~Map () |
virtual CartVect | evaluate (const CartVect &xi) const =0 |
Evaluate the map on (calculate $ x = F($ )$ ) | |
virtual CartVect | ievaluate (const CartVect &x, double tol, const CartVect &x0=CartVect(0.0)) const |
Evaluate the inverse map (calculate $ = F^-1($ x)$ to given tolerance) | |
virtual bool | inside_nat_space (const CartVect &xi, double &tol) const =0 |
decide if within the natural param space, with a tolerance | |
virtual Matrix3 | jacobian (const CartVect &xi) const =0 |
Evaluate the map's Jacobi matrix. | |
virtual Matrix3 | ijacobian (const CartVect &xi) const |
Evaluate the inverse of the Jacobi matrix. | |
virtual double | det_jacobian (const CartVect &xi) const |
Evaluate the determinate of the Jacobi matrix. | |
virtual double | det_ijacobian (const CartVect &xi) const |
Evaluate the determinate of the inverse Jacobi matrix. | |
virtual double | evaluate_scalar_field (const CartVect &xi, const double *field_vertex_values) const =0 |
Evaluate a scalar field at a point given field values at the vertices. | |
virtual double | integrate_scalar_field (const double *field_vertex_values) const =0 |
Integrate a scalar field over the element given field values at the vertices. | |
unsigned int | size () |
Size of the vertices vector. | |
const std::vector< CartVect > & | get_vertices () |
Retrieve vertices. | |
virtual void | set_vertices (const std::vector< CartVect > &v) |
Set vertices. | |
Protected Attributes | |
std::vector< CartVect > | vertex |
Class representing a map (diffeomorphism) F parameterizing a 3D element by its canonical preimage.
Definition at line 68 of file ElemUtil.hpp.
moab::Element::Map::Map | ( | const std::vector< CartVect > & | v | ) | [inline] |
Construct a Map defined by the given std::vector of vertices.
Definition at line 71 of file ElemUtil.hpp.
{this->vertex.resize(v.size()); this->set_vertices(v);};
moab::Element::Map::Map | ( | const unsigned int | n | ) | [inline] |
Construct a Map defined by n vertices.
Definition at line 73 of file ElemUtil.hpp.
{this->vertex = std::vector<CartVect>(n);};
moab::Element::Map::~Map | ( | ) | [virtual] |
Definition at line 422 of file ElemUtil.cpp.
{}
virtual double moab::Element::Map::det_ijacobian | ( | const CartVect & | xi | ) | const [inline, virtual] |
Evaluate the determinate of the inverse Jacobi matrix.
Reimplemented in moab::Element::LinearTet.
Definition at line 92 of file ElemUtil.hpp.
{return this->jacobian(xi).inverse().determinant();};
virtual double moab::Element::Map::det_jacobian | ( | const CartVect & | xi | ) | const [inline, virtual] |
Evaluate the determinate of the Jacobi matrix.
Reimplemented in moab::Element::LinearTet.
Definition at line 89 of file ElemUtil.hpp.
{return this->jacobian(xi).determinant();};
virtual CartVect moab::Element::Map::evaluate | ( | const CartVect & | xi | ) | const [pure virtual] |
Evaluate the map on (calculate $ x = F($ )$ )
Implemented in moab::Element::SpectralQuad, moab::Element::LinearEdge, moab::Element::LinearQuad, moab::Element::SpectralHex, moab::Element::LinearTet, moab::Element::QuadraticHex, and moab::Element::LinearHex.
virtual double moab::Element::Map::evaluate_scalar_field | ( | const CartVect & | xi, |
const double * | field_vertex_values | ||
) | const [pure virtual] |
Evaluate a scalar field at a point given field values at the vertices.
Implemented in moab::Element::SpectralQuad, moab::Element::LinearEdge, moab::Element::LinearQuad, moab::Element::SpectralHex, moab::Element::LinearTet, moab::Element::QuadraticHex, and moab::Element::LinearHex.
const std::vector< CartVect > & moab::Element::Map::get_vertices | ( | ) | [inline] |
CartVect moab::Element::Map::ievaluate | ( | const CartVect & | x, |
double | tol, | ||
const CartVect & | x0 = CartVect(0.0) |
||
) | const [virtual] |
Evaluate the inverse map (calculate $ = F^-1($ x)$ to given tolerance)
Definition at line 437 of file ElemUtil.cpp.
{ // TODO: should differentiate between epsilons used for // Newton Raphson iteration, and epsilons used for curved boundary geometry errors // right now, fix the tolerance used for NR tol = 1.0e-10; const double error_tol_sqr = tol*tol; double det; CartVect xi = x0; CartVect delta = evaluate(xi) - x; Matrix3 J; int iters=0; while (delta % delta > error_tol_sqr) { if(++iters>10) throw Map::EvaluationError(); 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()
virtual Matrix3 moab::Element::Map::ijacobian | ( | const CartVect & | xi | ) | const [inline, virtual] |
Evaluate the inverse of the Jacobi matrix.
Reimplemented in moab::Element::LinearTet.
Definition at line 86 of file ElemUtil.hpp.
virtual bool moab::Element::Map::inside_nat_space | ( | const CartVect & | xi, |
double & | tol | ||
) | const [pure virtual] |
decide if within the natural param space, with a tolerance
Implemented in moab::Element::SpectralQuad, moab::Element::LinearEdge, moab::Element::LinearQuad, moab::Element::SpectralHex, moab::Element::LinearTet, moab::Element::QuadraticHex, and moab::Element::LinearHex.
virtual double moab::Element::Map::integrate_scalar_field | ( | const double * | field_vertex_values | ) | const [pure virtual] |
Integrate a scalar field over the element given field values at the vertices.
Implemented in moab::Element::SpectralQuad, moab::Element::LinearEdge, moab::Element::LinearQuad, moab::Element::SpectralHex, moab::Element::LinearTet, moab::Element::QuadraticHex, and moab::Element::LinearHex.
virtual Matrix3 moab::Element::Map::jacobian | ( | const CartVect & | xi | ) | const [pure virtual] |
Evaluate the map's Jacobi matrix.
Implemented in moab::Element::SpectralQuad, moab::Element::LinearEdge, moab::Element::LinearQuad, moab::Element::SpectralHex, moab::Element::LinearTet, moab::Element::QuadraticHex, and moab::Element::LinearHex.
void moab::Element::Map::set_vertices | ( | const std::vector< CartVect > & | v | ) | [virtual] |
Set vertices.
Reimplemented in moab::Element::LinearTet.
Definition at line 429 of file ElemUtil.cpp.
unsigned int moab::Element::Map::size | ( | ) | [inline] |
Size of the vertices vector.
Definition at line 100 of file ElemUtil.hpp.
{return this->vertex.size();}
std::vector<CartVect> moab::Element::Map::vertex [protected] |
Definition at line 118 of file ElemUtil.hpp.