https://mooseframework.inl.gov
MFEMParaViewDataCollection.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 #ifdef MFEM_ENABLED
11 
13 
15 
18 {
20  params.addClassDescription("Output for controlling export to an mfem::ParaViewDataCollection.");
21  params.addParam<unsigned int>("refinements",
22  0,
23  "Number of uniform refinements for oversampling "
24  "(refinement levels beyond any uniform "
25  "refinements)");
26  params.addParam<bool>("high_order_output",
27  false,
28  "Sets whether or not to output the data as "
29  "high-order elements (false by default)."
30  "Reading high-order data requires ParaView"
31  "5.5 or later.");
32 
33  MooseEnum vtk_format("ASCII BINARY BINARY32", "BINARY", true);
34  params.addParam<MooseEnum>(
35  "vtk_format",
36  vtk_format,
37  "Select VTK data format to use, choosing between BINARY, BINARY32, and ASCII.");
38  return params;
39 }
40 
42  : MFEMDataCollection(parameters),
43  _pv_dc((_file_base + std::string("/Run") + std::to_string(getFileNumber())).c_str(), &_pmesh),
44  _high_order_output(getParam<bool>("high_order_output")),
45  _refinements(getParam<unsigned int>("refinements")),
46  _vtk_format(parameters.get<MooseEnum>("vtk_format").getEnum<mfem::VTKFormat>())
47 {
48  _pv_dc.SetPrecision(9);
49  _pv_dc.SetHighOrderOutput(_high_order_output);
50  _pv_dc.SetLevelsOfDetail(_refinements + 1);
51  _pv_dc.SetDataFormat(_vtk_format);
53 }
54 
55 #endif
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Definition: MooseUtils.h:1155
Class for output information saved in MFEM DataCollections.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
mfem::ParaViewDataCollection _pv_dc
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
static InputParameters validParams()
Class for output information saved in MFEM ParaViewDataCollections.
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...
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...
MFEMParaViewDataCollection(const InputParameters &parameters)
void ErrorVector unsigned int
registerMooseObject("MooseApp", MFEMParaViewDataCollection)