33 #ifndef SERIALIZATION_PARTICLES_H
34 #define SERIALIZATION_PARTICLES_H
36 #include <cereal/cereal.hpp>
41 template<
class Archive>
43 cereal::size_type size;
44 ar ( cereal::make_size_tag(size) );
48 for (
int i = 0;
i < size;
i++) {
55 template<
class Archive>
58 for (
const auto& p : handl) {
63 template<
class Archive>
69 ar( CEREAL_NVP(position),
78 template<
class Archive>
82 cereal::make_nvp(
"radius", p.
getRadius()));
double Mdouble
Definition: GeneralDefine.h:34
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void save(Archive &ar, const ParticleHandler &handl)
Definition: Particles.h:56
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:42
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Definition: BaseParticle.h:54
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1325
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51