PeriDEM 0.2.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. | |
std::vector< fe::QuadData > | getQuadDatas (const std::vector< util::Point > &nodes) override |
Get vector of quadrature data. | |
std::vector< fe::QuadData > | getQuadPoints (const std::vector< util::Point > &nodes) override |
Get vector of quadrature data. | |
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. | |
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_numQuadPts |
Number of quadrature points for order d_quadOrder. | |
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, we simply have \( 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 16 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 simply
\[ length(T) = v^2_x - v^1_x. \]
nodes | Vertices of element |
Implements fe::BaseElem.
Definition at line 23 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 104 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 can be computed easily if \( v^1, v^2 \) are known, 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 34 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 140 of file lineElem.cpp.
|
overridevirtual |
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 is set in the constructor. List of data for each quad point:
Let \( T \) is the given line with vertices \( v^1, v^2 \) and let \( T^0 \) is the reference line.
\[ w_q = w^0_q * J \]
where \( J \) is the Jacobian of map \( \Phi \).\[ N_i(x(\xi_q)) = N^0_i(\xi_q). \]
nodes | Vector of vertices of an element |
Implements fe::BaseElem.
Definition at line 50 of file lineElem.cpp.
|
overridevirtual |
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 is set in the constructor. List of data for each quad point:
This function is a lite version of fe::LineElem::getQuadDatas.
nodes | Vector of vertices of an element |
Implements fe::BaseElem.
Definition at line 77 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 96 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 28 of file lineElem.cpp.
|
overrideprivatevirtual |
Compute the quadrature points for line element.
Implements fe::BaseElem.
Definition at line 154 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 118 of file lineElem.cpp.
References util::Point::d_x, util::isGreater(), and util::isLess().