[petsc-users] Programmatically get TS Error estimates without adaptivity

Constantinescu, Emil M. emconsta at anl.gov
Mon Sep 16 09:56:33 CDT 2019


Mark, most integrators estimate the error occurring every step for 
adapting the step size. These are called local errors. GLEE are 
specialized integrator that estimate the actual error in time; this is 
called the global error. GLEE returns TimeError because it computes it 
internally, however none of the other solvers does it.

To assess the accuracy for a specific problem you have two options, and 
both involve you estimating the error yourself:

1. Use an integrator with very small step, store or save the solution 
(call it reference) and do the same for the others and then compute the 
error with respect to the reference. A strategy similar to this is 
implemented in src/ts/examples/tutorials/ex31.c

2. If you have an exact or manufactured solution, you can compare 
against that.

Emil

On 9/16/19 9:07 AM, Mark Lohry via petsc-users wrote:
> I'm trying to assess time accuracy for a couple different integrators 
> and timesteps in a setup where I need constant time steps.
>
> TSGetTimeError seems to only work for GLEE methods (it returns a 0 
> vector otherwise); is there an equivalent for others?
>
> I can run -ts_adapt_type basic, and just set min=max=constant, and it 
> clearly computes some integrator errors for printf, but is there a way 
> I can get that programmatically?
>
> Thanks,
> Mark
>
>
>


More information about the petsc-users mailing list