[petsc-users] Change SNES/TS setting from inside context
Jed Brown
jedbrown at mcs.anl.gov
Thu Oct 27 09:49:54 CDT 2011
On Thu, Oct 27, 2011 at 08:28, behzad baghapour
<behzad.baghapour at gmail.com>wrote:
> Actually I want to update the domain according to the global CFL number;
> e.g. dt = CFL * dx / Lambda; separately for each cell
> ( dx is the dimension of the cell and Lambda is the local maximum
> eigenvalue of the field )
>
TS does not know about "CFL" because it's not even a universal quantity. It
gives you a step size, call it pseudo_dt. You can sweep over the grid to
compute global_dt = min_e dx_e / lambda_e (the most restrictive step size
according to CFL=1). Now you can define the global CFL number = pseudo_dt /
global_dt and use this however you like.
You might have some cheap estimate of global_dt in which case you could use
it instead of making the sweep on each step to have an exact definition. Or
you can do it while computing the residual and cache the result in your
application context.
>
> So, here shift is the maximum time step and I should adjust other cells to
> this maximum value?
>
It really is the minimum time step since the global CFL is computed for the
fastest wave in the smallest cell (smallest value of dx/lambda). In your
slower, larger cells, the number dx/lambda will be larger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111027/22b3bff9/attachment.htm>
More information about the petsc-users
mailing list