Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a version of ParticleAccessor::set_properties(). #10319

Merged
merged 2 commits into from May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/news/changes/minor/20200522Bangerth
@@ -0,0 +1,5 @@
New: There is now a second overload for
Particles::ParticleAccessor::set_properties() that takes an ArrayView
as argument.
<br>
(Wolfgang Bangerth, 2020/05/22)
9 changes: 9 additions & 0 deletions include/deal.II/particles/particle_accessor.h
Expand Up @@ -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.
*
Expand Down
13 changes: 12 additions & 1 deletion source/particles/particle_accessor.cc
Expand Up @@ -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);
}


Expand Down