mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-08 13:04:20 +08:00
updates to tolerances in the derivative check.
This commit is contained in:
@@ -91,6 +91,8 @@ class RichardsProblem(Problem.BaseTimeProblem):
|
||||
surveyPair = RichardsSurvey
|
||||
mapPair = RichardsMap
|
||||
|
||||
debug=True
|
||||
|
||||
Solver = Solver
|
||||
solverOpts = {}
|
||||
|
||||
@@ -138,7 +140,7 @@ class RichardsProblem(Problem.BaseTimeProblem):
|
||||
for ii, dt in enumerate(self.timeSteps):
|
||||
bc = self.getBoundaryConditions(ii, u[ii])
|
||||
u[ii+1] = self.rootFinder.root(lambda hn1m, return_g=True: self.getResidual(m, u[ii], hn1m, dt, bc, return_g=return_g), u[ii])
|
||||
print "Solving Fields (%4d/%d - %3.1f%% Done) %d Iterations, %4.2f seconds"%(ii, self.nT, 100.0*ii/self.nT, self.rootFinder.iter, time.time() - tic)
|
||||
if self.debug: print "Solving Fields (%4d/%d - %3.1f%% Done) %d Iterations, %4.2f seconds"%(ii+1, self.nT, 100.0*(ii+1)/self.nT, self.rootFinder.iter, time.time() - tic)
|
||||
return u
|
||||
|
||||
@Utils.timeIt
|
||||
|
||||
@@ -79,7 +79,7 @@ class RichardsTests1D(unittest.TestCase):
|
||||
bc = np.array([-61.5,-20.7])
|
||||
h = np.zeros(M.nC) + bc[0]
|
||||
|
||||
prob = Richards.RichardsProblem(M, mapping=E, timeSteps=[(40,3),(60,3)],
|
||||
prob = Richards.RichardsProblem(M, mapping=E, timeSteps=[(40,3),(60,3)], tolRootFinder=1e-6, debug=False,
|
||||
boundaryConditions=bc, initialConditions=h,
|
||||
doNewton=False, method='mixed')
|
||||
prob.Solver = Solver
|
||||
@@ -153,7 +153,7 @@ class RichardsTests2D(unittest.TestCase):
|
||||
bc = np.array([-61.5,-20.7])
|
||||
bc = np.r_[np.zeros(M.nCy*2),np.ones(M.nCx)*bc[0],np.ones(M.nCx)*bc[1]]
|
||||
h = np.zeros(M.nC) + bc[0]
|
||||
prob = Richards.RichardsProblem(M,E, timeSteps=[(40,3),(60,3)], boundaryConditions=bc, initialConditions=h, doNewton=False, method='mixed')
|
||||
prob = Richards.RichardsProblem(M,E, timeSteps=[(40,3),(60,3)], boundaryConditions=bc, initialConditions=h, doNewton=False, method='mixed', tolRootFinder=1e-6, debug=False)
|
||||
prob.Solver = Solver
|
||||
|
||||
locs = Utils.ndgrid(np.array([5,7.]),np.array([5,15,25.]))
|
||||
@@ -225,7 +225,7 @@ class RichardsTests3D(unittest.TestCase):
|
||||
bc = np.array([-61.5,-20.7])
|
||||
bc = np.r_[np.zeros(M.nCy*M.nCz*2),np.zeros(M.nCx*M.nCz*2),np.ones(M.nCx*M.nCy)*bc[0],np.ones(M.nCx*M.nCy)*bc[1]]
|
||||
h = np.zeros(M.nC) + bc[0]
|
||||
prob = Richards.RichardsProblem(M,E, timeSteps=[(40,3),(60,3)], boundaryConditions=bc, initialConditions=h, doNewton=False, method='mixed')
|
||||
prob = Richards.RichardsProblem(M,E, timeSteps=[(40,3),(60,3)], boundaryConditions=bc, initialConditions=h, doNewton=False, method='mixed', tolRootFinder=1e-6, debug=False)
|
||||
prob.Solver = Solver
|
||||
|
||||
locs = Utils.ndgrid(np.r_[5,7.],np.r_[5,15.],np.r_[6,8.])
|
||||
|
||||
Reference in New Issue
Block a user