MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 \(x_i\) (calculate \(\vec x = F($\vec \xi)\) ) | |
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] = { { -1, 0, 0 }, { 1, 0, 0 } } |
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 399 of file ElemUtil.hpp.
moab::Element::LinearEdge::LinearEdge | ( | const std::vector< CartVect > & | vertices | ) | [inline] |
Definition at line 402 of file ElemUtil.hpp.
: Map( vertices ){};
Definition at line 616 of file ElemUtil.cpp.
: Map( 0 ) {} // LinearEdge::LinearEdge()
CartVect moab::Element::LinearEdge::evaluate | ( | const CartVect & | xi | ) | const [virtual] |
Evaluate the map on \(x_i\) (calculate \(\vec x = F($\vec \xi)\) )
Implements moab::Element::Map.
Definition at line 624 of file ElemUtil.cpp.
References corner, and corner_count.
{ 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 651 of file ElemUtil.cpp.
References corner, and corner_count.
Referenced by integrate_scalar_field().
{ 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 676 of file ElemUtil.cpp.
Referenced by moab::Coupler::nat_param().
{ // 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 663 of file ElemUtil.cpp.
References moab::Element::Map::det_jacobian(), evaluate_scalar_field(), gauss, and gauss_count.
{ 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 636 of file ElemUtil.cpp.
References corner, and corner_count.
{ 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 = { { -1, 0, 0 }, { 1, 0, 0 } } [static, protected] |
Definition at line 414 of file ElemUtil.hpp.
Referenced by evaluate(), evaluate_scalar_field(), and jacobian().
const unsigned int moab::Element::LinearEdge::corner_count = 2 [static, protected] |
Definition at line 416 of file ElemUtil.hpp.
Referenced by evaluate(), evaluate_scalar_field(), and jacobian().
const double moab::Element::LinearEdge::gauss = { { 2.0, 0.0 } } [static, protected] |
Definition at line 415 of file ElemUtil.hpp.
Referenced by integrate_scalar_field().
const unsigned int moab::Element::LinearEdge::gauss_count = 1 [static, protected] |
Definition at line 417 of file ElemUtil.hpp.
Referenced by integrate_scalar_field().