1 #ifndef ERF_INPUT_SPONGE_DATA_H_
2 #define ERF_INPUT_SPONGE_DATA_H_
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_Print.H>
10 #include <AMReX_Geometry.H>
27 amrex::ParmParse
pp(
"erf");
37 const amrex::Vector<amrex::Real>& zlevels_stag)
40 const int khi = geom.Domain().bigEnd()[AMREX_SPACEDIM-1];
41 const int Nz = geom.Domain().size()[AMREX_SPACEDIM-1];
51 amrex::Print() <<
"input_sponge file location : " <<
input_sponge_file << std::endl;
53 if(!input_sponge_reader.is_open()) {
54 amrex::Error(
"Error opening the input_sponge file.\n");
58 amrex::Print() <<
"Successfully opened the input_sponge file. Now reading... " << std::endl;
63 amrex::Vector<amrex::Real> z_inp_sponge_tmp, U_inp_sponge_tmp, V_inp_sponge_tmp;
66 z_inp_sponge_tmp.push_back(zbot);
67 U_inp_sponge_tmp.push_back(0);
68 V_inp_sponge_tmp.push_back(0);
72 while(std::getline(input_sponge_reader, line)) {
73 std::istringstream iss_z(line);
76 U_inp_sponge_tmp[0] =
U;
77 V_inp_sponge_tmp[0] =
V;
80 z_inp_sponge_tmp.push_back(
z);
81 U_inp_sponge_tmp.push_back(
U);
82 V_inp_sponge_tmp.push_back(
V);
89 const int Ninp = z_inp_sponge_tmp.size();
93 for (
int k=0; k < Nz; ++k) {
103 amrex::Print() <<
"Successfully read the input_sponge file..." << std::endl;
104 input_sponge_reader.close();
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
const Real ztop
Definition: ERF_InitCustomPertVels_ParticleTests.H:4
const int khi
Definition: ERF_InitCustomPert_Bubble.H:21
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
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: ERF_Interpolation_1D.H:14
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ U
Definition: ERF_IndexDefines.H:123
@ V
Definition: ERF_IndexDefines.H:124