-
Notifications
You must be signed in to change notification settings - Fork 49
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
Compute global quantities from AMR grid patches of solution #207
Comments
We have a hook for this functionality in Pyclaw; see http://www.clawpack.org/pyclaw/output.html#outputting-functionals (although the example code there doesn't make sense). A working example is in |
this is done at every time step in the routine conck.f, for mass conservation. Since we do conservative updates, it is only necessary to do it on the coarsest level. So I must not be understanding what you are looking for?
— Marsha
…On Feb 21, 2017, at 12:32 AM, Randall J. LeVeque ***@***.***> wrote:
A user requested a post-processing tool to help compute a global quantity (e.g. the total mass) from each frame of AMR output.
Not sure if this would go in visclaw, amrclaw, or pyclaw?
One way to do this might be:
For each grid patch define a boolean array finest of the same size, initialized to True everywhere.
Loop over patches from coarsest to finest. If a patch at level L covers some rectangular region of a patch at level L-1 then set finest = False in that portion of the level L-1 patch.
Loop over all patches a second time, accumulating the desired value, e.g. adding in rho(i,j)*dx*dy for each grid cell (i,j) for which finest = True.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@mjberger: Sorry, I was using mass computation as a simple example but the actual problem is to compute e.g. potential energy of a tsunami, which requires summing |
This could be incorporated in the |
A user requested a post-processing tool to help compute a global quantity (e.g. the total mass) from each frame of AMR output.
Not sure if this would go in visclaw, amrclaw, or pyclaw?
One way to do this might be:
finest
of the same size, initialized toTrue
everywhere.L
covers some rectangular region of a patch at levelL-1
then setfinest = False
in that portion of the levelL-1
patch.rho(i,j)*dx*dy
for each grid cell(i,j)
for whichfinest = True
.The text was updated successfully, but these errors were encountered: