From 87c7362a5f29077130b974c38571791664e8fdef Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 22 May 2020 15:20:22 -0600 Subject: [PATCH] Add a version of ParticleAccessor::set_properties(). --- include/deal.II/particles/particle_accessor.h | 9 +++++++++ source/particles/particle_accessor.cc | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/deal.II/particles/particle_accessor.h b/include/deal.II/particles/particle_accessor.h index d3a91867ea..415a69cddc 100644 --- a/include/deal.II/particles/particle_accessor.h +++ b/include/deal.II/particles/particle_accessor.h @@ -123,6 +123,15 @@ namespace Particles void set_properties(const std::vector &new_properties); + /** + * Set the properties of this particle. + * + * @param [in] new_properties An ArrayView pointing to memory locations + * containing the new properties for this particle. + */ + void + set_properties(const ArrayView &new_properties); + /** * Get write-access to properties of this particle. * diff --git a/source/particles/particle_accessor.cc b/source/particles/particle_accessor.cc index 2f861c3424..95d3cdc303 100644 --- a/source/particles/particle_accessor.cc +++ b/source/particles/particle_accessor.cc @@ -137,7 +137,18 @@ namespace Particles Assert(particle != map->end(), ExcInternalError()); particle->second.set_properties(new_properties); - return; + } + + + + template + void + ParticleAccessor::set_properties( + const ArrayView &new_properties) + { + Assert(particle != map->end(), ExcInternalError()); + + particle->second.set_properties(new_properties); } -- 2.39.5