-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added function to compute convolution. #4
Conversation
int_box.grow(phi_width); | ||
#ifndef NDEBUG | ||
// Error checking. Need ghost data for patch data. | ||
TBOX_ASSERT(a_data.getGhostBox() * int_box == int_box); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on why we need ghost data here, and what exactly this line is doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line computes the intersection between the two boxes, and makes sure that it's equal to the integration box. * is an overloaded operator for type Box<NDIM>
. Essentially, we're checking that the integration box is contained within the ghost box.
Can I call this function from |
Yeah. You need to include the header |
* Both patch data MUST have enough ghost cells for the width of the phi function. This assumes the phi function is | ||
* centered at idx and scaled by the grid spacing. | ||
*/ | ||
double convolution(double alpha, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain these parameters some more? I'm trying to include this in the two files I've been working on. In particular I'm curious as to where phi, phi_width, and dx come from and should be defined. I'm assuming a_data and b_data correspond loosely to phi_a and phi_b?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also a bit confused in my implementation since to compute alpha, you need to compute R2, which uses eta. But then eta is computed using alpha? This seems like a circular dependency.
This computes a convolution of
(alpha * a + beta * b)
and a functionphi(r)
at a specified cell index. Note that phi is assumed to be of the formphi(r) = phi(x)*phi(y)
(like IB delta functions).@jmcragun, take a look and feel free to merge if this makes sense to you.