Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit e879536

Browse files
committed
Add flux integrated boundary condition
1 parent 58bee89 commit e879536

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
#include "MFEMIntegratedBC.h"
3+
4+
class MFEMScalarFunctorFEFluxIntegratedBC : public MFEMIntegratedBC
5+
{
6+
public:
7+
static InputParameters validParams();
8+
9+
MFEMScalarFunctorFEFluxIntegratedBC(const InputParameters & parameters);
10+
11+
// Create MFEM integrator to apply to the RHS of the weak form. Ownership managed by the caller.
12+
virtual mfem::LinearFormIntegrator * createLFIntegrator();
13+
14+
// Create MFEM integrator to apply to the LHS of the weak form. Ownership managed by the caller.
15+
virtual mfem::BilinearFormIntegrator * createBFIntegrator();
16+
17+
protected:
18+
mfem::Coefficient & _coef;
19+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include "MFEMScalarFunctorFEFluxIntegratedBC.h"
2+
3+
registerMooseObject("PlatypusApp", MFEMScalarFunctorFEFluxIntegratedBC);
4+
5+
InputParameters
6+
MFEMScalarFunctorFEFluxIntegratedBC::validParams()
7+
{
8+
InputParameters params = MFEMIntegratedBC::validParams();
9+
params.addRequiredParam<MFEMScalarCoefficientName>(
10+
"coefficient",
11+
"The coefficient which will be used in the integrated BC. A coefficient can be be any of "
12+
"the following: a variable, an MFEM material property, a function, or a post-processor.");
13+
return params;
14+
}
15+
16+
MFEMScalarFunctorFEFluxIntegratedBC::MFEMScalarFunctorFEFluxIntegratedBC(
17+
const InputParameters & parameters)
18+
: MFEMIntegratedBC(parameters),
19+
_coef(getScalarCoefficient(getParam<MFEMScalarCoefficientName>("coefficient")))
20+
{
21+
}
22+
23+
// Create MFEM integrator to apply to the RHS of the weak form. Ownership managed by the caller.
24+
mfem::LinearFormIntegrator *
25+
MFEMScalarFunctorFEFluxIntegratedBC::createLFIntegrator()
26+
{
27+
return new mfem::VectorFEBoundaryFluxLFIntegrator(_coef);
28+
}
29+
30+
// Create MFEM integrator to apply to the LHS of the weak form. Ownership managed by the caller.
31+
mfem::BilinearFormIntegrator *
32+
MFEMScalarFunctorFEFluxIntegratedBC::createBFIntegrator()
33+
{
34+
return nullptr;
35+
}

0 commit comments

Comments
 (0)