Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 747 of file ParameterStudyAction.C.

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

Member Function Documentation

◆ areControllable()

bool AreParametersControllableWalker::areControllable ( ) const

Definition at line 782 of file ParameterStudyAction.C.

783 {
784  for (const auto & ic : _is_controllable)
785  if (!ic)
786  return false;
787  return true;
788 }

◆ walk()

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

Definition at line 760 of file ParameterStudyAction.C.

763 {
764  for (const auto & i : index_range(_pars))
765  {
766  const std::string obj = _pars[i].first;
767  const std::string par = _pars[i].second;
768  if (obj == fullpath)
769  {
770  const auto typeit = n->find("type");
771  if (typeit && typeit != n && typeit->type() == hit::NodeType::Field)
772  {
773  const std::string obj_type = n->param<std::string>("type");
774  const auto params = _app.getFactory().getValidParams(obj_type);
775  _is_controllable[i] = params.isControllable(par);
776  }
777  }
778  }
779 }
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: