9 #ifndef CONTACT_LAW_TEST_HELPERS
10 #define CONTACT_LAW_TEST_HELPERS
30 class LoadingTest :
public DPMBase
56 speciesHandler.copyAndAddObject(*species);
59 p.setSpecies(speciesHandler.getObject(0));
62 particleHandler.copyAndAddObject(
p);
65 w.setSpecies(speciesHandler.getObject(0));
67 wallHandler.copyAndAddObject(
w);
73 logger.assert_debug(
p,
"Empty particle handler");
74 p->setAngularVelocity({0, 0, 0});
92 logger(
INFO,
"finished loading test: run 'gnuplot %.gnu' to view output",
test.getName());
108 class LoadingTest :
public DPMBase
112 Mdouble tangentialDisplacement;
119 : species(species), displacement(displacement), tangentialDisplacement(tangentialDisplacement),
137 speciesHandler.copyAndAddObject(*species);
140 p.setSpecies(speciesHandler.getObject(0));
142 p.setPosition({0, 0,
radius - displacement});
143 particleHandler.copyAndAddObject(
p);
146 w.setSpecies(speciesHandler.getObject(0));
148 wallHandler.copyAndAddObject(
w);
154 logger.assert_debug(
p,
"Empty particle handler");
155 p->setAngularVelocity({0, 0, 0});
158 bool moveRight =
static_cast<int>(
getTime() / (2.0*tangentialDisplacement /
velocity) +0.5)%2==0;
175 logger(
INFO,
"finished tangential loading test: run 'gnuplot %.gnu' to view output",
test.getName());
190 class ObjectivenessTest :
public DPMBase
194 Mdouble tangentialDisplacement;
201 : species(species), displacement(displacement), tangentialDisplacement(tangentialDisplacement),
220 speciesHandler.copyAndAddObject(*species);
223 p.setSpecies(speciesHandler.getObject(0));
225 p.setPosition({0,
radius - displacement, 0});
226 particleHandler.copyAndAddObject(
p);
227 p.setPosition({0, -
radius + displacement, 0});
228 particleHandler.copyAndAddObject(
p);
235 logger.assert_debug(
p,
"Empty particle handler");
236 logger.assert_debug(
q,
"Empty particle handler");
241 p->setAngularVelocity({0, 0, 0});
244 q->setAngularVelocity({0, 0, 0});
255 p->setOrientation({1, 0, 0, 0});
259 q->setAngularVelocity(-
p->getAngularVelocity());
260 q->setOrientation(-
p->getOrientation());
261 q->setVelocity(-
p->getVelocity());
262 q->setPosition(-
p->getPosition());
270 logger(
INFO,
"finished objectiveness test: run 'gnuplot %.gnu' to view output",
test.getName());
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Array< double, 1, 3 > e(1./3., 0.5, 2.)
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseParticle.h:33
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:386
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:1987
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: DPMBase.cc:1853
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:437
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:879
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
Definition: ParticleSpecies.h:16
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
RealScalar s
Definition: level1_cplx_impl.h:130
#define INFO(i)
Definition: mumps_solver.h:54
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square nearest sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round nearest integer not less than the given sa Eigen::floor DOXCOMMA ArrayBase::ceil not a number test
Definition: GlobalFunctions.h:109
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
double angle(const double &t)
Angular position as a function of time t.
Definition: jeffery_orbit.cc:98
string dataFile
Definition: calibrate.py:175
int c
Definition: calibrate.py:100
const Mdouble pi
Definition: ExtendedMath.h:23
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
string name
Definition: plotDoE.py:33
Definition: indexed_view.cpp:20