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 MOOSE_MFEM_ENABLED 11 : 12 : #pragma once 13 : 14 : #include "MFEMObject.h" 15 : 16 : /** 17 : * Base class for construction of a mfem::ParSubMesh object. Access using the 18 : * getSubMesh() accessor. 19 : */ 20 : class MFEMSubMesh : public MFEMObject 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : MFEMSubMesh(const InputParameters & parameters); 26 : 27 : /// Returns a shared pointer to the constructed fespace. 28 167 : inline std::shared_ptr<mfem::ParSubMesh> getSubMesh() 29 : { 30 167 : if (!_submesh) 31 167 : buildSubMesh(); 32 167 : return _submesh; 33 : } 34 : 35 : protected: 36 : /// Stores the constructed submesh. 37 : std::shared_ptr<mfem::ParSubMesh> _submesh{nullptr}; 38 : /// Constructs the submesh. 39 : virtual void buildSubMesh() = 0; 40 : }; 41 : 42 : #endif