Skip to content

Commit

Permalink
changed docs to reflect geometry names.
Browse files Browse the repository at this point in the history
    grids became patches and related changes.
  • Loading branch information
rjleveque committed Feb 3, 2012
1 parent c055acf commit 266efab
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 42 deletions.
52 changes: 26 additions & 26 deletions doc/ClawPlotItem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The following attributes can be set by the user:
* '2d_contour' : two dimensional contour plot,
* '2d_pcolor' : two dimensional pcolor plot,
* '2d_schlieren' : two dimensional Schlieren plot,
* '2d_grid' : two dimensional plot of only the grids, no data
* '2d_edges' : two dimensional plot of only the cell and/or patch edges, no data

.. attribute:: outdir : str or None

Expand All @@ -52,7 +52,7 @@ The following attributes can be set by the user:
the Python convention that plot_var=0 corresponds to the first
component).

If a function, then this function is applied to q on each grid to
If a function, then this function is applied to q on each patch to
compute the variable var that is plotted. The signature is

* var = plot_var(current_data)
Expand All @@ -72,30 +72,30 @@ The following attributes can be set by the user:

def afteritem(current_data):

.. attribute:: aftergrid : str or function or None
.. attribute:: afterpatch : str or function or None

A string or function that is to be executed after plotting this item on
each grid. (There may be more than 1 grid in an AMR calculation.)
each patch. (There may be more than 1 patch in an AMR calculation.)
If a string, this string is executed using *exec*. If a
function, it should be defined to have a single argument
"data", [documentation to appear!]

For example::

def aftergrid(current_data):
def afterpatch(current_data):
cd = current_data
print "On grid number %s, xlower = %s, ylower = %s" \
% (cd.gridno, cd.xlower, cd.ylower)
print "On patch number %s, xlower = %s, ylower = %s" \
% (cd.patchno, cd.xlower, cd.ylower)

would print out the grid number and lower left corner for each grid in
a 2d computation after the grid is plotted.
would print out the patch number and lower left corner for each patch in
a 2d computation after the patch is plotted.



.. attribute:: MappedGrid : bool

If True, the grid mapping specified by the *mapc2p* attribute of the
underlying `ClawPlotData` object should be applied to the grid before
If True, the mapping specified by the *mapc2p* attribute of the
underlying `ClawPlotData` object should be applied to the patch before
plotting.


Expand Down Expand Up @@ -200,16 +200,16 @@ Special attributes for plot_type = '1d_from_2d_data'
Special attributes for all 2d plots, plot_type = '2d...'
------------------------------------------------------------

.. attribute:: gridlines_show : bool
.. attribute:: celledges_show : bool

If True, draw the grid lines on the plot.
The attribute 'amr_gridlines_show' should be used for AMR computations
to specify that gridlines should be shown on some levels and not
If True, draw the cell edges on the plot.
The attribute 'amr_celledges_show' should be used for AMR computations
to specify that cell edges should be shown on some levels and not
others. See :ref:`amr_attributes`.

.. attribute:: gridedges_show : bool
.. attribute:: patchedges_show : bool

If True, draw the edges of grids, mostly useful in AMR computations.
If True, draw the edges of patches, mostly useful in AMR computations.

Special attributes for plot_type = '2d_contour'
------------------------------------------------------
Expand Down Expand Up @@ -247,9 +247,9 @@ Special attributes for plot_type = '2d_contour'

to use black lines on Level 1, blue on Level 2, and red for all
subsequent levels. This is useful since with the matplotlib contour
plotter you will see both fine and course grid lines on top of one
plotter you will see both fine and coarse cell edges on top of one
another in refined regions (Matplotlib lacks the required
hidden line removal to blank out the lines from coarser grids easily.
hidden line removal to blank out the lines from coarser patches easily.
See also the next attributes.)

.. attribute:: contour_show : boolean
Expand All @@ -261,7 +261,7 @@ Special attributes for plot_type = '2d_contour'
.. attribute:: amr_contour_show : list or tuple of booleans

Determines whether to show the contour lines on each AMR level. Useful
if you only want to view the lines on the finest grids.
if you only want to view the lines on the finest patches.


.. attribute:: contour_kwargs : dictionary
Expand All @@ -280,7 +280,7 @@ Special attributes for plot_type = '2d_pcolor'
In general you should specify *pcolor_cmin* and *pcolor_cmax* to
specify the range of q values over which the colormap applies. If they
are not specified they will be chosen automatically and may vary from
frame to frame. Also, if AMR is used, they may vary from grid to grid,
frame to frame. Also, if AMR is used, they may vary from patch to patch,
yielding very confusing plots.

.. attribute:: pcolor_colorbar : bool
Expand Down Expand Up @@ -309,21 +309,21 @@ other hand::
plotitem = plotaxes.new_plotitem(plot_type='2d_contour')
plotitem.amr_contour_color = ['k', 'b']

will result in contour lines on grids at level 1 being black and on grids of
level 2 or higher being blue.
will result in contour lines on patches at level 1 being black and on
patches of level 2 or higher being blue.

Note that if the list is shorter than the number of levels, the last element
is used repeatedly.

If both attributes *contour_color* and *amr_contour_color* are set,
only *amr_contour_color* is used.

A common use is to show grid lines only on coarse levels, not on finer
A common use is to show cell edges only on coarse levels, not on finer
levels, e.g.::

plotitem.amr_gridlines_show = [1,1,0]
plotitem.amr_celledges_show = [1,1,0]

will result in gridlines being shown only on levels 1 and 2, not on finer
will result in celledges being shown only on levels 1 and 2, not on finer
levels.


Expand Down
6 changes: 6 additions & 0 deletions doc/README.txt
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
This directory is for documentation.

To make the documentation in this directory, run
make htmls
in the doc directory of the doc repository, after insuring that
visclaw_doc
is a link to this directory.
24 changes: 12 additions & 12 deletions doc/current_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Call back functions include:

* *beforeframe* and *afterframe* attributes of :ref:`ClawPlotData`
* *afteraxes* attribute of :ref:`ClawPlotAxes`
* *afteritem*, *aftergrid*, *plot_var*, *map2d_to_1d* attributes of :ref:`ClawPlotItem`
* *afteritem*, *afterpatch*, *plot_var*, *map2d_to_1d* attributes of :ref:`ClawPlotItem`


All of these functions are designed to take a single argument
Expand Down Expand Up @@ -48,22 +48,22 @@ current context, e.g. in a *beforeframe* function.

The current frame number

.. attribute:: grid :
.. attribute:: patch :

Object of :class:`pyclaw.solution.grid` with data for the last grid
Object of :class:`pyclaw.solution.patch` with data for the last patch
plotted.

.. attribute:: gridno :
.. attribute:: patchno :

Grid number of this grid, of interest only in AMR calculations.
Grid number of this patch, of interest only in AMR calculations.

.. attribute:: q :

q array for current frame, so for example the in a scalar 2d problem the
value in the (i,j) cell would be *current_data.q[i,j,0]* (remember that
Python always indexes starting at 0).

In an AMR calculation q will be from the last grid plotted.
In an AMR calculation q will be from the last patch plotted.

.. attribute:: aux :

Expand All @@ -74,7 +74,7 @@ current context, e.g. in a *beforeframe* function.

If fort.a files are not found then current_data.aux will be None.

In an AMR calculation aux will be from the last grid plotted.
In an AMR calculation aux will be from the last patch plotted.

.. attribute:: var :

Expand All @@ -84,9 +84,9 @@ current context, e.g. in a *beforeframe* function.

.. attribute:: level :

For AMR computations, where *current_data.grid* is for the last grid plotted,
*current_data.level* is the AMR level of this grid. Particularly useful
in `aftergrid` functions.
For AMR computations, where *current_data.patch* is for the last patch plotted,
*current_data.level* is the AMR level of this patch. Particularly useful
in `afterpatch` functions.

.. attribute:: t :

Expand All @@ -102,11 +102,11 @@ current context, e.g. in a *beforeframe* function.

.. attribute:: xlower :

left edge of current grid.
left edge of current patch.

.. attribute:: ylower :

left edge of current grid in y (only in 2d).
left edge of current patch in y (only in 2d).



2 changes: 1 addition & 1 deletion doc/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The advantages of using the Python options are:
open source visualization tools such as `VisIt
<https://wci.llnl.gov/codes/visit>`_ (developed at Lawrence Livermore
National Laboratory) are much better for dealing
with large data sets, AMR grids, etc. VisIt has Python bindings and
with large data sets, AMR meshes, etc. VisIt has Python bindings and
we are currently extending our tools to work with VisIt. If you are
already a VisIt user, note that VisIt has a Claw reader that can be used to
import data from Clawpack, see `Application Toolkit Formats
Expand Down
2 changes: 1 addition & 1 deletion doc/plotting_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If plot_var is a function then this function is applied to applied to
:ref:`current_data` and should return the array of values to be plotted.
For an example, see :ref:`plotexample-acou-1d-6`.

Sometimes you want to plot something other than the solution on the grid,
Sometimes you want to plot something other than the solution on the patch,
for example to add another feature to a plot of the solution. This can be
done via an ``afteraxes`` command, for example, which is called after all
items have been plotted on the current axes. See :ref:`ClawPlotAxes` for
Expand Down
4 changes: 2 additions & 2 deletions doc/setplot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Overview
The approach outlined below may seem more complicated than necessary, and it
would be if all you ever want to do is plot one set of data at each output
time. However, when adaptive mesh refinement is used each frame of data may
contain several grids and so creating the desired plot requires looping over
all grids. This is done by the plotting utilities described in :ref:`plotting`,
contain several patches and so creating the desired plot requires looping over
all patches. This is done by the plotting utilities described in :ref:`plotting`,
but for this to work it is necessary to specify what plot(s) are desired.

Most example directories contain a file setplot.py that contains a
Expand Down

0 comments on commit 266efab

Please sign in to comment.