![]() |
NLMech
0.1.0
|
A base class which provides methods to map points to/from reference element and to compute quadrature data. More...
#include <baseElem.h>


Public Member Functions | |
| BaseElem (size_t order, size_t element_type) | |
| Constructor. More... | |
| virtual double | elemSize (const std::vector< util::Point3 > &nodes)=0 |
| Returns the size of element (length in 1-d, area in 2-d, volume in 3-d element) More... | |
| virtual std::vector< std::vector< double > > | getDerShapes (const util::Point3 &p, const std::vector< util::Point3 > &nodes) |
| Returns the values of derivative of shape function at point p. More... | |
| size_t | getElemType () |
| Get element type. More... | |
| size_t | getNumQuadPoints () |
| Get number of quadrature points in the data. More... | |
| virtual std::vector< fe::QuadData > | getQuadDatas (const std::vector< util::Point3 > &nodes)=0 |
| Get vector of quadrature data. More... | |
| size_t | getQuadOrder () |
| Get order of quadrature approximation. More... | |
| virtual std::vector< fe::QuadData > | getQuadPoints (const std::vector< util::Point3 > &nodes)=0 |
| Get vector of quadrature data. More... | |
| virtual std::vector< double > | getShapes (const util::Point3 &p, const std::vector< util::Point3 > &nodes) |
| Returns the values of shape function at point p. More... | |
| void | print (int nt=0, int lvl=0) const |
| Prints the information about the instance of the object. More... | |
| std::string | printStr (int nt=0, int lvl=0) const |
| Returns the string containing information about the instance of the object. More... | |
Private Member Functions | |
| virtual std::vector< std::vector< double > > | getDerShapes (const util::Point3 &p)=0 |
| Returns the values of derivative of shape function at point p on reference element. More... | |
| virtual double | getJacobian (const util::Point3 &p, const std::vector< util::Point3 > &nodes, std::vector< std::vector< double >> *J)=0 |
Computes Jacobian of map from reference element to given element . More... | |
| virtual std::vector< double > | getShapes (const util::Point3 &p)=0 |
| Returns the values of shape function at point p on reference element. More... | |
| virtual void | init ()=0 |
| Compute the quadrature points. More... | |
| virtual util::Point3 | mapPointToRefElem (const util::Point3 &p, const std::vector< util::Point3 > &nodes) |
| Maps point p in a given element to the reference element and returns the mapped point. More... | |
Private Attributes | |
| size_t | d_elemType |
| Element type. | |
| size_t | d_numQuadPts |
| Number of quadrature points for order d_quadOrder. | |
| size_t | d_quadOrder |
| Order of quadrature point integration approximation. | |
| std::vector< fe::QuadData > | d_quads |
| Quadrature data collection. | |
A base class which provides methods to map points to/from reference element and to compute quadrature data.
For any type of element, such as fe::LineElem, fe::TriElem, fe::QuadElem, we have following important points
. E.g., reference element in fe::TriElem is a triangle with vertices at
.
are described by
(in 3-d),
(in 2-d), and
(in 1-d). Points in any other element
are described by
(in 3-d),
(in 2-d), and
(in 1-d). Here, we restrict discussion to 3-d element. For 2-d, one should ignore coordinate
and
, and for 1-d, one should ignore
and
.
we have shape functions
, where
is the number of vertices in the element. Shape functions
are functions of point
. For each type of element,
is fixed.
, shape functions are denoted as
and are functions of point
.
is described by vertices
.
, where
is a given element formed by vertices
, is defined as follows:
are the x, y, and z component of point
.
is given by
.| fe::BaseElem::BaseElem | ( | size_t | order, |
| size_t | element_type | ||
| ) |
Constructor.
| order | Order of quadrature point approximation |
| element_type | Type of element |
|
pure virtual |
Returns the size of element (length in 1-d, area in 2-d, volume in 3-d element)
| nodes | Vertices of element |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
Referenced by fe::Mesh::computeVol().

|
privatepure virtual |
Returns the values of derivative of shape function at point p on reference element.
| p | Location of point |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
|
virtual |
Returns the values of derivative of shape function at point p.
| p | Location of point |
| nodes | Vertices of element |
Reimplemented in fe::TriElem, fe::TetElem, and fe::LineElem.
|
inline |
Get element type.
|
privatepure virtual |
Computes Jacobian of map from reference element
to given element
.
| p | Location of point in reference element |
| nodes | Vertices of element |
| J | Matrix to store the Jacobian |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
|
inline |
Get number of quadrature points in the data.
|
pure virtual |
Get vector of quadrature data.
Given element vertices, this method returns the list of quadrature point and associated quantities. Here, order of quadrature approximation and element type are set in the constructor. List of data for each quad point:
| nodes | Vector of vertices of an element |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
Referenced by fe::Mesh::computeVol(), and tools::pp::Compute::getContourContribJInt().

|
inline |
Get order of quadrature approximation.
|
pure virtual |
Get vector of quadrature data.
Given element vertices, this method returns the list of quadrature point and essential quantities at quadrature points. Here, order of quadrature approximation and element type are set in the constructor. List of data for each quad point:
This function is a lite version of fe::BaseElem::getQuadDatas.
| nodes | Vector of vertices of an element |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
|
privatepure virtual |
Returns the values of shape function at point p on reference element.
| p | Location of point |
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
|
virtual |
Returns the values of shape function at point p.
The point p is assumed to be inside an element
given by nodes. The idea is to first map point p to the point
in reference element
and then compute shape functions at
.
The map from any element
to reference element is
gets complex for elements like fe::QuadElem. For elements fe:LineElem and fe::TriElem, this is simple to compute. Therefore, this method is only implemented for fe::TriElem and fe::LineElem.
| p | Location of point |
| nodes | Vertices of element |
Reimplemented in fe::TriElem, fe::TetElem, and fe::LineElem.
|
privatepure virtual |
Compute the quadrature points.
This must be implemented by inheriting classes.
Implemented in fe::TriElem, fe::TetElem, fe::QuadElem, and fe::LineElem.
|
privatevirtual |
Maps point p in a given element to the reference element and returns the mapped point.
| p | Location of point |
| nodes | Vertices of element |
Reimplemented in fe::TriElem, fe::TetElem, and fe::LineElem.
|
inline |
Prints the information about the instance of the object.
| nt | Number of tabs to append before each line of string |
| lvl | Level of information sought (higher level means more information) |

| std::string fe::BaseElem::printStr | ( | int | nt = 0, |
| int | lvl = 0 |
||
| ) | const |
Returns the string containing information about the instance of the object.
| nt | Number of tabs to append before each line of string |
| lvl | Level of information sought (higher level means more information) |
Referenced by print().

