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

Skip patches not seen #262

Merged
merged 2 commits into from
Apr 13, 2020
Merged
Changes from all 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
26 changes: 26 additions & 0 deletions src/python/visclaw/frametools.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,31 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False):
# loop over patches:
# ----------------

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

patch = state.patch

if (plotaxes.xlimits is not None) \
& (type(plotaxes.xlimits) is not str):
if (patch.dimensions[0].lower \
>= plotaxes.xlimits[1]) \
or (patch.dimensions[0].upper \
<= plotaxes.xlimits[0]):
num_skipped += 1
continue # go to next patch

if len(patch.dimensions) > 1:
# 2d patch
if (plotaxes.ylimits is not None) \
& (type(plotaxes.ylimits) is not str):
if (patch.dimensions[1].lower \
>= plotaxes.ylimits[1]) \
or (patch.dimensions[1].upper \
<= plotaxes.ylimits[0]):
num_skipped += 1
continue # go to next patch

current_data.add_attribute('patch',patch)
current_data.add_attribute("level",1)
current_data.add_attribute('q',state.q)
Expand Down Expand Up @@ -305,6 +326,11 @@ def plot_frame(framesolns,plotdata,frameno=0,verbose=False):

# end of loop over plotitems
# end of loop over patches

if False and num_skipped > 0:
# possible warning message:
print('Skipped plotting %i patches not visible' % num_skipped)

# end of loop over framesolns


Expand Down