Calculate cell data #701
Unanswered
martinbaun
asked this question in
Q&A
Replies: 2 comments
-
You could try creating another basis object with piecewise-constant element and project to that: basis0 = basis.with_element(skfem.ElementTriP0())
B_x = skfem.projection(A, basis0, basis, 1)
B_y = -skfem.projection(A, basis0, basis, 0)
from skfem.visuals.matplotlib import plot
plot(basis0, np.sqrt(B_x**2 + B_y**2), colorbar=True)
plt.axis('equal') Let me know if it works or if there is another issue. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Wow, that was a fast response. Works perfect! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I`m running a simulation of an Iron Core with a current density driven coil. The mesh is shown below. The attached code leads to correct solution vector "A". For postprocessing I want to calculate the magnetic flux density. In ex35 there is an example how to do that as nodal values. This leads to a blurry image and the image shows a magnetic field outside the iron core which shouldn't be. So I would like to calulate the flux density as a cell value. For linear elements the flux density is a constant in the cell, which is shown in the last picture below which I created with an other software. Do you have any hints?
Best regards
Martin
Beta Was this translation helpful? Give feedback.
All reactions