[cig-commits] r20244 - in short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith: materials problems

brad at geodynamics.org brad at geodynamics.org
Thu May 31 11:41:01 PDT 2012


Author: brad
Date: 2012-05-31 11:41:01 -0700 (Thu, 31 May 2012)
New Revision: 20244

Modified:
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPrager3D.cc
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/problems/SolverNonlinear.cc
Log:
Single precision fixes.

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPrager3D.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPrager3D.cc	2012-05-31 18:36:54 UTC (rev 20243)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPrager3D.cc	2012-05-31 18:41:01 UTC (rev 20244)
@@ -1272,10 +1272,8 @@
 
     PylithScalar plasticMult = 0.0;
     if (_allowTensileYield) {
-      plasticMult = std::min(sqrt(2.0) * d,
-			     plasticFac *
-			     (meanStrainFac * meanStrainPPTpdt + dFac * d -
-			      beta));
+      plasticMult = std::min(PylithScalar(sqrt(2.0)*d), 
+			     plasticFac * (meanStrainFac * meanStrainPPTpdt + dFac * d - beta));
     } else {
       plasticMult = plasticFac *
 	(meanStrainFac * meanStrainPPTpdt + dFac * d - beta);

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc	2012-05-31 18:36:54 UTC (rev 20243)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc	2012-05-31 18:41:01 UTC (rev 20244)
@@ -1241,10 +1241,8 @@
 
     PylithScalar plasticMult =  0.0;
     if (_allowTensileYield) {
-      plasticMult = std::min(sqrt(2.0) * d,
-			     plasticFac *
-			     (meanStrainFac * meanStrainPPTpdt + dFac * d -
-			      beta));
+      plasticMult = std::min(PylithScalar(sqrt(2.0) * d),
+			     plasticFac * (meanStrainFac * meanStrainPPTpdt + dFac * d - beta));
     } else {
       plasticMult = plasticFac *
 	(meanStrainFac * meanStrainPPTpdt + dFac * d - beta);

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/problems/SolverNonlinear.cc	2012-05-31 18:36:54 UTC (rev 20243)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/problems/SolverNonlinear.cc	2012-05-31 18:41:01 UTC (rev 20244)
@@ -276,7 +276,7 @@
 
 #if defined(PYLITH_CUSTOM_LINESEARCH)
   // Place reasonable absolute limit on minimum lambda
-  minlambda = std::max(steptol/rellength, 1.0/PYLITH_MAXSCALAR);
+  minlambda = std::max(steptol/rellength, PylithScalar(1.0)/PYLITH_MAXSCALAR);
 #else // ORIGINAL
   minlambda = steptol/rellength;
 #endif



More information about the CIG-COMMITS mailing list