mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-24 20:15:26 -04:00
Making pointer for property_map const and fixing property_map tests.
This commit is contained in:
parent
b9a57b02d4
commit
cdaad6ad54
4 changed files with 8 additions and 11 deletions
|
|
@ -1075,19 +1075,18 @@ extern "C" int openmc_id_map(const void* plot, int32_t* data_out)
|
|||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int openmc_property_map(void* plot, double* data_out) {
|
||||
extern "C" int openmc_property_map(const void* plot, double* data_out) {
|
||||
|
||||
auto plt = reinterpret_cast<PlotBase*>(plot);
|
||||
auto plt = reinterpret_cast<const PlotBase*>(plot);
|
||||
if (!plt) {
|
||||
set_errmsg("Invalid slice pointer passed to openmc_id_map");
|
||||
return OPENMC_E_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
PropertyData data = plt->get_property_map();
|
||||
PropertyData props = plt->get_property_map();
|
||||
|
||||
// write id data to array
|
||||
size_t i = 0;
|
||||
for (auto v : data) { data_out[i++] = v; }
|
||||
std::copy(props.begin(), props.end(), data_out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue