22 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
23 int const expected_component_number,
24 std::string_view
const base_tag_name)
26 auto const base_parameter_name = config.
getValue<std::string>();
28 base_parameter_name, parameters, 0 );
30 int const component_number = basis_vector.getNumberOfGlobalComponents();
31 if (base_tag_name ==
"basis_vector_1" && component_number != 2)
34 "The case of implicit \"basis_vector_0\" and "
35 "explicit \"basis_vector_1\" is for a 2D coordinate system. The "
36 "parameter for \"basis_vector_1\", {:s}, must have "
37 "two components but it has {:d}. In addition, \"basis_vector_2\" "
38 "should not exist in this case.",
39 base_parameter_name, component_number);
42 if (component_number != expected_component_number)
45 "The read parameter `{:s}' for tag {:s} has the wrong number of "
46 "components ({:d} instead of {:d}).",
47 base_parameter_name, base_tag_name, component_number,
48 expected_component_number);
81 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
87 auto const implicit_base1 =
97 int const expected_component_number = 2;
98 auto const basis_vector_1 =
100 expected_component_number,
"basis_vector_1");
114 auto const config_base2 =
120 "Both \"basis_vector_0\" and \"basis_vector_1\" are implicit but "
121 "\"basis_vector_2\" does not exist. If 2D coordinate system is "
122 "considered, please change \"basis_vector_1\" to explicit. If 3D "
123 "coordinate system is considered, please add \"basis_vector_2\".");
128 int const expected_component_number = 3;
130 *config_base2, parameters, expected_component_number,
"basis_vector_2");
135 std::optional<BaseLib::ConfigTree>
const& config,
136 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
147 auto const& config_base0 = config->getConfigSubtree(
"basis_vector_0");
148 auto const implicit_base0 =
150 config_base0.getConfigAttribute<
bool>(
"implicit",
false);
163 auto const base0_name = config_base0.getValue<std::string>();
165 base0_name, parameters, 0 );
166 int const dimension = basis_vector_0.getNumberOfGlobalComponents();
168 if (dimension != 2 && dimension != 3)
171 "Basis vector parameter '{:s}' must have two or three components, "
173 base0_name, dimension);
178 auto const& config_base1 = config->getConfigSubtree(
"basis_vector_1");
179 auto const implicit_base1 =
181 config_base1.getConfigAttribute<
bool>(
"implicit",
false);
185 "Since basis_vector_0 is explicitly defined, basis_vector_1"
186 " must be explicit as well.");
188 auto const base1_name = config_base1.getValue<std::string>();
189 auto const& basis_vector_1 =
200 auto const& config_base2 = config->getConfigSubtree(
"basis_vector_2");
203 int const expected_component_number = 3;
205 config_base2, parameters, expected_component_number,
"basis_vector_2");
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)