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

Class which is used to output valuable data in binary format from Mapping objects. More...

#include <MappingOutput.h>

Inheritance diagram for MappingOutput:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 MappingOutput (const InputParameters &parameters)
 
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
 
VariableMappingBasegetMapping (const std::string &name) const
 Get the mapping using the parameters of the moose object. More...
 
VariableMappingBasegetMappingByName (const UserObjectName &name) const
 Get the mapping by supplying the name of the object in the warehouse. More...
 

Static Public Member Functions

static InputParameters validParams ()
 
static ExecFlagEnum getDefaultExecFlagEnum ()
 
static void addDeprecatedInputParameters (InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual void output () override
 
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

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
 

Private Attributes

const std::vector< std::string > & _mappings
 List of supplied Mapping objects. More...
 

Detailed Description

Class which is used to output valuable data in binary format from Mapping objects.

Definition at line 19 of file MappingOutput.h.

Constructor & Destructor Documentation

◆ MappingOutput()

MappingOutput::MappingOutput ( const InputParameters parameters)

Definition at line 26 of file MappingOutput.C.

28  MappingInterface(this),
29  _mappings(getParam<std::vector<std::string>>("mappings"))
30 {
31 }
const std::vector< std::string > & _mappings
List of supplied Mapping objects.
Definition: MappingOutput.h:30
const T & getParam(const std::string &name) const
const InputParameters & parameters() const
MappingInterface(const MooseObject *moose_object)
Construct using a moose object (usually the object which inherits from the interface) ...
FileOutput(const InputParameters &parameters)

Member Function Documentation

◆ getMapping()

VariableMappingBase & MappingInterface::getMapping ( const std::string &  name) const
inherited

Get the mapping using the parameters of the moose object.

Parameters
nameThe parameter name

Definition at line 40 of file MappingInterface.C.

Referenced by SingularTripletReporter::initialSetup(), and InverseMapping::initialSetup().

41 {
42  return getMappingByName(_smi_params.get<UserObjectName>(name));
43 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
const std::string name
Definition: Setup.h:20
VariableMappingBase & getMappingByName(const UserObjectName &name) const
Get the mapping by supplying the name of the object in the warehouse.
const InputParameters & _smi_params
Parameters of the object with this interface.

◆ getMappingByName()

VariableMappingBase & MappingInterface::getMappingByName ( const UserObjectName &  name) const
inherited

Get the mapping by supplying the name of the object in the warehouse.

Parameters
nameThe name of the mapping object

Definition at line 26 of file MappingInterface.C.

Referenced by MappingInterface::getMapping(), MappingReporter::initialSetup(), and output().

27 {
28  std::vector<VariableMappingBase *> models;
30  .query()
31  .condition<AttribName>(name)
32  .condition<AttribSystem>("VariableMappingBase")
33  .queryInto(models);
34  if (models.empty())
35  mooseError("Unable to find a Mapping object with the name '" + name + "'");
36  return *(models[0]);
37 }
void mooseError(Args &&... args)
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
TheWarehouse & theWarehouse() const
const std::string name
Definition: Setup.h:20
Query query()

◆ output()

void MappingOutput::output ( )
overrideprotectedvirtual

Implements FileOutput.

Definition at line 34 of file MappingOutput.C.

35 {
36  if (processor_id() == 0)
37  for (const auto & map_name : _mappings)
38  {
39  const VariableMappingBase & map = getMappingByName(map_name);
40  const auto filename =
41  RestartableDataIO::restartableDataFolder(this->filename() + "_" + map_name);
43 
44  RestartableDataWriter writer(_app, meta_data);
45  writer.write(filename);
46  }
47 }
virtual std::string filename()
const std::vector< std::string > & _mappings
List of supplied Mapping objects.
Definition: MappingOutput.h:30
RestartableDataMap & getRestartableDataMap(const RestartableDataMapName &name)
VariableMappingBase & getMappingByName(const UserObjectName &name) const
Get the mapping by supplying the name of the object in the warehouse.
static std::filesystem::path restartableDataFolder(const std::filesystem::path &folder_base)
const std::string & modelMetaDataName() const
Accessor for the name of the model meta data.
MooseApp & _app
This is an abstract base class for objects that provide mapping between a full-order and a latent spa...
processor_id_type processor_id() const

◆ validParams()

InputParameters MappingOutput::validParams ( )
static

Definition at line 17 of file MappingOutput.C.

18 {
20  params.addClassDescription("Output for mapping model data.");
21  params.addRequiredParam<std::vector<std::string>>("mappings",
22  "A list of Mapping objects to output.");
23  return params;
24 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _mappings

const std::vector<std::string>& MappingOutput::_mappings
private

List of supplied Mapping objects.

Definition at line 30 of file MappingOutput.h.

Referenced by output().


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