Line data Source code
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 : 12 : #include "MFEMParaViewDataCollection.h" 13 : 14 : registerMooseObject("MooseApp", MFEMParaViewDataCollection); 15 : 16 : InputParameters 17 8886 : MFEMParaViewDataCollection::validParams() 18 : { 19 8886 : InputParameters params = MFEMDataCollection::validParams(); 20 8886 : params.addClassDescription("Output for controlling export to an mfem::ParaViewDataCollection."); 21 26658 : params.addParam<unsigned int>("refinements", 22 17772 : 0, 23 : "Number of uniform refinements for oversampling " 24 : "(refinement levels beyond any uniform " 25 : "refinements)"); 26 26658 : params.addParam<bool>("high_order_output", 27 17772 : 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 8886 : MooseEnum vtk_format("ASCII BINARY BINARY32", "BINARY", true); 34 8886 : params.addParam<MooseEnum>( 35 : "vtk_format", 36 : vtk_format, 37 : "Select VTK data format to use, choosing between BINARY, BINARY32, and ASCII."); 38 17772 : return params; 39 8886 : } 40 : 41 128 : MFEMParaViewDataCollection::MFEMParaViewDataCollection(const InputParameters & parameters) 42 : : MFEMDataCollection(parameters), 43 128 : _pv_dc((_file_base + std::string("/Run") + std::to_string(getFileNumber())).c_str(), &_pmesh), 44 128 : _high_order_output(getParam<bool>("high_order_output")), 45 128 : _refinements(getParam<unsigned int>("refinements")), 46 256 : _vtk_format(parameters.get<MooseEnum>("vtk_format").getEnum<mfem::VTKFormat>()) 47 : { 48 128 : _pv_dc.SetPrecision(9); 49 128 : _pv_dc.SetHighOrderOutput(_high_order_output); 50 128 : _pv_dc.SetLevelsOfDetail(_refinements + 1); 51 128 : _pv_dc.SetDataFormat(_vtk_format); 52 128 : registerFields(); 53 128 : } 54 : 55 : #endif