1D line element defined by two boundary nodes, with interior nodes placed at Gauss-Lobatto-Legendre points More...
#include <segment.h>
Public Member Functions | |
| Segment (const std::array< size_t, 2 > boundary_node_ids, const int material_id, const int source_id, const Mesh &mesh) | |
| Construct a new Segment object. | |
| std::vector< Node > | CreateInteriorNodes (const std::vector< Node > &existing_nodes, const GaussLobattoLegendre &gll_quadrature) override |
| Create interior Node objects using the Gauss-Lobatto-Legendre quadrature set. The mapping from the reference to the real domain was based on the equations provided by the book Computational Seismology by Heiner Igel (https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.geokniga.org/bookfiles/geokniga-computationalseismologyapracticalintroductionbyigelheinerz-liborg.pdf&ved=2ahUKEwiMuanq7_OVAxXVN4YAHVgAD1QQFnoECBUQAQ&usg=AOvVaw35g1Tl3ZSFUMusz8LKQxHk). For a line segment defined by two endpoints, the mapping is: | |
| arma::Col< double > | LocalForcingVector (const GaussLobattoLegendre &gll_quad, const Mesh &mesh, const MaterialBank &material_bank, const Ordinate &ordinate, const size_t ordinate_index) override |
| Construct the local forcing vector, which is: | |
| arma::Mat< double > | LocalStiffnessMatrix (const GaussLobattoLegendre &gll_quad, const MaterialBank &material_bank, const Ordinate &ordinate) override |
| Construct the dense local stiffness matrix using spectral elements on a Gauss-Lobatto-Legendre grid, defined as: | |
| arma::SpMat< double > | LocalMassMatrix (const GaussLobattoLegendre &gll_quad, const MaterialBank &material_bank) override |
| Construct the sparse diagonal local mass matrix using spectral elements on a Gauss-Lobatto-Legendre grid, defined as: | |
| unsigned int | dimension () const override |
| Get the spatial dimension of a Segment (always 1). | |
| Public Member Functions inherited from hummingbird::Element | |
| Element (const int material_id, const int source_id) | |
| Construct a new Element object. | |
| virtual | ~Element ()=default |
| Destroy the Element object. Virtual because Element is used polymorphically through std::unique_ptr<Element> (see Mesh::elements_). | |
| std::vector< size_t > | node_ids () const |
| Get node IDs. | |
| int | material_id () const |
| Get Material ID. | |
| int | source_id () const |
| Get Source ID. | |
| void | SetMaterialID (const int material_id) |
| Set the Material ID, e.g. once it has been resolved from a raw gmsh tag to a MaterialBank-assigned ID (see Mesh::ResolveIDs). | |
| void | SetSourceID (const int source_id) |
| Set the Source ID, e.g. once it has been resolved from a raw gmsh tag to a SourceBank-assigned ID (see Mesh::ResolveIDs). | |
| void | SetNewNodeID (const size_t prev_id, const size_t new_id) |
| Set the new Node ID. | |
| void | SetNodeIDs (std::vector< size_t > node_ids) |
| Replace all node IDs at once, e.g. when renumbering. Unlike SetNewNodeID, this does not search by value, so it is safe to use when remapped IDs could otherwise collide with not-yet-remapped IDs. | |
| void | SetNodeSourceFluxes (Mesh &mesh, const MaterialBank &material_bank, const SourceBank &source_bank, const QuadratureBase< Ordinate > &angular_quadrature) |
| Compute and set the source flux values on this element's nodes using this element's material and source IDs. | |
Private Member Functions | |
| double | ComputeLength (const std::array< size_t, 2 > boundary_node_ids, const Mesh &mesh) |
| Compute the length of the element on construction. | |
Private Attributes | |
| std::array< size_t, 2 > | boundary_node_ids_ |
| Node IDs defining the Segment bounds. | |
| const double | length_ |
| Length of the element. | |
Additional Inherited Members | |
| Protected Attributes inherited from hummingbird::Element | |
| int | material_id_ = -1 |
| Material ID to access Material Bank. Auto initialized to -1. Value must be set to a positive value (including 0) to map into the MaterialBank. | |
| int | source_id_ = 0 |
| Source ID to access Source Bank. ID of 0 is always NONE, meaning the element has no external source. | |
| std::vector< size_t > | node_ids_ |
| IDs of nodes defining the element. | |
1D line element defined by two boundary nodes, with interior nodes placed at Gauss-Lobatto-Legendre points
| hummingbird::Segment::Segment | ( | const std::array< size_t, 2 > | boundary_node_ids, |
| const int | material_id, | ||
| const int | source_id, | ||
| const Mesh & | mesh ) |
|
private |
Compute the length of the element on construction.
Definition at line 10 of file segment.cc.
|
overridevirtual |
Create interior Node objects using the Gauss-Lobatto-Legendre quadrature set. The mapping from the reference to the real domain was based on the equations provided by the book Computational Seismology by Heiner Igel (https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.geokniga.org/bookfiles/geokniga-computationalseismologyapracticalintroductionbyigelheinerz-liborg.pdf&ved=2ahUKEwiMuanq7_OVAxXVN4YAHVgAD1QQFnoECBUQAQ&usg=AOvVaw35g1Tl3ZSFUMusz8LKQxHk). For a line segment defined by two endpoints, the mapping is:
\[\mathbf{r}(\xi) = \mathbf{r}_1+\left( \frac{\xi+1}{2} \right)\left( \mathbf{r}_2-\mathbf{r}_1 \right) \]
where \(x\in[-1,1]\).
| existing_nodes | Nodes already existing in Mesh |
| gll_quadrature | Gauss-Lobatto-Legendre quadrature set |
Implements hummingbird::Element.
Definition at line 18 of file segment.cc.
|
overridevirtual |
Get the spatial dimension of a Segment (always 1).
Implements hummingbird::Element.
Definition at line 107 of file segment.cc.
|
overridevirtual |
Construct the local forcing vector, which is:
\[f_i = \frac{h_e}{2}\int_{-1}^1Q_n(\xi)\ell_i (\xi)d\xi + \frac{\hat{\Omega}_x}{\Sigma_t^e}\int_{-1}^1Q_n(\xi)\frac{d\ell_i}{d\xi}d\xi \]
which the integrals are again approximated using the GLL quadrature set:
\[f_i \approx \sum_{k=0}^{N_x}\rho_k Q_n(\xi_k)\left[ \frac{h_e}{2}\ell_i (\xi_k) +\frac{\hat{\Omega}_x}{\Sigma_t^e}\frac{d\ell_i}{d\xi}(\xi_k)\right] \]
| gll_quad | GaussLobattoLegendre quadrature set |
| mesh | Mesh |
| material_bank | Material bank |
| ordinate | Ordinate (direction) |
| ordinate_index | Index of the ordinate in the angular quadrature |
Implements hummingbird::Element.
Definition at line 52 of file segment.cc.
|
overridevirtual |
Construct the sparse diagonal local mass matrix using spectral elements on a Gauss-Lobatto-Legendre grid, defined as:
\[M_{ij}=\Sigma_t^e\frac{h_e}{2}\sum_{k=0}^{N_x}\rho_k\ell_i(\xi_k)\ell_j(\xi_k) \]
Which, using the cardinality of Lagrange polynomials, greatly simplifies to:
\[\Sigma_t^eM_{ij}=\begin{cases} 0, & i\neq j \\ \Sigma_t^e\frac{h_e}{2}\rho_i, &i=j \end{cases} \]
| gll_quad | GaussLobattoLegendre set |
| material_bank | MaterialBank |
Implements hummingbird::Element.
Definition at line 97 of file segment.cc.
|
overridevirtual |
Construct the dense local stiffness matrix using spectral elements on a Gauss-Lobatto-Legendre grid, defined as:
\[K_{ij}=\frac{\hat{\Omega}_x^2}{\Sigma_t^e}\frac{2}{h_e}\sum_{k=0}^{N_x}\rho_k \frac{d\ell_i}{d\xi}(\xi_k)\frac{d\ell_j}{d\xi}(\xi_k) \]
| gll_quad | GaussLobattoLegendre set |
| material_bank | MaterialBank |
| ordinate | Ordinate (direction) |
Implements hummingbird::Element.
Definition at line 77 of file segment.cc.
|
private |
|
private |