www.mooseframework.org
OversampleOutput.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #pragma once
11 
12 // MOOSE includes
13 #include "AdvancedOutput.h"
14 
15 class MooseMesh;
16 
17 // libMesh forward declarations
18 namespace libMesh
19 {
20 template <typename T>
21 class NumericVector;
22 class MeshFunction;
23 }
24 
38 {
39 public:
41 
43 
44  virtual ~OversampleOutput();
45 
46  virtual void initialSetup() override;
47  virtual void meshChanged() override;
48  virtual void outputStep(const ExecFlagType & type) override;
49 
50 protected:
54  virtual void updateOversample();
55 
57  virtual void setFileBaseInternal(const std::string & file_base) override;
58 
60  const unsigned int _refinements;
61 
64 
67 
68 private:
75  void initOversample();
76 
82  void cloneMesh();
83 
89  std::vector<std::vector<std::unique_ptr<MeshFunction>>> _mesh_functions;
90 
92  Point _position;
93 
96 
97  std::unique_ptr<EquationSystems> _oversample_es;
98  std::unique_ptr<MooseMesh> _cloned_mesh_ptr;
99 
101  /* Each of the MeshFunctions keeps a reference to this vector, the vector is updated for the
102  * current system
103  * and variable before the MeshFunction is applied. This allows for the same MeshFunction object
104  * to be
105  * re-used, unless the mesh has changed due to adaptivity */
106  std::unique_ptr<NumericVector<Number>> _serialized_solution;
107 };
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.
Based class for providing re-positioning and oversampling support to output objects.
virtual void updateOversample()
Performs the update of the solution vector for the oversample/re-positioned mesh. ...
OversampleOutput(const InputParameters &parameters)
std::vector< std::vector< std::unique_ptr< 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.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::unique_ptr< EquationSystems > _oversample_es
void initOversample()
Setups the output object to produce re-positioned and/or oversampled results.
std::unique_ptr< NumericVector< Number > > _serialized_solution
Oversample solution vector.
virtual void setFileBaseInternal(const std::string &file_base) override
Appends the base class&#39;s file base string.
bool _oversample
Flag indicating that oversampling is enabled.
virtual void initialSetup() override
Call init() method on setup.
void cloneMesh()
Clone mesh in preperation for re-positioning or oversampling.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:51
Based class for output objects.
virtual ~OversampleOutput()
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18
const InputParameters & parameters() const
Get the parameters of the object.
const unsigned int _refinements
The number of oversampling refinements.
std::unique_ptr< MooseMesh > _cloned_mesh_ptr
bool _change_position
Flag for re-positioning.
static InputParameters validParams()
virtual void outputStep(const ExecFlagType &type) override
A single call to this function should output all the necessary data for a single timestep.