https://mooseframework.inl.gov
MFEMBlockRestrictable.h
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 
12 #pragma once
13 #include "GeneralUserObject.h"
14 #include "libmesh/ignore_warnings.h"
15 #include <mfem.hpp>
16 #include "mfem/miniapps/common/mfem-common.hpp"
17 #include "libmesh/restore_warnings.h"
18 
24 {
25 public:
27 
28  MFEMBlockRestrictable(const InputParameters & parameters, const mfem::ParMesh & mfem_mesh);
29 
30  mfem::Array<int> subdomainsToAttributes(const std::vector<SubdomainName> & subdomain_names);
31  std::vector<std::string> subdomainsToStrings(const std::vector<SubdomainName> & subdomain_names);
32 
34  bool isSubdomainRestricted() { return _subdomain_names.size(); }
35 
36  const mfem::Array<int> & getSubdomainAttributes() { return _subdomain_attributes; }
37  mfem::Array<int> & getSubdomainMarkers() { return _subdomain_markers; }
38  const mfem::ParMesh & getMesh() const { return _mfem_mesh; }
39 
40 protected:
42  const mfem::ParMesh & _mfem_mesh;
44  std::vector<SubdomainName> _subdomain_names;
46  mfem::Array<int> _subdomain_attributes;
48  mfem::Array<int> _subdomain_markers;
49 };
50 
51 #endif
mfem::Array< int > subdomainsToAttributes(const std::vector< SubdomainName > &subdomain_names)
mfem::Array< int > & getSubdomainMarkers()
const mfem::ParMesh & _mfem_mesh
Stores the names of the subdomains.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const mfem::Array< int > & getSubdomainAttributes()
bool isSubdomainRestricted()
Returns a bool indicating if the object is restricted to a subset of subdomains.
std::vector< std::string > subdomainsToStrings(const std::vector< SubdomainName > &subdomain_names)
std::vector< SubdomainName > _subdomain_names
Stores the names of the subdomains.
mfem::Array< int > _subdomain_markers
Boolean array indicating which subdomains are active in this object.
mfem::Array< int > _subdomain_attributes
Array storing subdomain attribute IDs for this object.
static InputParameters validParams()
MFEMBlockRestrictable(const InputParameters &parameters, const mfem::ParMesh &mfem_mesh)
const mfem::ParMesh & getMesh() const
Base class for construction of an object that is restricted to a subset of subdomains of the problem ...