Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
AMReX/PatchHierarchy.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Maikel Nadolski
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef FUB_AMREX_PATCH_HIERARCHY_HPP
22 #define FUB_AMREX_PATCH_HIERARCHY_HPP
23 
25 #include "fub/Duration.hpp"
26 #include "fub/Equation.hpp"
27 #include "fub/Execution.hpp"
28 #include "fub/counter/CounterRegistry.hpp"
30 #include "fub/ext/Eigen.hpp"
31 #include "fub/ext/Log.hpp"
33 
34 #include <AMReX_FluxRegister.H>
35 #include <AMReX_Geometry.H>
36 
37 #include <AMReX_ParallelDescriptor.H>
38 #include <AMReX_PlotFileUtil.H>
39 #include <AMReX_VisMF.H>
40 
41 #include <fmt/format.h>
42 #include <fmt/ranges.h>
43 
44 #include <vector>
45 
46 namespace fub {
47 namespace amrex {
48 
49 /// \defgroup PatchHierarchy
50 
51 class DebugStorage;
52 
53 /// \ingroup PatchHierarchy
55  PatchHierarchyOptions() = default;
57 
58  template <typename Log> void Print(Log& log);
59 
61  ::amrex::IntVect refine_ratio{AMREX_D_DECL(2, 2, 2)};
62  ::amrex::IntVect blocking_factor{AMREX_D_DECL(32, 32, 32)};
63  ::amrex::IntVect max_grid_size{AMREX_D_DECL(128, 128, 128)};
64  ::amrex::IntVect n_error_buf{};
65  double grid_efficiency{0.7};
66  int verbose{0};
67  int n_proper{1};
68 };
69 
70 /// \ingroup PatchHierarchy
71 /// The DataDescription class contains all information which is neccessary to
72 /// describe the complete and conservative state data of an equation.
79  int dimension{AMREX_SPACEDIM};
80 };
81 
82 /// \ingroup PatchHierarchy
83 /// \brief The PatchLevel represents a distributed grid containing plain
84 /// simulation data without a ghost cell layer.
85 ///
86 /// Copying a patch level object will deeply copy the data and creates a new
87 /// independent patch level. This includes making duplicate objects of box array
88 /// and distribution mapping and modifying the copy will not affect the original
89 /// patch level in any way.
90 struct PatchLevel {
91  PatchLevel() = default;
92  ~PatchLevel() noexcept = default;
93 
94  /// \brief Creates a independent copy of the patch level.
95  PatchLevel(const PatchLevel& other);
96 
97  /// \brief Create a copy of the other patch level, deallocate old memory and
98  /// allocate new memory for the copied data.
99  PatchLevel& operator=(const PatchLevel& other);
100 
101  /// @{
102  /// \brief Moves a patch level without any allocations happening.
103  PatchLevel(PatchLevel&& other) noexcept = default;
104  PatchLevel& operator=(PatchLevel&& other) = default;
105  /// @}
106 
107  /// \brief Allocates arrays with specified box array and distribution mapping.
108  ///
109  /// \param num the refinement level number
110  /// \param tp the time point of the simulation
111  /// \param ba the box array of the distributed array
112  /// \param dm the distribution mapping for the array
113  /// \param n_components the number of components of the array
114  PatchLevel(int num, Duration tp, const ::amrex::BoxArray& ba,
115  const ::amrex::DistributionMapping& dm, int n_components);
116 
117  /// \brief Allocates arrays with specified box array and distribution mapping.
118  ///
119  /// \param num the refinement level number
120  /// \param tp the time point of the simulation
121  /// \param ba the box array of the distributed array
122  /// \param dm the distribution mapping for the array
123  /// \param n_components the number of components of the array
124  PatchLevel(int num, Duration tp, const ::amrex::BoxArray& ba,
125  const ::amrex::DistributionMapping& dm,
126  const DataDescription& desc);
127 
128  /// Allocates arrays with specified box array and distribution mapping.
129  ///
130  /// \param num the refinement level number
131  /// \param tp the time point of the simulation
132  /// \param ba the box array of the distributed array
133  /// \param dm the distribution mapping for the array
134  /// \param n_components the number of components of the array
135  /// \param factory the FAB factory, important with EB.
136  PatchLevel(int num, Duration tp, const ::amrex::BoxArray& ba,
137  const ::amrex::DistributionMapping& dm, int n_components,
138  const ::amrex::FabFactory<::amrex::FArrayBox>& factory);
139 
142  std::ptrdiff_t cycles{};
143  ::amrex::BoxArray box_array{};
144  ::amrex::DistributionMapping distribution_mapping{};
145  ::amrex::MultiFab data{};
146  std::unique_ptr<::amrex::MultiFab> nodes{};
147  std::array<std::unique_ptr<::amrex::MultiFab>, AMREX_SPACEDIM> faces{};
148 };
149 
150 template <typename Equation>
151 DataDescription MakeDataDescription(const Equation& equation);
152 
153 /// \ingroup PatchHierarchy
154 /// The PatchHierarchy holds simulation data on multiple refinement levels. It
155 /// also holds a time stamp for each level.
157 public:
158  /// \brief Constructs a PatchHierarchy object which is capable of holding data
159  /// described by the secified data description on given geometry extents.
160  template <typename Equation>
161  PatchHierarchy(const Equation& equation,
162  const CartesianGridGeometry& geometry,
163  const PatchHierarchyOptions& options);
164 
165  /// \brief Constructs a PatchHierarchy object which is capable of holding data
166  /// described by the secified data description on given geometry extents.
168  const CartesianGridGeometry& geometry,
169  const PatchHierarchyOptions& options);
170 
171  [[nodiscard]] const DataDescription& GetDataDescription() const noexcept;
172 
173  /// \brief Return some additional patch hierarchy options.
174  [[nodiscard]] const PatchHierarchyOptions& GetOptions() const noexcept;
175 
176  /// \brief Returns the Grid Geometry which was used to create the hierarchy
177  /// with.
178  [[nodiscard]] const CartesianGridGeometry& GetGridGeometry() const noexcept;
179 
180  [[nodiscard]] std::ptrdiff_t GetCycles(int level = 0) const;
181 
182  [[nodiscard]] Duration GetTimePoint(int level = 0) const;
183 
184  [[nodiscard]] int GetNumberOfLevels() const noexcept;
185 
186  [[nodiscard]] int GetMaxNumberOfLevels() const noexcept;
187 
188  [[nodiscard]] int GetRatioToCoarserLevel(int level, Direction dir) const
189  noexcept;
190 
191  [[nodiscard]] ::amrex::IntVect GetRatioToCoarserLevel(int level) const
192  noexcept;
193 
194  [[nodiscard]] PatchLevel& GetPatchLevel(int level);
195 
196  [[nodiscard]] const PatchLevel& GetPatchLevel(int level) const;
197 
198  /// \brief Returns a Geometry object for a specified level.
199  ///
200  /// \param[in] The refinement level number for this geometry obejct.
201  [[nodiscard]] const ::amrex::Geometry& GetGeometry(int level) const;
202 
203  /// \brief Returns the hierarchy of Geometry objects.
204  [[nodiscard]] const ::amrex::Vector<::amrex::Geometry> GetGeometries() const;
205 
206  /// \brief Returns the hierarchy of BoxArray objects.
207  [[nodiscard]] const ::amrex::Vector<::amrex::BoxArray> GetBoxArrays() const;
208 
209  /// \brief Returns the hierarchy of DistributionMapping objects.
210  [[nodiscard]] const ::amrex::Vector<::amrex::DistributionMapping>
212 
213  /// \brief Returns the hierarchy of MultiFabs representing the data.
214  [[nodiscard]] const ::amrex::Vector<const ::amrex::MultiFab*> GetData() const;
215 
216  // Modifiers
217 
218  void PushBack(const PatchLevel& level);
219 
220  void PushBack(PatchLevel&& level);
221 
222  void PopBack();
223 
224  [[nodiscard]] span<const ::amrex::EB2::IndexSpace*> GetIndexSpaces() noexcept;
225 
226  /// \brief Returns a shared pointer to the counter registry.
227  [[nodiscard]] const std::shared_ptr<CounterRegistry>&
228  GetCounterRegistry() const noexcept;
229 
230  /// \brief Returns a shared pointer to the debug storage.
231  [[nodiscard]] const std::shared_ptr<DebugStorage>& GetDebugStorage() const
232  noexcept;
233 
234  void SetCounterRegistry(std::shared_ptr<CounterRegistry> registry);
235 
236 private:
240  std::vector<PatchLevel> patch_level_;
241  std::vector<::amrex::Geometry> patch_level_geometry_;
242  std::vector<const ::amrex::EB2::IndexSpace*> index_spaces_;
243  std::shared_ptr<CounterRegistry> registry_;
244  std::shared_ptr<DebugStorage> debug_storage_;
245 };
246 
247 template <typename Equation>
249  const auto complete_depths = Depths(equation, Type<Complete<Equation>>{});
250  int n_comp = 0;
251  ForEachVariable([&n_comp](int depth) { n_comp += depth; }, complete_depths);
252 
253  const auto cons_depths = Depths(equation, Type<Conservative<Equation>>{});
254  int n_cons_comp = 0;
255  ForEachVariable([&n_cons_comp](int depth) { n_cons_comp += depth; },
256  cons_depths);
257 
258  DataDescription desc;
259  desc.n_state_components = n_comp;
260  desc.first_cons_component = 0;
261  desc.n_cons_components = n_cons_comp;
262  desc.dimension = Equation::Rank();
263  return desc;
264 }
265 
266 template <typename Equation>
267 void WritePlotFile(const std::string plotfilename,
268  const fub::amrex::PatchHierarchy& hier,
269  const Equation& equation) {
270  const int nlevels = hier.GetNumberOfLevels();
271  const double time_point = hier.GetTimePoint().count();
272  FUB_ASSERT(nlevels >= 0);
273  std::size_t size = static_cast<std::size_t>(nlevels);
274  ::amrex::Vector<const ::amrex::MultiFab*> mf = hier.GetData();
275  ::amrex::Vector<::amrex::Geometry> geoms = hier.GetGeometries();
276  ::amrex::Vector<int> level_steps(size);
277  ::amrex::Vector<::amrex::IntVect> ref_ratio(size - 1);
278  for (std::size_t i = 0; i < size; ++i) {
279  level_steps[i] = static_cast<int>(hier.GetCycles(static_cast<int>(i)));
280  }
281  for (std::size_t i = 1; i < size; ++i) {
282  ref_ratio[i - 1] = hier.GetRatioToCoarserLevel(static_cast<int>(i));
283  }
284  using Traits = StateTraits<Complete<Equation>>;
285  constexpr auto names = Traits::names;
286  const auto depths = Depths(equation, Type<Complete<Equation>>{});
287  const std::size_t n_names =
288  std::tuple_size<remove_cvref_t<decltype(names)>>::value;
289  ::amrex::Vector<std::string> varnames;
290  varnames.reserve(n_names);
291  boost::mp11::tuple_for_each(Zip(names, StateToTuple(depths)), [&](auto xs) {
292  const int ncomp = std::get<1>(xs);
293  if (ncomp == 1) {
294  varnames.push_back(std::get<0>(xs));
295  } else {
296  for (int i = 0; i < ncomp; ++i) {
297  varnames.push_back(fmt::format("{}_{}", std::get<0>(xs), i));
298  }
299  }
300  });
301  ::amrex::WriteMultiLevelPlotfile(plotfilename, nlevels, mf, varnames, geoms,
302  time_point, level_steps, ref_ratio);
303 }
304 
305 template <int Rank>
306 void WritePlotFile(const std::string plotfilename,
307  const fub::amrex::PatchHierarchy& hier,
308  const IdealGasMix<Rank>& equation) {
309  using Equation = IdealGasMix<Rank>;
310  const int nlevels = hier.GetNumberOfLevels();
311  const double time_point = hier.GetTimePoint().count();
312  FUB_ASSERT(nlevels >= 0);
313  std::size_t size = static_cast<std::size_t>(nlevels);
314  ::amrex::Vector<const ::amrex::MultiFab*> mf = hier.GetData();
315  ::amrex::Vector<::amrex::Geometry> geoms = hier.GetGeometries();
316  ::amrex::Vector<int> level_steps(size);
317  ::amrex::Vector<::amrex::IntVect> ref_ratio(size - 1);
318  for (std::size_t i = 0; i < size; ++i) {
319  level_steps[i] = static_cast<int>(hier.GetCycles(static_cast<int>(i)));
320  }
321  for (std::size_t i = 1; i < size; ++i) {
322  ref_ratio[i - 1] = hier.GetRatioToCoarserLevel(static_cast<int>(i));
323  }
324  using Traits = StateTraits<Complete<Equation>>;
325  constexpr auto names = Traits::names;
326  const auto depths = Depths(equation, Type<Complete<Equation>>{});
327  const std::size_t n_names =
328  std::tuple_size<remove_cvref_t<decltype(names)>>::value;
329  ::amrex::Vector<std::string> varnames;
330  varnames.reserve(n_names);
331  boost::mp11::tuple_for_each(Zip(names, StateToTuple(depths)), [&](auto xs) {
332  const int ncomp = std::get<1>(xs);
333  if (ncomp == 1) {
334  varnames.push_back(std::get<0>(xs));
335  } else {
336  span<const std::string> species = equation.GetReactor().GetSpeciesNames();
337  for (int i = 0; i < ncomp; ++i) {
338  if (std::get<0>(xs) == std::string{"Species"}) {
339  varnames.push_back(species[i]);
340  } else {
341  varnames.push_back(fmt::format("{}_{}", std::get<0>(xs), i));
342  }
343  }
344  }
345  });
346  ::amrex::WriteMultiLevelPlotfile(plotfilename, nlevels, mf, varnames, geoms,
347  time_point, level_steps, ref_ratio);
348 }
349 
350 void WriteCheckpointFile(const std::string checkpointname,
351  const fub::amrex::PatchHierarchy& hier);
352 
353 PatchHierarchy ReadCheckpointFile(const std::string& checkpointname,
354  DataDescription desc,
355  const CartesianGridGeometry& geometry,
356  const PatchHierarchyOptions& options);
357 
358 template <typename Equation>
360  const CartesianGridGeometry& geometry,
361  const PatchHierarchyOptions& options)
362  : PatchHierarchy(MakeDataDescription(equation), geometry, options) {}
363 
364 void WriteMatlabData(std::ostream& out, const ::amrex::FArrayBox& fab,
365  const fub::IdealGasMix<1>& eq,
366  const ::amrex::Geometry& geom);
367 
368 void WriteMatlabData(std::ostream& out, const ::amrex::FArrayBox& fab,
369  const fub::IdealGasMix<3>& eq,
370  const ::amrex::Geometry& geom);
371 
372 std::vector<double> GatherStates(
373  const PatchHierarchy& hierarchy,
375  MPI_Comm comm);
376 
377 void WriteTubeData(const std::string& filename, const PatchHierarchy& hierarchy,
378  const IdealGasMix<1>& eq, fub::Duration time_point,
379  std::ptrdiff_t cycle_number, MPI_Comm comm);
380 
381 void WriteToHDF5(const std::string& name, const ::amrex::FArrayBox& fab,
382  const ::amrex::Geometry& geom, Duration time_point,
383  std::ptrdiff_t cycle) noexcept;
384 
385 template <typename Log> void PatchHierarchyOptions::Print(Log& log) {
386  std::array<int, AMREX_SPACEDIM> ref_ratio{};
387  std::array<int, AMREX_SPACEDIM> blocking{};
388  std::array<int, AMREX_SPACEDIM> max_grid{};
389  std::array<int, AMREX_SPACEDIM> error_buf{};
390  std::copy_n(refine_ratio.begin(), AMREX_SPACEDIM, ref_ratio.begin());
391  std::copy_n(blocking_factor.begin(), AMREX_SPACEDIM, blocking.begin());
392  std::copy_n(max_grid_size.begin(), AMREX_SPACEDIM, max_grid.begin());
393  std::copy_n(n_error_buf.begin(), AMREX_SPACEDIM, error_buf.begin());
394  BOOST_LOG(log) << fmt::format(" - max_number_of_levels = {}",
396  BOOST_LOG(log) << fmt::format(" - refine_ratio = {{{}}}",
397  fmt::join(ref_ratio, ", "));
398  BOOST_LOG(log) << fmt::format(" - blocking_factor = {{{}}}",
399  fmt::join(blocking, ", "));
400  BOOST_LOG(log) << fmt::format(" - max_grid_size = {{{}}}",
401  fmt::join(max_grid, ", "));
402  BOOST_LOG(log) << fmt::format(" - n_err_buf = {{{}}}",
403  fmt::join(error_buf, ", "));
404  BOOST_LOG(log) << fmt::format(" - grid_efficiency = {}", grid_efficiency);
405  BOOST_LOG(log) << fmt::format(" - n_proper = {}", n_proper);
406 }
407 
408 } // namespace amrex
409 } // namespace fub
410 
411 #endif
#define FUB_ASSERT(x)
Definition: assert.hpp:39
span< const std::string > GetSpeciesNames() const
Return the name of the ith species.
Definition: FlameMasterReactor.hpp:338
FlameMasterReactor & GetReactor() noexcept
Definition: IdealGasMix.hpp:140
This class stores a list of snapshots and returns proxy objects to those.
Definition: output/DebugOutput.hpp:201
Definition: AMReX/Geometry.hpp:30
The PatchHierarchy holds simulation data on multiple refinement levels.
Definition: AMReX/PatchHierarchy.hpp:156
int GetMaxNumberOfLevels() const noexcept
const ::amrex::Vector<::amrex::Geometry > GetGeometries() const
Returns the hierarchy of Geometry objects.
span< const ::amrex::EB2::IndexSpace * > GetIndexSpaces() noexcept
PatchHierarchy(const Equation &equation, const CartesianGridGeometry &geometry, const PatchHierarchyOptions &options)
Constructs a PatchHierarchy object which is capable of holding data described by the secified data de...
Definition: AMReX/PatchHierarchy.hpp:359
void PushBack(const PatchLevel &level)
const ::amrex::Vector<::amrex::BoxArray > GetBoxArrays() const
Returns the hierarchy of BoxArray objects.
std::ptrdiff_t GetCycles(int level=0) const
const DataDescription & GetDataDescription() const noexcept
std::shared_ptr< DebugStorage > debug_storage_
Definition: AMReX/PatchHierarchy.hpp:244
int GetRatioToCoarserLevel(int level, Direction dir) const noexcept
PatchHierarchy(DataDescription description, const CartesianGridGeometry &geometry, const PatchHierarchyOptions &options)
Constructs a PatchHierarchy object which is capable of holding data described by the secified data de...
int GetNumberOfLevels() const noexcept
Duration GetTimePoint(int level=0) const
const CartesianGridGeometry & GetGridGeometry() const noexcept
Returns the Grid Geometry which was used to create the hierarchy with.
CartesianGridGeometry grid_geometry_
Definition: AMReX/PatchHierarchy.hpp:238
DataDescription description_
Definition: AMReX/PatchHierarchy.hpp:237
const ::amrex::Vector<::amrex::DistributionMapping > GetDistributionMappings() const
Returns the hierarchy of DistributionMapping objects.
const std::shared_ptr< CounterRegistry > & GetCounterRegistry() const noexcept
Returns a shared pointer to the counter registry.
PatchLevel & GetPatchLevel(int level)
std::shared_ptr< CounterRegistry > registry_
Definition: AMReX/PatchHierarchy.hpp:243
std::vector< const ::amrex::EB2::IndexSpace * > index_spaces_
Definition: AMReX/PatchHierarchy.hpp:242
std::vector< PatchLevel > patch_level_
Definition: AMReX/PatchHierarchy.hpp:240
std::vector<::amrex::Geometry > patch_level_geometry_
Definition: AMReX/PatchHierarchy.hpp:241
const ::amrex::Geometry & GetGeometry(int level) const
Returns a Geometry object for a specified level.
const std::shared_ptr< DebugStorage > & GetDebugStorage() const noexcept
Returns a shared pointer to the debug storage.
PatchHierarchyOptions options_
Definition: AMReX/PatchHierarchy.hpp:239
const PatchHierarchyOptions & GetOptions() const noexcept
Return some additional patch hierarchy options.
void SetCounterRegistry(std::shared_ptr< CounterRegistry > registry)
const ::amrex::Vector< const ::amrex::MultiFab * > GetData() const
Returns the hierarchy of MultiFabs representing the data.
Definition: mdspan.hpp:573
An extents object defines a multidimensional index space which is the Cartesian product of integers e...
Definition: mdspan.hpp:208
A span is a view over a contiguous sequence of objects, the storage of which is owned by some other o...
Definition: span.hpp:81
void WriteTubeData(const std::string &filename, const PatchHierarchy &hierarchy, const IdealGasMix< 1 > &eq, fub::Duration time_point, std::ptrdiff_t cycle_number, MPI_Comm comm)
void WritePlotFile(const std::string plotfilename, const fub::amrex::PatchHierarchy &hier, const Equation &equation)
Definition: AMReX/PatchHierarchy.hpp:267
void WriteMatlabData(std::ostream &out, const ::amrex::FArrayBox &fab, const fub::IdealGasMix< 1 > &eq, const ::amrex::Geometry &geom)
void WriteCheckpointFile(const std::string checkpointname, const fub::amrex::PatchHierarchy &hier)
std::vector< double > GatherStates(const PatchHierarchy &hierarchy, basic_mdspan< const double, extents< AMREX_SPACEDIM, dynamic_extent >> xs, MPI_Comm comm)
DataDescription MakeDataDescription(const Equation &equation)
Definition: AMReX/PatchHierarchy.hpp:248
PatchHierarchy ReadCheckpointFile(const std::string &checkpointname, DataDescription desc, const CartesianGridGeometry &geometry, const PatchHierarchyOptions &options)
void WriteToHDF5(const std::string &name, const ::amrex::FArrayBox &fab, const ::amrex::Geometry &geom, Duration time_point, std::ptrdiff_t cycle) noexcept
std::decay_t< decltype(std::declval< T >().GetEquation())> Equation
A template typedef to detect the member function.
Definition: Meta.hpp:59
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
typename remove_cvref< T >::type remove_cvref_t
Definition: type_traits.hpp:226
void Log(std::string message, Duration timepoint, boost::log::trivial::severity_level level=boost::log::trivial::severity_level::info)
std::chrono::duration< double > Duration
Definition: Duration.hpp:31
void ForEachVariable(F function, Ts &&... states)
Definition: State.hpp:89
constexpr struct fub::DepthsFn Depths
Direction
This is a type safe type to denote a dimensional split direction.
Definition: Direction.hpp:30
constexpr auto Zip(Ts &&... ts)
Definition: State.hpp:65
auto StateToTuple(const State &x)
Definition: State.hpp:322
std::map< std::string, pybind11::object > ProgramOptions
Definition: ProgramOptions.hpp:40
Definition: State.hpp:35
Definition: State.hpp:162
Definition: CartesianGridGeometry.hpp:37
The DataDescription class contains all information which is neccessary to describe the complete and c...
Definition: AMReX/PatchHierarchy.hpp:73
int dimension
Definition: AMReX/PatchHierarchy.hpp:79
int n_cons_components
Definition: AMReX/PatchHierarchy.hpp:76
int n_state_components
Definition: AMReX/PatchHierarchy.hpp:74
int first_cons_component
Definition: AMReX/PatchHierarchy.hpp:75
int n_node_components
Definition: AMReX/PatchHierarchy.hpp:77
int n_face_components
Definition: AMReX/PatchHierarchy.hpp:78
Definition: AMReX/PatchHierarchy.hpp:54
int verbose
Definition: AMReX/PatchHierarchy.hpp:66
PatchHierarchyOptions(const ProgramOptions &options)
int n_proper
Definition: AMReX/PatchHierarchy.hpp:67
::amrex::IntVect refine_ratio
Definition: AMReX/PatchHierarchy.hpp:61
int max_number_of_levels
Definition: AMReX/PatchHierarchy.hpp:60
void Print(Log &log)
Definition: AMReX/PatchHierarchy.hpp:385
::amrex::IntVect n_error_buf
Definition: AMReX/PatchHierarchy.hpp:64
double grid_efficiency
Definition: AMReX/PatchHierarchy.hpp:65
::amrex::IntVect max_grid_size
Definition: AMReX/PatchHierarchy.hpp:63
::amrex::IntVect blocking_factor
Definition: AMReX/PatchHierarchy.hpp:62
The PatchLevel represents a distributed grid containing plain simulation data without a ghost cell la...
Definition: AMReX/PatchHierarchy.hpp:90
std::array< std::unique_ptr<::amrex::MultiFab >, AMREX_SPACEDIM > faces
Definition: AMReX/PatchHierarchy.hpp:147
~PatchLevel() noexcept=default
Duration time_point
Definition: AMReX/PatchHierarchy.hpp:141
::amrex::BoxArray box_array
Definition: AMReX/PatchHierarchy.hpp:143
::amrex::DistributionMapping distribution_mapping
Definition: AMReX/PatchHierarchy.hpp:144
std::unique_ptr<::amrex::MultiFab > nodes
Definition: AMReX/PatchHierarchy.hpp:146
std::ptrdiff_t cycles
Definition: AMReX/PatchHierarchy.hpp:142
int level_number
Definition: AMReX/PatchHierarchy.hpp:140
::amrex::MultiFab data
Definition: AMReX/PatchHierarchy.hpp:145