hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
ordinate.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_ORDINATE_H_
5#define HUMMINGBIRD_ORDINATE_H_
6
7#include <armadillo>
8
9namespace hummingbird {
10
11/**
12 * @brief Defines a solid angle, or *ordinate*, in spherical geometry
13 *
14 */
15class Ordinate {
16 public:
17 /**
18 * @brief Construct a new Ordinate object
19 *
20 * @param azimuth Azimuthal angle \f$\theta\in [-\pi,\pi]\f$
21 * @param polar Polar angle \f$\varphi\in [0,\pi]\f$
22 */
23 Ordinate(const double azimuth, const double polar);
24
25 /**
26 * @brief Construct a new Ordinate object in the reflected direction given a
27 * starting direction and surface normal vector
28 *
29 * @param ordinate Initial direction
30 * @param surface_normal Surface normal vector
31 */
32 static Ordinate Reflect(const Ordinate& ordinate,
33 const arma::vec3 surface_normal);
34
35 /**
36 * @brief Getter for azimuthal angle
37 *
38 * @return double
39 */
40 double azimuth() const { return azimuth_; }
41
42 /**
43 * @brief Getter for polar angle
44 *
45 * @return double
46 */
47 double polar() const { return polar_; }
48
49 /**
50 * @brief Evaluate the x-direction cosine
51 *
52 * @return double
53 */
54 double x() const;
55
56 /**
57 * @brief Evaluate the y-direction cosine
58 *
59 * @return double
60 */
61 double y() const;
62
63 /**
64 * @brief Evaluate the z-direction cosine
65 *
66 * @return double
67 */
68 double z() const;
69
70 /**
71 * @brief Returns the Ordinate as a Cartesian unit vector
72 *
73 * @return arma::vec3
74 */
75 arma::vec3 CartesianUnitVector() const;
76
77 private:
78 /// @brief Azimuthal angle in radians
79 const double azimuth_;
80
81 /// @brief Polar angle in radians
82 const double polar_;
83
84 /**
85 * @brief Check that input angles are within expected bounds
86 *
87 * @param azimuth Azimuthal angle in radians
88 * @param polar Polar angle in radians
89 */
90 void CheckInput(const double azimuth, const double polar);
91};
92} // namespace hummingbird
93
94#endif // HUMMINGBIRD_ORDINATE_H_
Ordinate(const double azimuth, const double polar)
Construct a new Ordinate object.
Definition ordinate.cc:7
const double polar_
Polar angle in radians.
Definition ordinate.h:82
const double azimuth_
Azimuthal angle in radians.
Definition ordinate.h:79
double polar() const
Getter for polar angle.
Definition ordinate.h:47
double x() const
Evaluate the x-direction cosine.
Definition ordinate.cc:32
double azimuth() const
Getter for azimuthal angle.
Definition ordinate.h:40
double y() const
Evaluate the y-direction cosine.
Definition ordinate.cc:34
arma::vec3 CartesianUnitVector() const
Returns the Ordinate as a Cartesian unit vector.
Definition ordinate.cc:38
void CheckInput(const double azimuth, const double polar)
Check that input angles are within expected bounds.
Definition ordinate.cc:23
static Ordinate Reflect(const Ordinate &ordinate, const arma::vec3 surface_normal)
Construct a new Ordinate object in the reflected direction given a starting direction and surface nor...
Definition ordinate.cc:12
double z() const
Evaluate the z-direction cosine.
Definition ordinate.cc:36