Walls.h File Reference

Go to the source code of this file.

Classes

struct  SerializationWrappers::Wrapper< Base >
 

Namespaces

 SerializationWrappers
 

Functions

template<class Archive >
void save (Archive &ar, const WallHandler &w)
 
template<class Archive >
void load (Archive &ar, WallHandler &w)
 
template<class Archive >
void save (Archive &ar, const SerializationWrappers::Wrapper< BaseWall > w)
 
template<class Archive >
void load (Archive &ar, SerializationWrappers::Wrapper< BaseWall > &b)
 
template<class Archive >
void load (Archive &ar, InfiniteWall &w)
 
template<class Archive >
void save (Archive &ar, const InfiniteWall &w)
 
template<class Archive >
void load (Archive &ar, CylindricalWall &w)
 
template<class Archive >
void save (Archive &ar, const CylindricalWall &w)
 

Function Documentation

◆ load() [1/4]

template<class Archive >
void load ( Archive &  ar,
CylindricalWall w 
)
145  {
146  //Vec3D position;
147  Mdouble radius;
148  ar( //CEREAL_NVP( position ),
149  CEREAL_NVP( radius ));
150 }
double Mdouble
Definition: GeneralDefine.h:34

◆ load() [2/4]

template<class Archive >
void load ( Archive &  ar,
InfiniteWall w 
)
130  {
131  Vec3D position, normal;
132  ar( CEREAL_NVP( position ),
133  CEREAL_NVP( normal ));
134  w.setPosition( position );
135  w.setNormal( normal );
136 }
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
void setNormal(Vec3D normal)
Changes the normal of the InfiniteWall.
Definition: InfiniteWall.cc:127
Definition: Vector.h:51

References InfiniteWall::setNormal(), and BaseInteractable::setPosition().

◆ load() [3/4]

template<class Archive >
void load ( Archive &  ar,
SerializationWrappers::Wrapper< BaseWall > &  b 
)
103 {
104  logger(DEBUG, "In load Generic Wall!");
105  std::string type;
106  ar(cereal::make_nvp("type", type));
107  logger(INFO, "Type = %", type);
108  if (type == "InfiniteWall")
109  {
110  b.data = new InfiniteWall();
111  //ar( cereal::make_nvp("value", dynamic_cast<InfiniteWall*>(b)));
112  load(ar, *(dynamic_cast<InfiniteWall*>(b.data)));
113  /* } else if (type == "FiniteWall") {
114  b = new InfiniteWall();
115  ar( cereal::make_nvp("value", dynamic_cast<FiniteWall*>(b)));*/
116  }
117  else if (type == "InfiniteWallWithHole")
118  {
119  b.data = new InfiniteWallWithHole();
120  //ar( cereal::make_nvp("value", dynamic_cast<InfiniteWallWithHole*>(b)));
121  } else if (type == "CylindricalWall") {
122  b.data = new CylindricalWall();
123  //ar( cereal::make_nvp("value", dynamic_cast<CylindricalWall*>(b)));
124  load( ar, *(dynamic_cast<CylindricalWall*>(b.data)));
125  }
126 
127 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
LL< Log::DEBUG > DEBUG
Debug information.
Definition: Logger.cc:58
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void load(Archive &ar, WallHandler &w)
Definition: Walls.h:65
Definition: CylindricalWall.h:38
Definition: InfiniteWallWithHole.h:38
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
Base * data
Definition: Walls.h:52

References SerializationWrappers::Wrapper< Base >::data, DEBUG, INFO, load(), and logger.

◆ load() [4/4]

template<class Archive >
void load ( Archive &  ar,
WallHandler w 
)
65  {
66  cereal::size_type count;
67  ar ( cereal::make_size_tag(count));
68 
69  //Due to inheritance etc etc, we need to create pointers here.
70  logger(VERBOSE, "WallHandler");
71  for (int i = 0; i < count; i++)
72  {
74  logger(INFO, " Pass % / %\n", i, count, Flusher::NO_FLUSH);
75  ar(wall);
76  logger(INFO, " Adding...\n", Flusher::NO_FLUSH);
77  w.copyAndAddObject(wall.data);
78  logger(INFO, " Done. ");
79  }
80 }
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
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
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Definition: Walls.h:43

References BaseHandler< T >::copyAndAddObject(), SerializationWrappers::Wrapper< Base >::data, constants::i, INFO, logger, NO_FLUSH, and VERBOSE.

Referenced by load().

◆ save() [1/4]

template<class Archive >
void save ( Archive &  ar,
const CylindricalWall w 
)
153  {
154  ar ( //cereal::make_nvp("position", w.getPosition()),
155  cereal::make_nvp("radius", w.getRadius()));
156 }
double getRadius() const
access function for radius
Definition: CylindricalWall.cc:114

References CylindricalWall::getRadius().

◆ save() [2/4]

template<class Archive >
void save ( Archive &  ar,
const InfiniteWall w 
)
139  {
140  ar( cereal::make_nvp("position", w.getPosition()),
141  cereal::make_nvp("normal", w.getNormal()));
142 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Vec3D getNormal() const
Access function for normal.
Definition: InfiniteWall.cc:213

References InfiniteWall::getNormal(), and BaseInteractable::getPosition().

◆ save() [3/4]

template<class Archive >
void save ( Archive &  ar,
const SerializationWrappers::Wrapper< BaseWall w 
)
83  {
84  if (typeid(*(w.data)) == typeid(InfiniteWall)) {
85  ar( cereal::make_nvp("type","InfiniteWall"));
86  save( ar, *(dynamic_cast<InfiniteWall*>(w.data)));
87  //ar( cereal::make_nvp("value", dynamic_cast<const InfiniteWall*>(b)));
88  /*} else if (typeid(b) == typeid(FiniteWall)) {
89  ar( cereal::make_nvp("type","FiniteWall"));
90  ar( cereal::make_nvp("value", dynamic_cast<const FiniteWall*>(b))); */
91  } else if (typeid(*(w.data)) == typeid (InfiniteWallWithHole)) {
92  ar( cereal::make_nvp("type","InfiniteWallWithHole"));
93  //save( ar, *(dynamic_cast<InfiniteWallWithHole*>(w.data)));
94  } else if (typeid(*(w.data)) == typeid (CylindricalWall)) {
95  ar( cereal::make_nvp("type","CylindricalWall"));
96  save( ar, *(dynamic_cast<CylindricalWall*>(w.data)));
97  }
98 
99 }
void save(Archive &ar, const WallHandler &w)
Definition: Walls.h:57

References SerializationWrappers::Wrapper< Base >::data, and save().

◆ save() [4/4]

template<class Archive >
void save ( Archive &  ar,
const WallHandler w 
)
57  {
58  ar ( cereal::make_size_tag(w.getNumberOfObjects()));
59  for (const auto& wall UNUSED : w ) {
60  ar ( w );
61  }
62 }
#define UNUSED
Definition: GeneralDefine.h:39
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648

References BaseHandler< T >::getNumberOfObjects(), and UNUSED.

Referenced by save().