31 const std::vector<DataComponentInterpretation::DataComponentInterpretation>
37 "When calling Particles::DataOut::build_patches with data component "
38 "names and interpretations you need to provide as many data component "
39 "names as interpretations. Provide the same name for components that "
40 "belong to a single vector or tensor."));
46 particles.
begin()->has_properties(),
48 "You called Particles::DataOut::build_patches with data component "
49 "names and interpretations, but the particles do not seem to own "
54 particles.
begin()->get_properties().
size(),
56 "When calling Particles::DataOut::build_patches with data component "
57 "names and interpretations you need to provide as many data component "
58 "names as the particles have properties."));
61 dataset_names.clear();
62 dataset_names.emplace_back(
"id");
63 dataset_names.insert(dataset_names.end(),
67 data_component_interpretations.clear();
68 data_component_interpretations.emplace_back(
70 data_component_interpretations.insert(
71 data_component_interpretations.end(),
83 patches[i].vertices[0] =
particle->get_location();
84 patches[i].patch_index = i;
89 patches[i].data(0, 0) =
particle->get_id();
132 std::tuple<
unsigned int,
141 Assert(dataset_names.size() == data_component_interpretations.size(),
146 data_component_interpretations.
size();
151 switch (data_component_interpretations[i])
168 i, dataset_names[i]));
169 for (
unsigned int dd = 1;
dd < spacedim; ++
dd)
171 data_component_interpretations[i +
dd] ==
174 ExcInvalidVectorDeclaration(i, dataset_names[i]));
179 std::string name = dataset_names[i];
180 for (
unsigned int dd = 1;
dd < spacedim; ++
dd)
181 if (name != dataset_names[i +
dd])
191 ranges.emplace_back(std::forward_as_tuple(
208 const unsigned int size = spacedim * spacedim;
214 i, dataset_names[i]));
215 for (
unsigned int dd = 1;
dd < size; ++
dd)
217 data_component_interpretations[i +
dd] ==
220 ExcInvalidTensorDeclaration(i, dataset_names[i]));
225 std::string name = dataset_names[i];
226 for (
unsigned int dd = 1;
dd < size; ++
dd)
227 if (name != dataset_names[i +
dd])
234 ranges.emplace_back(std::forward_as_tuple(
virtual const std::vector< DataOutBase::Patch< 0, spacedim > > & get_patches() const override
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges() const override
void build_patches(const Particles::ParticleHandler< dim, spacedim > &particles, const std::vector< std::string > &data_component_names={}, const std::vector< DataComponentInterpretation::DataComponentInterpretation > &data_component_interpretations={})
virtual std::vector< std::string > get_dataset_names() const override
particle_iterator begin() const
particle_iterator end() const
types::particle_index n_locally_owned_particles() const