![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
A class for mapping and quadrature related operations for linear 2-node line element. More...
#include <lineElem.h>
Public Member Functions | |
| LineElem (size_t order) | |
| Constructor for line element. | |
| double | elemSize (const std::vector< util::Point > &nodes) override |
| Returns the length of element. | |
| std::vector< double > | getShapes (const util::Point &p, const std::vector< util::Point > &nodes) override |
| Returns the values of shape function at point p. | |
| std::vector< std::vector< double > > | getDerShapes (const util::Point &p, const std::vector< util::Point > &nodes) override |
| Returns the values of derivative of shape function at point p. | |
Public Member Functions inherited from fe::BaseElem | |
| BaseElem (size_t order, size_t element_type) | |
| Constructor. | |
| size_t | getElemType () |
| Get element type. | |
| size_t | getQuadOrder () |
| Get order of quadrature approximation. | |
| size_t | getNumQuadPoints () |
| Get number of quadrature points in the data. | |
| std::vector< fe::QuadData > | getQuadDatas (const std::vector< util::Point > &nodes) |
| Get quadrature data mapped to the physical element (N, dN/dx, x, w, J). Shared isoparametric map; types only fill reference N, dN/dξ, and w. | |
| std::vector< fe::QuadData > | getQuadPoints (const std::vector< util::Point > &nodes) |
| Same as getQuadDatas without transforming dN/dξ to dN/dx. | |
Private Member Functions | |
| std::vector< double > | getShapes (const util::Point &p) override |
| Returns the values of shape function at point p on reference element. | |
| std::vector< std::vector< double > > | getDerShapes (const util::Point &p) override |
| Returns the values of derivative of shape function at point p on reference element. | |
| util::Point | mapPointToRefElem (const util::Point &p, const std::vector< util::Point > &nodes) override |
| Maps point p in a given element to the reference element. | |
| double | getJacobian (const util::Point &p, const std::vector< util::Point > &nodes, std::vector< std::vector< double > > *J) override |
| Computes Jacobian of the map \( \Phi: T^0 \to T\). | |
| void | init () override |
| Compute the quadrature points for line element. | |
Additional Inherited Members | |
Protected Attributes inherited from fe::BaseElem | |
| size_t | d_quadOrder |
| Order of quadrature point integration approximation. | |
| size_t | d_elemType |
| Element type. | |
| std::vector< fe::QuadData > | d_quads |
| Quadrature data collection. | |
A class for mapping and quadrature related operations for linear 2-node line element.
The reference line element \(T^0 \) is given by vertices at \( v^1 = -1, v^2 = 1 \).
\[N^0_1(\xi) = \frac{1 - \xi}{2}, \quad N^0_2(\xi) = \frac{1 + \xi}{2}. \]
\[\frac{d N^0_1(\xi)}{d\xi} = \frac{-1}{2}, \, \frac{d N^0_2(\xi)}{d\xi} = \frac{1}{2}. \]
\[ x(\xi) = \sum_{i=1}^2 N^0_i(\xi) v^i_x, \]
where \( v^1, v^2\) are vertices of element \( T \). For 1-d points, \( v^i_x = v^i \).\[ J = \frac{dx}{d\xi}. \]
Since it is a 1-d case, Jacobian and its determinant are same. For line element the formula for Jacobian is as follows\[ J = \frac{dx}{d\xi} = \frac{v^2_x - v^1_x}{2} = \frac{length(T) }{length(T^0)}. \]
\[ \xi(x) = \frac{2}{v^2_x - v^1_x} (x - \frac{v^2_x + v^1_x}{2}) = \frac{1}{J}(x - \frac{v^2_x + v^1_x}{2}). \]
Definition at line 49 of file lineElem.h.
|
explicit |
Constructor for line element.
| order | Order of quadrature point approximation |
Definition at line 18 of file lineElem.cpp.
References init().
|
overridevirtual |
Returns the length of element.
If line \( T \) is given by points \( v^1, v^2\) then the length is
\[ length(T) = v^2_x - v^1_x. \]
| nodes | Vertices of element |
Implements fe::BaseElem.
Definition at line 25 of file lineElem.cpp.
|
overrideprivatevirtual |
Returns the values of derivative of shape function at point p on reference element.
| p | Location of point |
Implements fe::BaseElem.
Definition at line 59 of file lineElem.cpp.
|
overridevirtual |
Returns the values of derivative of shape function at point p.
Let \( x\) is the point on line \( T \) and let \( \xi \) is the point on reference line \( T^0 \). Let shape functions on \( T\) are \( N_1, N_2 \) and on \( T^0 \) are \( N^0_1, N^0_2 \).
We are interested in \( \frac{\partial N_i(x_p)}{\partial x}\). By using the map \( \xi \to x \) we have
\[ N^0_i(\xi) = N_i(x(\xi)) \]
and therefore we can write
\[ \frac{\partial N^0_i(\xi)}{\partial \xi} = \frac{\partial N_i}{\partial x} \frac{\partial x}{\partial \xi}. \]
Since \( \frac{\partial x}{\partial \xi} = J \) is a Jacobian of map which follows from \( v^1, v^2 \), we can invert and obtain the formula
\[ \frac{\partial N_i(\xi)}{\partial x} = \frac{1}{J} \frac{\partial N^0_i(\xi)}{\partial \xi}. \]
| p | Location of point |
| nodes | Vertices of element |
Reimplemented from fe::BaseElem.
Definition at line 36 of file lineElem.cpp.
|
overrideprivatevirtual |
Computes Jacobian of the map \( \Phi: T^0 \to T\).
| p | Location of point in reference element |
| nodes | Vertices of element |
| J | Matrix to store the Jacobian (if not nullptr) |
Implements fe::BaseElem.
Definition at line 96 of file lineElem.cpp.
|
overrideprivatevirtual |
Returns the values of shape function at point p on reference element.
| p | Location of point |
Implements fe::BaseElem.
Definition at line 51 of file lineElem.cpp.
References util::Point::d_x.
|
overridevirtual |
Returns the values of shape function at point p.
Line \( T \) is given by points \( v^1, v^2\). We first map the point p in \( T \) to reference line \( T^0 \) using fe::LineElem::mapPointToRefElem and then compute shape functions at the mapped point using fe::LineElem::getShapes(const util::Point &).
| p | Location of point |
| nodes | Vertices of element |
Reimplemented from fe::BaseElem.
Definition at line 30 of file lineElem.cpp.
|
overrideprivatevirtual |
Compute the quadrature points for line element.
Implements fe::BaseElem.
Definition at line 110 of file lineElem.cpp.
References fe::QuadData::d_derShapes, fe::QuadData::d_detJ, fe::QuadData::d_J, fe::QuadData::d_p, fe::QuadData::d_shapes, and fe::QuadData::d_w.
Referenced by LineElem().
|
overrideprivatevirtual |
Maps point p in a given element to the reference element.
Let \( v^1, v^2\) are vertices of element \( T\) and let \(T^0 \) is the reference element. Map \(\Phi : T^0 \to T\) is given by
\[ \xi(x) = \frac{2}{v^2_x - v^1_x} (x - \frac{v^2_x + v^1_x}{2}) = \frac{1}{J}(x - \frac{v^2_x + v^1_x}{2}). \]
If mapped point \( \xi\) does not satisfy condition
\[ -1 \leq \xi \leq 1 \]
then the point \( \xi \) does not belong to reference line \( T^0\) or equivalently point \(x \) does not belong to line \( T \) and the method issues error. Otherwise the method returns point \( \xi\).| p | Location of point |
| nodes | Vertices of element |
Reimplemented from fe::BaseElem.
Definition at line 73 of file lineElem.cpp.
References util::Point::d_x, util::isGreater(), and util::isLess().