Next: Nonlinear diffusion problem, Previous: Solving problems, Up: Solving problems
Assume that we want to solve the Poisson equation \Delta u(x,y) = f(x,y) on the unit square \Omega=(0,1)^2 with right-hand side f(x,y)=e^x+y and Dirichlet boundary conditions u(x,y)=0 for (x,y) \in \partial \Omega. The following command solves this equation approximately on a uniformly refined mesh using as termination criterion that the time for approximating the solution has increased beyond 20 seconds.
(let ((problem (cdr-model-problem (n-cube-domain 2)
:source #'(lambda (x) #I(exp(x[0]+x[1]))))))
(defparameter *result*
(solve (blackboard :problem problem :success-if '(> :time 20)))))
The result of the call to solve is a blackboard which we
saved in the global variable *result* for later reference. We
can extract items from there using the function getbb, e.g. for
plotting the solution:
(plot (getbb *result* :solution))