moab
|
Shape function space for bilinear quadrilateral, obtained from the canonical linear (affine) functions. More...
#include <ElemUtil.hpp>
Public Member Functions | |
LinearEdge (const std::vector< CartVect > &vertices) | |
LinearEdge () | |
virtual CartVect | evaluate (const CartVect &xi) const |
Evaluate the map on (calculate $ x = F($ )$ ) | |
virtual bool | inside_nat_space (const CartVect &xi, double &tol) const |
decide if within the natural param space, with a tolerance | |
virtual Matrix3 | jacobian (const CartVect &xi) const |
Evaluate the map's Jacobi matrix. | |
virtual double | evaluate_scalar_field (const CartVect &xi, const double *field_vertex_values) const |
Evaluate a scalar field at a point given field values at the vertices. | |
virtual double | integrate_scalar_field (const double *field_vertex_values) const |
Integrate a scalar field over the element given field values at the vertices. | |
Static Protected Attributes | |
static const double | corner [2][3] |
static const double | gauss [1][2] = { { 2.0, 0.0 } } |
static const unsigned int | corner_count = 2 |
static const unsigned int | gauss_count = 1 |
Shape function space for bilinear quadrilateral, obtained from the canonical linear (affine) functions.
Definition at line 252 of file ElemUtil.hpp.
moab::Element::LinearEdge::LinearEdge | ( | const std::vector< CartVect > & | vertices | ) | [inline] |
Definition at line 254 of file ElemUtil.hpp.
: Map(vertices){};
Definition at line 467 of file ElemUtil.cpp.
: Map(0) { }// LinearEdge::LinearEdge()
CartVect moab::Element::LinearEdge::evaluate | ( | const CartVect & | xi | ) | const [virtual] |
Evaluate the map on (calculate $ x = F($ )$ )
Implements moab::Element::Map.
Definition at line 477 of file ElemUtil.cpp.
{ CartVect x(0.0); for (unsigned i = 0; i < LinearEdge::corner_count; ++i) { const double N_i = (1.0 + xi[0]*corner[i][0]); x += N_i * this->vertex[i]; } x /= LinearEdge::corner_count; return x; }// LinearEdge::evaluate
double moab::Element::LinearEdge::evaluate_scalar_field | ( | const CartVect & | xi, |
const double * | field_vertex_values | ||
) | const [virtual] |
Evaluate a scalar field at a point given field values at the vertices.
Implements moab::Element::Map.
Definition at line 500 of file ElemUtil.cpp.
{ double f(0.0); for (unsigned i = 0; i < LinearEdge::corner_count; ++i) { const double N_i = (1 + xi[0]*corner[i][0]) * (1.0 + xi[1]*corner[i][1]); f += N_i * field_vertex_value[i]; } f /= LinearEdge::corner_count; return f; }// LinearEdge::evaluate_scalar_field()
bool moab::Element::LinearEdge::inside_nat_space | ( | const CartVect & | xi, |
double & | tol | ||
) | const [virtual] |
decide if within the natural param space, with a tolerance
Implements moab::Element::Map.
Definition at line 522 of file ElemUtil.cpp.
{ // just look at the box+tol here return ( xi[0]>=-1.-tol) && (xi[0]<=1.+tol) ; }
double moab::Element::LinearEdge::integrate_scalar_field | ( | const double * | field_vertex_values | ) | const [virtual] |
Integrate a scalar field over the element given field values at the vertices.
Implements moab::Element::Map.
Definition at line 511 of file ElemUtil.cpp.
{ double I(0.0); for(unsigned int j1 = 0; j1 < this->gauss_count; ++j1) { double x1 = this->gauss[j1][1]; double w1 = this->gauss[j1][0]; CartVect x(x1,0.0,0.0); I += this->evaluate_scalar_field(x,field_vertex_values)*w1*this->det_jacobian(x); } return I; }// LinearEdge::integrate_scalar_field()
Matrix3 moab::Element::LinearEdge::jacobian | ( | const CartVect & | xi | ) | const [virtual] |
Evaluate the map's Jacobi matrix.
Implements moab::Element::Map.
Definition at line 487 of file ElemUtil.cpp.
{ Matrix3 J(0.0); for (unsigned i = 0; i < LinearEdge::corner_count; ++i) { const double xi_p = 1.0 + xi[0]*corner[i][0]; const double dNi_dxi = corner[i][0] * xi_p ; J(0,0) += dNi_dxi * vertex[i][0]; } J(1,1) = 1.0; /* to make sure the Jacobian determinant is non-zero */ J(2,2) = 1.0; /* to make sure the Jacobian determinant is non-zero */ J /= LinearEdge::corner_count; return J; }// LinearEdge::jacobian()
const double moab::Element::LinearEdge::corner [static, protected] |
{ { -1, 0, 0 }, { 1, 0, 0 } }
Definition at line 266 of file ElemUtil.hpp.
const unsigned int moab::Element::LinearEdge::corner_count = 2 [static, protected] |
Definition at line 268 of file ElemUtil.hpp.
const double moab::Element::LinearEdge::gauss = { { 2.0, 0.0 } } [static, protected] |
Definition at line 267 of file ElemUtil.hpp.
const unsigned int moab::Element::LinearEdge::gauss_count = 1 [static, protected] |
Definition at line 269 of file ElemUtil.hpp.