https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InputParametersChecksUtils.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "InputParameters.h"
13#include "Moose.h"
14
15// C++ includes
16#include <cstdlib>
17#include <tuple>
18#include <type_traits>
19
26template <typename C>
28{
29public:
30 InputParametersChecksUtils(const C * customer_class) : _customer_class(customer_class) {}
31
32protected:
35 template <typename T>
36 void assertParamDefined(const std::string & param) const;
40 void checkParamsBothSetOrNotSet(const std::string & param1, const std::string & param2) const;
43 void checkAtMostOneParamSetByUser(const std::vector<std::string> & params) const;
47 void checkSecondParamSetOnlyIfFirstOneTrue(const std::string & param1,
48 const std::string & param2) const;
52 void checkSecondParamSetOnlyIfFirstOneSet(const std::string & param1,
53 const std::string & param2) const;
57 void checkSecondParamNotSetIfFirstOneSet(const std::string & param1,
58 const std::string & param2) const;
62 template <typename T, typename S>
63 void checkVectorParamsSameLength(const std::string & param1, const std::string & param2) const;
67 template <typename T>
68 void checkVectorParamAndMultiMooseEnumLength(const std::string & param1,
69 const std::string & param2) const;
73 template <typename T, typename S>
74 void checkTwoDVectorParamsSameLength(const std::string & param1,
75 const std::string & param2) const;
79 template <typename T>
80 void checkVectorParamsNoOverlap(const std::vector<std::string> & param_vecs) const;
84 template <typename T>
85 void checkTwoDVectorParamsNoRespectiveOverlap(const std::vector<std::string> & param_vecs) const;
89 template <typename T, typename S>
90 void checkTwoDVectorParamInnerSameLengthAsOneDVector(const std::string & param1,
91 const std::string & param2) const;
95 template <typename T>
96 void checkTwoDVectorParamMultiMooseEnumSameLength(const std::string & param1,
97 const std::string & param2,
98 const bool error_for_param2) const;
101 template <typename T>
102 void checkVectorParamNotEmpty(const std::string & param1) const;
106 template <typename T, typename S>
107 void checkVectorParamsSameLengthIfSet(const std::string & param1,
108 const std::string & param2,
109 const bool ignore_empty_default_param2 = false) const;
114 template <typename T, typename S, typename U>
115 void checkVectorParamLengthSameAsCombinedOthers(const std::string & param1,
116 const std::string & param2,
117 const std::string & param3) const;
118
122 template <typename T>
123 void checkBlockwiseConsistency(const std::string & block_param_name,
124 const std::vector<std::string> & parameter_names) const;
128 template <typename T>
129 bool parameterConsistent(const InputParameters & other_param,
130 const std::string & param_name) const;
134 template <typename T>
135 void warnInconsistent(const InputParameters & parameters, const std::string & param_name) const;
140 void errorDependentParameter(const std::string & param1,
141 const std::string & value_not_set,
142 const std::vector<std::string> & dependent_params) const;
147 void errorInconsistentDependentParameter(const std::string & param1,
148 const std::string & value_set,
149 const std::vector<std::string> & dependent_params) const;
150
151private:
152 // Convenience routines so that defining new checks feels very similar to coding checks in
153 // MooseObjects and Actions (MooseParameterInterface-derived classes)
155 template <typename T>
156 const T & forwardGetParam(const std::string & param_name) const
157 {
158 return _customer_class->template getParam<T>(param_name);
159 }
161 const InputParameters & forwardParameters() const { return _customer_class->parameters(); }
163 bool forwardIsParamSetByUser(const std::string & param_name) const
164 {
165 return _customer_class->isParamSetByUser(param_name);
166 }
168 bool forwardIsParamValid(const std::string & param_name) const
169 {
170 return _customer_class->isParamValid(param_name);
171 }
173 template <typename... Args>
174 void forwardParamError(Args &&... args) const
175 {
176 _customer_class->paramError(std::forward<Args>(args)...);
177 }
179 template <typename... Args>
180 void forwardMooseError(Args &&... args) const
181 {
182 _customer_class->mooseError(std::forward<Args>(args)...);
183 }
185 template <typename... Args>
186 void forwardMooseWarning(Args &&... args) const
187 {
188 _customer_class->mooseWarning(std::forward<Args>(args)...);
189 }
191 const std::string & forwardType() const { return _customer_class->type(); }
193 virtual const std::string & forwardName() const { return _customer_class->name(); }
195 const std::vector<SubdomainName> & forwardBlocks() const
196 {
197 // TODO Use SFINAE to create a version for classes that do not define blocks()
198 // TODO Use SFINAE to force blocks() to return a reference as well
199 return _customer_class->blocks();
200 }
201
202 // A pointer to the class using this
203 const C * const _customer_class;
204};
205
206template <typename C>
207template <typename T>
208void
209InputParametersChecksUtils<C>::assertParamDefined(const std::string & libmesh_dbg_var(param)) const
210{
211 mooseAssert(forwardParameters().template have_parameter<T>(param),
212 "Parameter '" + param + "' is not defined with type '" +
213 MooseUtils::prettyCppType<T>() + "' in object type '" +
214 MooseUtils::prettyCppType(forwardType()) + "'. Check your code.");
215}
216
217template <typename C>
218template <typename T, typename S>
219void
221 const std::string & param2) const
222{
223 assertParamDefined<std::vector<T>>(param1);
224 assertParamDefined<std::vector<S>>(param2);
225
226 if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
227 {
228 const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
229 const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
230 if (size_1 != size_2)
231 forwardParamError(param1,
232 "Vector parameters '" + param1 + "' (size " + std::to_string(size_1) +
233 ") and '" + param2 + "' (size " + std::to_string(size_2) +
234 ") must be the same size");
235 }
236 // handle empty vector defaults
237 else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
238 if (forwardGetParam<std::vector<T>>(param1).size() ||
239 forwardGetParam<std::vector<S>>(param2).size())
240 checkParamsBothSetOrNotSet(param1, param2);
241}
242
243template <typename C>
244template <typename T>
245void
247 const std::string & param1, const std::string & param2) const
248{
249 assertParamDefined<std::vector<T>>(param1);
250 assertParamDefined<MultiMooseEnum>(param2);
251
252 if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
253 {
254 const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
255 const auto size_2 = forwardGetParam<MultiMooseEnum>(param2).size();
256 if (size_1 != size_2)
257 forwardParamError(param1,
258 "Vector parameters '" + param1 + "' (size " + std::to_string(size_1) +
259 ") and '" + param2 + "' (size " + std::to_string(size_2) +
260 ") must be the same size");
261 }
262 // handle empty vector defaults
263 else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
264 if (forwardGetParam<std::vector<T>>(param1).size() ||
265 forwardGetParam<MultiMooseEnum>(param2).size())
266 checkParamsBothSetOrNotSet(param1, param2);
267}
268
269template <typename C>
270template <typename T, typename S>
271void
273 const std::string & param2) const
274{
275 checkVectorParamsSameLength<std::vector<T>, std::vector<S>>(param1, param2);
276 if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
277 {
278 const auto value1 = forwardGetParam<std::vector<std::vector<T>>>(param1);
279 const auto value2 = forwardGetParam<std::vector<std::vector<S>>>(param2);
280 for (const auto index : index_range(value1))
281 if (value1[index].size() != value2[index].size())
282 forwardParamError(
283 param1,
284 "Vector at index " + std::to_string(index) + " of 2D vector parameter '" + param1 +
285 "' is not the same size as its counterpart from 2D vector parameter '" + param2 +
286 "'.\nSize first vector: " + std::to_string(value1[index].size()) +
287 "\nSize second vector: " + std::to_string(value2[index].size()));
288 }
289 // handle empty vector defaults
290 else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
291 if (forwardGetParam<std::vector<T>>(param1).size() ||
292 forwardGetParam<std::vector<S>>(param2).size())
293 checkParamsBothSetOrNotSet(param1, param2);
294}
295
296template <typename C>
297template <typename T, typename S>
298void
300 const std::string & param1, const std::string & param2) const
301{
302 assertParamDefined<std::vector<std::vector<T>>>(param1);
303 assertParamDefined<std::vector<S>>(param2);
304 for (const auto & sub_vec_i : index_range(forwardGetParam<std::vector<std::vector<T>>>(param1)))
305 {
306 const auto size_1 = forwardGetParam<std::vector<std::vector<T>>>(param1)[sub_vec_i].size();
307 const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
308 if (size_1 != size_2)
309 forwardParamError(param1,
310 "Vector at index " + std::to_string(sub_vec_i) + " (size " +
311 std::to_string(size_1) +
312 ") "
313 " of this parameter should be the same length as parameter '" +
314 param2 + "' (size " + std::to_string(size_2) + ")");
315 }
316}
317
318template <typename C>
319template <typename T>
320void
322 const std::string & param1, const std::string & param2, const bool error_for_param2) const
323{
324 assertParamDefined<std::vector<std::vector<T>>>(param1);
325 assertParamDefined<MultiMooseEnum>(param2);
326 const auto vec1 = forwardGetParam<std::vector<std::vector<T>>>(param1);
327 const auto enum2 = forwardGetParam<MultiMooseEnum>(param2);
328 const auto size_1 = vec1.empty() ? 0 : vec1.size() * vec1[0].size();
329 const auto size_2 = enum2.size();
330 if (size_1 != size_2)
331 {
332 if (error_for_param2)
333 forwardParamError(param2,
334 "Vector enumeration parameter (size " + std::to_string(size_2) +
335 ") is not the same size as the vector of vector parameter '" + param1 +
336 "' (size " + std::to_string(size_1) + ")");
337 else
338 forwardParamError(param1,
339 "Vector of vector parameter '" + param1 + "' (total size " +
340 std::to_string(size_1) +
341 ") is not the same size as vector-enumeration parameter '" + param2 +
342 "' (size " + std::to_string(size_2) + ")");
343 }
344}
345
346template <typename C>
347template <typename T, typename S, typename U>
348void
350 const std::string & param1, const std::string & param2, const std::string & param3) const
351{
352 assertParamDefined<std::vector<T>>(param1);
353 assertParamDefined<std::vector<S>>(param2);
354 assertParamDefined<std::vector<U>>(param3);
355 const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
356 const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
357 const auto size_3 = forwardGetParam<std::vector<U>>(param3).size();
358
359 if (size_1 != size_2 + size_3)
360 forwardParamError(param1,
361 "Vector parameter '" + param1 + "' (size " + std::to_string(size_1) +
362 ") should be the same size as parameter '" + param2 + "' and '" + param3 +
363 " combined (total size " + std::to_string(size_2 + size_3) + ")");
364}
365
366template <typename C>
367template <typename T>
368void
370 const std::vector<std::string> & param_vec) const
371{
372 std::set<std::string> unique_params;
373 for (const auto & param : param_vec)
374 {
375 assertParamDefined<std::vector<T>>(param);
376
377 for (const auto & value : forwardGetParam<std::vector<T>>(param))
378 if (!unique_params.insert(value).second)
379 {
380 auto copy_params = param_vec;
381 copy_params.erase(std::find(copy_params.begin(), copy_params.end(), param));
382 // Overlap between multiple vectors of parameters
383 if (copy_params.size())
384 forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
385 "' is also present in one or more of the parameters '" +
386 Moose::stringify(copy_params) + "', which is not allowed.");
387 // Overlap within a single vector parameter caused by a repeated item
388 else
389 forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
390 "' is repeated, which is not allowed.");
391 }
392 }
393}
394
395template <typename C>
396template <typename T>
397void
399 const std::vector<std::string> & param_vec) const
400{
401 // Outer loop, each param is the name of a parameter for a vector of vectors
402 for (const auto & param : param_vec)
403 {
404 assertParamDefined<std::vector<std::vector<T>>>(param);
405 const auto & twoD_vec = forwardGetParam<std::vector<std::vector<T>>>(param);
406 std::vector<std::set<T>> unique_params(twoD_vec.size());
407
408 // Loop over each outer vector and compare the inner vectors respectively to other parameters
409 for (const auto i : index_range(twoD_vec))
410 {
411 for (const auto & value : twoD_vec[i])
412 if (!unique_params[i].insert(value).second)
413 {
414 auto copy_params = param_vec;
415 copy_params.erase(std::find(copy_params.begin(), copy_params.end(), param));
416 forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
417 "' is also present in one or more of the two-D vector parameters '" +
418 Moose::stringify(copy_params) +
419 "' in the inner vector of the same index, which is not allowed.");
420 }
421 }
422 }
423}
424
425template <typename C>
426template <typename T>
427void
429{
430 assertParamDefined<std::vector<T>>(param);
431 if (!forwardGetParam<std::vector<T>>(param).size())
432 forwardParamError(param, "Parameter '" + param + "' should not be set to an empty vector.");
433}
434
435template <typename C>
436template <typename T, typename S>
437void
439 const std::string & param1,
440 const std::string & param2,
441 const bool ignore_empty_default_param2) const
442{
443 assertParamDefined<std::vector<T>>(param1);
444 assertParamDefined<std::vector<S>>(param2);
445
446 if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
447 {
448 const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
449 const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
450 if (ignore_empty_default_param2 && (size_2 == 0) && !forwardIsParamSetByUser(param2))
451 return;
452 if (size_1 != size_2)
453 forwardParamError(param1,
454 "Parameter '" + param1 + "' (size " + std::to_string(size_1) + ") and '" +
455 param2 + "' (size " + std::to_string(size_2) +
456 ") must be the same size if set.");
457 }
458}
459
460template <typename C>
461template <typename T>
462bool
464 const std::string & param_name) const
465{
466 assertParamDefined<T>(param_name);
467 mooseAssert(other_param.have_parameter<T>(param_name),
468 "This should have been a parameter from the parameters being compared");
469 bool consistent = true;
470 if (forwardParameters().isParamValid(param_name) && other_param.isParamValid(param_name))
471 {
472 if constexpr (std::is_same_v<MooseEnum, T>)
473 {
474 if (!forwardGetParam<T>(param_name).compareCurrent(other_param.get<T>(param_name)))
475 consistent = false;
476 }
477 else if (forwardGetParam<T>(param_name) != other_param.get<T>(param_name))
478 consistent = false;
479 }
480 return consistent;
481}
482
483template <typename C>
484template <typename T>
485void
487 const std::string & block_param_name, const std::vector<std::string> & parameter_names) const
488{
489 const std::vector<std::vector<SubdomainName>> & block_names =
490 forwardGetParam<std::vector<std::vector<SubdomainName>>>(block_param_name);
491
492 if (block_names.size())
493 {
494 // We only check block-restrictions if the customer class is not restricted to `ANY_BLOCK_ID`.
495 // If the users define blocks that are not on the mesh, they will receive errors from the
496 // objects created by the customer class
497 const auto & object_blocks = forwardBlocks();
498 if (std::find(object_blocks.begin(), object_blocks.end(), "ANY_BLOCK_ID") ==
499 object_blocks.end())
500 for (const auto & block_group : block_names)
501 for (const auto & block : block_group)
502 if (std::find(object_blocks.begin(), object_blocks.end(), block) == object_blocks.end())
503 forwardParamError(block_param_name,
504 "Block '" + block + "' is not present in the block restriction of " +
505 forwardName() +
506 "!\nBlock restriction: " + Moose::stringify(object_blocks));
507
508 for (const auto & param_name : parameter_names)
509 {
510 const std::vector<T> & param_vector = forwardGetParam<std::vector<T>>(param_name);
511 if (block_names.size() != param_vector.size())
512 forwardParamError(param_name,
513 "The number of entries in '" + param_name + "' (" +
514 std::to_string(param_vector.size()) +
515 ") is not the same as the number of blocks"
516 " (" +
517 std::to_string(block_names.size()) + ") in '" + block_param_name +
518 "'!");
519 }
520 }
521 else
522 {
523 unsigned int previous_size = 0;
524 for (const auto param_i : index_range(parameter_names))
525 {
526 const std::vector<T> & param_vector =
527 forwardGetParam<std::vector<T>>(parameter_names[param_i]);
528 if (param_i == 0)
529 {
530 if (param_vector.size() > 1)
531 forwardParamError(parameter_names[param_i],
532 "The user should only use one or zero entries in " +
533 parameter_names[param_i] + " if " + block_param_name +
534 " not defined!");
535 previous_size = param_vector.size();
536 }
537 else
538 {
539 if (previous_size != param_vector.size())
540 forwardParamError(parameter_names[param_i],
541 "The number of entries in '" + parameter_names[param_i] +
542 "' is not the same as the number of entries in '" +
543 parameter_names[param_i - 1] + "'!");
544 }
545 }
546 }
547}
548
549template <typename C>
550template <typename T>
551void
553 const std::string & param_name) const
554{
555 const bool consistent = parameterConsistent<T>(other_param, param_name);
556 if (!consistent)
557 forwardMooseWarning("Parameter " + param_name + " is inconsistent between Physics \"" +
558 forwardName() + "\" of type \"" + forwardType() +
559 "\" and the parameter set for \"" + other_param.getObjectName() +
560 "\" of type \"" + other_param.getObjectType() + "\"");
561}
562
563template <typename C>
564void
566 const std::string & param1,
567 const std::string & value_not_set,
568 const std::vector<std::string> & dependent_params) const
569{
570 for (const auto & dependent_param : dependent_params)
571 if (forwardIsParamSetByUser(dependent_param))
572 forwardParamError(dependent_param,
573 "Parameter '" + dependent_param +
574 "' should not be set by the user if parameter '" + param1 +
575 "' has not been set to '" + value_not_set + "'");
576}
577
578template <typename C>
579void
581 const std::string & param1,
582 const std::string & value_set,
583 const std::vector<std::string> & dependent_params) const
584{
585 for (const auto & dependent_param : dependent_params)
586 if (forwardIsParamSetByUser(dependent_param))
587 forwardParamError(dependent_param,
588 "Parameter '" + dependent_param +
589 "' should not be set by the user if parameter '" + param1 +
590 "' has been set to '" + value_set + "'");
591}
592
593template <typename C>
594void
596 const std::string & param2) const
597{
598 if ((forwardIsParamValid(param1) + forwardIsParamValid(param2)) % 2 != 0)
599 forwardParamError(param1,
600 "Parameters '" + param1 + "' and '" + param2 +
601 "' must be either both set or both not set.");
602}
603
604template <typename C>
605void
607 const std::vector<std::string> & params) const
608{
609 unsigned int num_set = 0;
610 for (const auto & param : params)
611 num_set += forwardIsParamSetByUser(param);
612
613 if (num_set <= 1)
614 return;
615
616 std::vector<std::string> params_set;
617 std::string first_set;
618 for (const auto & param : params)
619 if (forwardIsParamSetByUser(param))
620 {
621 params_set.push_back(param);
622 if (first_set.empty())
623 first_set = param;
624 }
625
626 forwardParamError(first_set,
627 "Only one parameter of:\n" + Moose::stringify(params),
628 "\nshould be set but:\n" + Moose::stringify(params_set),
629 "\nhave been set.");
630}
631
632template <typename C>
633void
635 const std::string & param1, const std::string & param2) const
636{
637 mooseAssert(forwardParameters().template have_parameter<bool>(param1),
638 "Cannot check if parameter " + param1 +
639 " is true if it's not a bool parameter of this object");
640 if (!forwardGetParam<bool>(param1) && forwardIsParamSetByUser(param2))
641 forwardParamError(param2,
642 "Parameter '" + param1 + "' cannot be set to false if parameter '" + param2 +
643 "' is set by the user");
644}
645
646template <typename C>
647void
649 const std::string & param1, const std::string & param2) const
650{
651 if (!forwardIsParamSetByUser(param1) && forwardIsParamSetByUser(param2))
652 forwardParamError(param2,
653 "Parameter '" + param2 + "' should not be set if parameter '" + param1 +
654 "' is not specified.");
655}
656
657template <typename C>
658void
660 const std::string & param2) const
661{
662 if (forwardIsParamSetByUser(param1) && forwardIsParamSetByUser(param2))
663 forwardParamError(param2,
664 "Parameter '" + param2 + "' should not be specified if parameter '" + param1 +
665 "' is specified.");
666}
Utility class to help check parameters.
void forwardParamError(Args &&... args) const
Forwards error to the class using this utility to get better error messages.
bool forwardIsParamSetByUser(const std::string &param_name) const
Forwards parameter check to the class using this utility.
void checkVectorParamsSameLength(const std::string &param1, const std::string &param2) const
Check that the two vector parameters are of the same length.
void assertParamDefined(const std::string &param) const
Check in debug mode that this parameter has been added to the validParams.
const std::vector< SubdomainName > & forwardBlocks() const
Get the blocks for the class using this utility.
void checkSecondParamNotSetIfFirstOneSet(const std::string &param1, const std::string &param2) const
Check that a parameter is not set if the first one is set.
void errorDependentParameter(const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
Error messages for parameters that should depend on another parameter.
const InputParameters & forwardParameters() const
Forwards obtaining parameters to the class using this utility.
void checkParamsBothSetOrNotSet(const std::string &param1, const std::string &param2) const
Check that two parameters are either both set or both not set.
bool forwardIsParamValid(const std::string &param_name) const
Forwards parameter check to the class using this utility.
void errorInconsistentDependentParameter(const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
Error messages for parameters that should depend on another parameter but with a different error mess...
InputParametersChecksUtils(const C *customer_class)
virtual const std::string & forwardName() const
Get the name of the class using this utility.
void checkVectorParamLengthSameAsCombinedOthers(const std::string &param1, const std::string &param2, const std::string &param3) const
Check that a vector parameter is the same length as two others combined.
bool parameterConsistent(const InputParameters &other_param, const std::string &param_name) const
Return whether two parameters are consistent.
void checkVectorParamsNoOverlap(const std::vector< std::string > &param_vecs) const
Check that there is no overlap between the items in each vector parameters Each vector parameter shou...
void checkVectorParamNotEmpty(const std::string &param1) const
Check that the user did not pass an empty vector.
void checkTwoDVectorParamInnerSameLengthAsOneDVector(const std::string &param1, const std::string &param2) const
Check that each inner vector of a two-D vector parameter are the same size as another one-D vector pa...
void checkTwoDVectorParamMultiMooseEnumSameLength(const std::string &param1, const std::string &param2, const bool error_for_param2) const
Check that the size of a two-D vector parameter matches the size of a MultiMooseEnum parameter.
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const
Check that a parameter is set only if the first one is set to true.
void checkTwoDVectorParamsNoRespectiveOverlap(const std::vector< std::string > &param_vecs) const
Check that there is no overlap between the respective items in each vector of the two-D parameters Ea...
void checkVectorParamsSameLengthIfSet(const std::string &param1, const std::string &param2, const bool ignore_empty_default_param2=false) const
Check that two vector parameters are the same length if both are set.
void warnInconsistent(const InputParameters &parameters, const std::string &param_name) const
Emits a warning if two parameters are not equal to each other.
void forwardMooseWarning(Args &&... args) const
Forwards warning to the class using this utility to get better error messages.
void checkAtMostOneParamSetByUser(const std::vector< std::string > &params) const
Check that only one of the parameters are set.
const T & forwardGetParam(const std::string &param_name) const
Forwards parameter check to the class using this utility.
void forwardMooseError(Args &&... args) const
Forwards error to the class using this utility to get better error messages.
void checkBlockwiseConsistency(const std::string &block_param_name, const std::vector< std::string > &parameter_names) const
Check if the user commited errors during the definition of block-wise parameters.
const std::string & forwardType() const
Get the type of the class using this utility.
void checkSecondParamSetOnlyIfFirstOneSet(const std::string &param1, const std::string &param2) const
Check that a parameter is set only if the first one is set.
void checkVectorParamAndMultiMooseEnumLength(const std::string &param1, const std::string &param2) const
Check that this vector parameter (with name defined in param1) has the same length as the MultiMooseE...
void checkTwoDVectorParamsSameLength(const std::string &param1, const std::string &param2) const
Check that the two-D vectors have exactly the same length in both dimensions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
const std::string & getObjectType() const
const std::string & getObjectName() const
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
std::string prettyCppType(const std::string &cpp_type)
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:65