10#include "ddc_aliases.hpp"
11#include "mesh_builder.hpp"
12#include "non_uniform_interpolation_points.hpp"
13#include "paraconfpp.hpp"
14#include "pdi_helper.hpp"
25void parse_executable_arguments(
26 PC_tree_t& conf_voicexx,
30 char const*
const params_yaml);
41PC_tree_t parse_executable_arguments(
int argc,
char** argv,
char const*
const params_yaml);
61template <
class Gr
id1D,
class BSplines,
class InterpPo
intInitMethod>
62inline IdxRange<Grid1D> init_spline_dependent_idx_range(
63 PC_tree_t
const& conf_voicexx,
64 std::string
const& mesh_identifier)
66 using Dim =
typename Grid1D::continuous_dimension_type;
67 using Coord1D = ddc::Coordinate<Dim>;
69 std::vector<Coord1D> breakpoints;
71 if constexpr (BSplines::is_uniform()) {
73 Coord1D min(PCpp_double(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_min"));
74 Coord1D max(PCpp_double(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_max"));
75 IdxStep<Grid1D> ncells(
76 PCpp_int(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_ncells"));
77 ddc::init_discrete_space<BSplines>(min, max, ncells);
78 }
else if constexpr (!ddcHelper::is_non_uniform_interpolation_points_v<InterpPointInitMethod>) {
79 PDI_get_arrays(
"read_" + mesh_identifier,
"breakpoints_" + mesh_identifier, breakpoints);
80 ddc::init_discrete_space<BSplines>(breakpoints);
83 if constexpr (ddcHelper::is_non_uniform_interpolation_points_v<InterpPointInitMethod>) {
88 std::vector<Coord1D> mesh;
89 std::string grid_name =
"grid_" + mesh_identifier;
91 if constexpr (BSplines::is_uniform()) {
92 PDI_get_arrays(
"read_" + mesh_identifier, grid_name, mesh);
94 std::string breakpoints_name =
"breakpoints_" + mesh_identifier;
96 "read_" + mesh_identifier,
101 ddc::init_discrete_space<BSplines>(breakpoints);
103 ddc::init_discrete_space<Grid1D>(
104 InterpPointInitMethod::template get_sampling<Grid1D>(mesh));
106 ddc::init_discrete_space<Grid1D>(InterpPointInitMethod::template get_sampling<Grid1D>());
108 IdxRange<Grid1D> interpolation_idx_range(InterpPointInitMethod::template get_domain<Grid1D>());
109 return interpolation_idx_range;
129template <
class Gr
id1D,
class BSplines,
class InterpPo
intInitMethod>
130inline IdxRange<Grid1D> init_pseudo_uniform_spline_dependent_idx_range(
131 PC_tree_t
const& conf_voicexx,
132 std::string
const& mesh_identifier)
134 static_assert(!BSplines::is_uniform());
135 using Dim =
typename Grid1D::continuous_dimension_type;
136 using Coord1D = Coord<Dim>;
138 Coord1D min(PCpp_double(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_min"));
139 Coord1D max(PCpp_double(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_max"));
140 IdxStep<Grid1D> ncells(PCpp_int(conf_voicexx,
".SplineMesh." + mesh_identifier +
"_ncells"));
142 std::vector<Coord1D> break_points = build_uniform_break_points(min, max, ncells);
144 ddc::init_discrete_space<BSplines>(break_points);
145 ddc::init_discrete_space<Grid1D>(InterpPointInitMethod::template get_sampling<Grid1D>());
146 IdxRange<Grid1D> interpolation_idx_range(InterpPointInitMethod::template get_domain<Grid1D>());
147 return interpolation_idx_range;