16 #include "libmesh/distributed_mesh.h" 17 #include "libmesh/equation_systems.h" 18 #include "libmesh/mesh_function.h" 19 #include "libmesh/explicit_system.h" 29 params.
addParam<
unsigned int>(
"refinements",
31 "Number of uniform refinements for oversampling " 32 "(refinement levels beyond any uniform " 35 "Set a positional offset, this vector will get added to the " 36 "nodal coordinates to move the domain.");
37 params.
addParam<MeshFileName>(
"file",
"The name of the mesh file to read, for oversampling");
42 "Set to true to enable oversampling",
43 "This parameter is no longer active, simply set 'refinements' to " 44 "a value greater than zero to evoke oversampling");
47 "Append '_oversample' to the output file base",
48 "This parameter is no longer operational, to append " 49 "'_oversample' utilize the output block name or 'file_base'");
59 _refinements(getParam<unsigned
int>(
"refinements")),
60 _oversample(_refinements > 0 || isParamValid(
"file")),
61 _change_position(isParamValid(
"position")),
62 _position(_change_position ? getParam<
Point>(
"position") :
Point()),
63 _oversample_mesh_changed(true)
100 TIME_SECTION(
"outputStep", 2,
"Outputting Step");
164 for (
auto & elem : dist_mesh->active_local_element_ptr_range())
169 unsigned int num_systems = source_es.
n_systems();
173 for (
unsigned int sys_num = 0; sys_num < num_systems; sys_num++)
182 unsigned int num_vars = source_sys.
n_vars();
194 for (
unsigned int var_num = 0; var_num < num_vars; var_num++)
199 if (fe_type == second)
222 for (
unsigned int sys_num = 0; sys_num < source_es.
n_systems(); ++sys_num)
236 for (
unsigned int var_num = 0; var_num <
_mesh_functions[sys_num].size(); ++var_num)
253 for (
unsigned int var_num = 0; var_num <
_mesh_functions[sys_num].size(); ++var_num)
254 if (node->n_dofs(sys_num, var_num))
255 dest_sys.
solution->set(node->dof_number(sys_num, var_num, 0),
276 mesh_params.
set<
bool>(
"nemesis") =
false;
289 mooseWarning(
"Recovering or Restarting with Oversampling may not work (especially with " 290 "adapted meshes)!! Refs #2295");
304 if (getParam<bool>(
"append_oversample"))
bool _oversample_mesh_changed
A flag indicating that the mesh has changed and the oversampled mesh needs to be re-initialized.
virtual void meshChanged() override
Called on this object when the mesh changes.
virtual void setFileBaseInternal(const std::string &file_base)
Internal function that sets the file_base.
unsigned int n_systems() const
virtual void updateOversample()
Performs the update of the solution vector for the oversample/re-positioned mesh. ...
const ExecFlagType EXEC_FORCED
void allow_renumbering(bool allow)
OversampleOutput(const InputParameters ¶meters)
virtual bool onInterval()
Returns true if the output interval is satisfied.
void skip_partitioning(bool skip)
std::vector< std::vector< std::unique_ptr< libMesh::MeshFunction > > > _mesh_functions
A vector of pointers to the mesh functions This is only populated when the oversample() function is c...
Point _position
When oversampling, the output is shift by this amount.
const ExecFlagType EXEC_NONE
std::string _file_base
The base filename from the input paramaters.
virtual bool shouldOutput()
Handles logic for determining if a step should be output.
virtual void output()
A single call to this function should output all the necessary data for a single timestep.
const Parallel::Communicator & _communicator
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void add_extra_ghost_elem(Elem *e)
std::unique_ptr< EquationSystems > _oversample_es
const T_sys & get_system(std::string_view name) const
void initOversample()
Setups the output object to produce re-positioned and/or oversampled results.
std::unique_ptr< NumericVector< Number > > _serialized_solution
Oversample solution vector.
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
dof_id_type n_dofs() const
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual void setFileBaseInternal(const std::string &file_base) override
Appends the base class's file base string.
Real & _last_output_simulation_time
last simulation time an output has occured
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
bool _oversample
Flag indicating that oversampling is enabled.
ExecFlagType _current_execute_flag
Current execute on flag.
virtual void initialSetup() override
Call init() method on setup.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
void cloneMesh()
Clone mesh in preperation for re-positioning or oversampling.
virtual libMesh::EquationSystems & es() override
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
std::unique_ptr< NumericVector< Number > > solution
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
bool _allow_output
Flag for disabling output.
const std::string & type() const
Get the type of this class.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
const std::string & variable_name(const unsigned int i) const
MooseApp & _app
The MOOSE application this is associated with.
Based class for output objects.
virtual ~OversampleOutput()
virtual void initialSetup()
Call init() method on setup.
const FEType & variable_type(const unsigned int i) const
Class for containing MooseEnum item information.
virtual std::unique_ptr< MooseMesh > safeClone() const =0
A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer...
libMesh::EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
const MeshBase & get_mesh() const
MooseMesh * _mesh_ptr
A convenience pointer to the current mesh (reference or displaced depending on "use_displaced") ...
const InputParameters & parameters() const
Get the parameters of the object.
const unsigned int _refinements
The number of oversampling refinements.
const std::string & name() const
MeshBase::node_iterator localNodesEnd()
static InputParameters validParams()
unsigned int n_vars() const
MeshBase::node_iterator localNodesBegin()
Calls local_nodes_begin/end() on the underlying libMesh mesh object.
bool isRecovering() const
Whether or not this is a "recover" calculation.
const DofMap & get_dof_map() const
std::unique_ptr< MooseMesh > _cloned_mesh_ptr
bool _change_position
Flag for re-positioning.
static InputParameters validParams()
const ExecFlagType EXEC_FINAL
Real & _time
The current time for output purposes.
void ErrorVector unsigned int
virtual void outputStep(const ExecFlagType &type) override
A single call to this function should output all the necessary data for a single timestep.
const ExecFlagType EXEC_INITIAL