Class defining a Continuous Galerkin formulation of the SAAF transport equation. More...
#include <cg_problem.h>
Public Member Functions | |
| CGProblem (const size_t n_dofs, const size_t n_ordinates) | |
| Construct a new CGProblem object. | |
| std::vector< GlobalMatrixData > | AssembleGlobalMatrixData (const Mesh &mesh, const GaussLobattoLegendre &gll_quad, const MaterialBank &material_bank, const Ordinate &ordinate) override |
| See ProblemBase::AssembleGlobalMatrixData. For each element, the local mass and stiffness matrices are summed and scattered into GlobalMatrixData entries keyed by the element's node IDs. | |
| std::vector< GlobalForcingData > | AssembleGlobalForcingData (const GaussLobattoLegendre &gll_quad, Mesh &mesh, const MaterialBank &material_bank, const SourceBank &source_bank, const Ordinate &ordinate, const size_t ordinate_index, const QuadratureBase< Ordinate > &angular_quad_set) override |
| See ProblemBase::AssembleGlobalForcingData. For each element, the element's node source fluxes are first recomputed with Element::SetNodeSourceFluxes (using that element's material and source), then the local forcing vector is scattered into GlobalForcingData entries keyed by the element's node IDs. | |
| Public Member Functions inherited from hummingbird::ProblemBase | |
| ProblemBase (const size_t n_dofs, const size_t n_ordinates) | |
| Construct a new Problem Base object. | |
| virtual | ~ProblemBase ()=default |
| Destroy the Problem Base object. | |
| void | AssembleGlobalSystem (const std::vector< GlobalMatrixData > &global_matrix_data, const size_t ordinate_index) |
| Assemble the global element system. That is, form the matrix \(A\) in \( Ax=b\). This only should be called once per ordinate per simulation. The global matrix is sized from the n_dofs supplied at construction, not from global_matrix_data; row_id/col_id pairs are expected to repeat (shared nodes get summed contributions from multiple elements) and are summed via Armadillo's batch SpMat constructor's add_values=true overload (the default overload errors on duplicate locations instead of summing them). | |
| void | AssembleGlobalForcing (const std::vector< GlobalForcingData > &global_forcing_data, const size_t ordinate_index) |
| Assemble the global forcing vector for a given ordinate index. The global vector is sized from the n_dofs supplied at construction, not from global_forcing_data; row_id values are expected to repeat (shared nodes get summed contributions from multiple elements). | |
| void | Solve (const size_t ordinate_index) |
| Solve the linear system using Armadillo's sparse matrix solver. Stores the results in the solution_vectors_ member at the ordinate_index index. | |
| void | ApplyBCs (const Mesh &mesh, const Ordinate &ordinate, const BCBank &bc_bank, const size_t ordinate_index) |
| Apply boundary conditions by adding in values needed at boundary nodes. Internally, a switch calls the correct methods depending on the mesh dimension. | |
| const std::vector< arma::Col< double > > & | solution_vectors () const |
| Get the solution vectors. | |
| size_t | n_dofs () const |
| Get the number of degrees of freedom. | |
Private Member Functions | |
| void | Apply1DBCs (const Mesh &mesh, const Ordinate &ordinate, const BCBank &bc_bank, const size_t ordinate_index) override |
| See ProblemBase::Apply1DBCs. Only vacuum BCs are currently supported. | |
Additional Inherited Members | |
| Protected Member Functions inherited from hummingbird::ProblemBase | |
| void | CheckGlobalMatrixData (const std::vector< GlobalMatrixData > &gmd) |
| Validate a vector of GlobalMatrixData before it is used to assemble the global system matrix. row_id/col_id pairs are expected to repeat (shared nodes get summed contributions from multiple elements), so unique (row_id, col_id) pairs are not required. Instead, this checks that the set of distinct row/col IDs referenced is contiguous starting from 0, i.e. no node ID is missing from the data. | |
| void | CheckGlobalForcingData (const std::vector< GlobalForcingData > &gfd) |
| Validate a vector of GlobalForcingData before it is used to assemble the global forcing vector. row_id values are expected to repeat (shared nodes get summed contributions from multiple elements), so unique row_ids are not required. Instead, this checks that the set of distinct row IDs referenced is contiguous starting from 0, i.e. no DOF is missing from the data. | |
| Protected Attributes inherited from hummingbird::ProblemBase | |
| const size_t | n_dofs_ |
| Number of degrees of freedom in simulation. | |
| std::vector< arma::SpMat< double > > | global_system_matrices_ |
| Global system matrices in order of ordinates in angular quadrature set. | |
| std::vector< arma::Col< double > > | global_forcing_vectors_ |
| Global forcing vectors in order of ordinates in angular quadrature set. | |
| std::vector< arma::Col< double > > | solution_vectors_ |
| Column vector of the angular flux at the nodes in order of ordinates in angular quadrature set. | |
Class defining a Continuous Galerkin formulation of the SAAF transport equation.
Definition at line 15 of file cg_problem.h.
| hummingbird::CGProblem::CGProblem | ( | const size_t | n_dofs, |
| const size_t | n_ordinates ) |
Construct a new CGProblem object.
| n_dofs | Number of Degrees of Freedom |
| n_ordinates | Number of ordinates in angular quadrature |
Definition at line 5 of file cg_problem.cc.
|
overrideprivatevirtual |
See ProblemBase::Apply1DBCs. Only vacuum BCs are currently supported.
| mesh | Mesh |
| ordinate | Ordinate (direction) |
| bc_bank | BCBank object |
| ordinate_index | Index of the ordinate in the angular quadrature |
| std::runtime_error | if a boundary node has a reflective or unsupported BC |
Implements hummingbird::ProblemBase.
Definition at line 52 of file cg_problem.cc.
|
overridevirtual |
See ProblemBase::AssembleGlobalForcingData. For each element, the element's node source fluxes are first recomputed with Element::SetNodeSourceFluxes (using that element's material and source), then the local forcing vector is scattered into GlobalForcingData entries keyed by the element's node IDs.
| gll_quad | GaussLobattoLegendre quadrature set |
| mesh | Mesh |
| material_bank | Material bank |
| source_bank | Source bank |
| ordinate | Ordinate (direction) |
| ordinate_index | Index in the angular quadrature |
| angular_quad_set | Angular quadrature set |
Implements hummingbird::ProblemBase.
Definition at line 30 of file cg_problem.cc.
|
overridevirtual |
See ProblemBase::AssembleGlobalMatrixData. For each element, the local mass and stiffness matrices are summed and scattered into GlobalMatrixData entries keyed by the element's node IDs.
| mesh | Mesh |
| gll_quad | GaussLobattoLegendre quadrature set |
| material_bank | Material bank |
| ordinate | Ordinate for equation |
Implements hummingbird::ProblemBase.
Definition at line 8 of file cg_problem.cc.