Skip to content

Commit

Permalink
Merge pull request #262 from rjleveque/skip_patches_not_seen
Browse files Browse the repository at this point in the history
Skip patches not seen
  • Loading branch information
mandli authored Apr 13, 2020
2 parents 6a807fa + 5737dd6 commit b8d8598
Showing 1 changed file with 26 additions and 0 deletions.
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

0 comments on commit b8d8598

Please sign in to comment.