ASPECT
particles.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2019 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef _aspect_postprocess_particle_h
22 #define _aspect_postprocess_particle_h
23 
25 
27 
28 #include <deal.II/particles/particle_handler.h>
29 #include <deal.II/base/data_out_base.h>
30 #include <tuple>
31 
32 namespace aspect
33 {
34  namespace Postprocess
35  {
36  namespace internal
37  {
45  template<int dim>
46  class ParticleOutput : public ::DataOutInterface<0,dim>
47  {
48  public:
55  void build_patches(const Particles::ParticleHandler<dim> &particle_handler,
57  const std::vector<std::string> &exclude_output_properties,
58  const bool only_group_3d_vectors);
59 
60  private:
64  const std::vector<DataOutBase::Patch<0,dim> > &
65  get_patches () const override;
66 
70  std::vector< std::string >
71  get_dataset_names () const override;
72 
76 #if DEAL_II_VERSION_GTE(9,1,0)
77  std::vector<
78  std::tuple<unsigned int,
79  unsigned int,
80  std::string,
82  get_nonscalar_data_ranges () const override;
83 #else
84  std::vector<std::tuple<unsigned int, unsigned int, std::string> >
85  get_vector_data_ranges() const override;
86 #endif
87 
92  std::vector<DataOutBase::Patch<0,dim> > patches;
93 
97  std::vector<std::string> dataset_names;
98 
102 #if DEAL_II_VERSION_GTE(9,1,0)
103  std::vector<
104  std::tuple<unsigned int,
105  unsigned int,
106  std::string,
109 #else
110  std::vector<std::tuple<unsigned int, unsigned int, std::string> >
112 #endif
113  };
114  }
115 
125  template <int dim>
126  class Particles : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
127  {
128  public:
132  Particles();
133 
137  ~Particles() override;
138 
156  std::pair<std::string,std::string> execute (TableHandler &statistics) override;
157 
161  void save (std::map<std::string, std::string> &status_strings) const override;
162 
166  void load (const std::map<std::string, std::string> &status_strings) override;
167 
172  template <class Archive>
173  void serialize (Archive &ar, const unsigned int version);
174 
178  static
179  void
181 
185  void
186  parse_parameters (ParameterHandler &prm) override;
187 
188  private:
194 
199 
208  void set_last_output_time (const double current_time);
209 
214  unsigned int output_file_number;
215 
219  std::vector<std::string> output_formats;
220 
229  std::vector<std::pair<double,std::string> > times_and_pvtu_file_names;
230 
236  std::vector<std::pair<double,std::vector<std::string> > > times_and_vtu_file_names;
237 
243  std::vector<std::vector<std::string> > output_file_names_by_timestep;
244 
251  std::vector<XDMFEntry> xdmf_entries;
252 
259  unsigned int group_files;
260 
269 
277 
283 
288  std::vector<std::string> exclude_output_properties;
289 
297  static
298  void writer (const std::string filename,
299  const std::string temporary_filename,
300  const std::string *file_contents);
301 
318  void write_master_files (const internal::ParticleOutput<dim> &data_out,
319  const std::string &solution_file_prefix,
320  const std::vector<std::string> &filenames);
321  };
322  }
323 }
324 
325 #endif
static void declare_parameters(ParameterHandler &prm)
std::vector< std::pair< double, std::string > > times_and_pvtu_file_names
Definition: particles.h:229
const std::vector< DataOutBase::Patch< 0, dim > > & get_patches() const override
std::vector< std::pair< double, std::vector< std::string > > > times_and_vtu_file_names
Definition: particles.h:236
std::vector< std::tuple< unsigned int, unsigned int, std::string > > vector_datasets
Definition: particles.h:111
std::vector< DataOutBase::Patch< 0, dim > > patches
Definition: particles.h:92
void parse_parameters(ParameterHandler &prm)
void build_patches(const Particles::ParticleHandler< dim > &particle_handler, const aspect::Particle::Property::ParticlePropertyInformation &property_information, const std::vector< std::string > &exclude_output_properties, const bool only_group_3d_vectors)
std::vector< XDMFEntry > xdmf_entries
Definition: particles.h:251
std::vector< std::string > get_dataset_names() const override
Definition: compat.h:53
std::vector< std::string > exclude_output_properties
Definition: particles.h:288
std::vector< std::string > dataset_names
Definition: particles.h:97
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges() const
Threads::Thread< void > background_thread
Definition: particles.h:282
std::string temporary_output_location
Definition: particles.h:268
std::vector< std::vector< std::string > > output_file_names_by_timestep
Definition: particles.h:243
std::vector< std::tuple< unsigned int, unsigned int, std::string > > get_vector_data_ranges() const override
std::vector< std::string > output_formats
Definition: particles.h:219