Problem.h File Reference
#include <cereal/cereal.hpp>
#include <Mercury3D.h>

Go to the source code of this file.

Classes

class  SerializedProblem
 

Functions

template<class Archive >
void load (Archive &ar, SerializedProblem &base)
 
template<class Archive >
void save (Archive &ar, const SerializedProblem &base)
 

Function Documentation

◆ load()

template<class Archive >
void load ( Archive &  ar,
SerializedProblem base 
)
45  {
46  using namespace cereal;
47 
48  std::string name;
49  Mdouble tMax;
50  Mdouble tStep;
51  Vec3D gravity;
52  Vec3D minimum;
53  Vec3D maximum;
54 
55  ar( CEREAL_NVP( name )
56  ,CEREAL_NVP( tMax )
57  ,CEREAL_NVP( tStep )
58  ,CEREAL_NVP( gravity )
59  ,CEREAL_NVP( minimum )
60  ,CEREAL_NVP( maximum )
61  ,cereal::make_nvp("particles", base.particleHandler)
62  ,cereal::make_nvp("walls", base.wallHandler)
63  );
64 
65  base.setName( name );
66  base.setTimeMax( tMax );
67  base.setTimeStep( tStep );
68  base.setGravity( gravity );
69  base.setXMin(minimum.X);
70  base.setYMin(minimum.Y);
71  base.setZMin(minimum.Z);
72 
73  base.setXMax(maximum.X);
74  base.setYMax(maximum.Y);
75  base.setZMax(maximum.Z);
76 }
double Mdouble
Definition: GeneralDefine.h:34
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Definition: Vector.h:51
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
std::string name
Definition: MercuryProb.h:48

References units::name, DPMBase::particleHandler, DPMBase::setGravity(), DPMBase::setName(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), DPMBase::wallHandler, Vec3D::X, Vec3D::Y, and Vec3D::Z.

◆ save()

template<class Archive >
void save ( Archive &  ar,
const SerializedProblem base 
)
79  {
80  Vec3D minimum;
81  Vec3D maximum;
82 
83  minimum.X = base.getXMin();
84  minimum.Y = base.getYMin();
85  minimum.Z = base.getZMin();
86  maximum.X = base.getXMax();
87  maximum.Y = base.getYMax();
88  maximum.Z = base.getZMax();
89 
90  ar ( cereal::make_nvp("name", base.getName())
91  ,CEREAL_NVP(minimum)
92  ,CEREAL_NVP(maximum)
93  ,cereal::make_nvp("tMax", base.getTimeMax())
94  ,cereal::make_nvp("tStep", base.getTimeStep())
95  ,cereal::make_nvp("gravity", base.getGravity())
96  ,cereal::make_nvp("particles", base.particleHandler)
97  ,cereal::make_nvp("walls", base.wallHandler)
98  );
99 }
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1391
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644

References DPMBase::getGravity(), DPMBase::getName(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), DPMBase::particleHandler, DPMBase::wallHandler, Vec3D::X, Vec3D::Y, and Vec3D::Z.