The pyclaw classic clawpack solvers are a collection of solvers that represent the functionality of the older versions of clawpack. It comes in two forms, a pure python version and a python wrapping the fortran libraries. All of the solvers available provide the same basic interface and provide the same options as the old versions of clawpack. The superclass solvers are not meant to be used separately but there to provide common routines for all the Clawpack solvers. Please refer to each of the inherited classes for more info about the methods and attributes they provide each class. The inheritance structure is:
Example: | This is a simple example of how to instantiate and evolve a solution to a later time t_end using the linearized 1d acoustics Riemann solver: >>> from pyclaw.evolve.clawpack import ClawSolver1D
>>> solver = ClawSolver1D() # Instantiate a default, 1d solver
>>> solver.mthlim = [3,3] # Use the van Leer limiter
>>> solver.dt = 0.0001 # Set the initial time step
>>> solver.max_steps = 500 # Set the maximum number of time steps
>>> solver.evolve_to_time(solution,t_end) # Evolve the solution to t_end
|
---|
Note
The fortran wrapped classes are not included in this release.
Module containg the classic Clawpack solvers
This module contains the pure and wrapped classic clawpack solvers. All clawpack solvers inherit from the ClawSolver superclass which in turn inherits from the Solver superclass. As such, the only solver classes that should be directly used should be the dimensionally dependent ones such as ClawSolver1D.
Authors: | Kyle T. Mandli (2008-09-11) Initial version |
---|
Bases: pyclaw.evolve.solver.Solver
Generic classic Clawpack solver
All Clawpack solvers inherit from this base class.
Initialization: |
---|
Version: | 1.0 (2009-06-01) |
---|
Take one homogeneous step on the solutions
This is a dummy routine and must be overridden.
List available Riemann solvers
This routine returns a list of available Riemann solvers which is constructed in the Riemann solver package (Riemann Solver Package). In this case it lists all Riemann solvers.
Output: |
|
---|
Note
These Riemann solvers are currently only accessible to the python time stepping routines.
Assigns the library solver solver_name as the Riemann solver.
Input: |
|
---|
Called before any set of time steps.
This routine will be called once before the solver is used via the Controller. In the case of ClawSolver we make sure that the mthlim is a list.
Evolve solutions one time step
This routine encodes the generic order in a full time step in this order:
This routine is called from the method evolve_to_time defined in the pyclaw.evolve.solver.Solver superclass.
Input: |
|
---|---|
Output: |
|
Bases: pyclaw.evolve.clawpack.ClawSolver
Clawpack evolution routine in 1D
This class represents the 1d clawpack solver on a single grid. Note that there are routines here for interfacing with the fortran time stepping routines and the python time stepping routines. The ones used are dependent on the argument given to the initialization of the solver (defaults to python).
Initialization: |
---|
Authors: | Kyle T. Mandli (2008-09-11) Initial version |
---|
Take one time step on the homogeneous hyperbolic system
Takes one time step of size dt on the hyperbolic system defined in the appropriate Riemann solver rp.
Input: |
|
---|---|
Version: | 1.0 (2009-07-01) |
List available Riemann solvers
This routine returns a list of available Riemann solvers which is constructed in the Riemann solver package (_pyclaw_rp). In this case it lists only the 1D Riemann solvers.
Output: |
|
---|
Note
These Riemann solvers are currently only accessible to the python time stepping routines.
Assigns the library solver solver_name as the Riemann solver.
Input: |
|
---|
Dummy routine called to calculate a source term
Replace this routine if you want to include a source term.
Dummy routine called before each step
Replace this routine if you want to do something before each time step.