mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Making datasets structs with set_value methods instead of templating setters.
This commit is contained in:
parent
cdaad6ad54
commit
49ee1c4048
2 changed files with 56 additions and 34 deletions
|
|
@ -51,9 +51,30 @@ struct RGBColor {
|
|||
uint8_t red, green, blue;
|
||||
};
|
||||
|
||||
|
||||
typedef xt::xtensor<RGBColor, 2> ImageData;
|
||||
typedef xt::xtensor<int32_t, 3> IdData;
|
||||
typedef xt::xtensor<double, 3> PropertyData;
|
||||
|
||||
struct IdData {
|
||||
// Constructor
|
||||
IdData(int h_res, int v_res);
|
||||
|
||||
// Methods
|
||||
void set_value(int y, int x, const Particle& p, int level);
|
||||
|
||||
// Members
|
||||
xt::xtensor<int32_t, 3> data;
|
||||
};
|
||||
|
||||
struct PropertyData {
|
||||
// Constructor
|
||||
PropertyData(int h_res, int v_res);
|
||||
|
||||
// Methods
|
||||
void set_value(int y, int x, const Particle& p, int level);
|
||||
|
||||
// Members
|
||||
xt::xtensor<double, 3> data;
|
||||
};
|
||||
|
||||
enum class PlotType {
|
||||
slice = 1,
|
||||
|
|
@ -80,7 +101,7 @@ class PlotBase {
|
|||
PropertyData get_property_map() const;
|
||||
|
||||
private:
|
||||
template<class D, typename setter>
|
||||
template<class D>
|
||||
D generate_data() const;
|
||||
|
||||
// Members
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue