yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #11996
[Branch ~yade-pkg/yade/git-trunk] Rev 3641: Some warning fixes.
------------------------------------------------------------
revno: 3641
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2015-04-29 19:12:57 +0200
message:
Some warning fixes.
modified:
pkg/common/SPHEngine.cpp
pkg/pfv/PeriodicFlowEngine.cpp
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/common/SPHEngine.cpp'
--- pkg/common/SPHEngine.cpp 2014-11-04 06:45:39 +0000
+++ pkg/common/SPHEngine.cpp 2015-04-29 17:12:57 +0000
@@ -149,9 +149,9 @@
const Real coefA = 3. / (4. * M_PI * h * h * h);
const Real r_h = r / h;
if (r<=h) {
- return coefA * (-2.) / (h * h) * ( 7. * r - 6. * r * r / h);
+ return coefA * (-2.) / (h * h) * ( 7. * r - 6. * r * r_h);
} else {
- return coefA * 2. / h * (-6. + 7. * r / h - 2. * r * r / (h * h ) );
+ return coefA * 2. / h * (-6. + 7. * r_h - 2. * std::pow(r_h, 2) );
}
} else {
return 0;
=== modified file 'pkg/pfv/PeriodicFlowEngine.cpp'
--- pkg/pfv/PeriodicFlowEngine.cpp 2015-02-27 17:06:04 +0000
+++ pkg/pfv/PeriodicFlowEngine.cpp 2015-04-29 17:12:57 +0000
@@ -434,7 +434,9 @@
totVol+=newVol;
dVol=cell->info().volumeSign * ( newVol - cell->info().volume() );
totDVol+=dVol;
- epsVolMax = max ( epsVolMax, std::abs ( dVol/newVol ) );
+ if (newVol != 0) {
+ epsVolMax = max ( epsVolMax, std::abs ( dVol/newVol ) );
+ }
cell->info().dv() = dVol * invDeltaT;
cell->info().volume() = newVol;
}