44std::tuple<std::unique_ptr<MDGrid>, std::unique_ptr<CellData<typename MDGrid::LevelGridView, CellDataType>>>
47 using HostGrid =
typename MDGrid::HostGrid;
48 using MDEntity =
typename MDGrid::template Codim<0>::Entity;
51 std::size_t
const dim =
grid_config.get(
"dimension", std::size_t{ MDGrid::dimensionworld });
52 if (dim != MDGrid::dimensionworld) {
54 "Executable grid dimension does not match with input grid dimension!");
68 spdlog::info(
"Reading grid file '{}'",
grid_path);
77 std::array<unsigned int, MDGrid::dimensionworld>
cells{};
78 std::fill_n(
begin(
cells), MDGrid::dimensionworld, 1);
84 if (MDGrid::dimensionworld == 1) {
98 spdlog::info(
"Applying refinement of level: {}",
level);
102 std::cout << fmt::format(
"MultiDomainGrid: ");
105 auto cell_data = std::make_unique<CellData<typename MDGrid::LevelGridView, CellDataType>>(
md_grid_ptr->levelGridView(0));
115 std::vector<CellDataType> cell_values(
cell_data->size());
116 std::vector<bool> cell_mask(
cell_data->size());
126 if (
type ==
"expression") {
135 auto position = std::make_shared<FieldVector<double, MDGrid::dimensionworld>>();
138 if (
i < MDGrid::dimensionworld) {
148 return FloatCmp::ne(std::invoke(*
parser_ptr), 0.);
162 spdlog::warn(
"Compartment '{}' were not assigned an 'id'!",
compartment);
166 spdlog::info(
"Applying sub-domain partition");
180 "This version of dune-copasi does not support to"
181 " have more than {} domains per entity!",
187 spdlog::warn(
"Grid partition uses sub-domain{} {} but config file has {} compartment{}",
std::unique_ptr< MDGrid > make_multi_domain_grid(Dune::ParameterTree &config, std::shared_ptr< const ParserContext > parser_context={})
Creates a multi domain grid from a config file From given configuration file with grid and compartmen...
Definition make_multi_domain_grid.hh:212
void cell_data_parser(const ParameterTree &grid_config, CellData< GV, T > &cell_data)
Parse data file with cell data and add its values to cell data.
Definition cell_data_parser.hh:94
std::tuple< std::unique_ptr< MDGrid >, std::unique_ptr< CellData< typename MDGrid::LevelGridView, CellDataType > > > make_multi_domain_grid_with_cell_data(Dune::ParameterTree &config, std::shared_ptr< const ParserContext > parser_context={})
Creates a multi domain grid from a config file From given configuration file with grid and compartmen...
Definition make_multi_domain_grid.hh:45