hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
cg_problem.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2// Copyright (c) 2026, Liam Pohlmann
3
4#ifndef HUMMINGBIRD_PROBLEM_CG_PROBLEM_H_
5#define HUMMINGBIRD_PROBLEM_CG_PROBLEM_H_
6
8
9namespace hummingbird {
10/**
11 * @brief Class defining a Continuous Galerkin formulation of the SAAF transport
12 * equation
13 *
14 */
15class CGProblem : public ProblemBase {
16 public:
17 /**
18 * @brief Construct a new CGProblem object
19 *
20 * @param n_dofs Number of Degrees of Freedom
21 * @param n_ordinates Number of ordinates in angular quadrature
22 */
23 CGProblem(const size_t n_dofs, const size_t n_ordinates);
24
25 /**
26 * @brief See ProblemBase::AssembleGlobalMatrixData. For each element, the
27 * local mass and stiffness matrices are summed and scattered into
28 * GlobalMatrixData entries keyed by the element's node IDs.
29 *
30 * @param mesh Mesh
31 * @param gll_quad GaussLobattoLegendre quadrature set
32 * @param material_bank Material bank
33 * @param ordinate Ordinate for equation
34 * @return std::vector<GlobalMatrixData>
35 */
36 std::vector<GlobalMatrixData> AssembleGlobalMatrixData(
37 const Mesh& mesh, const GaussLobattoLegendre& gll_quad,
38 const MaterialBank& material_bank, const Ordinate& ordinate) override;
39
40 /**
41 * @brief See ProblemBase::AssembleGlobalForcingData. For each element, the
42 * element's node source fluxes are first recomputed with
43 * Element::SetNodeSourceFluxes (using that element's material and source),
44 * then the local forcing vector is scattered into GlobalForcingData entries
45 * keyed by the element's node IDs.
46 *
47 * @param gll_quad GaussLobattoLegendre quadrature set
48 * @param mesh Mesh
49 * @param material_bank Material bank
50 * @param source_bank Source bank
51 * @param ordinate Ordinate (direction)
52 * @param ordinate_index Index in the angular quadrature
53 * @param angular_quad_set Angular quadrature set
54 * @return std::vector<GlobalForcingData>
55 */
56 // this method will need to apply boundary conditions as well if needed
57 std::vector<GlobalForcingData> AssembleGlobalForcingData(
58 const GaussLobattoLegendre& gll_quad, Mesh& mesh,
59 const MaterialBank& material_bank, const SourceBank& source_bank,
60 const Ordinate& ordinate, const size_t ordinate_index,
61 const QuadratureBase<Ordinate>& angular_quad_set) override;
62
63 private:
64 /**
65 * @brief See ProblemBase::Apply1DBCs. Only vacuum BCs are currently
66 * supported.
67 *
68 * @param mesh Mesh
69 * @param ordinate Ordinate (direction)
70 * @param bc_bank BCBank object
71 * @param ordinate_index Index of the ordinate in the angular quadrature
72 * @throw std::runtime_error if a boundary node has a reflective or
73 * unsupported BC
74 * @todo Need to implement reflective BCs.
75 */
76 void Apply1DBCs(const Mesh& mesh, const Ordinate& ordinate,
77 const BCBank& bc_bank, const size_t ordinate_index) override;
78};
79} // namespace hummingbird
80
81#endif // HUMMINGBIRD_PROBLEM_CG_PROBLEM_H_
Bank holding the boundary conditions defined in the input file.
Definition bc_bank.h:21
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 fi...
Definition cg_problem.cc:30
CGProblem(const size_t n_dofs, const size_t n_ordinates)
Construct a new CGProblem object.
Definition cg_problem.cc:5
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.
Definition cg_problem.cc:52
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 ar...
Definition cg_problem.cc:8
Class defining a 1D Gauss-Legendre-Lobatto quadrature set on [-1,1]. The quadrature set approximates ...
Bank holding the materials defined in the input file.
Class defing a mesh.
Definition mesh.h:27
Defines a solid angle, or ordinate, in spherical geometry.
Definition ordinate.h:15
ProblemBase(const size_t n_dofs, const size_t n_ordinates)
Construct a new Problem Base object.
size_t n_dofs() const
Get the number of degrees of freedom.
Base class for defining a quadrature set.
Bank holding the volumetric sources defined in the input file.
Definition source_bank.h:25