~ubuntu-branches/debian/jessie/yade/jessie

« back to all changes in this revision

Viewing changes to pkg/dem/ConcretePM.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-08-04 19:34:58 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140804193458-cw8qhnujxe9wzi15
Tags: 1.11.0-1
* [a0600ae] Imported Upstream version 1.11.0
* [a3055e0] Do not use parallel build on kfreebsd-amd64 and s390x.
* [f86b405] Remove applied patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
                #endif
119
119
                Real aux = c*exp(N*ret)+exp(ret);
120
120
                f = log(aux);
121
 
                if (fabs(f) < maxError) return ret;
 
121
                if (std::abs(f) < maxError) return ret;
122
122
                Real df = (c*N*exp(N*ret)+exp(ret))/aux;
123
123
                ret -= f/df;
124
124
        }
185
185
                                dfg = CpmPhys::funcGDKappa(ret,epsCrackOnset,epsFracture,neverDamage,damLaw);
186
186
                                decr = fg/dfg;
187
187
                                ret -= decr;
188
 
                                if (fabs(decr/epsCrackOnset) < tol) {
 
188
                                if (std::abs(decr/epsCrackOnset) < tol) {
189
189
                                        return ret;
190
190
                                }
191
191
                        }
218
218
                df = e0i*(1-g-k*dg);
219
219
                decr = f/df;
220
220
                k -= decr;
221
 
                if (fabs(decr) < tol) {
 
221
                if (std::abs(decr) < tol) {
222
222
                        kappaD = k;
223
223
                        omega = CpmPhys::funcG(k,epsCrackOnset,epsFracture,neverDamage,damLaw);
224
224
                        relResidualStrength = r;
285
285
#define NNAN(a) YADE_VERIFY(!isnan(a));
286
286
#define NNANV(v) YADE_VERIFY(!isnan(v[0])); assert(!isnan(v[1])); assert(!isnan(v[2]));
287
287
 
288
 
void Law2_ScGeom_CpmPhys_Cpm::go(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* I){
 
288
bool Law2_ScGeom_CpmPhys_Cpm::go(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* I){
289
289
        TIMING_DELTAS_START();
290
290
        ScGeom* geom=static_cast<ScGeom*>(_geom.get());
291
291
        CpmPhys* phys=static_cast<CpmPhys*>(_phys.get());
413
413
                        { boost::mutex::scoped_lock lock(st1->updateMutex); st1->numBrokenCohesive += 1; /* st1->epsPlBroken += epsPlSum; */ }
414
414
                        { boost::mutex::scoped_lock lock(st2->updateMutex); st2->numBrokenCohesive += 1; /* st2->epsPlBroken += epsPlSum; */ }
415
415
                /* } */
416
 
                scene->interactions->requestErase(I);
417
 
                return;
 
416
                return false;
418
417
        }
419
418
 
420
419
        Fn = sigmaN*crossSection; phys->normalForce = -Fn*geom->normal;
438
437
                scene->forces.addTorque(id2,(geom->radius2+.5*(phys->refPD-geom->penetrationDepth))*geom->normal.cross(f));
439
438
        }
440
439
        TIMING_DELTAS_CHECKPOINT("rest");
 
440
        return true;
441
441
}
442
442
 
443
443
 
564
564
        FOREACH(const shared_ptr<Interaction>& I, *scene->interactions){
565
565
                if (!I) continue;
566
566
                if (!I->isReal()) continue;
567
 
                shared_ptr<CpmPhys> phys = boost::dynamic_pointer_cast<CpmPhys>(I->phys);
 
567
                shared_ptr<CpmPhys> phys = YADE_PTR_DYN_CAST<CpmPhys>(I->phys);
568
568
                if (!phys) continue;
569
569
                const Body::id_t id1 = I->getId1(), id2 = I->getId2();
570
570
                GenericSpheresContact* geom = YADE_CAST<GenericSpheresContact*>(I->geom.get());