PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
RestitutionProbe Class Reference
Inheritance diagram for RestitutionProbe:
Collaboration diagram for RestitutionProbe:

Public Member Functions

 RestitutionProbe (double H0)
 
void checkStop (data::ModelData &data) override
 
bool contacted () const
 
double H1 () const
 
double minGap () const
 
double tMin () const
 
double tH1 () const
 
const std::vector< std::pair< double, double > > & samples () const
 
double CR () const
 
- Public Member Functions inherited from postprocess::Postprocess
virtual ~Postprocess ()=default
 
virtual void close (data::ModelData &data)
 
virtual std::string twoParticle (data::ModelData &data)
 
virtual std::string compressive (data::ModelData &data)
 

Private Attributes

double d_H0
 
double d_H1 = 0.
 
double d_minGap = 1.0e9
 
double d_tMin = 0.
 
double d_tH1 = 0.
 
bool d_contacted = false
 
bool d_done = false
 
std::vector< std::pair< double, double > > d_samples
 

Detailed Description

Definition at line 343 of file main.cpp.

Constructor & Destructor Documentation

◆ RestitutionProbe()

RestitutionProbe::RestitutionProbe ( double  H0)
inlineexplicit

Definition at line 345 of file main.cpp.

345: d_H0(H0) {}

Member Function Documentation

◆ checkStop()

void RestitutionProbe::checkStop ( data::ModelData &  data)
inlineoverridevirtual

Reimplemented from postprocess::Postprocess.

Definition at line 347 of file main.cpp.

347 {
349 if (data.d_particlesListTypeAll.size() < 2)
350 return;
351 const auto *p0 = data.d_particlesListTypeAll[0];
352 const auto *p1 = data.d_particlesListTypeAll[1];
353 const double gap = p0->getXCenter().dist(p1->getXCenter()) -
354 p0->d_geom_p->boundingRadius() -
355 p1->d_geom_p->boundingRadius();
356 if (data.currentStep() % 50 == 0)
357 d_samples.push_back({data.d_time, gap});
358 if (d_done)
359 return;
360 const double leave = 1.0e-5;
361 const double significant = 0.05 * d_H0;
362 if (!d_contacted) {
363 if (gap < d_minGap) {
364 d_minGap = gap;
365 d_tMin = data.d_time;
366 } else if (d_minGap < 0.3 * d_H0 && gap > d_minGap + leave) {
367 d_contacted = true;
368 d_H1 = gap;
369 d_tH1 = data.d_time;
370 }
371 } else if (gap > d_H1) {
372 d_H1 = gap;
373 d_tH1 = data.d_time;
374 } else if (d_H1 > d_minGap + significant && gap < d_H1 - leave) {
375 d_done = true;
376 }
377 }
std::vector< std::pair< double, double > > d_samples
Definition main.cpp:401
double d_minGap
Definition main.cpp:396
double d_tMin
Definition main.cpp:397
virtual void checkStop(data::ModelData &data)
Definition contact.h:20

References postprocess::Postprocess::checkStop(), d_contacted, d_done, d_H0, d_H1, d_minGap, d_samples, d_tH1, and d_tMin.

Here is the call graph for this function:

◆ contacted()

bool RestitutionProbe::contacted ( ) const
inline

Definition at line 379 of file main.cpp.

379{ return d_contacted; }

References d_contacted.

Referenced by main().

Here is the caller graph for this function:

◆ CR()

double RestitutionProbe::CR ( ) const
inline

Definition at line 387 of file main.cpp.

387 {
388 if (d_H0 <= 0. || d_H1 <= 0.)
389 return 0.;
390 return std::sqrt(d_H1 / d_H0);
391 }

References d_H0, and d_H1.

Referenced by main().

Here is the caller graph for this function:

◆ H1()

double RestitutionProbe::H1 ( ) const
inline

Definition at line 380 of file main.cpp.

380{ return d_H1; }

References d_H1.

Referenced by main().

Here is the caller graph for this function:

◆ minGap()

double RestitutionProbe::minGap ( ) const
inline

Definition at line 381 of file main.cpp.

381{ return d_minGap; }

References d_minGap.

Referenced by main().

Here is the caller graph for this function:

◆ samples()

const std::vector< std::pair< double, double > > & RestitutionProbe::samples ( ) const
inline

Definition at line 384 of file main.cpp.

384 {
385 return d_samples;
386 }

References d_samples.

Referenced by main().

Here is the caller graph for this function:

◆ tH1()

double RestitutionProbe::tH1 ( ) const
inline

Definition at line 383 of file main.cpp.

383{ return d_tH1; }

References d_tH1.

Referenced by main().

Here is the caller graph for this function:

◆ tMin()

double RestitutionProbe::tMin ( ) const
inline

Definition at line 382 of file main.cpp.

382{ return d_tMin; }

References d_tMin.

Referenced by main().

Here is the caller graph for this function:

Field Documentation

◆ d_contacted

bool RestitutionProbe::d_contacted = false
private

Definition at line 399 of file main.cpp.

Referenced by checkStop(), and contacted().

◆ d_done

bool RestitutionProbe::d_done = false
private

Definition at line 400 of file main.cpp.

Referenced by checkStop().

◆ d_H0

double RestitutionProbe::d_H0
private

Definition at line 394 of file main.cpp.

Referenced by checkStop(), and CR().

◆ d_H1

double RestitutionProbe::d_H1 = 0.
private

Definition at line 395 of file main.cpp.

Referenced by checkStop(), CR(), and H1().

◆ d_minGap

double RestitutionProbe::d_minGap = 1.0e9
private

Definition at line 396 of file main.cpp.

Referenced by checkStop(), and minGap().

◆ d_samples

std::vector<std::pair<double, double> > RestitutionProbe::d_samples
private

Definition at line 401 of file main.cpp.

Referenced by checkStop(), and samples().

◆ d_tH1

double RestitutionProbe::d_tH1 = 0.
private

Definition at line 398 of file main.cpp.

Referenced by checkStop(), and tH1().

◆ d_tMin

double RestitutionProbe::d_tMin = 0.
private

Definition at line 397 of file main.cpp.

Referenced by checkStop(), and tMin().


The documentation for this class was generated from the following file: