[petsc-users] Stiff ODEs

Matthew Knepley knepley at gmail.com
Thu Dec 5 07:35:50 CST 2013


On Thu, Dec 5, 2013 at 7:21 AM, Katy Ghantous <katyghantous at gmail.com>wrote:
>
> On Thu, Dec 5, 2013 at 12:40 PM, Matthew Knepley <knepley at gmail.com>wrote:
>
>> On Thu, Dec 5, 2013 at 5:25 AM, Katy Ghantous <katyghantous at gmail.com>wrote:
>>
>>> thank you!
>>> i used master from petsc-dev on mac and have TSRK working now.
>>>
>>> i am using an explicit scheme since its a set of coupled nonlinear
>>> equations:
>>>
>>> dφn/d t = an φn-2φn-1 - bn φn-1φn+1 + cn φn+1φn+2
>>>
>>> where n can go up to 24 or so.. I didnt think it is possible to solve it
>>> implicitly. and TSRK works for it now.
>>>
>>
>> It is.
>>
>>
>>> But i need petsc on linux too, and testing to verify installation (same
>>> options on configure as mac expect arch) gave an error:
>>>
>>>
>>> /home/katy/petsc/linux-gnu-cxx-debug/bin/mpicxx -o ex19.o -c -Wall
>>> -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0  -fPIC
>>> -I/home/katy/petsc/include
>>> -I/home/katy/petsc/linux-gnu-cxx-debug/include    `pwd`/ex19.c
>>> /home/katy/petsc/linux-gnu-cxx-debug/bin/mpicxx -Wall -Wwrite-strings
>>> -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0  -o ex19  ex19.o
>>> -Wl,-rpath,/home/katy/petsc/linux-gnu-cxx-debug/lib
>>> -L/home/katy/petsc/linux-gnu-cxx-debug/lib  -lpetsc
>>> -Wl,-rpath,/home/katy/petsc/linux-gnu-cxx-debug/lib -lf2clapack -lf2cblas
>>> -lm -lpthread -lm -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.6
>>> -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -Wl,-rpath,/usr/lib/x86_64-linux-gnu
>>> -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu
>>> -L/lib/x86_64-linux-gnu -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl -lrt
>>> -lpthread -lgcc_s -ldl
>>> /home/katy/petsc/linux-gnu-cxx-debug/lib/libpetsc.so: undefined
>>> reference to `SNESDefaultMatrixFreeCreate2(_p_SNES*, _p_Vec*, _p_Mat**)'
>>> /home/katy/petsc/linux-gnu-cxx-debug/lib/libpetsc.so: undefined
>>> reference to `KSPCreate_DGMRES'
>>> /home/katy/petsc/linux-gnu-cxx-debug/lib/libpetsc.so: undefined
>>> reference to `PCCreate_TFS'
>>>
>>
>> Send make.log.
>>
>
It looks like you have corrupt source. Did you alter the source in any way.
I assume you got it from
git, so you can do 'git checkout master'.

If you think it should be correct,  send src/ksp/ksp/impls/gmres/makefile
and src/ksp/ksp/impls/gmres/dgmres/makefile.

   Matt


>   Matt
>>
>>
>>> On Tue, Dec 3, 2013 at 6:13 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>>
>>>> Katy Ghantous <katyghantous at gmail.com> writes:
>>>>
>>>> > Hi,
>>>> > I have just started with Petsc and have very elementary equations.
>>>> > I am trying to solve a set of stiff ODEs explicitly.
>>>>
>>>> If your ODEs are stiff, why are you trying to use an explicit method?
>>>> (A common definition of "stiff" is that explicit methods do not work
>>>> well.)
>>>>
>>>> > They are very stiff and was hoping to use TSRK with variable time
>>>> > steps, but it is throwing a segmentation fault
>>>>
>>>> Always show the full error message.  Please also use 'master' from
>>>> petsc-dev, because TSRK was overhauled recently to be consistent with
>>>> the other integrators (and adding a bunch of new functionality).
>>>>
>>>>   https://bitbucket.org/petsc/petsc/wiki/
>>>>
>>>> > otherwise non existent with Euler or TSSSP.  1. should i look into the
>>>> > TSRK error or is it something with the new version of Petsc?  2. i
>>>> > read somewhere (but cant find the source again) that TSSSP is not
>>>> > recommended for stiff equations (even with the rk solvers set as the
>>>> > type).
>>>>
>>>> Yes, TSSSP is for non-stiff problems that require "strong stability"
>>>> (like controlling total variation or positivity in transport-dominated
>>>> applications).
>>>>
>>>> > Is that correct? if so, what would be most optimized to solve stiff
>>>> > odes explicitly.
>>>>
>>>> Stiff ODEs should be solved *implicitly*.
>>>>
>>>> > 3. If it is not correct and TSSSP is useful for stiff equations, how
>>>> > can i run it with variable time steps, since with TSStep it is taking
>>>> > equal time steps which is the time step that i am specifying as an
>>>> > initial time step TSSetInitialTimeStep.
>>>>
>>>> TSSSP does not have an adaptive controller.  A user can set a post-check
>>>> function that adapts the time step based on a custom stability function
>>>> (e.g., CFL criteria).
>>>>
>>>> TSROSW and TSARKIMEX are IMEX methods that can handle stiff problems.
>>>> They have adaptive error estimators and the like.
>>>>
>>>
>>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131205/027df9d2/attachment.html>


More information about the petsc-users mailing list