Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to coefficients from boundary conditions #53

Merged
merged 34 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
838e583
Convert BCs no longer to expose coefficients to end-user
cmacmackin Oct 31, 2024
b672f22
Removed references to Platypus coefficient classes
cmacmackin Oct 31, 2024
76a8916
Fixed failing tests to use new BCs
cmacmackin Nov 4, 2024
3d3c02c
Merge branch 'cmacmackin/coefficients' into cmacmackin/bc_coefficients
cmacmackin Nov 4, 2024
471b844
Added function versions of new BCs
cmacmackin Nov 4, 2024
4a49aa6
Merge remote-tracking branch 'origin/main' into cmacmackin/bc_coeffic…
cmacmackin Nov 4, 2024
aecc477
Remove reference to MFEMCoefficient objects from test configs
cmacmackin Nov 4, 2024
5a98865
Stop trying to register actions to add coefficients
cmacmackin Nov 5, 2024
effb403
Fixed error when converting tests to use new BCs
cmacmackin Nov 5, 2024
77b52c9
Added tests for new integrated BCs
cmacmackin Nov 5, 2024
7240023
Use convenience function to build coefficient objects
cmacmackin Nov 5, 2024
df0a6b3
Add tests for Dirichlet boundaries
cmacmackin Nov 6, 2024
a6fb179
Fixed segfaults for vector BC tests
cmacmackin Nov 8, 2024
8175ac8
Add an example test for checking MFEMScalarDirichletBC has set the gr…
alexanderianblair Nov 15, 2024
c18d0b8
Remove duplicated check on the test variable name in MFEMEssentialBCT…
alexanderianblair Nov 15, 2024
29bf89e
Added first attempt to test Vector BCs
Dec 11, 2024
968e28d
Merge remote-tracking branch 'origin/main' into cmacmackin/bc_coeffic…
Dec 11, 2024
7b7ff29
Added docs and a function version of vector normal Dirichlet BC
Dec 11, 2024
b30a213
Fixed compile bug in normal dirichlet BCs
Dec 11, 2024
319c9ae
Rewrote how I check BCs, but still broken for some of them
cmacmackin Dec 13, 2024
b5f9fe3
Fix failing build of test
alexanderianblair Dec 16, 2024
b54c403
Removed coefficient action documentation
cmacmackin Dec 16, 2024
53ef341
Removed Coefficient objects from test
cmacmackin Dec 16, 2024
602d7e0
Fix broken MFEMEssentialBCTests for constant function calls
alexanderianblair Dec 16, 2024
d0a4a87
Fixed up BC for graddiv test and added missing documentation
cmacmackin Dec 16, 2024
39583f8
Merge branch 'alexanderianblair/essential-bc-tests' into cmacmackin/b…
cmacmackin Dec 16, 2024
9071d18
Fix most of the problems with Essential BCs
cmacmackin Dec 16, 2024
72405d2
Still trying to fix graddiv
cmacmackin Dec 16, 2024
2bc5155
Use second-order basis functions for norm and tangent BCs
cmacmackin Dec 16, 2024
810ad57
Removed debugging print statements
cmacmackin Dec 16, 2024
6ef2e25
Update unit/src/MFEMEssentialBCTest.C
cmacmackin Dec 17, 2024
f9ce360
Update doc/content/source/bcs/MFEMScalarFunctionDirichletBC.C
cmacmackin Dec 17, 2024
a5b7c0a
Update doc/content/source/bcs/MFEMVectorBoundaryIntegratedBC.md
cmacmackin Dec 17, 2024
12b9445
Remove duplicated documentation file with incorrect file extension fo…
alexanderianblair Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions doc/content/source/actions/AddCoefficientAction.md

This file was deleted.

17 changes: 0 additions & 17 deletions doc/content/source/actions/AddVectorCoefficientAction.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/content/source/bcs/MFEMScalarDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Overview

Boundary condition for enforcing an essential (Dirichlet) condition on a scalar variable on the
boundary, fixing its values to the input scalar coefficient on the boundary.
boundary, fixing its values to the input on the boundary.

## Example Input File Syntax

Expand Down
19 changes: 19 additions & 0 deletions doc/content/source/bcs/MFEMScalarFunctionDirichletBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# MFEMScalarFunctionDirichletBC

## Summary

!syntax description /BCs/MFEMScalarFunctionDirichletBC

## Overview

Boundary condition for enforcing an essential (Dirichlet) condition on
a scalar variable on the boundary, fixing its values to the input
scalar function on the boundary.

## Example Input File Syntax

!syntax parameters /BCs/MFEMScalarFunctionDirichletBC

!syntax inputs /BCs/MFEMScalarFunctionDirichletBC

!syntax children /BCs/MFEMScalarFunctionDirichletBC
2 changes: 1 addition & 1 deletion doc/content/source/bcs/MFEMVectorBoundaryIntegratedBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Adds the boundary integrator for integrating the linear form
!equation
(\vec f, \vec v)_{\partial\Omega} \,\,\, \forall \vec v \in V

where $v \in \vec H^1$ and $\vec f$ is a vector coefficient of the same dimension.
where $\vec v \in \vec H^1$ and $\vec f$ is a constant vector of the same dimension.

## Example Input File Syntax

Expand Down
2 changes: 1 addition & 1 deletion doc/content/source/bcs/MFEMVectorDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on all components of a
vector $H^1$ conforming variable on the boundary.
vector $H^1$ conforming variable on the boundary. The boundary value is constant in space and time.

## Example Input File Syntax

Expand Down
3 changes: 2 additions & 1 deletion doc/content/source/bcs/MFEMVectorDirichletBCBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Base class for objects applying essential boundary conditions on vector variable

Classes deriving from `MFEMVectorDirichletBCBase` are used for the application of Dirichlet-like BCs that
remove degrees of freedom from vector variables in the problem on the specified boundary. These are commonly used when
strongly constraining the values a solution may take on boundaries.
strongly constraining the values a solution may take on boundaries. The imposed values are uniform in space and constant
in time.
22 changes: 22 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionBoundaryIntegratedBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MFEMVectorFunctionBoundaryIntegratedBC

## Summary

!syntax description /BCs/MFEMVectorFunctionBoundaryIntegratedBC

## Overview

Adds the boundary integrator for integrating the linear form

!equation
(\vec f, \vec v)_{\partial\Omega} \,\,\, \forall \vec v \in V

where $v \in \vec H^1$ and $\vec f$ is a vector function of the same dimension.

## Example Input File Syntax

!syntax parameters /BCs/MFEMVectorFunctionBoundaryIntegratedBC

!syntax inputs /BCs/MFEMVectorFunctionBoundaryIntegratedBC

!syntax children /BCs/MFEMVectorFunctionBoundaryIntegratedBC
20 changes: 20 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionDirichletBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# MFEMVectorFunctionDirichletBC

## Summary

!syntax description /BCs/MFEMVectorFunctionDirichletBC

## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on all components of a
vector $H^1$ conforming variable on the boundary. The boundary value is a function of space and/or time.

## Example Input File Syntax

!listing test/tests/kernels/linearelasticity.i block=BCs

!syntax parameters /BCs/MFEMVectorFunctionDirichletBC

!syntax inputs /BCs/MFEMVectorFunctionDirichletBC

!syntax children /BCs/MFEMVectorFunctionDirichletBC
11 changes: 11 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionDirichletBCBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MFEMVectorFunctionDirichletBCBase

## Summary

Base class for objects applying essential boundary conditions on vector variables in an MFEM FE problem.

## Overview

Classes deriving from `MFEMVectorFunctionDirichletBCBase` are used for the application of Dirichlet-like BCs that
remove degrees of freedom from vector variables in the problem on the specified boundary. These are commonly used when
strongly constraining the values a solution may take on boundaries. The imposed values may vary in space and/or time.
21 changes: 21 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionNormalDirichletBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MFEMVectorFunctionNormalDirichletBC

## Summary

!syntax description /BCs/MFEMVectorFunctionNormalDirichletBC

## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on the normal
components of a $H(\mathrm{div})$ conforming vector FE at a boundary. The imposed value is
a function of space and/or time.

## Example Input File Syntax

!listing test/tests/kernels/graddiv.i block=BCs

!syntax parameters /BCs/MFEMVectorFunctionNormalDirichletBC

!syntax inputs /BCs/MFEMVectorFunctionNormalDirichletBC

!syntax children /BCs/MFEMVectorFunctionNormalDirichletBC
21 changes: 21 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionNormalIntegratedBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MFEMVectorFunctionNormalIntegratedBC

## Summary

!syntax description /BCs/MFEMVectorFunctionNormalIntegratedBC

## Overview

Adds the boundary integrator for integrating the linear form

!equation
(\vec f \cdot \hat n, v)_{\partial\Omega} \,\,\, \forall v \in V

where $v \in H^1$, $\vec f$ is a vector function, and $\hat n$ is the outward facing unit normal
vector on the boundary.

!syntax parameters /BCs/MFEMVectorFunctionNormalIntegratedBC

!syntax inputs /BCs/MFEMVectorFunctionNormalIntegratedBC

!syntax children /BCs/MFEMVectorFunctionNormalIntegratedBC
21 changes: 21 additions & 0 deletions doc/content/source/bcs/MFEMVectorFunctionTangentialDirichletBC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MFEMVectorFunctionTangentialDirichletBC

## Summary

!syntax description /BCs/MFEMVectorFunctionTangentialDirichletBC

## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on the tangential
components of a $H(\mathrm{curl})$ conforming vector FE at a boundary. The boundary value is
a function of space and/or time.

## Example Input File Syntax

!listing test/tests/kernels/curlcurl.i block=BCs

!syntax parameters /BCs/MFEMVectorFunctionTangentialDirichletBC

!syntax inputs /BCs/MFEMVectorFunctionTangentialDirichletBC

!syntax children /BCs/MFEMVectorFunctionTangentialDirichletBC
5 changes: 2 additions & 3 deletions doc/content/source/bcs/MFEMVectorNormalDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on the normal
components of a $H(\mathrm{div})$ conforming vector FE at a boundary.
components of a $H(\mathrm{div})$ conforming vector FE at a boundary. The imposed value is
constant in space and time.

## Example Input File Syntax

!listing test/tests/kernels/graddiv.i block=BCs

!syntax parameters /BCs/MFEMVectorNormalDirichletBC

!syntax inputs /BCs/MFEMVectorNormalDirichletBC
Expand Down
2 changes: 1 addition & 1 deletion doc/content/source/bcs/MFEMVectorNormalIntegratedBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Adds the boundary integrator for integrating the linear form
!equation
(\vec f \cdot \hat n, v)_{\partial\Omega} \,\,\, \forall v \in V

where $v \in H^1$, $\vec f$ is a vector coefficient, and $\hat n$ is the outward facing unit normal
where $v \in H^1$, $\vec f$ is a vector value, and $\hat n$ is the outward facing unit normal
vector on the boundary.

!syntax parameters /BCs/MFEMVectorNormalIntegratedBC
Expand Down
5 changes: 2 additions & 3 deletions doc/content/source/bcs/MFEMVectorTangentialDirichletBC.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
## Overview

Boundary condition for enforcing an essential (Dirichlet) boundary condition on the tangential
components of a $H(\mathrm{curl})$ conforming vector FE at a boundary.
components of a $H(\mathrm{curl})$ conforming vector FE at a boundary. The boundary value is
constant in space and time.

## Example Input File Syntax

!listing test/tests/kernels/curlcurl.i block=BCs

!syntax parameters /BCs/MFEMVectorTangentialDirichletBC

!syntax inputs /BCs/MFEMVectorTangentialDirichletBC
Expand Down
20 changes: 0 additions & 20 deletions include/actions/AddCoefficientAction.h

This file was deleted.

20 changes: 0 additions & 20 deletions include/actions/AddVectorCoefficientAction.h

This file was deleted.

9 changes: 3 additions & 6 deletions include/bcs/MFEMConvectiveHeatFluxBC.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "MFEMIntegratedBC.h"
#include "MFEMCoefficient.h"

/*
(h (T-T_inf), T')
Expand All @@ -20,9 +19,7 @@ class MFEMConvectiveHeatFluxBC : public MFEMIntegratedBC
virtual mfem::BilinearFormIntegrator * createBilinearFormIntegrator();

protected:
std::string _heat_transfer_coef_name;
std::string _T_inf_coef_name;
mfem::Coefficient & _heat_transfer_coef;
mfem::Coefficient & _T_inf_coef;
mfem::ProductCoefficient _external_heat_flux_coef;
std::shared_ptr<mfem::FunctionCoefficient> _heat_transfer_coef;
std::shared_ptr<mfem::Coefficient> _T_inf_coef;
std::shared_ptr<mfem::ProductCoefficient> _external_heat_flux_coef;
};
3 changes: 1 addition & 2 deletions include/bcs/MFEMScalarDirichletBC.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "MFEMEssentialBC.h"
#include "MFEMFunctionCoefficient.h"

class MFEMScalarDirichletBC : public MFEMEssentialBC
{
Expand All @@ -12,5 +11,5 @@ class MFEMScalarDirichletBC : public MFEMEssentialBC
void ApplyBC(mfem::GridFunction & gridfunc, mfem::Mesh * mesh_) override;

protected:
MFEMCoefficient * _coef{nullptr};
std::shared_ptr<mfem::ConstantCoefficient> _coef{nullptr};
};
15 changes: 15 additions & 0 deletions include/bcs/MFEMScalarFunctionDirichletBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once
#include "MFEMEssentialBC.h"

class MFEMScalarFunctionDirichletBC : public MFEMEssentialBC
{
public:
static InputParameters validParams();

MFEMScalarFunctionDirichletBC(const InputParameters & parameters);

void ApplyBC(mfem::GridFunction & gridfunc, mfem::Mesh * mesh_) override;

protected:
std::shared_ptr<mfem::FunctionCoefficient> _coef{nullptr};
};
5 changes: 2 additions & 3 deletions include/bcs/MFEMVectorBoundaryIntegratedBC.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include "MFEMIntegratedBC.h"
#include "MFEMVectorFunctionCoefficient.h"

class MFEMVectorBoundaryIntegratedBC : public MFEMIntegratedBC
{
Expand All @@ -17,6 +16,6 @@ class MFEMVectorBoundaryIntegratedBC : public MFEMIntegratedBC
virtual mfem::BilinearFormIntegrator * createBilinearFormIntegrator();

protected:
std::string _vec_coef_name;
MFEMVectorCoefficient * _vec_coef;
std::vector<Real> _vec_value;
std::shared_ptr<mfem::VectorCoefficient> _vec_coef;
};
4 changes: 2 additions & 2 deletions include/bcs/MFEMVectorDirichletBCBase.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "MFEMEssentialBC.h"
#include "MFEMVectorFunctionCoefficient.h"
#include "boundary_conditions.h"

class MFEMVectorDirichletBCBase : public MFEMEssentialBC
Expand All @@ -13,5 +12,6 @@ class MFEMVectorDirichletBCBase : public MFEMEssentialBC

protected:
MFEMVectorDirichletBCBase(const InputParameters & parameters);
MFEMVectorCoefficient * _vec_coef{nullptr};
std::vector<Real> _vec_value;
std::shared_ptr<mfem::VectorCoefficient> _vec_coef{nullptr};
};
20 changes: 20 additions & 0 deletions include/bcs/MFEMVectorFunctionBoundaryIntegratedBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once
#include "MFEMIntegratedBC.h"

class MFEMVectorFunctionBoundaryIntegratedBC : public MFEMIntegratedBC
{
public:
static InputParameters validParams();

MFEMVectorFunctionBoundaryIntegratedBC(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::shared_ptr<mfem::VectorCoefficient> _vec_coef{nullptr};
};
Loading
Loading