Feature/111 inflow outflow bcs
This PR adds inflow and outflow boundary condition integer parameters and overridable type bound procedures in the template model classes for 2D and 3D models.
Resolves #111
Codecov Report
Attention: Patch coverage is 4.19580% with 274 lines in your changes missing coverage. Please review.
:loudspeaker: Thoughts on this report? Let us know!
It would make sense to add some simple tests for each of the new BCs in 2D and 3D to satisfy codecov.
This would likely be under a new PR, but with the variety of BCs available it could be useful to add a dedicated "Boundary Conditions" page under "Mesh Generation" in the docs.
While I agree with this, I've been thinking on this issue of the ever growing number of potential boundary conditions. As I'm writing this, I'm inclined to kill this PR in favor of a different approach here.
What I'd propose is a new module with a class defined for mapping boundary conditions to procedure pointers. This class would be something like
type SELF_BoundaryCondition
procedure(SELF_BCFunction),pointer :: bcfunction
integer :: bcflag_id
character(len=SELF_BCNAME_LENGTH) :: bcflag_name
We could set such a class up as a linked list which could allow for dynamic insertion of boundary conditions on the fly.. Having methods like register_boundary_condition that could add a new procedure pointer with a new flag id and name would be kinda neat. With this approach, the boundary condition loops could be changed to something like
do concurrent(j=1:4,iel=1:this%mesh%nElem)
bcid = this%mesh%sideInfo(5,j,iEl) ! Boundary Condition ID
e2 = this%mesh%sideInfo(3,j,iEl) ! Neighboring Element ID
if(e2 == 0) then
! Get a function pointer for the boundary condition id
bfunc = this%boundaryconditions%GetBCFunc_for_id( bcid )
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points
x = this%geometry%x%boundary(i,j,iEl,1,1:2)
this%solution%extBoundary(i,j,iEl,1:this%nvar) = bcfunc(x,this%t)
endif
enddo