https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AnalysisStepPeriod Class Reference

A basic control for disabling objects for a portion of the simulation based on the analysis step concept. More...

#include <AnalysisStepPeriod.h>

Inheritance diagram for AnalysisStepPeriod:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 AnalysisStepPeriod (const InputParameters &parameters)
 
virtual void execute () override
 
std::vector< std::string > & getDependencies ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
PerfGraphperfGraph ()
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 Class constructor. More...
 
static MultiMooseEnum getExecuteOptions ()
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

void initialSetup () override
 If enabled, this injects the start/end times into the TimeStepper sync times. More...
 
virtual bool conditionMet (const unsigned int &i) override
 
void setupTimes ()
 
bool hasControllableParameterByName (const std::string &name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
virtual void addUserObjectDependencyHelper (const UserObject &) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
virtual void getAnalysisStepUserObject (const FEProblemBase &fe_problem, const AnalysisStepUserObject *&step_user_object, const std::string &name)
 

Protected Attributes

const AnalysisStepUserObject_step_user_object
 
std::vector< Real_start_time
 
std::vector< Real_end_time
 
const std::vector< std::string > & _enable
 
const std::vector< std::string > & _disable
 
const bool & _reverse_on_false
 
FEProblemBase_fe_problem
 
std::vector< std::string > _depends_on
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
const Parallel::Communicator & _communicator
 

Detailed Description

A basic control for disabling objects for a portion of the simulation based on the analysis step concept.

Definition at line 22 of file AnalysisStepPeriod.h.

Constructor & Destructor Documentation

◆ AnalysisStepPeriod()

AnalysisStepPeriod::AnalysisStepPeriod ( const InputParameters parameters)

Definition at line 35 of file AnalysisStepPeriod.C.

37 {
38 }
TimePeriodBase(const InputParameters &parameters)
const InputParameters & parameters() const

Member Function Documentation

◆ conditionMet()

bool AnalysisStepPeriod::conditionMet ( const unsigned int i)
overrideprotectedvirtual

Implements TimePeriodBase.

Definition at line 71 of file AnalysisStepPeriod.C.

72 {
75 }
bool absoluteFuzzyLessThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
std::vector< Real > _start_time
bool absoluteFuzzyGreaterEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
std::vector< Real > _end_time

◆ getAnalysisStepUserObject()

void AnalysisStepUOInterface::getAnalysisStepUserObject ( const FEProblemBase fe_problem,
const AnalysisStepUserObject *&  step_user_object,
const std::string &  name 
)
protectedvirtualinherited

Definition at line 15 of file AnalysisStepUOInterface.C.

Referenced by AbaqusUExternalDB::initialSetup(), AbaqusUMATStress::initialSetup(), and initialSetup().

18 {
19  std::vector<const UserObject *> uos;
20  fe_problem.theWarehouse().query().condition<AttribSystem>("UserObject").queryIntoUnsorted(uos);
21 
22  std::vector<const AnalysisStepUserObject *> step_uos;
23  for (const auto & uo : uos)
24  {
25  const AnalysisStepUserObject * possible_step_uo =
26  dynamic_cast<const AnalysisStepUserObject *>(uo);
27  if (possible_step_uo)
28  step_uos.push_back(possible_step_uo);
29  }
30 
31  if (step_uos.size() > 1)
32  mooseError("Your input file has multiple AnalysisStepUserObjects. MOOSE currently only support "
33  "one in ",
34  name,
35  ". \n");
36  else if (step_uos.size() == 1)
37  mooseInfo("A AnalysisStepUserObject, has been identified and will be used to drive stepping "
38  "behavior in ",
39  name,
40  ".");
41 
42  step_user_object = step_uos.size() == 1 ? step_uos[0] : nullptr;
43 }
void mooseError(Args &&... args)
void mooseInfo(Args &&... args)
TheWarehouse & theWarehouse() const
const std::string name
Definition: Setup.h:20
Query query()
User object that provides analysis steps given user input.

◆ initialSetup()

void AnalysisStepPeriod::initialSetup ( )
overrideprotectedvirtual

If enabled, this injects the start/end times into the TimeStepper sync times.

Reimplemented from TimePeriodBase.

Definition at line 41 of file AnalysisStepPeriod.C.

42 {
43  // Let's automatically detect uos and identify the one we are interested in.
44  // If there is more than one, we assume something is off and error out.
45  if (!isParamSetByUser("step_user_object"))
47  else
48  _step_user_object = &getUserObject<AnalysisStepUserObject>("analysis_step_user_object");
49 
50  _start_time.resize(1);
51  _end_time.resize(1);
52 
53  // Set start time
54  _start_time[0] = _step_user_object->getStartTime(getParam<unsigned int>("step_number"));
55 
56  // Set end time
57  _end_time[0] = _step_user_object->getEndTime(getParam<unsigned int>("step_number"));
58 
59  // Call base method to populate control times.
61 
62  if (getParam<bool>("set_sync_times"))
63  {
64  std::set<Real> & sync_times = _app.getOutputWarehouse().getSyncTimes();
65  sync_times.insert(_start_time.begin(), _start_time.end());
66  sync_times.insert(_end_time.begin(), _end_time.end());
67  }
68 }
Real getEndTime(const unsigned int &step) const
virtual const std::string & name() const
Real getStartTime(const unsigned int &step) const
FEProblemBase & _fe_problem
virtual void getAnalysisStepUserObject(const FEProblemBase &fe_problem, const AnalysisStepUserObject *&step_user_object, const std::string &name)
std::vector< Real > _start_time
bool isParamSetByUser(const std::string &nm) const
MooseApp & _app
const AnalysisStepUserObject * _step_user_object
std::set< Real > & getSyncTimes()
OutputWarehouse & getOutputWarehouse()
std::vector< Real > _end_time

◆ validParams()

InputParameters AnalysisStepPeriod::validParams ( )
static

Class constructor.

Parameters
parametersInput parameters for this Control object

Definition at line 20 of file AnalysisStepPeriod.C.

21 {
23  params.addClassDescription(
24  "Control the enabled/disabled state of objects with user-provided analysis steps.");
25  params.addParam<bool>(
26  "set_sync_times", true, "Set the start and end time as execute sync times.");
27  params.addParam<UserObjectName>(
28  "analysis_step_user_object",
29  "The AnalysisStepUserObject that provides times from analysis steps.");
30  params.addRequiredParam<unsigned int>("step_number",
31  "Step number on which this control object applies.");
32  return params;
33 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _step_user_object

const AnalysisStepUserObject* AnalysisStepPeriod::_step_user_object
protected

Definition at line 41 of file AnalysisStepPeriod.h.

Referenced by initialSetup().


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