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 286 of file main.cpp.

Constructor & Destructor Documentation

◆ RestitutionProbe()

RestitutionProbe::RestitutionProbe ( double  H0)
inlineexplicit

Definition at line 288 of file main.cpp.

288: d_H0(H0) {}

Member Function Documentation

◆ checkStop()

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

Reimplemented from postprocess::Postprocess.

Definition at line 290 of file main.cpp.

290 {
292 if (data.d_particlesListTypeAll.size() < 2)
293 return;
294 const auto *p0 = data.d_particlesListTypeAll[0];
295 const auto *p1 = data.d_particlesListTypeAll[1];
296 const double gap = p0->getXCenter().dist(p1->getXCenter()) -
297 p0->d_geom_p->boundingRadius() -
298 p1->d_geom_p->boundingRadius();
299 if (data.currentStep() % 50 == 0)
300 d_samples.push_back({data.d_time, gap});
301 if (d_done)
302 return;
303 const double leave = 1.0e-5;
304 const double significant = 0.05 * d_H0;
305 if (!d_contacted) {
306 if (gap < d_minGap) {
307 d_minGap = gap;
308 d_tMin = data.d_time;
309 } else if (d_minGap < 0.3 * d_H0 && gap > d_minGap + leave) {
310 d_contacted = true;
311 d_H1 = gap;
312 d_tH1 = data.d_time;
313 }
314 } else if (gap > d_H1) {
315 d_H1 = gap;
316 d_tH1 = data.d_time;
317 } else if (d_H1 > d_minGap + significant && gap < d_H1 - leave) {
318 d_done = true;
319 }
320 }
std::vector< std::pair< double, double > > d_samples
Definition main.cpp:344
double d_minGap
Definition main.cpp:339
double d_tMin
Definition main.cpp:340
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 322 of file main.cpp.

322{ 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 330 of file main.cpp.

330 {
331 if (d_H0 <= 0. || d_H1 <= 0.)
332 return 0.;
333 return std::sqrt(d_H1 / d_H0);
334 }

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 323 of file main.cpp.

323{ 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 324 of file main.cpp.

324{ 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 327 of file main.cpp.

327 {
328 return d_samples;
329 }

References d_samples.

Referenced by main().

Here is the caller graph for this function:

◆ tH1()

double RestitutionProbe::tH1 ( ) const
inline

Definition at line 326 of file main.cpp.

326{ 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 325 of file main.cpp.

325{ 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 342 of file main.cpp.

Referenced by checkStop(), and contacted().

◆ d_done

bool RestitutionProbe::d_done = false
private

Definition at line 343 of file main.cpp.

Referenced by checkStop().

◆ d_H0

double RestitutionProbe::d_H0
private

Definition at line 337 of file main.cpp.

Referenced by checkStop(), and CR().

◆ d_H1

double RestitutionProbe::d_H1 = 0.
private

Definition at line 338 of file main.cpp.

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

◆ d_minGap

double RestitutionProbe::d_minGap = 1.0e9
private

Definition at line 339 of file main.cpp.

Referenced by checkStop(), and minGap().

◆ d_samples

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

Definition at line 344 of file main.cpp.

Referenced by checkStop(), and samples().

◆ d_tH1

double RestitutionProbe::d_tH1 = 0.
private

Definition at line 341 of file main.cpp.

Referenced by checkStop(), and tH1().

◆ d_tMin

double RestitutionProbe::d_tMin = 0.
private

Definition at line 340 of file main.cpp.

Referenced by checkStop(), and tMin().


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