https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GMVOutput.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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// Moose includes
11#include "GMVOutput.h"
12
13#include "libmesh/equation_systems.h"
14#include "libmesh/gmv_io.h"
15
17
20{
21 // Get the base class parameters
23
24 // Advanced file options
25 params.addParam<bool>("binary", true, "Output the file in binary format");
26 params.addParamNamesToGroup("binary", "Advanced");
27
28 // Add description for the GMVOutput class
29 params.addClassDescription("Object for outputting data in the GMV format");
30
31 // Need a layer of geometric ghosting for mesh serialization
32 params.addRelationshipManager("ElementPointNeighborLayers",
34
35 // Return the InputParameters
36 return params;
37}
38
40 : SampledOutput(parameters), _binary(getParam<bool>("binary"))
41{
42}
43
44void
46{
48 out.write_equation_systems(filename(), *_es_ptr);
49 _file_num++;
50}
51
52std::string
54{
55 // Append the padded time step to the file base
56 std::ostringstream output;
57 output << _file_base << "_" << std::setw(_padding) << std::setprecision(0) << std::setfill('0')
58 << std::right << _file_num;
59 return output.str() + ".gmv";
60}
registerMooseObjectAliased("MooseApp", GMVOutput, "GMV")
unsigned int _padding
Number of digits to pad the extensions.
Definition FileOutput.h:83
std::string _file_base
The base filename from the input paramaters.
Definition FileOutput.h:89
unsigned int & _file_num
A file number counter, initialized to 0 (this must be controlled by the child class,...
Definition FileOutput.h:80
Class for output data to the GMVOutputII format.
Definition GMVOutput.h:19
static InputParameters validParams()
Definition GMVOutput.C:19
virtual void output() override
Overload the Output::output method, this is required for GMVOutput output due to the method utilized ...
Definition GMVOutput.C:45
GMVOutput(const InputParameters &parameters)
Class constructor.
Definition GMVOutput.C:39
virtual std::string filename() override
Returns the current filename, this method handles adding the timestep suffix.
Definition GMVOutput.C:53
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addRelationshipManager(const std::string &name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback input_parameter_callback=nullptr)
Tells MOOSE about a RelationshipManager that this object needs.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
libMesh::EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
Definition Output.h:194
Based class for providing re-positioning and oversampling support to output objects.
static InputParameters validParams()
const MeshBase & get_mesh() const