mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Merge branch 'pshriwise-centre_for_cylinder_spherical_meshes' into centre_for_cylinder_spherical_meshes
This commit is contained in:
commit
408f2fd714
4 changed files with 15 additions and 5 deletions
|
|
@ -359,8 +359,7 @@ public:
|
|||
void to_hdf5(hid_t group) const override;
|
||||
|
||||
array<vector<double>, 3> grid_;
|
||||
array<double, 3> origin_;
|
||||
|
||||
Position origin_;
|
||||
|
||||
int set_grid();
|
||||
|
||||
|
|
@ -415,7 +414,7 @@ public:
|
|||
void to_hdf5(hid_t group) const override;
|
||||
|
||||
array<vector<double>, 3> grid_;
|
||||
array<double, 3> origin_;
|
||||
Position origin_;
|
||||
|
||||
int set_grid();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "xtensor/xadapt.hpp"
|
||||
#include "xtensor/xarray.hpp"
|
||||
|
||||
#include "openmc/position.h"
|
||||
#include "openmc/vector.h"
|
||||
|
||||
namespace openmc {
|
||||
|
|
@ -49,5 +50,8 @@ xt::xarray<T> get_node_xarray(
|
|||
return xt::adapt(v, shape);
|
||||
}
|
||||
|
||||
Position get_node_position(
|
||||
pugi::xml_node node, const char* name, bool lowercase = false);
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_XML_INTERFACE_H
|
||||
|
|
|
|||
|
|
@ -955,7 +955,7 @@ CylindricalMesh::CylindricalMesh(pugi::xml_node node) : StructuredMesh {node}
|
|||
grid_[0] = get_node_array<double>(node, "r_grid");
|
||||
grid_[1] = get_node_array<double>(node, "phi_grid");
|
||||
grid_[2] = get_node_array<double>(node, "z_grid");
|
||||
origin_ = get_node_array<double>(node, "origin");
|
||||
origin_ = get_node_position(node, "origin");
|
||||
|
||||
if (int err = set_grid()) {
|
||||
fatal_error(openmc_err_msg);
|
||||
|
|
@ -1193,7 +1193,7 @@ SphericalMesh::SphericalMesh(pugi::xml_node node) : StructuredMesh {node}
|
|||
grid_[0] = get_node_array<double>(node, "r_grid");
|
||||
grid_[1] = get_node_array<double>(node, "theta_grid");
|
||||
grid_[2] = get_node_array<double>(node, "phi_grid");
|
||||
origin_ = get_node_array<double>(node, "origin");
|
||||
origin_ = get_node_position(node, "origin");
|
||||
|
||||
if (int err = set_grid()) {
|
||||
fatal_error(openmc_err_msg);
|
||||
|
|
|
|||
|
|
@ -48,4 +48,11 @@ bool get_node_value_bool(pugi::xml_node node, const char* name)
|
|||
return false;
|
||||
}
|
||||
|
||||
Position get_node_position(
|
||||
pugi::xml_node node, const char* name, bool lowercase)
|
||||
{
|
||||
vector<double> arr = get_node_array<double>(node, name, lowercase);
|
||||
return Position(arr);
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue