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

Add user defined BC types #2995

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions Docs/sphinx_documentation/source/Basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,11 @@ The basic idea behind physical boundary conditions is as follows:
Reflection from interior cells with sign
changed, :math:`q(-i) = -q(i)`.

- For external Dirichlet boundaries, the user needs to provide a
user_1, user_2 and user_3
"User". It is the user's responsibility to write a routine
to fill ghost cells (more details below).

- For external Dirichlet and user boundaries, the user needs to provide a
callable object like below.

.. highlight:: c++
Expand All @@ -2564,7 +2568,7 @@ The basic idea behind physical boundary conditions is as follows:
const BCRec* bcr, const int bcomp,
const int orig_comp) const
{
// external Dirichlet for cell iv
// external Dirichlet or user BC for cell iv
}
};

Expand Down
5 changes: 2 additions & 3 deletions Docs/sphinx_documentation/source/LinearSolvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ function

::

void setDomainBC (const Array<BCType,AMREX_SPACEDIM>& lobc, // for lower ends
const Array<BCType,AMREX_SPACEDIM>& hibc); // for higher ends
void setDomainBC (const Array<LinOpBCType,AMREX_SPACEDIM>& lobc, // for lower ends
const Array<LinOpBCType,AMREX_SPACEDIM>& hibc); // for higher ends

The supported BC types at the physical domain boundaries are

Expand Down Expand Up @@ -761,4 +761,3 @@ An example (implemented in the ``MultiComponent`` tutorial) might be:
See ``amrex-tutorials/ExampleCodes/LinearSolvers/MultiComponent`` for a complete working example.

.. solver reuse

6 changes: 4 additions & 2 deletions Src/Base/AMReX_BC_TYPES.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ enum mathematicalBndryTypes : int {
foextrap = 2,
ext_dir = 3,
hoextrap = 4,
hoextrapcc = 5
hoextrapcc = 5,
user_1 = 1001,
user_2 = 1002,
user_3 = 1003
};
}

Expand Down Expand Up @@ -102,4 +105,3 @@ enum mathematicalBndryTypes : int {
#endif

#endif

3 changes: 3 additions & 0 deletions Src/Base/AMReX_bc_types_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ module amrex_bc_types_module
integer, parameter, public :: amrex_bc_ext_dir = 3
integer, parameter, public :: amrex_bc_hoextrap = 4
integer, parameter, public :: amrex_bc_hoextrapcc = 5
integer, parameter, public :: amrex_bc_user_1 = 1001
integer, parameter, public :: amrex_bc_user_2 = 1002
integer, parameter, public :: amrex_bc_user_3 = 1003

integer, parameter, public :: amrex_pbc_interior = 0
integer, parameter, public :: amrex_pbc_inflow = 1
Expand Down