56 if (!
line.compare(
""))
71 logger(
INFO,
"Reading % particles at time %",
N,time);
74 for (
unsigned i = 0;
i <
N; ++
i) {
87 species.setAdhesionForceMax(1e20);
88 species.setAdhesionStiffness(1);
93 p.setRadius(
cbrt(0.75 /
pi * volume));
94 p.setPosition(position);
103 if (!
line.compare(
""))
118 for (
unsigned i=0;
i<
N; ++
i) {
120 Vec3D force, contact;
124 logger.assert_debug(
p1 !=
nullptr,
"Particle % does not exist", id1);
125 logger.assert_debug(p2 !=
nullptr,
"Particle % does not exist", id1);
128 logger.assert_debug(
c !=
nullptr,
"Particle-particle interaction % % does not exist",
p1, p2);
130 c->setNormal(P1ToP2 /
c->getDistance());
131 c->setOverlap(
c->getDistance() -
p1->getRadius() - p2->
getRadius());
135 contact =
p1->getPosition() - P1ToP2 * ((
p1->getRadius() - 0.5 *
c->getOverlap()) /
c->getDistance());
139 cFile_ >> contact >> force;
142 c->setContactPoint(contact);
144 if (
i % (
N / 10) == 0)
153 if (!
line.compare(
""))
159 logger(
ERROR,
"Timesteps in p3w and p3p do not agree");
173 for (
unsigned i=0;
i<
N; ++
i) {
175 Vec3D force, contact, particleToContact;
178 logger.assert_debug(
p!=
nullptr,
"Particle % does not exist",
id);
180 logger.assert_debug(
c!=
nullptr,
"Particle-wall interaction % % does not exist",
p,
w);
182 wFile_ >> force >> particleToContact;
183 contact =
p->getPosition()-particleToContact;
185 wFile_ >> contact >> force;
186 particleToContact =
p->getPosition()-contact;
189 c->setContactPoint(contact);
190 c->setDistance(particleToContact.getLength());
191 c->setNormal(particleToContact/
c->getDistance());
192 c->setOverlap(
c->getDistance()-
p->getRadius());
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector3f p1
Definition: MatrixBase_all.cpp:2
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:656
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:536
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:677
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:360
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
T * getObjectById(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:573
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:197
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: BaseParticle.h:33
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:331
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:148
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
Vec3D getMax() const
Returns the maximum coordinates of the problem domain.
Definition: DPMBase.h:659
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
Vec3D getMin() const
Returns the minimum coordinates of the problem domain.
Definition: DPMBase.h:653
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1473
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
void forceWriteOutputFiles()
Writes output files immediately, even if the current time step was not meant to be written....
Definition: DPMBase.cc:4094
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:827
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:971
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:98
Contains material and contact force properties.
Definition: Species.h:14
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
static Vec3D max(const Vec3D &a, const Vec3D &b)
Calculates the pointwise maximum of two Vec3D.
Definition: Vector.cc:69
static Vec3D min(const Vec3D &a, const Vec3D &b)
Calculates the pointwise minimum of two Vec3D.
Definition: Vector.cc:82
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:350
@ N
Definition: constructor.cpp:22
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16 &a)
Definition: BFloat16.h:646
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cbrt(const T &x)
Definition: MathFunctions.h:1320
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
int c
Definition: calibrate.py:100
line
Definition: calibrate.py:103
const Mdouble pi
Definition: ExtendedMath.h:23
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286