chombo-discharge
CD_DischargeIO.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_DischargeIO_H
13 #define CD_DischargeIO_H
14 
15 // Std includes
16 #include <string>
17 
18 // Chombo includes
19 #include <REAL.H>
20 #include <RealVect.H>
21 #include <IntVect.H>
22 #include <Vector.H>
23 #include <DisjointBoxLayout.H>
24 #include <LevelData.H>
25 #include <EBCellFAB.H>
26 #include <ParticleIO.H>
27 #include <ProblemDomain.H>
28 
29 // Our includes
30 #include <CD_EBAMRData.H>
31 #include <CD_ParticleContainer.H>
32 #include <CD_GenericParticle.H>
33 #include <CD_NamespaceHeader.H>
34 
38 namespace DischargeIO {
44  std::string
45  numberFmt(const long long a_number, char a_sep = ',') noexcept;
46 
52  Vector<std::string>
53  numberFmt(const Vector<long long> a_numbers, char a_sep = ',') noexcept;
54 
71 #ifdef CH_USE_HDF5
72  void
73  writeEBHDF5(const std::string& a_filename,
74  const Vector<std::string>& a_variableNames,
75  const Vector<DisjointBoxLayout>& a_grids,
76  const Vector<LevelData<EBCellFAB>*>& a_data,
77  const Vector<ProblemDomain>& a_domains,
78  const Vector<Real> a_dx,
79  const Vector<int> a_refinementRatios,
80  const Real a_dt,
81  const Real a_time,
82  const RealVect a_probLo,
83  const int a_numLevels,
84  const int a_numGhost) noexcept;
85 #endif
86 
87 #ifdef CH_USE_HDF5
95  void
96  writeEBHDF5Header(HDF5Handle& a_handleH5,
97  const int a_numLevels,
98  const RealVect& a_probLo,
99  const Vector<std::string>& a_variableNames) noexcept;
100 
101 #endif
102 
103 #ifdef CH_USE_HDF5
116  void
117  writeEBHDF5Level(HDF5Handle& a_handleH5,
118  const LevelData<EBCellFAB>& a_outputData,
119  const ProblemDomain a_domain,
120  const Real a_dx,
121  const Real a_dt,
122  const Real a_time,
123  const int a_level,
124  const int a_refRatio,
125  const int a_numGhost) noexcept;
126 #endif
127 
128 #ifdef CH_USE_HDF5
134  void
135  writeEBHDF5(const EBAMRCellData& a_data, const std::string& a_file);
136 #endif
137 
152  template <size_t M, size_t N>
153  void
154  writeH5Part(const std::string a_filename,
155  const ParticleContainer<GenericParticle<M, N>>& a_particles,
156  const std::vector<std::string> a_realVars = std::vector<std::string>(),
157  const std::vector<std::string> a_vectVars = std::vector<std::string>(),
158  const RealVect a_shift = RealVect::Zero,
159  const Real a_time = 0.0) noexcept;
160 
161 } // namespace DischargeIO
162 
163 #include <CD_NamespaceFooter.H>
164 
165 #include <CD_DischargeIOImplem.H>
166 
167 #endif
Implementation of CD_DischargeIO.H.
Class for holding data across EBAMR hierarchies.
Declaration of a generic particle class.
Declaration of a class for holding particles on an AMR hierarchy.
A generic particle class, holding the position and a specified number of real and vector values.
Definition: CD_GenericParticle.H:33
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50
Namespace which encapsulates chombo-discharge IO functionality.
Definition: CD_DischargeIO.H:38
void writeH5Part(const std::string a_filename, const ParticleContainer< GenericParticle< M, N >> &a_particles, const std::vector< std::string > a_realVars=std::vector< std::string >(), const std::vector< std::string > a_vectVars=std::vector< std::string >(), const RealVect a_shift=RealVect::Zero, const Real a_time=0.0) noexcept
A shameless copy of Chombo's writeEBHDF5 but including the lower-left corner of the physical domain a...
Definition: CD_DischargeIOImplem.H:26
std::string numberFmt(const long long a_number, char a_sep=',') noexcept
Number formatting method – writes big numbers using an input separator. E.g. the number 123456 is wri...
Definition: CD_DischargeIO.cpp:25