with Model fields
model.add_real_field("density");
auto& field_data = model.get_real_field("density");
auto inbox = pfc::fft::get_inbox(model.get_fft());
{inbox.high[0] - inbox.low[0] + 1,
inbox.high[1] - inbox.low[1] + 1,
inbox.high[2] - inbox.low[2] + 1},
{inbox.low[0], inbox.low[1], inbox.low[2]},
pfc::world::get_origin(world),
pfc::world::get_spacing(world)
);
discrete_field.apply([](double x, double y, double z) {
return std::sin(x);
});
field_data = discrete_field.get_data();
The Model class represents the physics model for simulations in OpenPFC.
Definition model.hpp:95
Represents the global simulation domain (the "world").
Definition world.hpp:91