ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ReadBndryPlanes Class Reference

#include <ERF_ReadBndryPlanes.H>

Collaboration diagram for ReadBndryPlanes:

Public Member Functions

 ReadBndryPlanes (const amrex::Geometry &geom, const amrex::Real &rdOcp_in)
 
void define_level_data (int lev)
 
void read_time_file ()
 
void read_input_files (double time, double dt, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals)
 
void read_file (int idx, amrex::Vector< std::unique_ptr< PlaneVector >> &data_to_fill, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals)
 
amrex::Vector< std::unique_ptr< PlaneVector > > & interp_in_time (const double &time)
 
amrex::Vector< std::unique_ptr< PlaneVector > > & get_tendency (const double &time)
 
double tinterp () const
 
int ingested_velocity () const
 
int ingested_theta () const
 
int ingested_density () const
 
int ingested_scalar () const
 
int ingested_q1 () const
 
int ingested_q2 () const
 
int ingested_KE () const
 

Static Public Member Functions

static int plane_slot (const std::string &var_name)
 

Private Attributes

double m_tn
 The times for which we currently have data. More...
 
double m_tnp1
 
double m_tnp2
 
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_n
 Data at time m_tn. More...
 
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_np1
 Data at time m_tnp1. More...
 
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_np2
 Data at time m_tnp2. More...
 
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_interp
 Data interpolated to the time requested. More...
 
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_tendency
 Tendency between the n and np1 data. More...
 
double m_tinterp {-1.0}
 Time for plane at interpolation. More...
 
amrex::Geometry m_geom
 Geometry at level 0. More...
 
std::string m_filename {""}
 File name for IO. More...
 
std::string m_time_file {""}
 File name for file holding timesteps and times. More...
 
amrex::Vector< double > m_in_times
 The timesteps / times that we read from time.dat. More...
 
amrex::Vector< int > m_in_timesteps
 
amrex::Vector< std::string > m_var_names
 Variables to be read in. More...
 
int m_in_rad = 1
 Controls extents on native bndry output. More...
 
const int m_out_rad = 1
 
const int m_extent_rad = 0
 
bool m_use_real_bcs = false
 Are real BCs being used? More...
 
const amrex::Real m_rdOcp
 R_d/c_p is needed for reading boundary files. More...
 
int is_velocity_read
 
int is_density_read
 
int is_temperature_read
 
int is_theta_read
 
int is_scalar_read
 
int is_q1_read
 
int is_q2_read
 
int is_KE_read
 
int last_file_read
 

Detailed Description

Collection of data structures and operations for reading data

This class contains the inlet data structures and operations to read and interpolate inflow data.

Constructor & Destructor Documentation

◆ ReadBndryPlanes()

ReadBndryPlanes::ReadBndryPlanes ( const amrex::Geometry &  geom,
const amrex::Real &  rdOcp_in 
)
explicit

ReadBndryPlanes class constructor. Handles initialization from inputs file parameters.

Parameters
geomGeometry for the domain
rdOcp_inReal constant for the Rhydberg constant ($R_d$) divided by the specific heat at constant pressure ($c_p$)
222 :
223  m_geom(geom),
224  m_rdOcp(rdOcp_in)
225 {
226  ParmParse pp("erf");
227 
228  // Get the radius inside the domain
229  pp.queryAdd("in_rad",m_in_rad);
230 
231  // Are we using real bcs?
232  pp.queryAdd("use_real_bcs", m_use_real_bcs);
233 
234  last_file_read = -1;
235 
236  m_tinterp = -1.0;
237 
238  // What folder will the time series of planes be read from
239  pp.get("bndry_file", m_filename);
240 
241  is_velocity_read = 0;
242  is_density_read = 0;
244  is_theta_read = 0;
245  is_scalar_read = 0;
246  is_q1_read = 0;
247  is_q2_read = 0;
248  is_KE_read = 0;
249 
250  if (pp.contains("bndry_input_var_names"))
251  {
252  int num_vars = pp.countval("bndry_input_var_names");
253  m_var_names.resize(num_vars);
254  pp.queryarr("bndry_input_var_names",m_var_names,0,num_vars);
255  for (int i = 0; i < m_var_names.size(); i++) {
256  if (m_var_names[i] == "velocity") is_velocity_read = 1;
257  if (m_var_names[i] == "density") is_density_read = 1;
258  if (m_var_names[i] == "temperature") is_temperature_read = 1;
259  if (m_var_names[i] == "theta") is_theta_read = 1;
260  if (m_var_names[i] == "scalar") is_scalar_read = 1;
261  if (m_var_names[i] == "qv") is_q1_read = 1;
262  if (m_var_names[i] == "qc") is_q2_read = 1;
263  if (m_var_names[i] == "ke") is_KE_read = 1;
264  if (plane_slot(m_var_names[i]) < 0) {
265  Abort("erf.bndry_input_var_names: unknown variable \"" + m_var_names[i] +
266  "\"; the names read are velocity, density, temperature, theta, scalar, qv, qc and ke");
267  }
268  }
269  // The passive scalars share one boundary condition, so an ingested scalar
270  // plane fills every one of them; the writer saves only the first.
271  // (if constexpr: with one scalar the body is compiled out, so clang's
272  // -Wunreachable-code does not flag it.)
273  if constexpr (NSCALARS > 1) {
274  if (is_scalar_read) {
275  Print() << "WARNING: erf.bndry_input_var_names reads \"scalar\": the plane of the first "
276  << "passive scalar (rhoadv_0) fills all " << NSCALARS << " passive scalars at the "
277  << "ingested faces, the extra ones (such as dust or smoke) included" << std::endl;
278  }
279  }
280  // Theta is recovered from a temperature plane through the pressure, rho R_d T, so it
281  // needs the density the writer had; a constant face density would bias theta by
282  // (rho/rho_bc)^(R_d/c_p) wherever the two differ
284  Abort("erf.bndry_input_var_names reads temperature but not density: theta cannot be "
285  "recovered from temperature without the density planes. Add density to "
286  "erf.bndry_input_var_names (and to the writer's erf.bndry_output_var_names), "
287  "or write and read theta instead of temperature");
288  }
289  }
290 
291  // time.dat will be in the same folder as the time series of data
292  m_time_file = m_filename + "/time.dat";
293 
294  // each pointer (at at given time) has 6 components, one for each orientation
295  // TODO: we really only need 4 not 6
296  int size = 2*AMREX_SPACEDIM;
297  m_data_n.resize(size);
298  m_data_np1.resize(size);
299  m_data_np2.resize(size);
300  m_data_interp.resize(size);
301  m_data_tendency.resize(size);
302 }
#define NSCALARS
Definition: ERF_IndexDefines.H:34
ParmParse pp("prob")
int is_velocity_read
Definition: ERF_ReadBndryPlanes.H:125
int is_q2_read
Definition: ERF_ReadBndryPlanes.H:131
int is_theta_read
Definition: ERF_ReadBndryPlanes.H:128
bool m_use_real_bcs
Are real BCs being used?
Definition: ERF_ReadBndryPlanes.H:120
std::string m_filename
File name for IO.
Definition: ERF_ReadBndryPlanes.H:102
int is_temperature_read
Definition: ERF_ReadBndryPlanes.H:127
int is_density_read
Definition: ERF_ReadBndryPlanes.H:126
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_np2
Data at time m_tnp2.
Definition: ERF_ReadBndryPlanes.H:87
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_interp
Data interpolated to the time requested.
Definition: ERF_ReadBndryPlanes.H:90
static int plane_slot(const std::string &var_name)
Definition: ERF_ReadBndryPlanes.H:29
int last_file_read
Definition: ERF_ReadBndryPlanes.H:134
int is_KE_read
Definition: ERF_ReadBndryPlanes.H:132
const amrex::Real m_rdOcp
R_d/c_p is needed for reading boundary files.
Definition: ERF_ReadBndryPlanes.H:123
std::string m_time_file
File name for file holding timesteps and times.
Definition: ERF_ReadBndryPlanes.H:105
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_tendency
Tendency between the n and np1 data.
Definition: ERF_ReadBndryPlanes.H:93
amrex::Vector< std::string > m_var_names
Variables to be read in.
Definition: ERF_ReadBndryPlanes.H:112
int is_scalar_read
Definition: ERF_ReadBndryPlanes.H:129
int is_q1_read
Definition: ERF_ReadBndryPlanes.H:130
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_n
Data at time m_tn.
Definition: ERF_ReadBndryPlanes.H:81
amrex::Vector< std::unique_ptr< PlaneVector > > m_data_np1
Data at time m_tnp1.
Definition: ERF_ReadBndryPlanes.H:84
int m_in_rad
Controls extents on native bndry output.
Definition: ERF_ReadBndryPlanes.H:115
amrex::Geometry m_geom
Geometry at level 0.
Definition: ERF_ReadBndryPlanes.H:99
double m_tinterp
Time for plane at interpolation.
Definition: ERF_ReadBndryPlanes.H:96
Here is the call graph for this function:

Member Function Documentation

◆ define_level_data()

void ReadBndryPlanes::define_level_data ( int  lev)

Function in ReadBndryPlanes class for allocating space for the boundary plane data ERF will need.

52 {
53  Print() << "ReadBndryPlanes::define_level_data" << std::endl;
54  // *********************************************************
55  // Allocate space for all of the boundary planes we may need
56  // *********************************************************
57  int ncomp = BCVars::NumTypes;
58  const Box& domain = m_geom.Domain();
59  for (OrientationIter oit; oit != nullptr; ++oit) {
60  auto ori = oit();
61  if (ori.coordDir() < 2) {
62 
63  m_data_n[ori] = std::make_unique<PlaneVector>();
64  m_data_np1[ori] = std::make_unique<PlaneVector>();
65  m_data_np2[ori] = std::make_unique<PlaneVector>();
66  m_data_interp[ori] = std::make_unique<PlaneVector>();
67  m_data_tendency[ori] = std::make_unique<PlaneVector>();
68 
69  const auto& lo = domain.loVect();
70  const auto& hi = domain.hiVect();
71 
72  IntVect plo(lo);
73  IntVect phi(hi);
74  const int normal = ori.coordDir();
75  plo[normal] = ori.isHigh() ? hi[normal] - (m_in_rad - 1) : lo[normal] - m_out_rad;
76  phi[normal] = ori.isHigh() ? hi[normal] + (m_out_rad ) : lo[normal] + (m_in_rad - 1);
77  const Box pbx(plo, phi);
78  m_data_n[ori]->push_back(FArrayBox(pbx, ncomp));
79  m_data_np1[ori]->push_back(FArrayBox(pbx, ncomp));
80  m_data_np2[ori]->push_back(FArrayBox(pbx, ncomp));
81  m_data_interp[ori]->push_back(FArrayBox(pbx, ncomp));
82  m_data_tendency[ori]->push_back(FArrayBox(pbx, ncomp));
83  }
84  }
85 }
GpuArray< Real, AMREX_SPACEDIM > plo
Definition: ERF_ActuatorSpreading.cpp:131
const int m_out_rad
Definition: ERF_ReadBndryPlanes.H:116
@ NumTypes
Definition: ERF_IndexDefines.H:141
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real phi(amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept
Definition: ERF_ImmersedWallCell.H:176

Referenced by read_time_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_tendency()

Vector< std::unique_ptr< PlaneVector > > & ReadBndryPlanes::get_tendency ( const double &  time_in)

Function in ReadBndryPlanes class for interpolating boundary data in time.

Parameters
time_inConstant specifying the time for interpolation
160 {
161  // A restart that lands exactly on a boundary-plane time can request a time a few
162  // ULP outside [m_tn, m_tnp2] because per-level t_new drifts under subcycling.
163  // Tolerate that drift, then clamp into the valid window before interpolating.
164  const double eps = 1.0e-8 * (m_tnp2 - m_tn);
165  AMREX_ALWAYS_ASSERT(m_tn - eps <= time_in && time_in <= m_tnp2 + eps);
166  const double time = std::min(std::max(time_in, m_tn), m_tnp2);
167 
168  if (time < m_tnp1) {
169  Real idt = static_cast<Real>(1.0 / (m_tnp1 - m_tn));
170  for (OrientationIter oit; oit != nullptr; ++oit) {
171  auto ori = oit();
172  if (ori.coordDir() < 2) {
173  const int nlevels = static_cast<int>(m_data_n[ori]->size());
174  for (int lev = 0; lev < nlevels; ++lev) {
175  auto& fabt = (*m_data_tendency[ori])[lev];
176  Box bx = fabt.box();
177  int ncomp = fabt.nComp();
178 
179  const auto& datt = fabt.array();
180  const auto& datn = (*m_data_n[ori])[lev].array();
181  const auto& datnp1 = (*m_data_np1[ori])[lev].array();
182  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
183  {
184  datt(i,j,k,n) = (datnp1(i,j,k,n) - datn(i,j,k,n)) * idt;
185  });
186  }
187  }
188  }
189  } else {
190  Real idt = static_cast<Real>(1.0 / (m_tnp2 - m_tnp1));
191  for (OrientationIter oit; oit != nullptr; ++oit) {
192  auto ori = oit();
193  if (ori.coordDir() < 2) {
194  const int nlevels = static_cast<int>(m_data_n[ori]->size());
195  for (int lev = 0; lev < nlevels; ++lev) {
196  auto& fabt = (*m_data_tendency[ori])[lev];
197  Box bx = fabt.box();
198  int ncomp = fabt.nComp();
199 
200  const auto& datt = fabt.array();
201  const auto& datnp1 = (*m_data_np1[ori])[lev].array();
202  const auto& datnp2 = (*m_data_np2[ori])[lev].array();
203  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
204  {
205  datt(i,j,k,n) = (datnp2(i,j,k,n) - datnp1(i,j,k,n)) * idt;
206  });
207  }
208  }
209  }
210  }
211 
212  return m_data_tendency;
213 }
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
double m_tnp1
Definition: ERF_ReadBndryPlanes.H:77
double m_tnp2
Definition: ERF_ReadBndryPlanes.H:78
double m_tn
The times for which we currently have data.
Definition: ERF_ReadBndryPlanes.H:76
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real eps()
Definition: ERF_ShocMoments.cpp:19
Here is the call graph for this function:

◆ ingested_density()

int ReadBndryPlanes::ingested_density ( ) const
inline
67 {return is_density_read;}

◆ ingested_KE()

int ReadBndryPlanes::ingested_KE ( ) const
inline
71 {return is_KE_read;}

◆ ingested_q1()

int ReadBndryPlanes::ingested_q1 ( ) const
inline
69 {return is_q1_read;}

◆ ingested_q2()

int ReadBndryPlanes::ingested_q2 ( ) const
inline
70 {return is_q2_read;}

◆ ingested_scalar()

int ReadBndryPlanes::ingested_scalar ( ) const
inline
68 {return is_scalar_read;}

◆ ingested_theta()

int ReadBndryPlanes::ingested_theta ( ) const
inline

◆ ingested_velocity()

int ReadBndryPlanes::ingested_velocity ( ) const
inline
65 {return is_velocity_read;}

◆ interp_in_time()

Vector< std::unique_ptr< PlaneVector > > & ReadBndryPlanes::interp_in_time ( const double &  time_in)

Function in ReadBndryPlanes class for interpolating boundary data in time.

Parameters
time_inConstant specifying the time for interpolation
95 {
96  // A restart that lands exactly on a boundary-plane time can request a time a few
97  // ULP outside [m_tn, m_tnp2] because per-level t_new drifts under subcycling.
98  // Tolerate that drift, then clamp into the valid window before interpolating.
99  const double eps = 1.0e-8 * (m_tnp2 - m_tn);
100  AMREX_ALWAYS_ASSERT(m_tn - eps <= time_in && time_in <= m_tnp2 + eps);
101  const double time = std::min(std::max(time_in, m_tn), m_tnp2);
102 
103  //Print() << "interp_in_time at time " << time << " given " << m_tn << " " << m_tnp1 << " " << m_tnp2 << std::endl;
104  //Print() << "m_tinterp " << m_tinterp << std::endl;
105 
106  if (time == m_tinterp) {
107  // We have already interpolated to this time
108  return m_data_interp;
109 
110  } else {
111 
112  // We must now interpolate to a new time
113  m_tinterp = time;
114 
115  if (time < m_tnp1) {
116  for (OrientationIter oit; oit != nullptr; ++oit) {
117  auto ori = oit();
118  if (ori.coordDir() < 2) {
119  const int nlevels = static_cast<int>(m_data_n[ori]->size());
120  for (int lev = 0; lev < nlevels; ++lev) {
121  const auto& datn = (*m_data_n[ori])[lev];
122  const auto& datnp1 = (*m_data_np1[ori])[lev];
123  auto& dati = (*m_data_interp[ori])[lev];
124  dati.linInterp<RunOn::Device>(datn, 0, datnp1, 0,
125  static_cast<Real>(m_tn), static_cast<Real>(m_tnp1),
126  static_cast<Real>(m_tinterp),
127  datn.box(), 0, dati.nComp());
128  }
129  }
130  }
131  } else {
132  for (OrientationIter oit; oit != nullptr; ++oit) {
133  auto ori = oit();
134  if (ori.coordDir() < 2) {
135  const int nlevels = static_cast<int>(m_data_n[ori]->size());
136  for (int lev = 0; lev < nlevels; ++lev) {
137  const auto& datnp1 = (*m_data_np1[ori])[lev];
138  const auto& datnp2 = (*m_data_np2[ori])[lev];
139  auto& dati = (*m_data_interp[ori])[lev];
140  dati.linInterp<RunOn::Device>(datnp1, 0, datnp2, 0,
141  static_cast<Real>(m_tnp1), static_cast<Real>(m_tnp2),
142  static_cast<Real>(m_tinterp),
143  datnp1.box(), 0, dati.nComp());
144  }
145  }
146  }
147  }
148  }
149  return m_data_interp;
150 }
Here is the call graph for this function:

◆ plane_slot()

static int ReadBndryPlanes::plane_slot ( const std::string &  var_name)
inlinestatic

The slot (BCVars) a plane of variable var_name is stored in, the same slot fill_from_bndryregs reads it from (cons_bc_comp of the component it fills); -1 for a name that is not a plane variable.

30  {
31  if (var_name == "density") { return BCVars::Rho_bc_comp; }
32  if (var_name == "theta") { return BCVars::RhoTheta_bc_comp; }
33  if (var_name == "temperature") { return BCVars::RhoTheta_bc_comp; }
34  if (var_name == "ke") { return BCVars::RhoKE_bc_comp; }
35  if (var_name == "scalar") { return BCVars::RhoScalar_bc_comp; }
36  if (var_name == "qv") { return BCVars::RhoQ1_bc_comp; }
37  if (var_name == "qc") { return BCVars::RhoQ2_bc_comp; }
38  if (var_name == "velocity") { return BCVars::xvel_bc; }
39  return -1;
40  }
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:126
@ RhoQ1_bc_comp
Definition: ERF_IndexDefines.H:127
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:125
@ RhoTheta_bc_comp
Definition: ERF_IndexDefines.H:124
@ RhoQ2_bc_comp
Definition: ERF_IndexDefines.H:128
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:123
@ xvel_bc
Definition: ERF_IndexDefines.H:138

Referenced by read_file(), and ReadBndryPlanes().

Here is the caller graph for this function:

◆ read_file()

void ReadBndryPlanes::read_file ( int  idx,
amrex::Vector< std::unique_ptr< PlaneVector >> &  data_to_fill,
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max >  m_bc_extdir_vals 
)

Function in ReadBndryPlanes to read boundary data for each face and variable from files.

Parameters
idxSpecifies the index corresponding to the timestep we want
data_to_fillContainer for face data on boundaries
m_bc_extdir_valsContainer storing the external dirichlet boundary conditions we are reading from the input files
459 {
460  if (idx >= m_in_timesteps.size()) {
461  Print() << "Asking for index " << idx << " but m_in_timesteps only has size " << m_in_timesteps.size() << std::endl;
462  Abort();
463  }
464  const int t_step = m_in_timesteps[idx];
465  const std::string chkname1 = m_filename + Concatenate("/bndry_output", t_step);
466 
467  const std::string level_prefix = "Level_";
468  const int lev = 0;
469 
470  const Box& domain = m_geom.Domain();
471  BoxArray ba(domain);
472  DistributionMapping dm{ba};
473 
474  GpuArray<GpuArray<Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> l_bc_extdir_vals_d;
475 
476  for (int i = 0; i < BCVars::NumTypes; i++)
477  {
478  for (OrientationIter oit; oit != nullptr; ++oit) {
479  auto ori = oit();
480  l_bc_extdir_vals_d[i][ori] = m_bc_extdir_vals[i][ori];
481  }
482  }
483 
484  int n_for_density = -1;
485  for (int i = 0; i < m_var_names.size(); i++)
486  {
487  if (m_var_names[i] == "density") n_for_density = i;
488  }
489 
490  // We need to initialize all the components because we may not fill all of them from files,
491  // but the loop in the interpolate routine goes over all the components anyway
492  int ncomp_for_bc = BCVars::NumTypes;
493  for (OrientationIter oit; oit != nullptr; ++oit) {
494  auto ori = oit();
495  if (ori.coordDir() < 2) {
496  FArrayBox& d = (*data_to_fill[ori])[lev];
497  const auto& bx = d.box();
498  Array4<Real> d_arr = d.array();
499  ParallelFor(
500  bx, ncomp_for_bc, [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept {
501  d_arr(i,j,k,n) = zero;
502  });
503  }
504  }
505 
506  // Read density for primitive to conserved conversions. Only when density is read: the
507  // writer writes only the variables it lists, so the planes may hold no density, and then
508  // the conversions below use the erf.<face>.density BC value instead.
509  BndryRegister bndry_r(ba, dm, m_in_rad, m_out_rad, m_extent_rad, 1);
510  bndry_r.setVal(bogus_large_value);
511  if (n_for_density >= 0) {
512  std::string filenamer = MultiFabFileFullPrefix(lev, chkname1, level_prefix, "density");
513  for (OrientationIter oit; oit != nullptr; ++oit) {
514  auto ori = oit();
515  if (ori.coordDir() < 2) {
516  std::string facenamer = Concatenate(filenamer + '_', ori, 1);
517  bndry_r[ori].read(facenamer);
518  }
519  }
520  }
521 
522  // A moist writer computes the temperature plane with qv (erf_dermoisttemp), so the conversion
523  // back to theta below needs the same qv: read its plane too when both are read. Otherwise qv
524  // is zero there, as for a dry writer.
525  BndryRegister bndry_qv(ba, dm, m_in_rad, m_out_rad, m_extent_rad, 1);
526  bndry_qv.setVal(zero);
528  std::string filenameqv = MultiFabFileFullPrefix(lev, chkname1, level_prefix, "qv");
529  for (OrientationIter oit; oit != nullptr; ++oit) {
530  auto ori = oit();
531  if (ori.coordDir() < 2) {
532  std::string facenameqv = Concatenate(filenameqv + '_', ori, 1);
533  bndry_qv[ori].read(facenameqv);
534  }
535  }
536  }
537 
538  // A temperature plane written with qv cannot be converted back to theta without it
540  const std::string qv_header = Concatenate(MultiFabFileFullPrefix(lev, chkname1, level_prefix, "qv") + '_',
541  Orientation(0, Orientation::low), 1) + "_H";
542  if (FileExists(qv_header)) {
543  Abort("erf.bndry_input_var_names reads temperature but not qv, and " + m_filename +
544  " holds qv planes: the writer was moist, so its temperature includes qv. Add qv to"
545  " erf.bndry_input_var_names, or write and read theta instead of temperature");
546  }
547  }
548 
549  // Expose for GPU
550  bool real_bcs = m_use_real_bcs;
551 
552  for (int ivar = 0; ivar < m_var_names.size(); ivar++)
553  {
554  std::string var_name = m_var_names[ivar];
555 
556  std::string filename1 = MultiFabFileFullPrefix(lev, chkname1, level_prefix, var_name);
557 
558  int ncomp;
559  if (var_name == "velocity") {
560  ncomp = AMREX_SPACEDIM;
561  } else {
562  ncomp = 1;
563  }
564 
565  // The slot the plane is stored in; every name was checked against
566  // plane_slot in the constructor, so it is never -1 here.
567  const int n_offset = plane_slot(var_name);
568 
569  // Print() << "Reading " << chkname1 << " for variable " << var_name << " with n_offset == " << n_offset << std::endl;
570 
571  BndryRegister bndry(ba, dm, m_in_rad, m_out_rad, m_extent_rad, ncomp);
572  bndry.setVal(bogus_large_value);
573 
574  // *********************************************************
575  // Read in the BndryReg for all non-z faces
576  // *********************************************************
577  for (OrientationIter oit; oit != nullptr; ++oit) {
578  auto ori = oit();
579  if (ori.coordDir() < 2) {
580 
581  std::string facename1 = Concatenate(filename1 + '_', ori, 1);
582  bndry[ori].read(facename1);
583 
584  int normal = ori.coordDir();
585  IntVect v_offset = offset(ori.faceDir(), normal);
586  if (real_bcs) { v_offset = IntVect(0); }
587 
588  const auto& bbx = (*data_to_fill[ori])[lev].box();
589 
590  // *********************************************************
591  // Copy from the BndryReg into a MultiFab then use copyTo
592  // to write from the MultiFab to a single FAB for each face
593  // *********************************************************
594  MultiFab bndryMF(
595  bndry[ori].boxArray(), bndry[ori].DistributionMap(),
596  ncomp, 0, MFInfo());
597 
598  for (MFIter mfi(bndryMF); mfi.isValid(); ++mfi) {
599 
600  const auto& vbx = mfi.validbox();
601  const auto& bndry_read_arr = bndry[ori].array(mfi);
602  const auto& bndry_read_r_arr = bndry_r[ori].array(mfi);
603  const auto& bndry_read_qv_arr = bndry_qv[ori].array(mfi);
604  const auto& bndry_mf_arr = bndryMF.array(mfi);
605 
606  const auto& bx = bbx & vbx;
607  if (bx.isEmpty()) {
608  continue;
609  }
610 
611  // Split the 2-cell-thick working box into ghost and interior
612  // slots so the (i+v_offset) neighbor access stays in-bounds.
613  // Both slots are filled with the same face-averaged Dirichlet
614  // value; the interior slot just needs the opposite neighbor.
615  Box bx_ghost = bx;
616  Box bx_int = bx;
617  if (ori.isLow()) {
618  bx_ghost.setBig (normal, domain.smallEnd(normal) - 1);
619  bx_int .setSmall(normal, domain.smallEnd(normal));
620  } else {
621  bx_ghost.setSmall(normal, domain.bigEnd(normal) + 1);
622  bx_int .setBig (normal, domain.bigEnd(normal));
623  }
624  const IntVect v_offset_int = -v_offset;
625 
626  // We average the two cell-centered data points in the normal direction
627  // to define a Dirichlet value on the face itself.
628 
629  // This is the scalars -- they all get multiplied by rho, and in the case of
630  // reading in temperature, we must convert to theta first
631  Real rdOcp = m_rdOcp;
632  if (n_for_density >= 0) {
633  if (var_name == "temperature") {
634  ParallelFor(
635  bx_ghost, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
636  Real R1 = bndry_read_r_arr(i, j, k, 0);
637  Real R2 = bndry_read_r_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
638  Real T1 = bndry_read_arr(i, j, k, 0);
639  Real T2 = bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
640  Real Q1 = bndry_read_qv_arr(i, j, k, 0);
641  Real Q2 = bndry_read_qv_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
642  Real Th1 = getThgivenRandT(R1,T1,rdOcp,Q1);
643  Real Th2 = getThgivenRandT(R2,T2,rdOcp,Q2);
644  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
645  myhalf * (R1*Th1 + R2*Th2);
646  });
647  } else if (var_name == "theta" || var_name == "ke" || var_name == "scalar" ||
648  var_name == "qv" || var_name == "qc") {
649  ParallelFor(
650  bx_ghost, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
651  Real R1 = bndry_read_r_arr(i, j, k, 0);
652  Real R2 = bndry_read_r_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
653  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
654  myhalf * ( R1 * bndry_read_arr(i, j, k, 0) +
655  R2 * bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
656  });
657  } else if (var_name == "density") {
658  ParallelFor(
659  bx_ghost, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
660  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
661  myhalf * ( bndry_read_arr(i, j, k, 0) +
662  bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
663  });
664  }
665  } else {
666  if (var_name == "temperature") {
667  ParallelFor(
668  bx_ghost, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
669  Real R1 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
670  Real R2 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
671  Real T1 = bndry_read_arr(i, j, k, 0);
672  Real T2 = bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0);
673  Real Q1 = bndry_read_qv_arr(i, j, k, 0);
674  Real Q2 = bndry_read_qv_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
675  Real Th1 = getThgivenRandT(R1,T1,rdOcp,Q1);
676  Real Th2 = getThgivenRandT(R2,T2,rdOcp,Q2);
677  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
678  myhalf * (R1*Th1 + R2*Th2);
679  });
680  } else if (var_name == "theta" || var_name == "ke" || var_name == "scalar" ||
681  var_name == "qv" || var_name == "qc") {
682  ParallelFor(
683  bx_ghost, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
684  Real R1 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
685  Real R2 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
686  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
687  myhalf * (R1 * bndry_read_arr(i, j, k, 0) +
688  R2 * bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
689  });
690  }
691  }
692 
693  // This is velocity
694  if (var_name == "velocity") {
695  ParallelFor(
696  bx_ghost, ncomp, [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept {
697  bndry_mf_arr(i, j, k, n) = (real_bcs) ? bndry_read_arr(i, j, k, n) :
698  myhalf * (bndry_read_arr(i, j, k, n) +
699  bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], n));
700  });
701  }
702 
703  // --- interior-slot fill (same face-averaged Dirichlet value;
704  // neighbor offset is flipped because the "other cell"
705  // is now on the opposite side of the boundary face) ---
706  if (n_for_density >= 0) {
707  if (var_name == "temperature") {
708  ParallelFor(
709  bx_int, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
710  Real R1 = bndry_read_r_arr(i, j, k, 0);
711  Real R2 = bndry_read_r_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2],0);
712  Real T1 = bndry_read_arr(i, j, k, 0);
713  Real T2 = bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2],0);
714  Real Q1 = bndry_read_qv_arr(i, j, k, 0);
715  Real Q2 = bndry_read_qv_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2],0);
716  Real Th1 = getThgivenRandT(R1,T1,rdOcp,Q1);
717  Real Th2 = getThgivenRandT(R2,T2,rdOcp,Q2);
718  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
719  myhalf * (R1*Th1 + R2*Th2);
720  });
721  } else if (var_name == "theta" || var_name == "ke" || var_name == "scalar" ||
722  var_name == "qv" || var_name == "qc") {
723  ParallelFor(
724  bx_int, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
725  Real R1 = bndry_read_r_arr(i, j, k, 0);
726  Real R2 = bndry_read_r_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2],0);
727  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
728  myhalf * ( R1 * bndry_read_arr(i, j, k, 0) +
729  R2 * bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2], 0));
730  });
731  } else if (var_name == "density") {
732  ParallelFor(
733  bx_int, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
734  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
735  myhalf * ( bndry_read_arr(i, j, k, 0) +
736  bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2], 0));
737  });
738  }
739  } else {
740  if (var_name == "temperature") {
741  ParallelFor(
742  bx_int, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
743  Real R1 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
744  Real R2 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
745  Real T1 = bndry_read_arr(i, j, k, 0);
746  Real T2 = bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2], 0);
747  Real Q1 = bndry_read_qv_arr(i, j, k, 0);
748  Real Q2 = bndry_read_qv_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2],0);
749  Real Th1 = getThgivenRandT(R1,T1,rdOcp,Q1);
750  Real Th2 = getThgivenRandT(R2,T2,rdOcp,Q2);
751  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
752  myhalf * (R1*Th1 + R2*Th2);
753  });
754  } else if (var_name == "theta" || var_name == "ke" || var_name == "scalar" ||
755  var_name == "qv" || var_name == "qc") {
756  ParallelFor(
757  bx_int, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
758  Real R1 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
759  Real R2 = l_bc_extdir_vals_d[BCVars::Rho_bc_comp][ori];
760  bndry_mf_arr(i, j, k, 0) = (real_bcs) ? bndry_read_arr(i, j, k, 0) :
761  myhalf * (R1 * bndry_read_arr(i, j, k, 0) +
762  R2 * bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2], 0));
763  });
764  }
765  }
766 
767  if (var_name == "velocity") {
768  ParallelFor(
769  bx_int, ncomp, [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept {
770  bndry_mf_arr(i, j, k, n) = (real_bcs) ? bndry_read_arr(i, j, k, n) :
771  myhalf * (bndry_read_arr(i, j, k, n) +
772  bndry_read_arr(i+v_offset_int[0],j+v_offset_int[1],k+v_offset_int[2], n));
773  });
774  }
775 
776  } // mfi
777  bndryMF.copyTo((*data_to_fill[ori])[lev], 0, n_offset, ncomp);
778  } // coordDir < 2
779  } // ori
780  } // var_name
781 }
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenRandT(const amrex::Real rho, const amrex::Real T, const amrex::Real rdOcp, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:64
#define NBCVAR_max
Definition: ERF_IndexDefines.H:50
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:128
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int idx(int i, int j, int k, int nx, int ny)
Definition: ERF_InitForEnsemble.cpp:404
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
AMREX_FORCE_INLINE IntVect offset(const int face_dir, const int normal)
Definition: ERF_ReadBndryPlanes.cpp:36
amrex::Vector< int > m_in_timesteps
Definition: ERF_ReadBndryPlanes.H:109
const int m_extent_rad
Definition: ERF_ReadBndryPlanes.H:117

Referenced by read_input_files().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_input_files()

void ReadBndryPlanes::read_input_files ( double  time,
double  dt,
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max >  m_bc_extdir_vals 
)

Function in ReadBndryPlanes for reading boundary data at a specific time and at the next timestep from input files.

Parameters
timeCurrent time
dtCurrent timestep
m_bc_extdir_valsContainer storing the external dirichlet boundary conditions we are reading from the input files
381 {
382  BL_PROFILE("ERF::ReadBndryPlanes::read_input_files");
383 
384  // Assert that both the current time and the next time are within the bounds
385  // of the data that we can read. A run that stops at the last plane time can end a few
386  // ULP past it, since its time and the plane times are summed from steps separately;
387  // tolerate that drift as interp_in_time does, which then clamps into the data.
388  const int n_intervals = std::max(static_cast<int>(m_in_times.size()) - 1, 1);
389  const double eps = 1.0e-8 * (m_in_times.back() - m_in_times[0]) / n_intervals;
390  AMREX_ALWAYS_ASSERT((m_in_times[0] - eps <= time) && (time <= m_in_times.back() + eps));
391  AMREX_ALWAYS_ASSERT((m_in_times[0] - eps <= time+dt) && (time+dt <= m_in_times.back() + eps));
392 
393  int ncomp = 1;
394 
395  const Box& domain = m_geom.Domain();
396  BoxArray ba(domain);
397  DistributionMapping dm{ba};
398  BndryRegister bndryn(ba, dm, m_in_rad, m_out_rad, m_extent_rad, ncomp);
399  bndryn.setVal(bogus_large_value);
400 
401  // The first time we enter this routine we read the first three files
402  if (last_file_read == -1)
403  {
404  int idx_init = 0;
405  read_file(idx_init,m_data_n ,m_bc_extdir_vals);
406  read_file(idx_init,m_data_interp,m_bc_extdir_vals); // We want to start with this filled
407  m_tn = m_in_times[idx_init];
408 
409  idx_init = 1;
410  read_file(idx_init,m_data_np1,m_bc_extdir_vals);
411  m_tnp1 = m_in_times[idx_init];
412 
413  idx_init = 2;
414  read_file(idx_init,m_data_np2,m_bc_extdir_vals);
415  m_tnp2 = m_in_times[idx_init];
416 
417  last_file_read = idx_init;
418  }
419 
420  // Compute the index such that time falls between times[idx] and times[idx+1]
421  const int idx = closest_index(m_in_times, time);
422 
423  // Advance the read window until it spans the requested time.
424  while (idx >= last_file_read-1 && last_file_read != m_in_times.size()-1) {
425  int new_read = last_file_read+1;
426 
427  // We need to change which data the pointers point to before we read in the new data
428  // This doesn't actually move the data, just swaps the pointers
429  for (OrientationIter oit; oit != nullptr; ++oit) {
430  auto ori = oit();
431  std::swap(m_data_n[ori] ,m_data_np1[ori]);
432  std::swap(m_data_np1[ori],m_data_np2[ori]);
433  }
434 
435  // Set the times corresponding to the post-swap pointers
436  m_tn = m_tnp1;
437  m_tnp1 = m_tnp2;
438  m_tnp2 = m_in_times[new_read];
439 
440  read_file(new_read,m_data_np2,m_bc_extdir_vals);
441  last_file_read = new_read;
442  }
443 
444  AMREX_ASSERT(time >= m_tn - eps && time <= m_tnp2 + eps);
445  AMREX_ASSERT(time+dt >= m_tn - eps && time+dt <= m_tnp2 + eps);
446 }
AMREX_FORCE_INLINE int closest_index(const Vector< double > &vec, const double value)
Definition: ERF_ReadBndryPlanes.cpp:19
amrex::Vector< double > m_in_times
The timesteps / times that we read from time.dat.
Definition: ERF_ReadBndryPlanes.H:108
void read_file(int idx, amrex::Vector< std::unique_ptr< PlaneVector >> &data_to_fill, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals)
Definition: ERF_ReadBndryPlanes.cpp:456
Here is the call graph for this function:

◆ read_time_file()

void ReadBndryPlanes::read_time_file ( )

Function in ReadBndryPlanes class for reading the external file specifying time data and broadcasting this data across MPI ranks.

309 {
310  BL_PROFILE("ERF::ReadBndryPlanes::read_time_file");
311 
312  // *********************************************************
313  // Read the time.data file and store the timesteps and times
314  // *********************************************************
315  int time_file_length = 0;
316 
317  if (ParallelDescriptor::IOProcessor()) {
318 
319  std::string line;
320  std::ifstream time_file(m_time_file);
321  if (!time_file.good()) {
322  Abort("Cannot find time file: " + m_time_file);
323  }
324  while (std::getline(time_file, line)) {
325  ++time_file_length;
326  }
327 
328  time_file.close();
329  }
330 
331  ParallelDescriptor::Bcast(
332  &time_file_length, 1,
333  ParallelDescriptor::IOProcessorNumber(),
334  ParallelDescriptor::Communicator());
335 
336  m_in_times.resize(time_file_length);
337  m_in_timesteps.resize(time_file_length);
338 
339  if (ParallelDescriptor::IOProcessor()) {
340  std::ifstream time_file(m_time_file);
341  for (int i = 0; i < time_file_length; ++i) {
342  time_file >> m_in_timesteps[i] >> m_in_times[i];
343  }
344  // Sanity check that there are no duplicates or mis-orderings
345  for (int i = 1; i < time_file_length; ++i) {
346  if (m_in_timesteps[i] <= m_in_timesteps[i-1])
347  Error("Bad timestep in time.dat file");
348  if (m_in_times[i] <= m_in_times[i-1])
349  Error("Bad time in time.dat file");
350  }
351  time_file.close();
352  }
353 
354  ParallelDescriptor::Bcast(
355  m_in_timesteps.data(), time_file_length,
356  ParallelDescriptor::IOProcessorNumber(),
357  ParallelDescriptor::Communicator());
358 
359  ParallelDescriptor::Bcast(
360  m_in_times.data(), time_file_length,
361  ParallelDescriptor::IOProcessorNumber(),
362  ParallelDescriptor::Communicator());
363 
364  // Allocate data we will need -- for now just at one level
365  int lev = 0;
366  define_level_data(lev);
367  Print() << "Successfully read time file and allocated data" << std::endl;
368 }
void define_level_data(int lev)
Definition: ERF_ReadBndryPlanes.cpp:51
Here is the call graph for this function:

◆ tinterp()

double ReadBndryPlanes::tinterp ( ) const
inline
63 { return m_tinterp; }

Member Data Documentation

◆ is_density_read

int ReadBndryPlanes::is_density_read
private

◆ is_KE_read

int ReadBndryPlanes::is_KE_read
private

Referenced by ingested_KE(), and ReadBndryPlanes().

◆ is_q1_read

int ReadBndryPlanes::is_q1_read
private

◆ is_q2_read

int ReadBndryPlanes::is_q2_read
private

Referenced by ingested_q2(), and ReadBndryPlanes().

◆ is_scalar_read

int ReadBndryPlanes::is_scalar_read
private

Referenced by ingested_scalar(), and ReadBndryPlanes().

◆ is_temperature_read

int ReadBndryPlanes::is_temperature_read
private

◆ is_theta_read

int ReadBndryPlanes::is_theta_read
private

Referenced by ingested_theta(), and ReadBndryPlanes().

◆ is_velocity_read

int ReadBndryPlanes::is_velocity_read
private

◆ last_file_read

int ReadBndryPlanes::last_file_read
private

◆ m_data_interp

amrex::Vector<std::unique_ptr<PlaneVector> > ReadBndryPlanes::m_data_interp
private

Data interpolated to the time requested.

Referenced by read_input_files(), and ReadBndryPlanes().

◆ m_data_n

amrex::Vector<std::unique_ptr<PlaneVector> > ReadBndryPlanes::m_data_n
private

Data at time m_tn.

Referenced by read_input_files(), and ReadBndryPlanes().

◆ m_data_np1

amrex::Vector<std::unique_ptr<PlaneVector> > ReadBndryPlanes::m_data_np1
private

Data at time m_tnp1.

Referenced by read_input_files(), and ReadBndryPlanes().

◆ m_data_np2

amrex::Vector<std::unique_ptr<PlaneVector> > ReadBndryPlanes::m_data_np2
private

Data at time m_tnp2.

Referenced by read_input_files(), and ReadBndryPlanes().

◆ m_data_tendency

amrex::Vector<std::unique_ptr<PlaneVector> > ReadBndryPlanes::m_data_tendency
private

Tendency between the n and np1 data.

Referenced by ReadBndryPlanes().

◆ m_extent_rad

const int ReadBndryPlanes::m_extent_rad = 0
private

Referenced by read_file(), and read_input_files().

◆ m_filename

std::string ReadBndryPlanes::m_filename {""}
private

File name for IO.

Referenced by read_file(), and ReadBndryPlanes().

◆ m_geom

amrex::Geometry ReadBndryPlanes::m_geom
private

Geometry at level 0.

Referenced by read_file(), and read_input_files().

◆ m_in_rad

int ReadBndryPlanes::m_in_rad = 1
private

Controls extents on native bndry output.

Referenced by read_file(), read_input_files(), and ReadBndryPlanes().

◆ m_in_times

amrex::Vector<double> ReadBndryPlanes::m_in_times
private

The timesteps / times that we read from time.dat.

Referenced by read_input_files(), and read_time_file().

◆ m_in_timesteps

amrex::Vector<int> ReadBndryPlanes::m_in_timesteps
private

Referenced by read_file(), and read_time_file().

◆ m_out_rad

const int ReadBndryPlanes::m_out_rad = 1
private

Referenced by read_file(), and read_input_files().

◆ m_rdOcp

const amrex::Real ReadBndryPlanes::m_rdOcp
private

R_d/c_p is needed for reading boundary files.

Referenced by read_file().

◆ m_time_file

std::string ReadBndryPlanes::m_time_file {""}
private

File name for file holding timesteps and times.

Referenced by read_time_file(), and ReadBndryPlanes().

◆ m_tinterp

double ReadBndryPlanes::m_tinterp {-1.0}
private

Time for plane at interpolation.

Referenced by ReadBndryPlanes(), and tinterp().

◆ m_tn

double ReadBndryPlanes::m_tn
private

The times for which we currently have data.

Referenced by read_input_files().

◆ m_tnp1

double ReadBndryPlanes::m_tnp1
private

Referenced by read_input_files().

◆ m_tnp2

double ReadBndryPlanes::m_tnp2
private

Referenced by read_input_files().

◆ m_use_real_bcs

bool ReadBndryPlanes::m_use_real_bcs = false
private

Are real BCs being used?

Referenced by read_file(), and ReadBndryPlanes().

◆ m_var_names

amrex::Vector<std::string> ReadBndryPlanes::m_var_names
private

Variables to be read in.

Referenced by read_file(), and ReadBndryPlanes().


The documentation for this class was generated from the following files: