-
Notifications
You must be signed in to change notification settings - Fork 63
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
Assign spatially varying matrix coefficient #57
Comments
May I ask how your coefficient is defined? If it is a regular function of position, x, y, z, then |
Thanks for the instruction. My coefficients are defined in an n1xn2xn3 discrete grid points in space (regularly sampled, loaded from external file), not an analytical function, and the coefficient is a 3x3 matrix at each grid point. I didn't figure out how to define such a coefficient and apply it to the Poisson during pymfem. What is the appropriate mfem API for this and does pymfem include an example of this kind? Is it MatrixCoefficient or something similar? Thank you very much! |
My apology for slow response. Assuming it is okay to interpolate each of 3x3 matrix element separately, one way is
I added a sample matrix_coefficient. Although the example returns a fixed 2x2 matrix (it is a 2D example), one can call the above function from inside MatrixPyCoefficient::EvalValue |
Closing for now. Feel free to open if you have further questions. |
Hi,
Is there an example on how to assign matrix coefficient to each of the elements in the mesh?
The text was updated successfully, but these errors were encountered: