https://mooseframework.inl.gov
THMProblem.C
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 #include "THMProblem.h"
11 #include "AddPostprocessorAction.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", THMProblem);
14 
17 {
19 
20  params.addParam<bool>("2nd_order_mesh", false, "Use 2nd order elements in the mesh");
21 
22  params.addParam<FileName>("initial_from_file",
23  "The name of an exodus file with initial conditions");
24  params.addParam<std::string>(
25  "initial_from_file_timestep",
26  "LATEST",
27  "Gives the timestep (or \"LATEST\") for which to read a solution from a file "
28  "for a given variable. (Default: LATEST)");
29 
30  params.set<bool>("boundary_restricted_elem_integrity_check") = false;
31 
32  params.addClassDescription("Specialization of FEProblem to run with component subsystem");
33 
34  return params;
35 }
36 
38  : FEProblem(parameters), Simulation(*this, parameters)
39 {
40 }
41 
42 void
44 {
47 }
48 
49 void
51 {
54 }
55 
56 bool
57 THMProblem::hasPostprocessor(const std::string & name) const
58 {
60  return true;
61 
62  // Sometimes we want to know if a Postprocessor exists well before Postprocessor objects
63  // are actually constructed (within check() in Components) in order to provide a better
64  // error than MOOSE (which checks for Postprocessor existence well after objects are added).
65  // Therefore, if we can't find that we have a Reporter value that represents the PP,
66  // this method might have been called before the add_postprocessor task that sets up the
67  // Reporter values for the postprocessors. Therefore, let's also see which Postprocessors
68  // are slated to be constructed in the future (via the AddPostprocessorAction actions,
69  // in which the names are the PP names themselves)
70  for (const auto & action : getMooseApp().actionWarehouse().getActions<AddPostprocessorAction>())
71  if (action->name() == name)
72  return true;
73 
74  return false;
75 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
THMProblem(const InputParameters &parameters)
Definition: THMProblem.C:37
Main class for simulation (the driver of the simulation)
Definition: Simulation.h:29
T & set(const std::string &name, bool quiet_mode=false)
virtual bool hasPostprocessor(const std::string &name) const
Check if a postprocessor with a given name exists in the simulation.
Definition: THMProblem.C:57
static InputParameters validParams()
Definition: THMProblem.C:16
virtual const std::string & name() const
MooseApp & getMooseApp() const
virtual void advanceState()
virtual void copySolutionsBackwards()
static InputParameters validParams()
ReporterData _reporter_data
const std::string name
Definition: Setup.h:20
ActionWarehouse & actionWarehouse()
registerMooseObject("ThermalHydraulicsApp", THMProblem)
void addClassDescription(const std::string &doc_string)
bool hasReporterValue(const ReporterName &reporter_name) const
virtual void advanceState() override
Definition: THMProblem.C:43
std::vector< const T *> getActions()
virtual void copySolutionsBackwards() override
Definition: THMProblem.C:50
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
Definition: Simulation.C:1076