forked from aurora-multiphysics/platypus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aurora-multiphysics#65 from aurora-multiphysics/al…
…exanderianblair/h1-integrators Extend range of integrators and preconditioner types for use with H1 conforming FEs
- Loading branch information
Showing
13 changed files
with
74,065 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
framework/include/mfem/bcs/MFEMScalarBoundaryIntegratedBC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
#include "MFEMIntegratedBC.h" | ||
|
||
class MFEMScalarBoundaryIntegratedBC : public MFEMIntegratedBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MFEMScalarBoundaryIntegratedBC(const InputParameters & parameters); | ||
|
||
// Create a new MFEM integrator to apply to the RHS of the weak form. Ownership managed by the | ||
// caller. | ||
virtual mfem::LinearFormIntegrator * createLinearFormIntegrator(); | ||
|
||
// Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller. | ||
virtual mfem::BilinearFormIntegrator * createBilinearFormIntegrator(); | ||
|
||
protected: | ||
std::string _coef_name; | ||
mfem::Coefficient & _coef; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
#include "MFEMKernel.h" | ||
|
||
/* | ||
(\\vec f, \\vec u') | ||
*/ | ||
class MFEMVectorDomainLFKernel : public MFEMKernel<mfem::LinearFormIntegrator> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MFEMVectorDomainLFKernel(const InputParameters & parameters); | ||
~MFEMVectorDomainLFKernel() override {} | ||
|
||
virtual mfem::LinearFormIntegrator * createIntegrator() override; | ||
|
||
protected: | ||
std::string _vec_coef_name; | ||
mfem::VectorCoefficient & _vec_coef; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "MFEMScalarBoundaryIntegratedBC.h" | ||
|
||
registerMooseObject("PlatypusApp", MFEMScalarBoundaryIntegratedBC); | ||
|
||
InputParameters | ||
MFEMScalarBoundaryIntegratedBC::validParams() | ||
{ | ||
InputParameters params = MFEMIntegratedBC::validParams(); | ||
params.addClassDescription("Adds the domain integrator to an MFEM problem for the linear form " | ||
"$(f, v)_\\Omega$ " | ||
"arising from the weak form of the forcing term $f$."); | ||
params.addRequiredParam<std::string>( | ||
"coefficient", "The scalar MFEM coefficient which will be used in the integrated BC."); | ||
return params; | ||
} | ||
|
||
MFEMScalarBoundaryIntegratedBC::MFEMScalarBoundaryIntegratedBC(const InputParameters & parameters) | ||
: MFEMIntegratedBC(parameters), | ||
_coef_name(getParam<std::string>("coefficient")), | ||
_coef(getMFEMProblem().getProperties().getScalarProperty(_coef_name)) | ||
{ | ||
} | ||
|
||
// Create a new MFEM integrator to apply to the RHS of the weak form. Ownership managed by the | ||
// caller. | ||
mfem::LinearFormIntegrator * | ||
MFEMScalarBoundaryIntegratedBC::createLinearFormIntegrator() | ||
{ | ||
return new mfem::BoundaryLFIntegrator(_coef); | ||
} | ||
|
||
// Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller. | ||
mfem::BilinearFormIntegrator * | ||
MFEMScalarBoundaryIntegratedBC::createBilinearFormIntegrator() | ||
{ | ||
return nullptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "MFEMVectorDomainLFKernel.h" | ||
|
||
registerMooseObject("PlatypusApp", MFEMVectorDomainLFKernel); | ||
|
||
InputParameters | ||
MFEMVectorDomainLFKernel::validParams() | ||
{ | ||
InputParameters params = MFEMKernel::validParams(); | ||
params.addClassDescription("Adds the domain integrator to an MFEM problem for the linear form " | ||
"$(\\vec f, \\vec v)_\\Omega$ " | ||
"arising from the weak form of the forcing term $\\vec f$."); | ||
params.addParam<std::string>("vector_coefficient", "Name of body force density $\\vec f$."); | ||
return params; | ||
} | ||
|
||
MFEMVectorDomainLFKernel::MFEMVectorDomainLFKernel(const InputParameters & parameters) | ||
: MFEMKernel(parameters), | ||
_vec_coef_name(getParam<std::string>("vector_coefficient")), | ||
_vec_coef(getMFEMProblem().getProperties().getVectorProperty(_vec_coef_name)) | ||
{ | ||
} | ||
|
||
mfem::LinearFormIntegrator * | ||
MFEMVectorDomainLFKernel::createIntegrator() | ||
{ | ||
return new mfem::VectorDomainLFIntegrator(_vec_coef); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test/tests/mfem_kernels/gold/OutputData/Gravity/Run0/Cycle000000/data.pvtu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0"?> | ||
<VTKFile type="PUnstructuredGrid" version ="0.1" byte_order="LittleEndian"> | ||
<PUnstructuredGrid GhostLevel="0"> | ||
<PPoints> | ||
<PDataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii"/> | ||
</PPoints> | ||
<PCells> | ||
<PDataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii"/> | ||
<PDataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii"/> | ||
<PDataArray type="UInt8" Name="types" NumberOfComponents="1" format="ascii"/> | ||
</PCells> | ||
<PPointData> | ||
<PDataArray type="Float64" Name="displacement" NumberOfComponents="3" ComponentName0="0" ComponentName1="1" ComponentName2="2" format="ascii" /> | ||
</PPointData> | ||
<PCellData> | ||
<PDataArray type="Int32" Name="attribute" NumberOfComponents="1" format="ascii"/> | ||
</PCellData> | ||
<Piece Source="proc000000.vtu"/> | ||
</PUnstructuredGrid> | ||
</VTKFile> |
Oops, something went wrong.