24 template <
int dim,
int spacedim>
29 , property_pool(nullptr)
35 template <
int dim,
int spacedim>
40 , reference_location(reference_location)
48 template <
int dim,
int spacedim>
66 their_properties.
end(),
67 my_properties.
begin());
73 template <
int dim,
int spacedim>
80 const double *pdata =
reinterpret_cast<const double *
>(id_data);
82 for (
unsigned int i = 0; i < spacedim; ++i)
85 for (
unsigned int i = 0; i < dim; ++i)
99 const unsigned int size = particle_properties.
size();
100 for (
unsigned int i = 0; i < size; ++i)
101 particle_properties[i] = *pdata++;
104 data =
static_cast<const void *
>(pdata);
109 template <
int dim,
int spacedim>
111 :
location(std::move(particle.location))
113 ,
id(std::move(particle.id))
122 template <
int dim,
int spacedim>
126 if (
this != &particle)
142 their_properties.
end(),
143 my_properties.
begin());
153 template <
int dim,
int spacedim>
158 if (
this != &particle)
172 template <
int dim,
int spacedim>
181 template <
int dim,
int spacedim>
188 double *pdata =
reinterpret_cast<double *
>(id_data);
191 for (
unsigned int i = 0; i < spacedim; ++i, ++pdata)
195 for (
unsigned int i = 0; i < dim; ++i, ++pdata)
203 for (
unsigned int i = 0; i < particle_properties.
size(); ++i, ++pdata)
204 *pdata = particle_properties[i];
207 data =
static_cast<void *
>(pdata);
212 template <
int dim,
int spacedim>
223 size +=
sizeof(
double) * particle_properties.
size();
230 template <
int dim,
int spacedim>
239 template <
int dim,
int spacedim>
248 template <
int dim,
int spacedim>
257 template <
int dim,
int spacedim>
266 template <
int dim,
int spacedim>
275 template <
int dim,
int spacedim>
284 template <
int dim,
int spacedim>
293 template <
int dim,
int spacedim>
307 new_properties.
size() == old_properties.
size(),
310 "You are trying to assign properties with an incompatible length. ") +
311 "The particle has space to store " +
313 "and this function tries to assign" +
315 "This is not allowed."));
317 if (old_properties.
size() > 0)
319 new_properties.
end(),
320 old_properties.
begin());
325 template <
int dim,
int spacedim>
336 template <
int dim,
int spacedim>
350 std::fill(my_properties.
begin(), my_properties.
end(), 0.0);
358 template <
int dim,
int spacedim>
371 #include "particle.inst" PropertyPool::Handle properties
Point< spacedim > location
void set_property_pool(PropertyPool &property_pool)
Particle< dim, spacedim > & operator=(const Particle< dim, spacedim > &particle)
ArrayView< double > get_properties(const Handle handle)
void write_data(void *&data) const
types::particle_index get_id() const
void set_properties(const ArrayView< const double > &new_properties)
const Point< spacedim > & get_location() const
void deallocate_properties_array(const Handle handle)
const ArrayView< double > get_properties()
void set_reference_location(const Point< dim > &new_reference_location)
std::size_t serialized_size_in_bytes() const
unsigned int particle_index
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
static const Handle invalid_handle
const Point< dim > & get_reference_location() const
#define DEAL_II_NAMESPACE_CLOSE
Point< dim > reference_location
bool has_properties() const
#define DEAL_II_NAMESPACE_OPEN
void set_id(const types::particle_index &new_id)
void set_location(const Point< spacedim > &new_location)
void copy(const T *begin, const T *end, U *dest)
PropertyPool * property_pool
Handle allocate_properties_array()
static ::ExceptionBase & ExcInternalError()