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

Discussion on the assembly of the element matrix #318

Open
huangyb2 opened this issue Dec 15, 2024 · 3 comments
Open

Discussion on the assembly of the element matrix #318

huangyb2 opened this issue Dec 15, 2024 · 3 comments
Labels
question Further information is requested

Comments

@huangyb2
Copy link

In Palace, when assembling the element matrix, the element matrix is first computed without considering the material coefficients. After the element matrix is calculated, the material coefficients are then added to the element matrix. Doesn't this significantly increase the computational cost? Is this approach beneficial for parallel computing in some way?

@hughcars hughcars added the question Further information is requested label Dec 16, 2024
@hughcars
Copy link
Collaborator

Hi @huangyb2,

I'm not 100% sure what you mean by your question, but if you are referring to computing the element transformation pieces separately before the coefficient terms, then this is an optimization. See #122 and #166. The rough idea was that extra computation on the fly was worth it to reduce the size of the data needed to be stored. Does that answer your question? If not if you point me at the particular lines of code you are confused by, maybe I can be of more help.

@huangyb2
Copy link
Author

Hi@hughcars
Thank you for your reply, and I apologize for the delay in my response. My focus is on understanding how the relative permeability is incorporated into the assembly process of the unit matrix, such as the curlcurl unit matrix, in Palace. I have gone through the code implementation of each function layer by layer, but still cannot find the answer. Could you please tell me where the bottom-level implementation of this function is located?My trace process is as follows:
1
image
2
image

3
image
and so on.......

@hughcars
Copy link
Collaborator

I think what you're looking for are the integrators and qfunctions. If you look at CurlCurlIntegrator::Assemble you will find that a QFunction is being assembled, which contains all the data that will be evaluated at each quadrature point. If you trace further, you'll eventually end up in the libceed functions, where the geometry data (things like jacobians, jacobian determinants etc. are computed) and the physical data (material properties) are combined. You need to go a long way further than BilinearForm::PartialAssemble, as the process to assemble efficiently in parallel is fairly involved.

The geometry data is computed once and then reused in any relevant integrands, whereas the physical data is specific to each integrand. This process is key to the partial assembly approach taken within Palace, that is explained by MFEM, https://mfem.org/performance/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants