-
Notifications
You must be signed in to change notification settings - Fork 7
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 #41 from aurora-multiphysics/k-collie/linear-elastic
Add linear elastic beam test and required functionality
- Loading branch information
Showing
35 changed files
with
74,566 additions
and
79 deletions.
There are no files selected for viewing
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,17 @@ | ||
#pragma once | ||
|
||
#include "Action.h" | ||
#include "MFEMProblem.h" | ||
/** | ||
* This class implements the action ensuring the mesh uses the same FE space as | ||
* the displacement for mesh updates. | ||
*/ | ||
class SetMeshFESpaceAction : public Action | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
SetMeshFESpaceAction(const InputParameters & parameters); | ||
|
||
virtual void act() override; | ||
}; |
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,22 @@ | ||
#pragma once | ||
#include "MFEMIntegratedBC.h" | ||
#include "MFEMVectorFunctionCoefficient.h" | ||
|
||
class MFEMVectorBoundaryIntegratedBC : public MFEMIntegratedBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MFEMVectorBoundaryIntegratedBC(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 _vec_coef_name; | ||
MFEMVectorCoefficient * _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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
#pragma once | ||
#include "MFEMEssentialBC.h" | ||
#include "MFEMVectorFunctionCoefficient.h" | ||
|
||
class MFEMVectorDirichletBC : public MFEMEssentialBC | ||
{ | ||
protected: | ||
MFEMVectorCoefficient * _vec_coef{nullptr}; | ||
enum APPLY_TYPE | ||
{ | ||
STANDARD, | ||
TANGENTIAL, | ||
NORMAL | ||
}; | ||
#include "MFEMVectorDirichletBCBase.h" | ||
|
||
class MFEMVectorDirichletBC : public MFEMVectorDirichletBCBase | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MFEMVectorDirichletBC(const InputParameters & parameters); | ||
|
||
~MFEMVectorDirichletBC() override = default; | ||
void ApplyBC(mfem::GridFunction & gridfunc, mfem::Mesh * mesh_) override; | ||
|
||
APPLY_TYPE _boundary_apply_type; | ||
}; |
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,17 @@ | ||
#pragma once | ||
|
||
#include "MFEMEssentialBC.h" | ||
#include "MFEMVectorFunctionCoefficient.h" | ||
#include "boundary_conditions.h" | ||
|
||
class MFEMVectorDirichletBCBase : public MFEMEssentialBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
~MFEMVectorDirichletBCBase() override = default; | ||
|
||
protected: | ||
MFEMVectorDirichletBCBase(const InputParameters & parameters); | ||
MFEMVectorCoefficient * _vec_coef{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
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,11 @@ | ||
#pragma once | ||
|
||
#include "MFEMVectorDirichletBCBase.h" | ||
|
||
class MFEMVectorTangentialDirichletBC : public MFEMVectorDirichletBCBase | ||
{ | ||
public: | ||
MFEMVectorTangentialDirichletBC(const InputParameters & parameters); | ||
~MFEMVectorTangentialDirichletBC() override = default; | ||
void ApplyBC(mfem::GridFunction & gridfunc, mfem::Mesh * mesh_) override; | ||
}; |
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,26 @@ | ||
#pragma once | ||
#include "MFEMKernel.h" | ||
|
||
/* | ||
(cᵢₖⱼₗ∇uⱼ, ∇vᵢ), | ||
cᵢₖⱼₗ = λ δᵢₖδⱼₗ + μ (δᵢⱼδₖₗ + δᵢₗδⱼₖ), | ||
λ = (Eν)/((1-2ν)(1+ν)), | ||
μ = E/(2(1+ν)), | ||
E is Young's modulus, | ||
ν is Poisson's ratio | ||
*/ | ||
class MFEMLinearElasticityKernel : public MFEMKernel<mfem::BilinearFormIntegrator> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MFEMLinearElasticityKernel(const InputParameters & parameters); | ||
|
||
virtual mfem::BilinearFormIntegrator * createIntegrator() override; | ||
|
||
protected: | ||
std::string _lambda_name; | ||
std::string _mu_name; | ||
mfem::Coefficient & _lambda; | ||
mfem::Coefficient & _mu; | ||
}; |
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
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,36 @@ | ||
#include "SetMeshFESpaceAction.h" | ||
|
||
registerMooseAction("PlatypusApp", SetMeshFESpaceAction, "set_mesh_fe_space"); | ||
|
||
InputParameters | ||
SetMeshFESpaceAction::validParams() | ||
{ | ||
InputParameters params = Action::validParams(); | ||
params.addClassDescription("Set the mesh nodal finite element space to the same as the mesh " | ||
"displacement variable, if one is specified."); | ||
return params; | ||
} | ||
|
||
SetMeshFESpaceAction::SetMeshFESpaceAction(const InputParameters & parameters) : Action(parameters) | ||
{ | ||
} | ||
|
||
void | ||
SetMeshFESpaceAction::act() | ||
{ | ||
auto * mfem_problem = dynamic_cast<MFEMProblem *>(_problem.get()); | ||
|
||
if (!mfem_problem) | ||
{ | ||
return; | ||
} | ||
|
||
mfem::ParMesh & mesh = mfem_problem->mesh().getMFEMParMesh(); | ||
auto const displacement = mfem_problem->getMeshDisplacementGridFunction(); | ||
if (!displacement) | ||
{ | ||
return; | ||
} | ||
|
||
mesh.SetNodalFESpace(displacement.value().get().ParFESpace()); | ||
} |
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,36 @@ | ||
#include "MFEMVectorBoundaryIntegratedBC.h" | ||
|
||
registerMooseObject("PlatypusApp", MFEMVectorBoundaryIntegratedBC); | ||
|
||
InputParameters | ||
MFEMVectorBoundaryIntegratedBC::validParams() | ||
{ | ||
InputParameters params = MFEMIntegratedBC::validParams(); | ||
params.addRequiredParam<std::string>( | ||
"vector_coefficient", "The vector MFEM coefficient which will be used in the integrated BC"); | ||
return params; | ||
} | ||
|
||
// TODO: Currently assumes the vector function coefficient is 3D | ||
MFEMVectorBoundaryIntegratedBC::MFEMVectorBoundaryIntegratedBC(const InputParameters & parameters) | ||
: MFEMIntegratedBC(parameters), | ||
_vec_coef_name(getParam<std::string>("vector_coefficient")), | ||
_vec_coef(const_cast<MFEMVectorCoefficient *>( | ||
&getUserObject<MFEMVectorCoefficient>("vector_coefficient"))) | ||
{ | ||
} | ||
|
||
// Create a new MFEM integrator to apply to the RHS of the weak form. Ownership managed by the | ||
// caller. | ||
mfem::LinearFormIntegrator * | ||
MFEMVectorBoundaryIntegratedBC::createLinearFormIntegrator() | ||
{ | ||
return new mfem::VectorBoundaryLFIntegrator(*_vec_coef->getVectorCoefficient()); | ||
} | ||
|
||
// Create a new MFEM integrator to apply to LHS of the weak form. Ownership managed by the caller. | ||
mfem::BilinearFormIntegrator * | ||
MFEMVectorBoundaryIntegratedBC::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
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,18 @@ | ||
#include "MFEMVectorDirichletBCBase.h" | ||
|
||
InputParameters | ||
MFEMVectorDirichletBCBase::validParams() | ||
{ | ||
InputParameters params = MFEMEssentialBC::validParams(); | ||
params.addRequiredParam<UserObjectName>( | ||
"vector_coefficient", "The vector MFEM coefficient to use in the Dirichlet condition"); | ||
return params; | ||
} | ||
|
||
// TODO: Currently assumes the vector function coefficient is 3D | ||
MFEMVectorDirichletBCBase::MFEMVectorDirichletBCBase(const InputParameters & parameters) | ||
: MFEMEssentialBC(parameters), | ||
_vec_coef(const_cast<MFEMVectorCoefficient *>( | ||
&getUserObject<MFEMVectorCoefficient>("vector_coefficient"))) | ||
{ | ||
} |
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
Oops, something went wrong.