]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a version of ParticleAccessor::set_properties().
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 May 2020 21:20:22 +0000 (15:20 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 May 2020 21:26:37 +0000 (15:26 -0600)
include/deal.II/particles/particle_accessor.h
source/particles/particle_accessor.cc

index d3a91867ea4a8e39fa40c8f8761cc10fd105911a..415a69cddc631fdfc77c5a32a34f14c89c4463ef 100644 (file)
@@ -123,6 +123,15 @@ namespace Particles
     void
     set_properties(const std::vector<double> &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<const double> &new_properties);
+
     /**
      * Get write-access to properties of this particle.
      *
index 2f861c34240a85cbb2279a6d45412c93a3237adf..95d3cdc303a38dbe2666d0b2ac01348572ea57fe 100644 (file)
@@ -137,7 +137,18 @@ namespace Particles
     Assert(particle != map->end(), ExcInternalError());
 
     particle->second.set_properties(new_properties);
-    return;
+  }
+
+
+
+  template <int dim, int spacedim>
+  void
+  ParticleAccessor<dim, spacedim>::set_properties(
+    const ArrayView<const double> &new_properties)
+  {
+    Assert(particle != map->end(), ExcInternalError());
+
+    particle->second.set_properties(new_properties);
   }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.