https://mooseframework.inl.gov
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 
26 template <typename C>
28 {
29 public:
30  InputParametersChecksUtils(const C * customer_class) : _customer_class(customer_class) {}
31 
32 protected:
35  template <typename T>
36  void assertParamDefined(const std::string & param) const;
40  void checkParamsBothSetOrNotSet(const std::string & param1, const std::string & param2) const;
44  void checkSecondParamSetOnlyIfFirstOneTrue(const std::string & param1,
45  const std::string & param2) const;
49  void checkSecondParamSetOnlyIfFirstOneSet(const std::string & param1,
50  const std::string & param2) const;
54  void checkSecondParamNotSetIfFirstOneSet(const std::string & param1,
55  const std::string & param2) const;
59  template <typename T, typename S>
60  void checkVectorParamsSameLength(const std::string & param1, const std::string & param2) const;
64  template <typename T>
65  void checkVectorParamAndMultiMooseEnumLength(const std::string & param1,
66  const std::string & param2) const;
70  template <typename T, typename S>
71  void checkTwoDVectorParamsSameLength(const std::string & param1,
72  const std::string & param2) const;
76  template <typename T>
77  void checkVectorParamsNoOverlap(const std::vector<std::string> & param_vecs) const;
81  template <typename T>
82  void checkTwoDVectorParamsNoRespectiveOverlap(const std::vector<std::string> & param_vecs) const;
86  template <typename T, typename S>
87  void checkTwoDVectorParamInnerSameLengthAsOneDVector(const std::string & param1,
88  const std::string & param2) const;
92  template <typename T>
93  void checkTwoDVectorParamMultiMooseEnumSameLength(const std::string & param1,
94  const std::string & param2,
95  const bool error_for_param2) const;
98  template <typename T>
99  void checkVectorParamNotEmpty(const std::string & param1) const;
103  template <typename T, typename S>
104  void checkVectorParamsSameLengthIfSet(const std::string & param1,
105  const std::string & param2,
106  const bool ignore_empty_default_param2 = false) const;
111  template <typename T, typename S, typename U>
112  void checkVectorParamLengthSameAsCombinedOthers(const std::string & param1,
113  const std::string & param2,
114  const std::string & param3) const;
115 
119  template <typename T>
120  void checkBlockwiseConsistency(const std::string & block_param_name,
121  const std::vector<std::string> & parameter_names) const;
125  template <typename T>
126  bool parameterConsistent(const InputParameters & other_param,
127  const std::string & param_name) const;
131  template <typename T>
132  void warnInconsistent(const InputParameters & parameters, const std::string & param_name) const;
137  void errorDependentParameter(const std::string & param1,
138  const std::string & value_not_set,
139  const std::vector<std::string> & dependent_params) const;
144  void errorInconsistentDependentParameter(const std::string & param1,
145  const std::string & value_set,
146  const std::vector<std::string> & dependent_params) const;
147 
148 private:
149  // Convenience routines so that defining new checks feels very similar to coding checks in
150  // MooseObjects and Actions (MooseParameterInterface-derived classes)
152  template <typename T>
153  T forwardGetParam(const std::string & param_name) const
154  {
155  return _customer_class->template getParam<T>(param_name);
156  }
158  const InputParameters & forwardParameters() const { return _customer_class->parameters(); }
160  bool forwardIsParamSetByUser(const std::string & param_name) const
161  {
162  return _customer_class->isParamSetByUser(param_name);
163  }
165  bool forwardIsParamValid(const std::string & param_name) const
166  {
167  return _customer_class->isParamValid(param_name);
168  }
170  template <typename... Args>
171  void forwardParamError(Args &&... args) const
172  {
173  _customer_class->paramError(std::forward<Args>(args)...);
174  }
176  template <typename... Args>
177  void forwardMooseError(Args &&... args) const
178  {
179  _customer_class->mooseError(std::forward<Args>(args)...);
180  }
182  template <typename... Args>
183  void forwardMooseWarning(Args &&... args) const
184  {
185  _customer_class->mooseWarning(std::forward<Args>(args)...);
186  }
188  const std::string & forwardType() const { return _customer_class->type(); }
190  virtual const std::string & forwardName() const { return _customer_class->name(); }
192  const std::vector<SubdomainName> & forwardBlocks() const
193  {
194  // TODO Use SFINAE to create a version for classes that do not define blocks()
195  // TODO Use SFINAE to force blocks() to return a reference as well
196  return _customer_class->blocks();
197  }
198 
199  // A pointer to the class using this
200  const C * const _customer_class;
201 };
202 
203 template <typename C>
204 template <typename T>
205 void
206 InputParametersChecksUtils<C>::assertParamDefined(const std::string & libmesh_dbg_var(param)) const
207 {
208  mooseAssert(forwardParameters().template have_parameter<T>(param),
209  "Parameter '" + param + "' is not defined with type '" +
210  MooseUtils::prettyCppType<T>() + "' in object type '" +
211  MooseUtils::prettyCppType(forwardType()) + "'. Check your code.");
212 }
213 
214 template <typename C>
215 template <typename T, typename S>
216 void
218  const std::string & param2) const
219 {
220  assertParamDefined<std::vector<T>>(param1);
221  assertParamDefined<std::vector<S>>(param2);
222 
223  if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
224  {
225  const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
226  const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
227  if (size_1 != size_2)
228  forwardParamError(param1,
229  "Vector parameters '" + param1 + "' (size " + std::to_string(size_1) +
230  ") and '" + param2 + "' (size " + std::to_string(size_2) +
231  ") must be the same size");
232  }
233  // handle empty vector defaults
234  else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
235  if (forwardGetParam<std::vector<T>>(param1).size() ||
236  forwardGetParam<std::vector<T>>(param2).size())
237  checkParamsBothSetOrNotSet(param1, param2);
238 }
239 
240 template <typename C>
241 template <typename T>
242 void
244  const std::string & param1, const std::string & param2) const
245 {
246  assertParamDefined<std::vector<T>>(param1);
247  assertParamDefined<MultiMooseEnum>(param2);
248 
249  if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
250  {
251  const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
252  const auto size_2 = forwardGetParam<MultiMooseEnum>(param2).size();
253  if (size_1 != size_2)
254  forwardParamError(param1,
255  "Vector parameters '" + param1 + "' (size " + std::to_string(size_1) +
256  ") and '" + param2 + "' (size " + std::to_string(size_2) +
257  ") must be the same size");
258  }
259  // handle empty vector defaults
260  else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
261  if (forwardGetParam<std::vector<T>>(param1).size() ||
262  forwardGetParam<MultiMooseEnum>(param2).size())
263  checkParamsBothSetOrNotSet(param1, param2);
264 }
265 
266 template <typename C>
267 template <typename T, typename S>
268 void
270  const std::string & param2) const
271 {
272  checkVectorParamsSameLength<std::vector<T>, std::vector<S>>(param1, param2);
273  if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
274  {
275  const auto value1 = forwardGetParam<std::vector<std::vector<T>>>(param1);
276  const auto value2 = forwardGetParam<std::vector<std::vector<S>>>(param2);
277  for (const auto index : index_range(value1))
278  if (value1[index].size() != value2[index].size())
279  forwardParamError(
280  param1,
281  "Vector at index " + std::to_string(index) + " of 2D vector parameter '" + param1 +
282  "' is not the same size as its counterpart from 2D vector parameter '" + param2 +
283  "'.\nSize first vector: " + std::to_string(value1[index].size()) +
284  "\nSize second vector: " + std::to_string(value2[index].size()));
285  }
286  // handle empty vector defaults
287  else if (forwardIsParamValid(param1) || forwardIsParamValid(param2))
288  if (forwardGetParam<std::vector<T>>(param1).size() ||
289  forwardGetParam<std::vector<T>>(param2).size())
290  checkParamsBothSetOrNotSet(param1, param2);
291 }
292 
293 template <typename C>
294 template <typename T, typename S>
295 void
297  const std::string & param1, const std::string & param2) const
298 {
299  assertParamDefined<std::vector<std::vector<T>>>(param1);
300  assertParamDefined<std::vector<S>>(param2);
301  for (const auto & sub_vec_i : index_range(forwardGetParam<std::vector<std::vector<T>>>(param1)))
302  {
303  const auto size_1 = forwardGetParam<std::vector<std::vector<T>>>(param1)[sub_vec_i].size();
304  const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
305  if (size_1 != size_2)
306  forwardParamError(param1,
307  "Vector at index " + std::to_string(sub_vec_i) + " (size " +
308  std::to_string(size_1) +
309  ") "
310  " of this parameter should be the same length as parameter '" +
311  param2 + "' (size " + std::to_string(size_2) + ")");
312  }
313 }
314 
315 template <typename C>
316 template <typename T>
317 void
319  const std::string & param1, const std::string & param2, const bool error_for_param2) const
320 {
321  assertParamDefined<std::vector<std::vector<T>>>(param1);
322  assertParamDefined<MultiMooseEnum>(param2);
323  const auto vec1 = forwardGetParam<std::vector<std::vector<T>>>(param1);
324  const auto enum2 = forwardGetParam<MultiMooseEnum>(param2);
325  const auto size_1 = vec1.empty() ? 0 : vec1.size() * vec1[0].size();
326  const auto size_2 = enum2.size();
327  if (size_1 != size_2)
328  {
329  if (error_for_param2)
330  forwardParamError(param2,
331  "Vector enumeration parameter (size " + std::to_string(size_2) +
332  ") is not the same size as the vector of vector parameter '" + param1 +
333  "' (size " + std::to_string(size_1) + ")");
334  else
335  forwardParamError(param1,
336  "Vector of vector parameter '" + param1 + "' (total size " +
337  std::to_string(size_1) +
338  ") is not the same size as vector-enumeration parameter '" + param2 +
339  "' (size " + std::to_string(size_2) + ")");
340  }
341 }
342 
343 template <typename C>
344 template <typename T, typename S, typename U>
345 void
347  const std::string & param1, const std::string & param2, const std::string & param3) const
348 {
349  assertParamDefined<std::vector<T>>(param1);
350  assertParamDefined<std::vector<S>>(param2);
351  assertParamDefined<std::vector<U>>(param3);
352  const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
353  const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
354  const auto size_3 = forwardGetParam<std::vector<U>>(param3).size();
355 
356  if (size_1 != size_2 + size_3)
357  forwardParamError(param1,
358  "Vector parameter '" + param1 + "' (size " + std::to_string(size_1) +
359  ") should be the same size as parameter '" + param2 + "' and '" + param3 +
360  " combined (total size " + std::to_string(size_2 + size_3) + ")");
361 }
362 
363 template <typename C>
364 template <typename T>
365 void
367  const std::vector<std::string> & param_vec) const
368 {
369  std::set<std::string> unique_params;
370  for (const auto & param : param_vec)
371  {
372  assertParamDefined<std::vector<T>>(param);
373 
374  for (const auto & value : forwardGetParam<std::vector<T>>(param))
375  if (!unique_params.insert(value).second)
376  {
377  auto copy_params = param_vec;
378  copy_params.erase(std::find(copy_params.begin(), copy_params.end(), param));
379  // Overlap between multiple vectors of parameters
380  if (copy_params.size())
381  forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
382  "' is also present in one or more of the parameters '" +
383  Moose::stringify(copy_params) + "', which is not allowed.");
384  // Overlap within a single vector parameter caused by a repeated item
385  else
386  forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
387  "' is repeated, which is not allowed.");
388  }
389  }
390 }
391 
392 template <typename C>
393 template <typename T>
394 void
396  const std::vector<std::string> & param_vec) const
397 {
398  // Outer loop, each param is the name of a parameter for a vector of vectors
399  for (const auto & param : param_vec)
400  {
401  assertParamDefined<std::vector<std::vector<T>>>(param);
402  const auto & twoD_vec = forwardGetParam<std::vector<std::vector<T>>>(param);
403  std::vector<std::set<T>> unique_params(twoD_vec.size());
404 
405  // Loop over each outer vector and compare the inner vectors respectively to other parameters
406  for (const auto i : index_range(twoD_vec))
407  {
408  for (const auto & value : twoD_vec[i])
409  if (!unique_params[i].insert(value).second)
410  {
411  auto copy_params = param_vec;
412  copy_params.erase(std::find(copy_params.begin(), copy_params.end(), param));
413  forwardMooseError("Item '" + value + "' specified in vector parameter '" + param +
414  "' is also present in one or more of the two-D vector parameters '" +
415  Moose::stringify(copy_params) +
416  "' in the inner vector of the same index, which is not allowed.");
417  }
418  }
419  }
420 }
421 
422 template <typename C>
423 template <typename T>
424 void
426 {
427  assertParamDefined<std::vector<T>>(param);
428  if (!forwardGetParam<std::vector<T>>(param).size())
429  forwardParamError(param, "Parameter '" + param + "' should not be set to an empty vector.");
430 }
431 
432 template <typename C>
433 template <typename T, typename S>
434 void
436  const std::string & param1,
437  const std::string & param2,
438  const bool ignore_empty_default_param2) const
439 {
440  assertParamDefined<std::vector<T>>(param1);
441  assertParamDefined<std::vector<S>>(param2);
442 
443  if (forwardIsParamValid(param1) && forwardIsParamValid(param2))
444  {
445  const auto size_1 = forwardGetParam<std::vector<T>>(param1).size();
446  const auto size_2 = forwardGetParam<std::vector<S>>(param2).size();
447  if (ignore_empty_default_param2 && (size_2 == 0) && !forwardIsParamSetByUser(param2))
448  return;
449  if (size_1 != size_2)
450  forwardParamError(param1,
451  "Parameter '" + param1 + "' (size " + std::to_string(size_1) + ") and '" +
452  param2 + "' (size " + std::to_string(size_2) +
453  ") must be the same size if set.");
454  }
455 }
456 
457 template <typename C>
458 template <typename T>
459 bool
461  const std::string & param_name) const
462 {
463  assertParamDefined<T>(param_name);
464  mooseAssert(other_param.have_parameter<T>(param_name),
465  "This should have been a parameter from the parameters being compared");
466  bool consistent = true;
467  if (forwardParameters().isParamValid(param_name) && other_param.isParamValid(param_name))
468  {
469  if constexpr (std::is_same_v<MooseEnum, T>)
470  {
471  if (!forwardGetParam<T>(param_name).compareCurrent(other_param.get<T>(param_name)))
472  consistent = false;
473  }
474  else if (forwardGetParam<T>(param_name) != other_param.get<T>(param_name))
475  consistent = false;
476  }
477  return consistent;
478 }
479 
480 template <typename C>
481 template <typename T>
482 void
484  const std::string & block_param_name, const std::vector<std::string> & parameter_names) const
485 {
486  const std::vector<std::vector<SubdomainName>> & block_names =
487  forwardGetParam<std::vector<std::vector<SubdomainName>>>(block_param_name);
488 
489  if (block_names.size())
490  {
491  // We only check block-restrictions if the customer class is not restricted to `ANY_BLOCK_ID`.
492  // If the users define blocks that are not on the mesh, they will receive errors from the
493  // objects created by the customer class
494  const auto & object_blocks = forwardBlocks();
495  if (std::find(object_blocks.begin(), object_blocks.end(), "ANY_BLOCK_ID") ==
496  object_blocks.end())
497  for (const auto & block_group : block_names)
498  for (const auto & block : block_group)
499  if (std::find(object_blocks.begin(), object_blocks.end(), block) == object_blocks.end())
500  forwardParamError(block_param_name,
501  "Block '" + block + "' is not present in the block restriction of " +
502  forwardName() +
503  "!\nBlock restriction: " + Moose::stringify(object_blocks));
504 
505  for (const auto & param_name : parameter_names)
506  {
507  const std::vector<T> & param_vector = forwardGetParam<std::vector<T>>(param_name);
508  if (block_names.size() != param_vector.size())
509  forwardParamError(param_name,
510  "The number of entries in '" + param_name + "' (" +
511  std::to_string(param_vector.size()) +
512  ") is not the same as the number of blocks"
513  " (" +
514  std::to_string(block_names.size()) + ") in '" + block_param_name +
515  "'!");
516  }
517  }
518  else
519  {
520  unsigned int previous_size = 0;
521  for (const auto param_i : index_range(parameter_names))
522  {
523  const std::vector<T> & param_vector =
524  forwardGetParam<std::vector<T>>(parameter_names[param_i]);
525  if (param_i == 0)
526  {
527  if (param_vector.size() > 1)
528  forwardParamError(parameter_names[param_i],
529  "The user should only use one or zero entries in " +
530  parameter_names[param_i] + " if " + block_param_name +
531  " not defined!");
532  previous_size = param_vector.size();
533  }
534  else
535  {
536  if (previous_size != param_vector.size())
537  forwardParamError(parameter_names[param_i],
538  "The number of entries in '" + parameter_names[param_i] +
539  "' is not the same as the number of entries in '" +
540  parameter_names[param_i - 1] + "'!");
541  }
542  }
543  }
544 }
545 
546 template <typename C>
547 template <typename T>
548 void
550  const std::string & param_name) const
551 {
552  const bool consistent = parameterConsistent<T>(other_param, param_name);
553  if (!consistent)
554  forwardMooseWarning("Parameter " + param_name + " is inconsistent between Physics \"" +
555  forwardName() + "\" of type \"" + forwardType() +
556  "\" and the parameter set for \"" +
557  other_param.get<std::string>("_action_name") + "\" of type \"" +
558  other_param.get<std::string>("action_type") + "\"");
559 }
560 
561 template <typename C>
562 void
564  const std::string & param1,
565  const std::string & value_not_set,
566  const std::vector<std::string> & dependent_params) const
567 {
568  for (const auto & dependent_param : dependent_params)
569  if (forwardIsParamSetByUser(dependent_param))
570  forwardParamError(dependent_param,
571  "Parameter '" + dependent_param +
572  "' should not be set by the user if parameter '" + param1 +
573  "' has not been set to '" + value_not_set + "'");
574 }
575 
576 template <typename C>
577 void
579  const std::string & param1,
580  const std::string & value_set,
581  const std::vector<std::string> & dependent_params) const
582 {
583  for (const auto & dependent_param : dependent_params)
584  if (forwardIsParamSetByUser(dependent_param))
585  forwardParamError(dependent_param,
586  "Parameter '" + dependent_param +
587  "' should not be set by the user if parameter '" + param1 +
588  "' has been set to '" + value_set + "'");
589 }
590 
591 template <typename C>
592 void
594  const std::string & param2) const
595 {
596  if ((forwardIsParamValid(param1) + forwardIsParamValid(param2)) % 2 != 0)
597  forwardParamError(param1,
598  "Parameters '" + param1 + "' and '" + param2 +
599  "' must be either both set or both not set.");
600 }
601 
602 template <typename C>
603 void
605  const std::string & param1, const std::string & param2) const
606 {
607  mooseAssert(forwardParameters().template have_parameter<bool>(param1),
608  "Cannot check if parameter " + param1 +
609  " is true if it's not a bool parameter of this object");
610  if (!forwardGetParam<bool>(param1) && forwardIsParamSetByUser(param2))
611  forwardParamError(param2,
612  "Parameter '" + param1 + "' cannot be set to false if parameter '" + param2 +
613  "' is set by the user");
614 }
615 
616 template <typename C>
617 void
619  const std::string & param1, const std::string & param2) const
620 {
621  if (!forwardIsParamSetByUser(param1) && forwardIsParamSetByUser(param2))
622  forwardParamError(param2,
623  "Parameter '" + param2 + "' should not be set if parameter '" + param1 +
624  "' is not specified.");
625 }
626 
627 template <typename C>
628 void
630  const std::string & param2) const
631 {
632  if (forwardIsParamSetByUser(param1) && forwardIsParamSetByUser(param2))
633  forwardParamError(param2,
634  "Parameter '" + param2 + "' should not be specified if parameter '" + param1 +
635  "' is specified.");
636 }
const std::vector< SubdomainName > & forwardBlocks() const
Get the blocks for the class using this utility.
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 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...
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.
void assertParamDefined(const std::string &param) const
Check in debug mode that this parameter has been added to the validParams.
void forwardParamError(Args &&... args) const
Forwards error to the class using this utility to get better error messages.
void forwardMooseWarning(Args &&... args) const
Forwards warning 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.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParametersChecksUtils(const C *customer_class)
void checkParamsBothSetOrNotSet(const std::string &param1, const std::string &param2) const
Check that two parameters are either both set or both not set.
virtual const std::string & forwardName() const
Get the name of the class using this utility.
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.
Utility class to help check parameters.
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 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 checkVectorParamsSameLength(const std::string &param1, const std::string &param2) const
Check that the two vector parameters are of the same length.
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 forwardIsParamValid(const std::string &param_name) const
Forwards parameter check to the class using this utility.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
T forwardGetParam(const std::string &param_name) const
Forwards parameter check to the class using this utility.
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.
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 InputParameters & forwardParameters() const
Forwards obtaining parameters to the class using this utility.
void checkVectorParamNotEmpty(const std::string &param1) const
Check that the user did not pass an empty vector.
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
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...
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
bool parameterConsistent(const InputParameters &other_param, const std::string &param_name) const
Return whether two parameters are consistent.
const std::string & forwardType() const
Get the type of the class using this utility.
void forwardMooseError(Args &&... args) const
Forwards error to the class using this utility to get better error messages.
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 warnInconsistent(const InputParameters &parameters, const std::string &param_name) const
Emits a warning if two parameters are not equal to each other.
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 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.
auto index_range(const T &sizable)
std::string prettyCppType(const std::string &cpp_type)
Definition: MooseUtils.C:1246
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...
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.