Line data Source code
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 : 15 : InputParameters 16 7808 : THMProblem::validParams() 17 : { 18 7808 : InputParameters params = FEProblem::validParams(); 19 : 20 15616 : params.addParam<bool>("2nd_order_mesh", false, "Use 2nd order elements in the mesh"); 21 : 22 15616 : params.addParam<FileName>("initial_from_file", 23 : "The name of an exodus file with initial conditions"); 24 15616 : 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 7808 : params.set<bool>("boundary_restricted_elem_integrity_check") = false; 31 : 32 7808 : params.addClassDescription("Specialization of FEProblem to run with component subsystem"); 33 : 34 7808 : return params; 35 0 : } 36 : 37 3904 : THMProblem::THMProblem(const InputParameters & parameters) 38 3904 : : FEProblem(parameters), Simulation(*this, parameters) 39 : { 40 3904 : } 41 : 42 : void 43 29020 : THMProblem::advanceState() 44 : { 45 29020 : FEProblem::advanceState(); 46 29020 : Simulation::advanceState(); 47 29020 : } 48 : 49 : void 50 2879 : THMProblem::copySolutionsBackwards() 51 : { 52 2879 : FEProblem::copySolutionsBackwards(); 53 2879 : Simulation::advanceState(); 54 2879 : } 55 : 56 : bool 57 0 : THMProblem::hasPostprocessor(const std::string & name) const 58 : { 59 0 : if (_reporter_data.hasReporterValue(ReporterName(name, "value"))) 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 0 : for (const auto & action : getMooseApp().actionWarehouse().getActions<AddPostprocessorAction>()) 71 0 : if (action->name() == name) 72 : return true; 73 : 74 0 : return false; 75 : }