← Back to team overview

dolfin team mailing list archive

[noreply@xxxxxxxxxxxxx: [Branch ~dolfin-core/dolfin/main] Rev 6163: Allow zero tolerance for adaptive solvers. This is USEFUL, don't know]

 

Should the error message be correspondingly changed to "The tolerance
cannot be negative"?

--
Anders
--- Begin Message ---
------------------------------------------------------------
revno: 6163
committer: Marie E. Rognes <meg@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2011-08-29 21:21:41 +0200
message:
  Allow zero tolerance for adaptive solvers. This is USEFUL, don't know
  why it was disallowed.
modified:
  site-packages/dolfin/fem/solving.py


--
lp:dolfin
https://code.launchpad.net/~dolfin-core/dolfin/main

Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
=== modified file 'site-packages/dolfin/fem/solving.py'
--- site-packages/dolfin/fem/solving.py	2011-08-24 20:12:09 +0000
+++ site-packages/dolfin/fem/solving.py	2011-08-29 19:21:41 +0000
@@ -203,7 +203,7 @@
               form_compiler_parameters={"optimize": True})
 
     For available choices for the 'solver_parameters' kwarg, look at:
-    
+
         .. code-block:: python
 
         info(LinearVariationalSolver.default_parameters(), 1)
@@ -231,7 +231,7 @@
 
 
     For available choices for the 'solver_parameters' kwarg, look at:
-    
+
         .. code-block:: python
 
         info(NonlinearVariationalSolver.default_parameters(), 1)
@@ -240,7 +240,7 @@
 
     FIXME: Missing documentation for adaptive solve, add here.
 
-    
+
     """
 
     assert(len(args) > 0)
@@ -349,10 +349,10 @@
                          "solve variational problem",
                          "Too many arguments, expecting solve(lhs == rhs, "\
                          "u, [bc]), where bc is optional")
-    
+
     # Extract equation
     eq = _extract_eq(args[0])
-    
+
     # Extract solution function
     u = _extract_u(args[1])
 
@@ -368,10 +368,10 @@
         cpp.dolfin_error("solving.py",
                          "solve variational problem",
                          "Expecting Jacobian J to be a UFL Form")
-    
+
     # Extract tolerance
     tol = kwargs.get("tol", None)
-    if tol is not None and not (isinstance(tol, (float, int)) and tol > 0.0):
+    if tol is not None and not (isinstance(tol, (float, int)) and tol >= 0.0):
         cpp.dolfin_error("solving.py",
                          "solve variational problem",
                          "Expecting tolerance tol to be a positive number")


--- End Message ---