https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMDomainSubMesh.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 MOOSE_MFEM_ENABLED
11
12#include "MFEMDomainSubMesh.h"
13#include "MFEMProblem.h"
14
16
19{
22 params.addClassDescription("Class to construct an MFEMSubMesh formed from the subspace of the "
23 "parent mesh restricted to the set of user-specified subdomains.");
24 params.addParam<BoundaryName>("submesh_boundary", "Name to assign submesh boundary.");
25 return params;
26}
27
29 : MFEMSubMesh(parameters),
30 MFEMBlockRestrictable(parameters, getMFEMProblem().mesh().getMFEMParMesh())
31{
32}
33
34void
36{
37 _submesh = std::make_shared<mfem::ParSubMesh>(
38 mfem::ParSubMesh::CreateFromDomain(getMesh(), getSubdomainAttributes()));
39 _submesh->attribute_sets.attr_sets = getMesh().attribute_sets.attr_sets;
40 _submesh->bdr_attribute_sets.attr_sets = getMesh().bdr_attribute_sets.attr_sets;
41
42 if (isParamSetByUser("submesh_boundary"))
43 _submesh->bdr_attribute_sets.SetAttributeSet(
44 getParam<BoundaryName>("submesh_boundary"),
45 mfem::Array<int>({getMesh().bdr_attributes.Max() + 1}));
46}
47
48#endif
registerMooseObject("MooseApp", MFEMDomainSubMesh)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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 addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Base class for construction of an object that is restricted to a subset of subdomains of the problem ...
const mfem::Array< int > & getSubdomainAttributes()
static InputParameters validParams()
const mfem::ParMesh & getMesh() const
Constructs and stores an mfem::ParSubMesh object as as a restriction of the parent mesh to the set of...
virtual void buildSubMesh() override
Constructs the submesh.
static InputParameters validParams()
MFEMDomainSubMesh(const InputParameters &parameters)
Base class for construction of a mfem::ParSubMesh object.
Definition MFEMSubMesh.h:21
std::shared_ptr< mfem::ParSubMesh > _submesh
Stores the constructed submesh.
Definition MFEMSubMesh.h:37
static InputParameters validParams()
Definition MFEMSubMesh.C:16
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
Definition MooseBase.h:205
MeshBase & mesh