LiquidFilm< Particle > Class Template Reference

#include <LiquidFilmParticle.h>

+ Inheritance diagram for LiquidFilm< Particle >:

Public Member Functions

 LiquidFilm ()
 Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1. More...
 
 LiquidFilm (const LiquidFilm &p)
 Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism. More...
 
 ~LiquidFilm () override=default
 Particle destructor, needs to be implemented and checked if it removes tangential spring information. More...
 
LiquidFilmcopy () const override
 Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism. More...
 
void write (std::ostream &os) const override
 
std::string getName () const override
 
void read (std::istream &is) override
 
Mdouble getLiquidVolume () const
 
void setLiquidVolume (Mdouble liquidVolume)
 
void addLiquidVolume (Mdouble liquidVolume)
 
unsigned getNumberOfFieldsVTK () const override
 
std::string getTypeVTK (unsigned i) const override
 
std::string getNameVTK (unsigned i) const override
 
std::vector< MdoublegetFieldVTK (unsigned i) const override
 
bool isSphericalParticle () const override
 

Protected Attributes

Mdouble liquidVolume_
 

Constructor & Destructor Documentation

◆ LiquidFilm() [1/2]

template<class Particle >
LiquidFilm< Particle >::LiquidFilm ( )
inline

Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.

default constructor

43  {
44  liquidVolume_ = 0;
45  }
Mdouble liquidVolume_
Definition: LiquidFilmParticle.h:136

References LiquidFilm< Particle >::liquidVolume_.

Referenced by LiquidFilm< Particle >::copy().

◆ LiquidFilm() [2/2]

template<class Particle >
LiquidFilm< Particle >::LiquidFilm ( const LiquidFilm< Particle > &  p)
inline

Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism.

Constructor that copies most of the properties of the given particle. Please note that not everything is copied, for example the position in the HGrid is not determined yet by the end of this constructor. It also does not copy the interactions and the pointer to the handler that handles this particle. Use with care.

Parameters
[in,out]pReference to the LiquidFilm this one should become a copy of.
56  : Particle(p)
57  {
59  }

References LiquidFilm< Particle >::liquidVolume_.

◆ ~LiquidFilm()

template<class Particle >
LiquidFilm< Particle >::~LiquidFilm ( )
overridedefault

Particle destructor, needs to be implemented and checked if it removes tangential spring information.

Destructor. It asks the ParticleHandler to check if this was the smallest or largest particle and adjust itself accordingly.

Member Function Documentation

◆ addLiquidVolume()

◆ copy()

template<class Particle >
LiquidFilm* LiquidFilm< Particle >::copy ( ) const
inlineoverride

Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.

Copy method. Uses copy constructor to create a copy on the heap. Useful for polymorphism.

Returns
pointer to the particle's copy
76  {
77  return new LiquidFilm(*this);
78  }
LiquidFilm()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.
Definition: LiquidFilmParticle.h:42

References LiquidFilm< Particle >::LiquidFilm().

◆ getFieldVTK()

template<class Particle >
std::vector< Mdouble > LiquidFilm< Particle >::getFieldVTK ( unsigned  i) const
override
175 {
176  if (i==1) {
177  return std::vector<Mdouble>(1, liquidVolume_);
178  } else /*i=2 or 0*/ {
179  Mdouble fullLiquidVolume = (i==2)?0:liquidVolume_;
180  for (auto k : this->getInteractions()) {
181  if(dynamic_cast<LiquidMigrationWilletInteraction*>(k)){
182  auto j = dynamic_cast<LiquidMigrationWilletInteraction*>(k);
183  if (j && j->getLiquidBridgeVolume()) {
184  fullLiquidVolume += 0.5*j->getLiquidBridgeVolume();
185  }
186  }
187  if(dynamic_cast<LiquidMigrationLSInteraction*>(k)) {
188  auto j = dynamic_cast<LiquidMigrationLSInteraction*>(k);
189  if (j && j->getLiquidBridgeVolume()) {
190  fullLiquidVolume += 0.5 * j->getLiquidBridgeVolume();
191  }
192  }
193 
194  }
195  return std::vector<Mdouble>(1, fullLiquidVolume);
196  }
197 }
double Mdouble
Definition: GeneralDefine.h:34
Defines the liquid bridge LS interaction between two particles or walls.
Definition: LiquidMigrationLSInteraction.h:45
Mdouble getLiquidBridgeVolume() const
Definition: LiquidMigrationLSInteraction.cc:497
Defines the liquid bridge willet interaction between two particles or walls.
Definition: LiquidMigrationWilletInteraction.h:45
Mdouble getLiquidBridgeVolume() const
Definition: LiquidMigrationWilletInteraction.cc:462
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References constants::i.

◆ getLiquidVolume()

◆ getName()

template<class Particle >
std::string LiquidFilm< Particle >::getName ( ) const
inlineoverride

Returns the name of the object; in this case 'LiquidFilm'.

Returns
The object name.
97  {
98  return "LiquidFilm";
99  }

◆ getNameVTK()

template<class Particle >
std::string LiquidFilm< Particle >::getNameVTK ( unsigned  i) const
override
164 {
165  if (i==1)
166  return "liquidFilmVolume";
167  else if (i==2)
168  return "liquidBridgeVolume";
169  else /*i=0*/
170  return "fullLiquidVolume";
171 }

References constants::i.

◆ getNumberOfFieldsVTK()

template<class Particle >
unsigned LiquidFilm< Particle >::getNumberOfFieldsVTK ( ) const
inlineoverride
119  {
120  return 3;
121  }

◆ getTypeVTK()

template<class Particle >
std::string LiquidFilm< Particle >::getTypeVTK ( unsigned  i) const
inlineoverride
124  {
125  return "Float32";
126  }

◆ isSphericalParticle()

template<class Particle >
bool LiquidFilm< Particle >::isSphericalParticle ( ) const
inlineoverride
132 {return true;}

◆ read()

template<class Particle >
void LiquidFilm< Particle >::read ( std::istream &  is)
override

Particle read function. Has an std::istream as argument, from which it extracts the radius_, invMass_ and invInertia_, respectively. From these the mass_ and inertia_ are deduced. An additional set of properties is read through the call to the parent's method BaseParticle::read().

Parameters
[in,out]isinput stream with particle properties.
151 {
152  Particle::read(is);
153  std::string dummy;
154  is >> dummy >> liquidVolume_;
155  // a fix to allow reading of restart files pre-nonspherical
156  if (dummy == "invInertia")
157  {
158  is >> dummy >> liquidVolume_;
159  }
160 }

◆ setLiquidVolume()

◆ write()

template<class Particle >
void LiquidFilm< Particle >::write ( std::ostream &  os) const
inlineoverride

LiquidFilm print method, which accepts an os std::ostream as input. It prints human readable LiquidFilm information to the std::ostream.

Parameters
[in,out]osstream to which the info is written
87  {
88  Particle::write(os);
89  os << " liquidVolume " << liquidVolume_;
90  }

References LiquidFilm< Particle >::liquidVolume_.

Member Data Documentation

◆ liquidVolume_


The documentation for this class was generated from the following file: