Skip to content

Commit

Permalink
Merge branch 'development' into perturbation_box_method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting-Hsuan (Dustin) Ma committed Jul 22, 2024
2 parents e0c24c1 + 34b469b commit d9d7c86
Show file tree
Hide file tree
Showing 17 changed files with 364 additions and 105 deletions.
12 changes: 0 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@
datlog
log.*

# Ignore everything in Build except the cmake script
/Build/*
!/Build/cmake.sh
!/Build/cmake_cuda.sh
!/Build/cmake_hip_crusher.sh
!/Build/cmake_hip.sh
!/Build/cmake_sycl.sh
!/Build/cmake_with_moisture.sh
!/Build/cmake_with_netcdf.sh
!/Build/cmake_with_poisson.sh
!/Build/cmake_with_warm_no_precip.sh

# Temporary files
*/Testing/Temporary
.*.swp
Expand Down
12 changes: 12 additions & 0 deletions Docs/sphinx_doc/BoundaryConditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ xlo.density = 1. sets the inflow density,
xlo.theta = 300. sets the inflow potential temperature,
xlo.scalar = 2. sets the inflow value of the advected scalar

Additionally, one may use an input file to specify the Dirichlet velocities as a function of the
vertical coordinate z. The input file is expected to contain the following components ``{z u v w}``.
For a file named ``inflow_file``, one would use the following inputs:

::

xlo.type = "Inflow"
xlo.dirichlet_file = "inflow_file"
xlo.density = 1.
xlo.theta = 300.
xlo.scalar = 2.

The "slipwall" and "noslipwall" types have options for adiabatic vs Dirichlet boundary conditions.
If a value for theta is given for a face with type "slipwall" or "noslipwall" then the boundary
condition for theta is assumed to be "ext_dir", i.e. theta is specified on the boundary.
Expand Down
16 changes: 8 additions & 8 deletions Source/BoundaryConditions/BoundaryConditions_xvel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
// First do all ext_dir bcs
if (!is_periodic_in_x)
{
Real* xvel_xlo_ptr = m_u_bc_data[0];
Real* xvel_xhi_ptr = m_u_bc_data[3];
Real* xvel_bc_ptr = m_u_bc_data;
Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+2);
Box bx_xlo_face(bx); bx_xlo_face.setSmall(0,dom_lo.x ); bx_xlo_face.setBig(0,dom_lo.x );
Expand All @@ -63,7 +62,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
{
int iflip = dom_lo.x - i;
if (bc_ptr[n].lo(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (xvel_xlo_ptr) ? xvel_xlo_ptr[k] : l_bc_extdir_vals_d[n][0];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][0];
} else if (bc_ptr[n].lo(0) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(dom_lo.x,j,k);
} else if (bc_ptr[n].lo(0) == ERFBCType::open) {
Expand All @@ -80,7 +79,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
bx_xlo_face, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
if (bc_ptr[n].lo(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (xvel_xlo_ptr) ? xvel_xlo_ptr[k] : l_bc_extdir_vals_d[n][0];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][0];
} else if (bc_ptr[n].lo(0) == ERFBCType::neumann_int) {
dest_arr(i,j,k) = (4.0*dest_arr(dom_lo.x+1,j,k) - dest_arr(dom_lo.x+2,j,k))/3.0;
}
Expand All @@ -91,7 +90,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
{
int iflip = 2*(dom_hi.x + 1) - i;
if (bc_ptr[n].hi(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (xvel_xhi_ptr) ? xvel_xhi_ptr[k] : l_bc_extdir_vals_d[n][3];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][3];
} else if (bc_ptr[n].hi(0) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(dom_hi.x+1,j,k);
} else if (bc_ptr[n].hi(0) == ERFBCType::open) {
Expand All @@ -108,7 +107,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
bx_xhi_face, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
if (bc_ptr[n].hi(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (xvel_xhi_ptr) ? xvel_xhi_ptr[k] : l_bc_extdir_vals_d[n][3];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][3];
} else if (bc_ptr[n].hi(0) == ERFBCType::neumann_int) {
dest_arr(i,j,k) = (4.0*dest_arr(dom_hi.x,j,k) - dest_arr(dom_hi.x-1,j,k))/3.0;
}
Expand All @@ -119,13 +118,14 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
if (!is_periodic_in_y)
{
// Populate ghost cells on lo-y and hi-y domain boundaries
Real* xvel_bc_ptr = m_u_bc_data;
Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
ParallelFor(
bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int jflip = dom_lo.y - 1 - j;
if (bc_ptr[n].lo(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][1];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][1];
} else if (bc_ptr[n].lo(1) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(i,dom_lo.y,k);
} else if (bc_ptr[n].lo(1) == ERFBCType::open) {
Expand All @@ -139,7 +139,7 @@ void ERFPhysBCFunct_u::impose_lateral_xvel_bcs (const Array4<Real>& dest_arr,
bx_yhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int jflip = 2*dom_hi.y + 1 - j;
if (bc_ptr[n].hi(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][4];
dest_arr(i,j,k) = (xvel_bc_ptr) ? xvel_bc_ptr[k] : l_bc_extdir_vals_d[n][4];
} else if (bc_ptr[n].hi(1) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(i,dom_hi.y,k);
} else if (bc_ptr[n].hi(1) == ERFBCType::open) {
Expand Down
17 changes: 8 additions & 9 deletions Source/BoundaryConditions/BoundaryConditions_yvel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
if (!is_periodic_in_x)
{
// Populate ghost cells on lo-x and hi-x domain boundaries
Real* yvel_xlo_ptr = m_v_bc_data[0];
Real* yvel_xhi_ptr = m_v_bc_data[3];
Real* yvel_bc_ptr = m_v_bc_data;
Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);
ParallelFor(
bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int iflip = dom_lo.x - 1- i;
if (bc_ptr[n].lo(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (yvel_xlo_ptr) ? yvel_xlo_ptr[k] : l_bc_extdir_vals_d[n][0];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][0];
} else if (bc_ptr[n].lo(0) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(dom_lo.x,j,k);
} else if (bc_ptr[n].lo(0) == ERFBCType::open) {
Expand All @@ -73,7 +72,7 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
bx_xhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int iflip = 2*dom_hi.x + 1 - i;
if (bc_ptr[n].hi(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (yvel_xhi_ptr) ? yvel_xhi_ptr[k] : l_bc_extdir_vals_d[n][3];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][3];
} else if (bc_ptr[n].hi(0) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(dom_hi.x,j,k);
} else if (bc_ptr[n].hi(0) == ERFBCType::open) {
Expand All @@ -90,17 +89,17 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
if (!is_periodic_in_y)
{
// Populate ghost cells on lo-y and hi-y domain boundaries
Real* yvel_bc_ptr = m_v_bc_data;
Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+2);
Box bx_ylo_face(bx); bx_ylo_face.setSmall(1,dom_lo.y ); bx_ylo_face.setBig(1,dom_lo.y );
Box bx_yhi_face(bx); bx_yhi_face.setSmall(1,dom_hi.y+1); bx_yhi_face.setBig(1,dom_hi.y+1);

ParallelFor(
bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
int jflip = dom_lo.y-j;
if (bc_ptr[n].lo(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][1];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][1];
} else if (bc_ptr[n].lo(1) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(i,dom_lo.y,k);
} else if (bc_ptr[n].lo(1) == ERFBCType::open) {
Expand All @@ -117,7 +116,7 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
bx_ylo_face, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
if (bc_ptr[n].lo(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][1];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][1];
} else if (bc_ptr[n].lo(1) == ERFBCType::neumann_int) {
dest_arr(i,j,k) = (4.0*dest_arr(i,dom_lo.y+1,k) - dest_arr(i,dom_lo.y+2,k))/3.0;
}
Expand All @@ -128,7 +127,7 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
{
int jflip = 2*(dom_hi.y + 1) - j;
if (bc_ptr[n].hi(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][4];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][4];
} else if (bc_ptr[n].hi(1) == ERFBCType::foextrap) {
dest_arr(i,j,k) = dest_arr(i,dom_hi.y+1,k);
} else if (bc_ptr[n].hi(1) == ERFBCType::open) {
Expand All @@ -145,7 +144,7 @@ void ERFPhysBCFunct_v::impose_lateral_yvel_bcs (const Array4<Real>& dest_arr,
bx_yhi_face, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
if (bc_ptr[n].hi(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][4];
dest_arr(i,j,k) = (yvel_bc_ptr) ? yvel_bc_ptr[k] : l_bc_extdir_vals_d[n][4];
} else if (bc_ptr[n].hi(1) == ERFBCType::neumann_int) {
dest_arr(i,j,k) = (4.0*dest_arr(i,dom_hi.y,k) - dest_arr(i,dom_hi.y-1,k))/3.0;
}
Expand Down
12 changes: 6 additions & 6 deletions Source/BoundaryConditions/BoundaryConditions_zvel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ void ERFPhysBCFunct_w::impose_lateral_zvel_bcs (const Array4<Real >& dest_a
// First do all ext_dir bcs
if (!is_periodic_in_x)
{
Real* zvel_xlo_ptr = m_w_bc_data[0];
Real* zvel_xhi_ptr = m_w_bc_data[3];
Real* zvel_bc_ptr = m_w_bc_data;
Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);
ParallelFor(
bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int iflip = dom_lo.x - 1 - i;
if (bc_ptr_w[n].lo(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (zvel_xlo_ptr) ? zvel_xlo_ptr[k] : l_bc_extdir_vals_d[n][0];
dest_arr(i,j,k) = (zvel_bc_ptr) ? zvel_bc_ptr[k] : l_bc_extdir_vals_d[n][0];
if (l_use_terrain) {
dest_arr(i,j,k) = WFromOmega(i,j,k,dest_arr(i,j,k),xvel_arr,yvel_arr,z_phys_nd,dxInv);
}
Expand All @@ -85,7 +84,7 @@ void ERFPhysBCFunct_w::impose_lateral_zvel_bcs (const Array4<Real >& dest_a
bx_xhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int iflip = 2*dom_hi.x + 1 - i;
if (bc_ptr_w[n].hi(0) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = (zvel_xhi_ptr) ? zvel_xhi_ptr[k] : l_bc_extdir_vals_d[n][3];
dest_arr(i,j,k) = (zvel_bc_ptr) ? zvel_bc_ptr[k] : l_bc_extdir_vals_d[n][3];
if (l_use_terrain) {
dest_arr(i,j,k) = WFromOmega(i,j,k,dest_arr(i,j,k),xvel_arr,yvel_arr,z_phys_nd,dxInv);
}
Expand All @@ -105,12 +104,13 @@ void ERFPhysBCFunct_w::impose_lateral_zvel_bcs (const Array4<Real >& dest_a
// First do all ext_dir bcs
if (!is_periodic_in_y)
{
Real* zvel_bc_ptr = m_w_bc_data;
Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
ParallelFor(bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int jflip = dom_lo.y - 1 - j;
if (bc_ptr_w[n].lo(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][1];
dest_arr(i,j,k) = (zvel_bc_ptr) ? zvel_bc_ptr[k] : l_bc_extdir_vals_d[n][1];
if (l_use_terrain) {
dest_arr(i,j,k) = WFromOmega(i,j,k,dest_arr(i,j,k),xvel_arr,yvel_arr,z_phys_nd,dxInv);
}
Expand All @@ -127,7 +127,7 @@ void ERFPhysBCFunct_w::impose_lateral_zvel_bcs (const Array4<Real >& dest_a
bx_yhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) {
int jflip = 2*dom_hi.y + 1 - j;
if (bc_ptr_w[n].hi(1) == ERFBCType::ext_dir) {
dest_arr(i,j,k) = l_bc_extdir_vals_d[n][4];
dest_arr(i,j,k) = (zvel_bc_ptr) ? zvel_bc_ptr[k] : l_bc_extdir_vals_d[n][4];
if (l_use_terrain) {
dest_arr(i,j,k) = WFromOmega(i,j,k,dest_arr(i,j,k),xvel_arr,yvel_arr,z_phys_nd,dxInv);
}
Expand Down
60 changes: 20 additions & 40 deletions Source/BoundaryConditions/ERF_PhysBCFunct.H
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,16 @@ public:
amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> bc_neumann_vals,
std::unique_ptr<amrex::MultiFab>& z_phys_nd,
const bool use_real_bcs,
amrex::Vector<amrex::Real*> u_bc_data)
amrex::Real* u_bc_data)
: m_lev(lev), m_geom(geom),
m_domain_bcs_type(domain_bcs_type),
m_domain_bcs_type_d(domain_bcs_type_d),
m_bc_extdir_vals(bc_extdir_vals),
m_bc_neumann_vals(bc_neumann_vals),
m_z_phys_nd(z_phys_nd.get()),
m_use_real_bcs(use_real_bcs)
{
int nval = u_bc_data.size();
m_u_bc_data.resize(nval);
for (int ival(0); ival<nval; ++ival) {
m_u_bc_data[ival] = u_bc_data[ival];
}
}
m_use_real_bcs(use_real_bcs),
m_u_bc_data(u_bc_data)
{ }

~ERFPhysBCFunct_u () {}

Expand Down Expand Up @@ -132,7 +127,7 @@ private:
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> m_bc_neumann_vals;
amrex::MultiFab* m_z_phys_nd;
bool m_use_real_bcs;
amrex::Vector<amrex::Real*> m_u_bc_data;
amrex::Real* m_u_bc_data;
};

class ERFPhysBCFunct_v
Expand All @@ -145,21 +140,16 @@ public:
amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> bc_neumann_vals,
std::unique_ptr<amrex::MultiFab>& z_phys_nd,
const bool use_real_bcs,
amrex::Vector<amrex::Real*> v_bc_data)
amrex::Real* v_bc_data)
: m_lev(lev),
m_geom(geom), m_domain_bcs_type(domain_bcs_type),
m_domain_bcs_type_d(domain_bcs_type_d),
m_bc_extdir_vals(bc_extdir_vals),
m_bc_neumann_vals(bc_neumann_vals),
m_z_phys_nd(z_phys_nd.get()),
m_use_real_bcs(use_real_bcs)
{
int nval = v_bc_data.size();
m_v_bc_data.resize(nval);
for (int ival(0); ival<nval; ++ival) {
m_v_bc_data[ival] = v_bc_data[ival];
}
}
m_use_real_bcs(use_real_bcs),
m_v_bc_data(v_bc_data)
{ }

~ERFPhysBCFunct_v () {}

Expand Down Expand Up @@ -194,7 +184,7 @@ private:
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> m_bc_neumann_vals;
amrex::MultiFab* m_z_phys_nd;
bool m_use_real_bcs;
amrex::Vector<amrex::Real*> m_v_bc_data;
amrex::Real* m_v_bc_data;
};

class ERFPhysBCFunct_w
Expand All @@ -207,22 +197,17 @@ public:
amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> bc_neumann_vals,
const TerrainType& terrain_type, std::unique_ptr<amrex::MultiFab>& z_phys_nd,
const bool use_real_bcs,
amrex::Vector<amrex::Real*> w_bc_data)
amrex::Real* w_bc_data)
: m_lev(lev),
m_geom(geom), m_domain_bcs_type(domain_bcs_type),
m_domain_bcs_type_d(domain_bcs_type_d),
m_bc_extdir_vals(bc_extdir_vals),
m_bc_neumann_vals(bc_neumann_vals),
m_terrain_type(terrain_type),
m_z_phys_nd(z_phys_nd.get()),
m_use_real_bcs(use_real_bcs)
{
int nval = w_bc_data.size();
m_w_bc_data.resize(nval);
for (int ival(0); ival<nval; ++ival) {
m_w_bc_data[ival] = w_bc_data[ival];
}
}
m_use_real_bcs(use_real_bcs),
m_w_bc_data(w_bc_data)
{ }

~ERFPhysBCFunct_w () {}

Expand Down Expand Up @@ -265,7 +250,7 @@ private:
TerrainType m_terrain_type;
amrex::MultiFab* m_z_phys_nd;
bool m_use_real_bcs;
amrex::Vector<amrex::Real*> m_w_bc_data;
amrex::Real* m_w_bc_data;
};

class ERFPhysBCFunct_w_no_terrain
Expand All @@ -278,20 +263,15 @@ public:
amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> bc_extdir_vals,
amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> bc_neumann_vals,
const bool use_real_bcs,
amrex::Vector<amrex::Real*> w_bc_data)
amrex::Real* w_bc_data)
: m_lev(lev),
m_geom(geom), m_domain_bcs_type(domain_bcs_type),
m_domain_bcs_type_d(domain_bcs_type_d),
m_bc_extdir_vals(bc_extdir_vals),
m_bc_neumann_vals(bc_neumann_vals),
m_use_real_bcs(use_real_bcs)
{
int nval = w_bc_data.size();
m_w_bc_data.resize(nval);
for (int ival(0); ival<nval; ++ival) {
m_w_bc_data[ival] = w_bc_data[ival];
}
}
m_use_real_bcs(use_real_bcs),
m_w_bc_data(w_bc_data)
{ }

~ERFPhysBCFunct_w_no_terrain () {}

Expand Down Expand Up @@ -323,7 +303,7 @@ private:
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> m_bc_extdir_vals;
amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NVAR_max> m_bc_neumann_vals;
bool m_use_real_bcs;
amrex::Vector<amrex::Real*> m_w_bc_data;
amrex::Real* m_w_bc_data;
};

#endif
9 changes: 4 additions & 5 deletions Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,12 @@ private:
InputSpongeData input_sponge_data;

// Vector (6 planes) of DeviceVectors (ncell in plane) for Dirichlet BC data
amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> xvel_bc_data;
amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> yvel_bc_data;
amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> zvel_bc_data;
amrex::Gpu::DeviceVector<amrex::Real> xvel_bc_data;
amrex::Gpu::DeviceVector<amrex::Real> yvel_bc_data;
amrex::Gpu::DeviceVector<amrex::Real> zvel_bc_data;

// Function to read and populate above vectors (if input file exists)
void init_Dirichlet_bc_data (amrex::Orientation ori,
const std::string input_file);
void init_Dirichlet_bc_data (const std::string input_file);

// write checkpoint file to disk
void WriteCheckpointFile () const;
Expand Down
Loading

0 comments on commit d9d7c86

Please sign in to comment.