30 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
31 int const expected_component_number,
32 std::string_view
const base_tag_name)
34 auto const base_parameter_name = config.
getValue<std::string>();
36 base_parameter_name, parameters, 0 );
38 int const component_number = basis_vector.getNumberOfGlobalComponents();
39 if (base_tag_name ==
"basis_vector_1" && component_number != 2)
42 "The case of implicit \"basis_vector_0\" and "
43 "explicit \"basis_vector_1\" is for a 2D coordinate system. The "
44 "parameter for \"basis_vector_1\", {:s}, must have "
45 "two components but it has {:d}. In addition, \"basis_vector_2\" "
46 "should not exist in this case.",
47 base_parameter_name, component_number);
50 if (component_number != expected_component_number)
53 "The read parameter `{:s}' for tag {:s} has the wrong number of "
54 "components ({:d} instead of {:d}).",
55 base_parameter_name, base_tag_name, component_number,
56 expected_component_number);
89 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
95 auto const implicit_base1 =
105 int const expected_component_number = 2;
106 auto const basis_vector_1 =
108 expected_component_number,
"basis_vector_1");
122 auto const config_base2 =
128 "Both \"basis_vector_0\" and \"basis_vector_1\" are implicit but "
129 "\"basis_vector_2\" does not exist. If 2D coordinate system is "
130 "considered, please change \"basis_vector_1\" to explicit. If 3D "
131 "coordinate system is considered, please add \"basis_vector_2\".");
136 int const expected_component_number = 3;
138 *config_base2, parameters, expected_component_number,
"basis_vector_2");
143 std::optional<BaseLib::ConfigTree>
const& config,
144 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
155 auto const& config_base0 = config->getConfigSubtree(
"basis_vector_0");
156 auto const implicit_base0 =
158 config_base0.getConfigAttribute<
bool>(
"implicit",
false);
171 auto const base0_name = config_base0.getValue<std::string>();
173 base0_name, parameters, 0 );
174 int const dimension = basis_vector_0.getNumberOfGlobalComponents();
176 if (dimension != 2 && dimension != 3)
179 "Basis vector parameter '{:s}' must have two or three components, "
181 base0_name, dimension);
186 auto const& config_base1 = config->getConfigSubtree(
"basis_vector_1");
187 auto const implicit_base1 =
189 config_base1.getConfigAttribute<
bool>(
"implicit",
false);
193 "Since basis_vector_0 is explicitly defined, basis_vector_1"
194 " must be explicit as well.");
196 auto const base1_name = config_base1.getValue<std::string>();
197 auto const& basis_vector_1 =
208 auto const& config_base2 = config->getConfigSubtree(
"basis_vector_2");
211 int const expected_component_number = 3;
213 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)