1#include <AMReX_Vector.H>
2#include <AMReX_BC_TYPES.H>
3#include <AMReX_ParmParse.H>
104 " needs an inflow value: set " +
pp.prefixedName(
value_key));
149 amrex::Abort(
"Chapman BC can only be applied to zeta");
160 amrex::Abort(
"Flather BC can only be applied to ubar or vbar");
179 amrex::Abort(
"Periodic boundary specified in a non-periodic direction");
199 amrex::Abort(
"Wrong BC type for periodic boundary");
206 amrex::Abort(
"This BC type is unknown");
228 std::vector<std::string>
bc_types = {
"null",
"null",
"null",
"null"};
241 bc_types = {
"outflow",
"outflow",
"outflow",
"outflow"};
242 for (
int i=0;
i<4;
i++) {
254 amrex::Abort(
pp.prefixedName(
"type") +
" needs four entries, one per side in the "
255 "order West South East North; got " + std::to_string(
bc_types.size()));
257 for (
int i=0;
i<4;
i++) {
309 pp.contains(
"bc.scalar.type") ||
310 pp.contains(
"bc.u.type") ||
311 pp.contains(
"bc.v.type") ||
312 pp.contains(
"bc.w.type") ||
313 pp.contains(
"bc.ubar.type") ||
314 pp.contains(
"bc.vbar.type") ||
315 pp.contains(
"bc.zeta.type") ||
316 pp.contains(
"bc.tke.type"))) {
317 amrex::Abort(
"boundary_per_variable set to false, but per-variable boundary conditions are specified. Use bc.{x,y}{lo,hi}.type instead");
320 pp.contains(
"bc.xhi.type") ||
321 pp.contains(
"bc.ylo.type") ||
322 pp.contains(
"bc.yhi.type"))) {
323 amrex::Abort(
"boundary_per_variable set to true, but per-side boundary conditions are specified. Use bc.{temp,salt,etc}.type instead");
362 Orientation::Side
side =
ori.faceDir();
364 for (
int i = 0;
i < 2;
i++) {
368 if (
side == Orientation::low) {
380 if (
side == Orientation::low) {
388 if (
side == Orientation::low) {
396 if (
side == Orientation::low) {
404 if (
side == Orientation::low) {
421 if (
side == Orientation::low) {
429 if (
side == Orientation::low) {
437 if (
side == Orientation::low) {
445 if (
side == Orientation::low) {
453 amrex::Abort(
"Velocity boundary condition not validly specified");
458 if (
side == Orientation::low) {
476 Orientation::Side
side =
ori.faceDir();
481 if (
side == Orientation::low) {
489 if (
side == Orientation::low) {
497 if (
side == Orientation::low) {
505 if (
side == Orientation::low) {
513 if (
side == Orientation::low) {
521 if (
side == Orientation::low) {
529 if (
side == Orientation::low) {
537 if (
side == Orientation::low) {
545 if (
side == Orientation::low) {
553 amrex::Abort(
"Scalar/tracer boundary condition not validly specified");
570 Orientation::Side
side =
ori.faceDir();
571 for (
int i = 0;
i < 2;
i++) {
575 if (
side == Orientation::low) {
593 if (
side == Orientation::low) {
603 if (
side == Orientation::low) {
613 if (
side == Orientation::low) {
623 if (
side == Orientation::low) {
644 if (
side == Orientation::low) {
654 if (
side == Orientation::low) {
664 if (
side == Orientation::low) {
685 if (
side == Orientation::low) {
695 if (
side == Orientation::low) {
705 amrex::Abort(
"ubar or vbar boundary condition not validly specified");
721 Orientation::Side
side =
ori.faceDir();
722 for (
int i = 0;
i < 2;
i++) {
726 if (
side == Orientation::low) {
734 if (
side == Orientation::low) {
742 if (
side == Orientation::low) {
750 if (
side == Orientation::low) {
758 if (
side == Orientation::low) {
766 if (
side == Orientation::low) {
774 if (
side == Orientation::low) {
782 if (
side == Orientation::low) {
790 if (
side == Orientation::low) {
798 if (
side == Orientation::low) {
806 amrex::Abort(
"Free surface (zeta) boundary condition not validly specified");
822 Orientation::Side
side =
ori.faceDir();
823 if (
side == Orientation::low) {
840 Orientation::Side
side =
ori.faceDir();
841 if (
side == Orientation::low) {
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
int foextrap_periodic_bc() const noexcept
int ncons
Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
int zvel_bc() const noexcept
void init_bcs()
Read in boundary parameters from input file and set up data structures.
int xvel_bc() const noexcept
amrex::Vector< amrex::BCRec > domain_bcs_type
vector (over BCVars) of BCRecs
bool set_bcs_by_var
whether to set boundary conditions by variable rather than just by side
amrex::Vector< std::string > cons_names
Names of scalars for plotfile output.
int tke_bc() const noexcept
int num_bc_vars() const noexcept
int yvel_bc() const noexcept
int foextrap_bc() const noexcept
int v2d_simple_bc() const noexcept
int zeta_bc() const noexcept
amrex::Vector< amrex::GpuArray< REMORA_BC, AMREX_SPACEDIM *2 > > phys_bc_type
Array holding the "physical" boundary condition types (e.g. "inflow")
amrex::Vector< int > bdy_index
Container to connect boundary data being read in boundary condition containers.
int num_bdy_vars() const noexcept
int u2d_simple_bc() const noexcept
int bdy_zeta() const noexcept
int bdy_vbar() const noexcept
static SolverChoice solverChoice
Container for algorithmic choices.
int bdy_ubar() const noexcept
int ubar_bc() const noexcept
int vbar_bc() const noexcept
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Array of strings describing domain boundary conditions.
amrex::Vector< amrex::GpuArray< bool, AMREX_SPACEDIM *2 > > phys_bc_need_data
These are flags that indicate whether we need to read in boundary data from file.
amrex::Vector< amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > > m_bc_extdir_vals
Array holding the Dirichlet values at walls which need them.
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
GPU vector (over BCVars) of BCRecs.
int NumTypes(int ncons) noexcept
static constexpr int cons_bc
static constexpr int Salt_bc_comp
static constexpr int Temp_bc_comp
int cons(int icomp) noexcept
bool boundary_from_netcdf