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
XFEMCutMeshOutput Class Reference

Outputs the cutting mesh used by XFEM to an Exodus file. More...

#include <XFEMCutMeshOutput.h>

Inheritance diagram for XFEMCutMeshOutput:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 XFEMCutMeshOutput (const InputParameters &parameters)
 
virtual std::string filename () override
 
virtual void output () override
 
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
 
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
 

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
 
virtual void addUserObjectDependencyHelper (const UserObject &) 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 MeshCut2DUserObjectBase_cutter_uo
 The mesh cutting user object. More...
 
std::unique_ptr< libMesh::EquationSystems_es
 The EquationSystems. More...
 
std::unique_ptr< libMesh::ExodusII_IO_exodus_io
 Exodus for outputting points and values. More...
 

Detailed Description

Outputs the cutting mesh used by XFEM to an Exodus file.

The output file contains only the mesh, and no solution results.

Definition at line 25 of file XFEMCutMeshOutput.h.

Constructor & Destructor Documentation

◆ XFEMCutMeshOutput()

XFEMCutMeshOutput::XFEMCutMeshOutput ( const InputParameters parameters)

Definition at line 25 of file XFEMCutMeshOutput.C.

26  : FileOutput(params),
27  UserObjectInterface(this),
28  _cutter_uo(getUserObject<MeshCut2DUserObjectBase>("xfem_cutter_uo"))
29 {
30 }
const MeshCut2DUserObjectBase & _cutter_uo
The mesh cutting user object.
FileOutput(const InputParameters &parameters)
UserObjectInterface(const MooseObject *moose_object)

Member Function Documentation

◆ filename()

std::string XFEMCutMeshOutput::filename ( )
overridevirtual

Reimplemented from FileOutput.

Definition at line 33 of file XFEMCutMeshOutput.C.

Referenced by output().

34 {
35  // Append the .e extension to the base file name
36  std::ostringstream output;
37  output << _file_base << "_XFEMCutMeshOutput.e";
38 
39  // Add the _000x extension to the file
40  if (_file_num > 1)
41  output << "-s" << std::setw(_padding) << std::setprecision(0) << std::setfill('0') << std::right
42  << _file_num;
43 
44  // Return the filename
45  return output.str();
46 }
virtual void output() override
std::string _file_base
unsigned int _padding
unsigned int & _file_num

◆ output()

void XFEMCutMeshOutput::output ( )
overridevirtual

Implements FileOutput.

Definition at line 49 of file XFEMCutMeshOutput.C.

Referenced by filename().

50 {
51  // exodus_num is always one because we are always assuming the mesh changes between outputs
52  int exodus_num = 1;
53  ++_file_num;
54  _es = std::make_unique<EquationSystems>(_cutter_uo.getCutterMesh());
55  _exodus_io = std::make_unique<libMesh::ExodusII_IO>(_es->get_mesh());
56  // Default to non-HDF5 output for wider compatibility
57  _exodus_io->set_hdf5_writing(false);
58  _exodus_io->write_timestep(
59  filename(), *_es, exodus_num, getOutputTime() + _app.getGlobalTimeOffset());
60 
61  // Done with these
62  // We don't necessarily need to create a new mesh every time, but it's easier than
63  // checking if the cutter mesh has changed from last time we built a mesh
64  _es->clear();
65  _es = nullptr;
66 }
std::unique_ptr< libMesh::ExodusII_IO > _exodus_io
Exodus for outputting points and values.
const MeshCut2DUserObjectBase & _cutter_uo
The mesh cutting user object.
std::unique_ptr< libMesh::EquationSystems > _es
The EquationSystems.
virtual std::string filename() override
MooseApp & _app
unsigned int & _file_num
Real getGlobalTimeOffset() const
virtual Real getOutputTime()

◆ validParams()

InputParameters XFEMCutMeshOutput::validParams ( )
static

Definition at line 16 of file XFEMCutMeshOutput.C.

17 {
19  params.addClassDescription("Outputs XFEM MeshCut2DUserObjectBase cutter mesh in Exodus format.");
20  params.addRequiredParam<UserObjectName>("xfem_cutter_uo",
21  "The MeshCut2DUserObject to get cutter mesh from");
22  return params;
23 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _cutter_uo

const MeshCut2DUserObjectBase& XFEMCutMeshOutput::_cutter_uo
private

The mesh cutting user object.

Definition at line 38 of file XFEMCutMeshOutput.h.

Referenced by output().

◆ _es

std::unique_ptr<libMesh::EquationSystems> XFEMCutMeshOutput::_es
private

The EquationSystems.

Definition at line 41 of file XFEMCutMeshOutput.h.

Referenced by output().

◆ _exodus_io

std::unique_ptr<libMesh::ExodusII_IO> XFEMCutMeshOutput::_exodus_io
private

Exodus for outputting points and values.

Definition at line 44 of file XFEMCutMeshOutput.h.

Referenced by output().


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