28 const int khi = geom.Domain().bigEnd()[AMREX_SPACEDIM-1];
29 const int Nz = geom.Domain().size()[AMREX_SPACEDIM-1];
30 const amrex::Real dz = geom.CellSize()[AMREX_SPACEDIM-1];
32 const bool use_terrain = (zlevels_stag.size() > 0);
33 const amrex::Real zbot = (use_terrain) ? zlevels_stag[klo] : geom.ProbLo(AMREX_SPACEDIM-1);
34 const amrex::Real ztop = (use_terrain) ? zlevels_stag[khi+1] : geom.ProbHi(AMREX_SPACEDIM-1);
41 amrex::Print() <<
"input_sponge file location : " << input_sponge_file << std::endl;
42 std::ifstream input_sponge_reader(input_sponge_file);
43 if(!input_sponge_reader.is_open()) {
44 amrex::Error(
"Error opening the input_sponge file.\n");
48 amrex::Print() <<
"Successfully opened the input_sponge file. Now reading... " << std::endl;
53 amrex::Vector<amrex::Real> z_inp_sponge_tmp, U_inp_sponge_tmp, V_inp_sponge_tmp;
56 z_inp_sponge_tmp.push_back(zbot);
57 U_inp_sponge_tmp.push_back(0);
58 V_inp_sponge_tmp.push_back(0);
62 while(std::getline(input_sponge_reader, line)) {
63 std::istringstream iss_z(line);
66 U_inp_sponge_tmp[0] =
U;
67 V_inp_sponge_tmp[0] =
V;
69 AMREX_ALWAYS_ASSERT(
z > z_inp_sponge_tmp[z_inp_sponge_tmp.size()-1]);
70 z_inp_sponge_tmp.push_back(
z);
71 U_inp_sponge_tmp.push_back(
U);
72 V_inp_sponge_tmp.push_back(
V);
79 const int Ninp = z_inp_sponge_tmp.size();
83 for (
int k=0; k < Nz; ++k) {
84 z_inp_sponge[k+1] = (use_terrain) ? 0.5 * (zlevels_stag[k] + zlevels_stag[k+1])
85 : zbot + (k + 0.5) * dz;
94 amrex::Print() <<
"Successfully read the input_sponge file..." << std::endl;
95 input_sponge_reader.close();
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real interpolate_1d(const amrex::Real *alpha, const amrex::Real *beta, const amrex::Real alpha_interp, const int alpha_size)
Definition: Interpolation_1D.H:12
@ U
Definition: IndexDefines.H:64
@ V
Definition: IndexDefines.H:65