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

Prints out a user selected variable value in matrix format at a specific plane. More...

#include <QuadSubChannelNormalSliceValues.h>

Inheritance diagram for QuadSubChannelNormalSliceValues:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 QuadSubChannelNormalSliceValues (const InputParameters &params)
 
virtual void output () override
 
virtual std::string filename ()
 
void setFileBase (const std::string &file_base)
 
void setFileNumber (unsigned int num)
 
unsigned int getFileNumber ()
 
virtual Real time () override
 
virtual Real timeOld ()
 
virtual Real dt ()
 
virtual Real dtOld ()
 
virtual int timeStep ()
 
const unsigned intinterval () const
 
const MultiMooseEnumexecuteOn () const
 
bool isAdvanced ()
 
virtual const OutputOnWarehouseadvancedExecuteOn () const
 
void allowOutput (bool state)
 
virtual void outputStep (const ExecFlagType &type)
 
const std::set< Real > & getSyncTimes ()
 
virtual bool supportsMaterialPropertyOutput () const
 
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
 
virtual void meshChanged ()
 
virtual void initialSetup ()
 
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
 
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
 
PerfGraphperfGraph ()
 
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 ()
 
static ExecFlagEnum getDefaultExecFlagEnum ()
 
static void addDeprecatedInputParameters (InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual bool shouldOutput () override
 
bool checkFilename ()
 
virtual void setFileBaseInternal (const std::string &file_base)
 
bool inNonlinearTimeWindow ()
 
bool inLinearTimeWindow ()
 
virtual Real getOutputTime ()
 
virtual bool onInterval ()
 
void setWallTimeIntervalFromCommandLineParam ()
 
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
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
virtual void addReporterDependencyHelper (const ReporterName &)
 
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
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 

Static Protected Member Functions

static PetscErrorCode petscNonlinearOutput (SNES, PetscInt its, PetscReal fnorm, void *void_ptr)
 
static PetscErrorCode petscLinearOutput (KSP, PetscInt its, PetscReal fnorm, void *void_ptr)
 

Protected Attributes

const QuadSubChannelMesh_mesh
 
Eigen::MatrixXd _exit_value
 matrix that holds the value of the variable the user wants to print More...
 
const VariableName & _variable
 The name of the variable. More...
 
const Real_height
 The axial location where the plane is. More...
 
unsigned int_file_num
 
unsigned int _padding
 
std::vector< std::string > _output_if_base_contains
 
std::string _file_base
 
Real _norm
 
PetscInt _nonlinear_iter
 
PetscInt _linear_iter
 
bool _on_linear_residual
 
bool _on_nonlinear_residual
 
FEProblemBase_problem_ptr
 
bool _transient
 
bool _use_displaced
 
libMesh::EquationSystems_es_ptr
 
MooseMesh_mesh_ptr
 
bool _sequence
 
ExecFlagEnum _execute_on
 
ExecFlagType _current_execute_flag
 
Real_time
 
Real_time_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
unsigned int _num
 
const bool _time_step_interval_set_by_addparam
 
unsigned int _time_step_interval
 
const Real _min_simulation_time_interval
 
const Real _simulation_time_interval
 
Real _wall_time_interval
 
std::set< Real_sync_times
 
const Times *const _sync_times_object
 
Real _start_time
 
Real _end_time
 
int _start_step
 
int _end_step
 
Real _t_tol
 
bool _sync_only
 
bool _allow_output
 
bool _is_advanced
 
OutputOnWarehouse _advanced_execute_on
 
Real_last_output_simulation_time
 
std::chrono::time_point< std::chrono::steady_clock > _last_output_wall_time
 
Real _wall_time_since_last_output
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
const ExecFlagEnum_execute_enum
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
PetscOutput_petsc_output
 
const Parallel::Communicator & _communicator
 

Detailed Description

Prints out a user selected variable value in matrix format at a specific plane.

Definition at line 19 of file QuadSubChannelNormalSliceValues.h.

Constructor & Destructor Documentation

◆ QuadSubChannelNormalSliceValues()

QuadSubChannelNormalSliceValues::QuadSubChannelNormalSliceValues ( const InputParameters params)

Definition at line 31 of file QuadSubChannelNormalSliceValues.C.

33  _mesh(dynamic_cast<QuadSubChannelMesh &>(*_mesh_ptr)),
34  _variable(getParam<VariableName>("variable")),
35  _height(getParam<Real>("height"))
36 {
37  _exit_value.resize(_mesh.getNy(), _mesh.getNx());
38 }
Eigen::MatrixXd _exit_value
matrix that holds the value of the variable the user wants to print
virtual const unsigned int & getNy() const
Number of subchannels in the -y direction.
MooseMesh * _mesh_ptr
const VariableName & _variable
The name of the variable.
const InputParameters & parameters() const
virtual const unsigned int & getNx() const
Number of subchannels in the -x direction.
const Real & _height
The axial location where the plane is.
FileOutput(const InputParameters &parameters)

Member Function Documentation

◆ output()

void QuadSubChannelNormalSliceValues::output ( )
overridevirtual

Implements FileOutput.

Definition at line 41 of file QuadSubChannelNormalSliceValues.C.

42 {
43  auto val_soln = SolutionHandle(_problem_ptr->getVariable(0, _variable));
44  auto nz = _mesh.getNumOfAxialCells();
45  auto z_grid = _mesh.getZGrid();
46  auto n_channels = _mesh.getNumOfChannels();
47  auto total_length =
49 
50  if (_height >= total_length)
51  {
52  for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
53  {
54  auto * node = _mesh.getChannelNode(i_ch, nz);
55  unsigned int i = (i_ch / _mesh.getNx()); // row
56  unsigned int j = i_ch - i * _mesh.getNx(); // column
57  _exit_value(i, j) = val_soln(node);
58  }
59  }
60  else
61  {
62  for (unsigned int iz = 0; iz < nz; iz++)
63  {
64  if (_height >= z_grid[iz] && _height < z_grid[iz + 1])
65  {
66  for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
67  {
68  auto * node_out = _mesh.getChannelNode(i_ch, iz + 1);
69  auto * node_in = _mesh.getChannelNode(i_ch, iz);
70  unsigned int i = (i_ch / _mesh.getNx()); // row
71  unsigned int j = i_ch - i * _mesh.getNx(); // column
72  _exit_value(i, j) = val_soln(node_in) + (val_soln(node_out) - val_soln(node_in)) *
73  (_height - z_grid[iz]) /
74  (z_grid[iz + 1] - z_grid[iz]);
75  }
76  break;
77  }
78  }
79  }
80 
81  std::ofstream myfile;
82  myfile.open(_file_base, std::ofstream::trunc);
83  myfile << std::setprecision(10) << std::fixed << _exit_value << "\n";
84  myfile.close();
85 }
virtual const std::vector< Real > & getZGrid() const
Get axial location of layers.
std::string _file_base
Provide a simple RAII interface for linear lagrange solution variables.
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
virtual const Real & getHeatedLength() const
Return heated length.
FEProblemBase * _problem_ptr
Eigen::MatrixXd _exit_value
matrix that holds the value of the variable the user wants to print
virtual const unsigned int & getNumOfAxialCells() const
Return the number of axial cells.
virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const override
Get the subchannel mesh node for a given channel index and elevation index.
virtual const unsigned int & getNumOfChannels() const override
Return the number of channels per layer.
const VariableName & _variable
The name of the variable.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual const Real & getHeatedLengthExit() const
Return unheated length at exit.
virtual const unsigned int & getNx() const
Number of subchannels in the -x direction.
const Real & _height
The axial location where the plane is.
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.

◆ validParams()

InputParameters QuadSubChannelNormalSliceValues::validParams ( )
static

Definition at line 17 of file QuadSubChannelNormalSliceValues.C.

18 {
20  params.addRequiredParam<VariableName>("variable", "Variable you want the value of");
21  params.addRequiredParam<Real>("height", "Axial location of normal slice [m]");
22  params.addClassDescription("Prints out a user selected value at a user selected axial height in "
23  "a matrix format to be used for post-processing");
24  params.suppressParameter<bool>("append_date");
25  params.suppressParameter<std::string>("append_date_format");
26  params.suppressParameter<unsigned int>("padding");
27  params.suppressParameter<std::vector<std::string>>("output_if_base_contains");
28  return params;
29 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _exit_value

Eigen::MatrixXd QuadSubChannelNormalSliceValues::_exit_value
protected

matrix that holds the value of the variable the user wants to print

Definition at line 28 of file QuadSubChannelNormalSliceValues.h.

Referenced by output(), and QuadSubChannelNormalSliceValues().

◆ _height

const Real& QuadSubChannelNormalSliceValues::_height
protected

The axial location where the plane is.

Definition at line 32 of file QuadSubChannelNormalSliceValues.h.

Referenced by output().

◆ _mesh

const QuadSubChannelMesh& QuadSubChannelNormalSliceValues::_mesh
protected

Definition at line 26 of file QuadSubChannelNormalSliceValues.h.

Referenced by output(), and QuadSubChannelNormalSliceValues().

◆ _variable

const VariableName& QuadSubChannelNormalSliceValues::_variable
protected

The name of the variable.

Definition at line 30 of file QuadSubChannelNormalSliceValues.h.

Referenced by output().


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