On Sun, Mar 18, 2012 at 14:52, Barry Smith <bsmith at mcs.anl.gov> wrote:
> Just run your single code in complex numbers (where the nonlinear part > may have zero imaginary part). You are introducing a complicated work flow > (saving to files ...) (that is also not well supported in PETSc) just to > save some work on the nonlinear part when generally most nonlinear solvers > spend much more time in the linear solve than the nonlinear computations. > Make your life easy, just use complex numbers; your time is much more > valuable than the computers. Also, if the nonlinear function is very expensive, you can read the state from the Vec into PetscReal locally (e.g. one stencil at a time) and compute with reals. Writing to files creates a _serious_ bottleneck that will likely take orders of magnitude longer than everything else your code does if you scale it to large problems/computers. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120318/ffbfc303/attachment.htm>
