hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
parsed_volumetric_source.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_PHYSICS_PARSED_VOLUMETRIC_SOURCE_H_
5#define HUMMINGBIRD_PHYSICS_PARSED_VOLUMETRIC_SOURCE_H_
6
7#include <string>
8
9#include "mesh/node.h"
10#include "physics/source_base.h"
12
13namespace hummingbird {
14/**
15 * @brief Defines a volumetric source defined by a parsed function passed by the
16 * user
17 *
18 */
20 public:
21 /**
22 * @brief Construct a new Parsed Volumetric Source object
23 *
24 * @param expression Function expression to be evaluated
25 */
26 ParsedVolumetricSource(const std::string expression);
27
28 /**
29 * @brief Evaluate the parsed expression_ at a node in a particular
30 * direction. The expression may reference the variables x, y, z (the
31 * node's coordinates) and mu (the direction's x-direction cosine)
32 *
33 * @param node Node
34 * @param ordinate Ordinate (direction)
35 * @return Volumetric source in n/cm2/s/str
36 * @throw std::runtime_error if the expression fails to parse
37 * @todo Add support for 2- and 3D angular functions (currently only supports
38 * mu-functions).
39 */
40 double EvaluateAtNode(const Node& node, const Ordinate& ordinate) override;
41
42 private:
43 /// @brief Function expression to be evaluated
44 const std::string expression_;
45};
46} // namespace hummingbird
47
48#endif // HUMMINGBIRD_PHYSICS_PARSED_VOLUMETRIC_SOURCE_H_
Defines a solid angle, or ordinate, in spherical geometry.
Definition ordinate.h:15
double EvaluateAtNode(const Node &node, const Ordinate &ordinate) override
Evaluate the parsed expression_ at a node in a particular direction. The expression may reference the...
ParsedVolumetricSource(const std::string expression)
Construct a new Parsed Volumetric Source object.
const std::string expression_
Function expression to be evaluated.
SourceBase()=default
Construct a new Source Base object.
A point in the mesh holding its coordinates, boundary info, and flux solution values.
Definition node.h:26