https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
AreParametersControllableWalker Class Reference

This class is a hit walker used to see if a list of parameters are all controllable. More...

#include <ParameterStudyAction.h>

Inheritance diagram for AreParametersControllableWalker:
[legend]

Public Member Functions

 AreParametersControllableWalker (const std::vector< std::string > &parameters, MooseApp &app)
 
void walk (const std::string &fullpath, const std::string &nodename, hit::Node *n) override
 
bool areControllable () const
 

Private Attributes

MooseApp_app
 
std::vector< bool > _is_controllable
 
std::vector< std::pair< std::string, std::string > > _pars
 

Detailed Description

This class is a hit walker used to see if a list of parameters are all controllable.

Definition at line 189 of file ParameterStudyAction.h.

Constructor & Destructor Documentation

◆ AreParametersControllableWalker()

AreParametersControllableWalker::AreParametersControllableWalker ( const std::vector< std::string > &  parameters,
MooseApp app 
)

Definition at line 744 of file ParameterStudyAction.C.

746  : _app(app), _is_controllable(parameters.size(), false)
747 {
748  // Seperate the object from the parameter into a list of pairs
749  for (const auto & param : parameters)
750  {
751  const auto pos = param.rfind("/");
752  _pars.emplace_back(param.substr(0, pos), param.substr(pos + 1));
753  }
754 }
std::vector< std::pair< std::string, std::string > > _pars

Member Function Documentation

◆ areControllable()

bool AreParametersControllableWalker::areControllable ( ) const

Definition at line 779 of file ParameterStudyAction.C.

Referenced by ParameterStudyAction::inferMultiAppMode().

780 {
781  for (const auto & ic : _is_controllable)
782  if (!ic)
783  return false;
784  return true;
785 }

◆ walk()

void AreParametersControllableWalker::walk ( const std::string &  fullpath,
const std::string &  nodename,
hit::Node *  n 
)
override

Definition at line 757 of file ParameterStudyAction.C.

760 {
761  for (const auto & i : index_range(_pars))
762  {
763  const std::string obj = _pars[i].first;
764  const std::string par = _pars[i].second;
765  if (obj == fullpath)
766  {
767  const auto typeit = n->find("type");
768  if (typeit && typeit != n && typeit->type() == hit::NodeType::Field)
769  {
770  const std::string obj_type = n->param<std::string>("type");
771  const auto params = _app.getFactory().getValidParams(obj_type);
772  _is_controllable[i] = params.isControllable(par);
773  }
774  }
775  }
776 }
InputParameters getValidParams(const std::string &name) const
Factory & getFactory()
std::vector< std::pair< std::string, std::string > > _pars
auto index_range(const T &sizable)

Member Data Documentation

◆ _app

MooseApp& AreParametersControllableWalker::_app
private

Definition at line 198 of file ParameterStudyAction.h.

Referenced by walk().

◆ _is_controllable

std::vector<bool> AreParametersControllableWalker::_is_controllable
private

Definition at line 199 of file ParameterStudyAction.h.

Referenced by areControllable(), and walk().

◆ _pars

std::vector<std::pair<std::string, std::string> > AreParametersControllableWalker::_pars
private

Definition at line 200 of file ParameterStudyAction.h.

Referenced by AreParametersControllableWalker(), and walk().


The documentation for this class was generated from the following files: