Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't skip patches if mapped grid used #279

Merged
merged 5 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/visclaw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def __init__(self, name, plotfigure):
self.add_attribute('afteraxes',None)
self.add_attribute('xlimits',None)
self.add_attribute('ylimits',None)
self.add_attribute('skip_patches_outside_xylimits',True)
self.add_attribute('skip_patches_outside_xylimits',None)
self.add_attribute('scaled',False) # true so x- and y-axis scaled same
self.add_attribute('image',False) # true so x- and y-axis scaled same
# and plot bounds tight
Expand Down
20 changes: 17 additions & 3 deletions src/python/visclaw/frametools.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False):
beforeaxes = getattr(plotaxes,'beforeaxes',None)
current_data = run_str_or_func(beforeaxes,current_data)

skip_patches_outside_xylimits = plotaxes.skip_patches_outside_xylimits

if skip_patches_outside_xylimits is None:
# User didn't set. Set to True unless there's a mapped grid

MappedGridExists = (plotdata.mapc2p is not None)
mandli marked this conversation as resolved.
Show resolved Hide resolved
if not MappedGridExists:
# check every item in case there's a mapc2p:
for itemname in plotaxes._itemnames:
plotitem = plotaxes.plotitem_dict[itemname]
MappedGridExists = MappedGridExists or \
(plotitem.mapc2p is not None)

skip_patches_outside_xylimits = not MappedGridExists


# NOTE: This was rearranged December 2009 to
# loop over patches first and then over plotitems so that
Expand All @@ -206,10 +221,9 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False):
# loop over patches:
# ----------------

num_skipped = 0
skip_patches_outside_xylimits = \
getattr(plotaxes,'skip_patches_outside_xylimits',True)

num_skipped = 0

for stateno,state in enumerate(framesoln.states):

patch = state.patch
Expand Down