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 // Forward declerations
16 class OversampleOutput;
17 class MooseMesh;
18 
19 // libMesh forward declarations
20 namespace libMesh
21 {
22 template <typename T>
23 class NumericVector;
24 class MeshFunction;
25 }
26 
27 template <>
29 
43 {
44 public:
46 
47  virtual ~OversampleOutput();
48 
49  virtual void initialSetup() override;
50  virtual void meshChanged() override;
51  virtual void outputStep(const ExecFlagType & type) override;
52 
53 protected:
57  virtual void updateOversample();
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 };
108 
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...
InputParameters validParams< OversampleOutput >()
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.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
bool _oversample
Flag indicating that oversampling is enabled.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual void initialSetup() override
Initialization method.
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:74
Based class for output objects.
virtual ~OversampleOutput()
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
const unsigned int _refinements
The number of oversampling refinements.
std::unique_ptr< MooseMesh > _cloned_mesh_ptr
bool _change_position
Flag for re-positioning.
virtual void outputStep(const ExecFlagType &type) override
A single call to this function should output all the necessary data for a single timestep.