56 logger(
INFO,
" Simulates a particle-particle collision.\n"
58 " - at one instant in time\n"
59 " - standard fields (density and stress)\n"
60 " - for O, Z, and XYZ coordinates\n"
61 " - for both Gauss and Lucy kernel functions\n");
64 dpm.
setName(
"CGParticleParticleUnitTest");
77 Z->setMin({-1,-1,0.95});
78 Z->setMax({1,1,0.95});
82 G->setMin({-1,-1,0.95});
83 G->setMax({1,1,0.95});
90 XYZ->setMin({-0.95,-1,0.95});
91 XYZ->setMax({1.05,1,0.95});
104 helpers::check(
O->getPoint(0).getDensity(),0.125,1e-15,
"Average density");
109 helpers::check(
Z->getPoint(0).getDensity(),phiL0/4.0,1e-15,
"Z-resolved density at particle centre");
113 helpers::check(G->getPoint(0).getDensity(),phiG0/4.0,1e-15,
"Z-resolved density for Gaussian CG");
117 helpers::check(
XYZ->getPoint(0).getDensity(),phi30,1e-11,
"Fully-resolved density at particle centre");
122 Mdouble overlap = 2.0-distance;
123 helpers::check(
O->getPoint(0).getContactStress().trace(),2e5*overlap*distance/16,1e-11,
"Average stress");
128 helpers::check(C->getPoint(0).getContactStress().trace(),2e5*overlap*distance/distanceZ/4,1e-11,
"Z-resolved stress at contact point");
@ NO_FILE
file will not be created/read
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ Z
Definition: StatisticsVector.h:42
@ XYZ
Definition: StatisticsVector.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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:76
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
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 solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Definition: CGLiquidsUnitTest.cpp:35
static Mdouble getDistance(const Vec3D &a, const Vec3D &b)
Calculates the distance between two Vec3D: .
Definition: Vector.cc:175
Mdouble Z
Definition: Vector.h:66
const Mdouble pi
Definition: ExtendedMath.h:45
const Mdouble sqrt_pi
Definition: ExtendedMath.h:46
const Mdouble sqrt_2
Definition: ExtendedMath.h:48
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:115