hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
results.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_UTILS_RESULTS_H_
5#define HUMMINGBIRD_UTILS_RESULTS_H_
6
7#include <string>
8#include <vector>
9
10#include "mesh/node.h"
13#include "utils/enums.h"
14
15namespace hummingbird {
16/**
17 * @brief Exports simulation results to a file
18 *
19 */
20class Results {
21 public:
22 /**
23 * @brief Construct a new Results object
24 *
25 * @param name Problem name, used to build the output file name
26 * @param output_format Format to export results in
27 * @param nodes Mesh nodes holding the solution values to export
28 * @param angular_quadrature Angular quadrature set for the simulation
29 * @param dimension Spatial dimension of the mesh. For dimension == 1, each
30 * ordinate is exported as a single direction cosine (the only angular
31 * quantity that matters in 1D) instead of azimuth/polar.
32 */
33 Results(const std::string& name, const OutputFormat output_format,
34 const std::vector<Node>& nodes,
35 const QuadratureBase<Ordinate>& angular_quadrature,
36 const unsigned int dimension);
37
38 /**
39 * @brief Export the results in the format given by output_format_
40 *
41 * @throw std::runtime_error if output_format_ is not yet supported
42 */
43 void Export();
44
45 private:
46 /// @brief Problem name, used to build the output file name
47 const std::string& name_;
48
49 /// @brief Format to export results in
51
52 /// @brief Mesh nodes holding the solution values to export
53 const std::vector<Node>& nodes_;
54
55 /// @brief Angular quadrature set
57
58 /// @brief Spatial dimension of the mesh
59 const unsigned int dimension_;
60
61 /**
62 * @brief Export the results as a CSV file
63 *
64 */
65 void ToCSV();
66};
67} // namespace hummingbird
68
69#endif // HUMMINGBIRD_UTILS_RESULTS_H_
Base class for defining a quadrature set.
const std::string & name_
Problem name, used to build the output file name.
Definition results.h:47
const std::vector< Node > & nodes_
Mesh nodes holding the solution values to export.
Definition results.h:53
const OutputFormat output_format_
Format to export results in.
Definition results.h:50
const QuadratureBase< Ordinate > & angular_quadrature_
Angular quadrature set.
Definition results.h:56
const unsigned int dimension_
Spatial dimension of the mesh.
Definition results.h:59
void ToCSV()
Export the results as a CSV file.
Definition results.cc:31
Results(const std::string &name, const OutputFormat output_format, const std::vector< Node > &nodes, const QuadratureBase< Ordinate > &angular_quadrature, const unsigned int dimension)
Construct a new Results object.
Definition results.cc:9
void Export()
Export the results in the format given by output_format_.
Definition results.cc:19
OutputFormat
Output forms available for export.
Definition enums.h:99