revision: v0.14
VTKData.h
Go to the documentation of this file.
1 //Copyright (c) 2015, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef TOOLS_VTKDATA_H
27 #define TOOLS_VTKDATA_H
28 
29 #include <fstream>
30 #include <iostream>
31 #include <string>
32 #include <sstream>
33 #include <functional>
34 #include <map>
35 #include <vector>
36 #include <type_traits>
37 
38 //Namespace Detail contains black magic.
39 namespace Detail {
43  template<typename T>
45  {
46  std::string name_;
47  public:
52  VTKPointDescriptorEntry(std::string fieldName)
53  : name_(fieldName)
54  {
55  }
56 
58  {
59  }
60 
66  virtual void emit(std::ostream& out, const T& t) const = 0;
71  virtual std::string getTypeName() const = 0;
75  std::string getName() const
76  {
77  return name_;
78  }
82  virtual std::size_t getNumberOfComponents() const = 0;
83  };
84 
86  template<typename V>
87  typename std::enable_if<std::is_floating_point<V>::value, std::string>::type
89  {
90  return "Float32";
91  }
92 
93  template<typename V>
94  typename std::enable_if<std::is_integral<V>::value && std::is_unsigned<V>::value, std::string>::type
96  {
97  return "UInt32";
98  }
99 
100  template<typename V>
101  typename std::enable_if<std::is_integral<V>::value && std::is_signed<V>::value, std::string>::type
103  {
104  return "Int32";
105  }
106 
107  template<typename V>
108  typename std::enable_if<std::is_array<V>::value, std::string>::type
110  {
111  return toVTKDataType< typename std::remove_extent<V>::type >();
112  }
113 
115  template<typename T, typename V>
116  typename std::enable_if<std::is_array<V>::value || std::is_pointer<V>::value, void>::type
117  emitProxy(std::ostream& out, const T& t, std::size_t nComponents, V T::*member)
118  {
119  for (std::size_t i = 0; i < nComponents; i++)
120  {
121  out << (t.*member)[i] << " ";
122  }
123  }
124 
125  template<typename T, typename V>
126  typename std::enable_if<!(std::is_array<V>::value || std::is_pointer<V>::value), void>::type
127  emitProxy(std::ostream& out, const T& t, std::size_t nComponents, V T::*member)
128  {
129  out << t.*member << " ";
130  }
131 
135  template<typename T, typename V>
137  {
138  const V T::* member_;
139  const std::size_t nComponents_;
140  public:
141  VTKPointDescriptorEntryImpl(std::string name, V T::*member, std::size_t nComponents)
142  : VTKPointDescriptorEntry<T>(name), member_(member), nComponents_(nComponents)
143  { }
144 
145  std::string getTypeName() const override
146  {
147  return toVTKDataType<V>();
148  }
149 
150  void emit(std::ostream& out, const T& t) const override
151  {
152  emitProxy(out, t, nComponents_, member_);
153  }
154 
155  std::size_t getNumberOfComponents() const override
156  {
157  return nComponents_;
158  }
159  };
160 }
161 
170 template<typename T>
172 {
173  std::vector< Detail::VTKPointDescriptorEntry<T>* > entries_;
175  public:
177  {
178  }
179 
181  {
182  for (auto * d : entries_)
183  delete d;
184  }
185 
186  template<typename DATATYPE>
187  typename std::enable_if<std::is_array<DATATYPE>::value, VTKPointDescriptor&>::type
188  addProperty(std::string name, DATATYPE T::*m, bool isPrimary = false)
189  {
191  = new Detail::VTKPointDescriptorEntryImpl<T,DATATYPE>(name, m, std::extent<DATATYPE>::value);
192  entries_.push_back(data);
193  if (isPrimary)
194  positionEntry_ = entries_.back();
195 
196  return *this;
197  }
198 
199  template<typename DATATYPE>
200  typename std::enable_if<!std::is_array<DATATYPE>::value, VTKPointDescriptor&>::type
201  addProperty(std::string name, DATATYPE T::*m, bool isPrimary = false)
202  {
205  entries_.push_back(data);
206  if (isPrimary)
207  positionEntry_ = entries_.back();
208 
209  return *this;
210  }
211 
212  template<typename DATATYPE>
213  VTKPointDescriptor& addProperty(std::string name, DATATYPE T::*m, std::size_t nComponents, bool isPrimary = false)
214  {
217  entries_.push_back(data);
218  if (isPrimary)
219  positionEntry_ = entries_.back();
220 
221  return *this;
222  }
223 
224 
225  template<typename VT>
226  friend class VTKUnstructuredGrid;
227 };
228 
229 /* \brief VTKCollection output file writer
230 *
231 * This is templated by the VTKDescriptor DESCR.
232 * \param T the backing output type
233 */
235 {
236  std::ofstream outFile_;
239  std::size_t recordID_;
240 
241  void writeHeader()
242  {
243  outFile_ <<
244  "<?xml version=\"1.0\"?>\n"
245  "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"LittleEndian\">\n"
246  " <Collection>\n";
247  hasHeader_ = true;
248  }
249 
250  void writeFooter()
251  {
252  outFile_ <<
253  " </Collection>\n"
254  "</VTKFile>\n";
255  hasFooter_ = true;
256  }
257 
258  public:
259  VTKCollection(std::string fileName)
260  : outFile_(fileName), hasHeader_(false), hasFooter_(false), recordID_(0)
261  {
262  }
263 
265  {
266  if (hasHeader_ && !hasFooter_)
267  writeFooter();
268  }
269 
270  /* Returns true if the output file is valid and no error bits are set. */
271  operator bool() const
272  {
273  return outFile_.good();
274  }
275 
276  /* Appends the (relative) path to this index file. */
277  void append(std::string filename)
278  {
279  if (!hasHeader_)
280  writeHeader();
281 
282  outFile_ <<
283  "<DataSet group=\"\" part=\"0\" timestep=\"" << recordID_ << "\" file=\"" << filename << "\" />\n";
284 
285  recordID_++;
286  }
287 };
288 
293 template<typename T>
295 {
297  std::ofstream outFile_;
298  public:
303  VTKUnstructuredGrid(std::string filename, const VTKPointDescriptor<T>* descr)
304  : descriptor_(descr), outFile_(filename)
305  {
306  }
307 
309  operator bool() const
310  {
311  return outFile_.good();
312  }
313 
319  template<typename C>
320  void write(const C& container)
321  {
322  outFile_ <<
323  "<?xml version=\"1.0\"?>\n"
324  "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n"
325  " <UnstructuredGrid>\n"
326  " <Piece NumberOfPoints=\"" << container.size() << "\" NumberOfCells=\"0\">\n"
327  " <Cells>\n"
328  " <DataArray type=\"Int32\" name=\"connectivity\" format=\"ascii\">\n"
329  " 0\n"
330  " </DataArray>\n"
331  " <DataArray type=\"Float32\" name=\"offset\" format=\"ascii\">\n"
332  " 0\n"
333  " </DataArray>\n"
334  " <DataArray type=\"UInt8\" name=\"types\" format=\"ascii\">\n"
335  " 1\n"
336  " </DataArray>\n"
337  " </Cells>\n"
338  " <Points>\n";
339  Detail::VTKPointDescriptorEntry<T>* pDescr = descriptor_->positionEntry_;
340  outFile_ << "<DataArray type=\"" << pDescr->getTypeName() << "\" "
341  "NumberOfComponents=\"" << pDescr->getNumberOfComponents() << "\" "
342  "format=\"ascii\">\n";
343  for (const T& mem : container)
344  {
345  pDescr->emit(outFile_, mem);
346  }
347  outFile_ << "\n</DataArray>\n";
348 
349  outFile_ <<
350  " </Points>\n"
351  " <PointData>\n";
352 
353  for (Detail::VTKPointDescriptorEntry<T>* descr : descriptor_->entries_)
354  {
355  outFile_ << "<DataArray type=\"" << descr->getTypeName() << "\" "
356  "Name=\"" << descr->getName() << "\" "
357  "NumberOfComponents=\"" << descr->getNumberOfComponents() << "\" "
358  "format=\"ascii\">\n";
359  for (const T& mem : container)
360  {
361  descr->emit(outFile_, mem);
362  }
363  outFile_ << "\n</DataArray>\n";
364  }
365  outFile_ <<
366  " </PointData>\n"
367  " <CellData/>\n"
368  " </Piece>\n"
369  " </UnstructuredGrid>\n"
370  "</VTKFile>\n";
371  }
372 };
373 
374 #endif
DPMBase::setMax
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
VTKCollection::writeFooter
void writeFooter()
Definition: VTKData.h:250
SinterInteraction
Computes normal forces in case of a linear plastic visco-elastic interaction.
Definition: SinterInteraction.h:40
vibratedBed::setAmplitude
void setAmplitude(Mdouble amplitude)
Definition: vibratedBed.cpp:79
mathsFunc::square
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
VolumeTest::test
void test()
Definition: VolumeUnitTest.cpp:38
DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
MercuryBase::getHGrid
HGrid * getHGrid()
Gets the HGrid used by this problem.
Definition: MercuryBase.h:311
VTKPointDescriptor::addProperty
VTKPointDescriptor & addProperty(std::string name, DATATYPE T::*m, std::size_t nComponents, bool isPrimary=false)
Definition: VTKData.h:213
VTKPointDescriptor::addProperty
std::enable_if<!std::is_array< DATATYPE >::value, VTKPointDescriptor & >::type addProperty(std::string name, DATATYPE T::*m, bool isPrimary=false)
Definition: VTKData.h:201
Detail::VTKPointDescriptorEntryImpl
Definition: VTKData.h:137
File::setFileType
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
DPMBase::readRestartFile
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:2921
SilbertPeriodic.h
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
DPMBase::setMin
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
DPMBase::getTimeStep
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Detail::VTKPointDescriptorEntryImpl::member_
const V T::* member_
Definition: VTKData.h:138
main
int main(int argc, char *argv[])
Definition: vibratedBed.cpp:101
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
Chute::getChuteAngleDegrees
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:743
vibratedBed::frequency_
Mdouble frequency_
Definition: vibratedBed.cpp:98
VTKCollection::append
void append(std::string filename)
Definition: VTKData.h:277
Vreman::set_InflowNu
void set_InflowNu(double Nu)
Definition: Vreman.cpp:80
VisualisationTest::actionsAfterSolve
void actionsAfterSolve() override
A virtual function which allows to define operations to be executed after the solve().
Definition: VisualisationTest.cpp:59
VTKCollection::~VTKCollection
~VTKCollection()
Definition: VTKData.h:264
Chute::setMaxFailed
void setMaxFailed(unsigned int maxFailed)
Sets the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:754
Detail::VTKPointDescriptorEntry::VTKPointDescriptorEntry
VTKPointDescriptorEntry(std::string fieldName)
initialises this data member with given name.
Definition: VTKData.h:52
Detail::toVTKDataType
std::enable_if< std::is_floating_point< V >::value, std::string >::type toVTKDataType()
Definition: VTKData.h:88
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
Chute::setInflowVelocity
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:910
Chute::setInflowHeight
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:884
BaseWall
Basic class for walls.
Definition: BaseWall.h:48
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
VTKPointDescriptor
Definition: VTKData.h:172
main
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: VerticalMixerDemo.cpp:28
VTKUnstructuredGrid::outFile_
std::ofstream outFile_
Definition: VTKData.h:297
main
int main(int argc, char *argv[])
Definition: VremanHopper.cpp:86
ParticleHandler::getNumberOfObjects
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:1315
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
vibratedBed::vibratedBed
vibratedBed()
Definition: vibratedBed.cpp:33
VerticalMixer.h
ChuteWithHopper::setupInitialConditions
void setupInitialConditions() override
Sets up the initial conditions for the problem.
Definition: ChuteWithHopper.cc:130
Vec3D::dot
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:76
Vreman
Definition: Vreman.cpp:38
HGrid::info
void info() const
Displays the member variables of the hGrid object. This function is intended for debugging the hGrid,...
Definition: HGrid.cc:151
Chute::setupInitialConditions
void setupInitialConditions() override
Creates bottom, side walls and a particle insertion boundary.
Definition: Chute.cc:242
Detail::VTKPointDescriptorEntryImpl::emit
void emit(std::ostream &out, const T &t) const override
writes this VTKData to the given output stream for a single T
Definition: VTKData.h:150
Detail::VTKPointDescriptorEntry::getTypeName
virtual std::string getTypeName() const =0
Gives the VTKDataType for VTK.
File::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
Mercury3D
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
VerticalMixerAngledBlades
Definition: VerticalMixer.h:215
Chute::setChuteWidth
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:966
FileType::NO_FILE
@ NO_FILE
file will not be created/read
DPMBase::restartFile
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1451
DPMBase::writeRestartFile
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2854
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Chute::setChuteAngle
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:695
vibratedBed::printTime
void printTime() const override
Displays the current simulation time and the maximum simulation duration.
Definition: vibratedBed.cpp:84
VTKCollection::hasFooter_
bool hasFooter_
Definition: VTKData.h:238
VTKCollection::VTKCollection
VTKCollection(std::string fileName)
Definition: VTKData.h:259
Vec3D
Definition: Vector.h:50
VerticalMixer::haveOuterWalls
bool haveOuterWalls
Definition: VerticalMixer.h:44
MULTILAYER
@ MULTILAYER
Definition: Chute.h:53
helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: Helpers.cc:374
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
main
int main()
Definition: VolumeUnitTest.cpp:112
bool
SuperQuadricParticle::setInertia
void setInertia() override
Compute and set the inertia-tensor for this superquadric. For internal use only.
Definition: SuperQuadricParticle.cc:216
VTKCollection::recordID_
std::size_t recordID_
Definition: VTKData.h:239
DPMBase::setZMax
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
SinterInteraction.h
main
int main(int argc, char *argv[])
Definition: VisualisationTest.cpp:66
Vreman::actionsAfterTimeStep
void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: Vreman.cpp:133
Chute::setRoughBottomType
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:641
Vreman::InflowNu
double InflowNu
Definition: Vreman.cpp:80
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
SuperQuadricParticle.h
vibratedBed
Definition: vibratedBed.cpp:30
BaseInteractable::setVelocity
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
double
VTKCollection::outFile_
std::ofstream outFile_
Definition: VTKData.h:236
Chute::setInflowParticleRadius
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:775
ChuteWithHopper
ChuteWithHopper has a hopper as inflow.
Definition: ChuteWithHopper.h:39
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
VTKUnstructuredGrid::VTKUnstructuredGrid
VTKUnstructuredGrid(std::string filename, const VTKPointDescriptor< T > *descr)
Definition: VTKData.h:303
Detail::VTKPointDescriptorEntry::getName
std::string getName() const
Returns the name associated with this field.
Definition: VTKData.h:75
DPMBase::getKineticEnergy
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
VolumeTest
Definition: VolumeUnitTest.cpp:36
MONOLAYER_DISORDERED
@ MONOLAYER_DISORDERED
Definition: Chute.h:53
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
LinearViscoelasticSpecies
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
SpeciesHandler::addObject
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:797
SilbertPeriodic::set_study
void set_study()
Definition: GlasPeriodic.h:102
LinearViscoelasticSpecies.h
DPMBase::getTime
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
Detail::VTKPointDescriptorEntry::emit
virtual void emit(std::ostream &out, const T &t) const =0
writes this VTKData to the given output stream for a single T
Detail::VTKPointDescriptorEntry::getNumberOfComponents
virtual std::size_t getNumberOfComponents() const =0
Returns the number of components in this type.
Species< LinearViscoelasticNormalSpecies >
Vreman::set_symmetric_contraction
void set_symmetric_contraction(double x_min, double x_max, double delta_y)
Definition: Vreman.cpp:56
Detail::VTKPointDescriptorEntryImpl::nComponents_
const std::size_t nComponents_
Definition: VTKData.h:139
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
helpers::round
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
VTKPointDescriptor::~VTKPointDescriptor
~VTKPointDescriptor()
Definition: VTKData.h:180
VTKUnstructuredGrid::write
void write(const C &container)
Definition: VTKData.h:320
VTKUnstructuredGrid
Definition: VTKData.h:295
DPMBase::getElasticEnergy
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521
VTKPointDescriptor::entries_
std::vector< Detail::VTKPointDescriptorEntry< T > * > entries_
Definition: VTKData.h:173
Vreman::add_particles
void add_particles()
Definition: Vreman.cpp:83
Detail::emitProxy
std::enable_if< std::is_array< V >::value||std::is_pointer< V >::value, void >::type emitProxy(std::ostream &out, const T &t, std::size_t nComponents, V T::*member)
This function actually writes the correct datatype to ostream.
Definition: VTKData.h:117
VerticalMixer::particleNumber_
Mdouble particleNumber_
Definition: VerticalMixer.h:40
SilbertPeriodic
Definition: flowRuleDiego_HeightAngle.cpp:35
main
int main(int argc, char *argv[])
Definition: VremanRough.cpp:149
DPMBase::wallHandler
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
main
int main(int argc, char *argv[])
Definition: visualiseSinteringFromRestartFile.cpp:31
Chute::getInflowVelocity
Mdouble getInflowVelocity() const
Returns the average inflow velocity.
Definition: Chute.cc:927
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Chute::setChuteLength
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:986
Chute::setFixedParticleRadius
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:608
vibratedBed::amplitude_
Mdouble amplitude_
Definition: vibratedBed.cpp:97
DPMBase::getName
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Chute::setInflowVelocityVariance
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:937
vibratedBed::getPrescribedVelocity
Vec3D getPrescribedVelocity()
Definition: vibratedBed.cpp:63
helpers::getMaximumVelocity
MERCURY_DEPRECATED Mdouble getMaximumVelocity(Mdouble k, Mdouble disp, Mdouble radius, Mdouble mass)
Calculates the maximum relative velocity allowed for a normal collision of two particles of radius r ...
Definition: Helpers.cc:346
Vreman::printTime
void printTime() const
Displays the current simulation time and the maximum simulation duration.
Definition: Vreman.cpp:143
DPMBase::setSuperquadricParticlesWriteVTK
void setSuperquadricParticlesWriteVTK(bool writeSuperquadricParticlesVTK)
Definition: DPMBase.cc:948
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
main
int main(int argc, char *argv[])
Definition: Vreman.cpp:150
Mdouble
Detail::VTKPointDescriptorEntry::~VTKPointDescriptorEntry
virtual ~VTKPointDescriptorEntry()
Definition: VTKData.h:57
DPMBase::eneFile
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1446
BaseParticle
Definition: BaseParticle.h:54
Detail::VTKPointDescriptorEntry::name_
std::string name_
Definition: VTKData.h:46
UNUSED
#define UNUSED
Definition: GeneralDefine.h:39
VTKPointDescriptor::positionEntry_
Detail::VTKPointDescriptorEntry< T > * positionEntry_
Definition: VTKData.h:174
Detail::VTKPointDescriptorEntry
Definition: VTKData.h:45
BaseHandler::copyAndAddObject
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
BaseParticle::getMaxInteractionRadius
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
n
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Vreman::setupInitialConditions
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: Vreman.cpp:44
SuperQuadricParticle::getVolume
Mdouble getVolume() const override
Definition: SuperQuadricParticle.cc:204
VisualisationTest
Definition: VisualisationTest.cpp:33
Vreman::Vreman
Vreman()
Definition: Vreman.cpp:40
VTKCollection::hasHeader_
bool hasHeader_
Definition: VTKData.h:237
vibratedBed::setFrequency
void setFrequency(Mdouble frequency)
Definition: vibratedBed.cpp:74
SuperQuadricParticle
Definition: SuperQuadricParticle.h:56
DPMBase::setXBallsAdditionalArguments
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
vibratedBed::run
void run(std::vector< Mdouble > studyNumber, int argc, char *argv[])
Definition: vibratedBed.cpp:40
DPMBase::setRestarted
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1492
VTKCollection
Definition: VTKData.h:235
VTKCollection::writeHeader
void writeHeader()
Definition: VTKData.h:241
vibratedBed::setShakingStrength
void setShakingStrength(Mdouble S)
Definition: vibratedBed.cpp:68
Detail::VTKPointDescriptorEntryImpl::getNumberOfComponents
std::size_t getNumberOfComponents() const override
Returns the number of components in this type.
Definition: VTKData.h:155
Detail
Definition: MpiContainer.h:91
vibratedBed::actionsAfterTimeStep
void actionsAfterTimeStep() override
A virtual function which allows to define operations to be executed after time step.
Definition: vibratedBed.cpp:54
VisualisationTest::setupInitialConditions
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: VisualisationTest.cpp:34
Chute::getInflowHeight
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:901
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
SuperQuadricParticle::setAxesAndExponents
void setAxesAndExponents(const Mdouble &a1, const Mdouble &a2, const Mdouble &a3, const Mdouble &eps1, const Mdouble &eps2)
Set the geometrical properties of the superquadrics, namely the axes-lengths a1, a2 and a3,...
Definition: SuperQuadricParticle.cc:133
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
DPMBase::removeOldFiles
void removeOldFiles() const
Definition: DPMBase.cc:4256
VTKPointDescriptor::addProperty
std::enable_if< std::is_array< DATATYPE >::value, VTKPointDescriptor & >::type addProperty(std::string name, DATATYPE T::*m, bool isPrimary=false)
Definition: VTKData.h:188
main
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: VerticalMixerAngledBlades.cpp:28
Detail::VTKPointDescriptorEntryImpl::VTKPointDescriptorEntryImpl
VTKPointDescriptorEntryImpl(std::string name, V T::*member, std::size_t nComponents)
Definition: VTKData.h:141
Chute
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
mathsFunc::cubic
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:115
VTKPointDescriptor::VTKPointDescriptor
VTKPointDescriptor()
Definition: VTKData.h:176
Mercury3D.h
DPMBase::dataFile
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
VerticalMixer::prettyWalls_
bool prettyWalls_
Definition: VerticalMixer.h:43
mathsFunc::isEqual
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:251
ParticleHandler::write
void write(std::ostream &os) const
units::name
std::string name
Definition: MercuryProb.h:48
Chute::getChuteWidth
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:976
Chute::getInflowParticleRadius
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:856
helpers::to_string
std::string to_string(const T &n)
Definition: Helpers.h:227
VerticalMixerAngledBlades::bladeAngle_
Mdouble bladeAngle_
Definition: VerticalMixer.h:217
mathsFunc::cos
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
DPMBase::interactionHandler
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1425
Detail::VTKPointDescriptorEntryImpl::getTypeName
std::string getTypeName() const override
Gives the VTKDataType for VTK.
Definition: VTKData.h:145
DPMBase::getTimeMax
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:885
VTKUnstructuredGrid::descriptor_
const VTKPointDescriptor< T > * descriptor_
Definition: VTKData.h:296
DPMBase::readArguments
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4225