mercury.cpp File Reference
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <Mercury3D.h>
#include <Species/LinearViscoelasticSpecies.h>
#include "Serialization.h"
#include <cereal/archives/json.hpp>

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)
51  {
52 
53  std::ifstream file("../../../../sim.json");
54  cereal::JSONInputArchive ar(file);
55 
58  p.setXMax(1.0);
59  p.setYMax(1.0);
60  p.setZMax(1.0);
61 
63  species->setDensity(2500.0); // sets the species type-0 density
64  species->setStiffness(258.5);// sets the spring stiffness
65  species->setDissipation(0.0);// sets the dissipation
66 
67  //p.setSaveCount(10);
70 
71  p.setXBallsAdditionalArguments("-solidf -v0");
72 
73  load(ar, p);
74 
75  p.solve(argc,argv);
76 
77  file.close();
78 
79  return 0;
80 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
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 setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
Definition: Problem.h:39

References BaseHandler< T >::copyAndAddObject(), DPMBase::dataFile, load(), ONE_FILE, DPMBase::restartFile, File::setFileType(), DPMBase::setSystemDimensions(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), DPMBase::solve(), and DPMBase::speciesHandler.