-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Using MakiE to visualize JuAFEM meshes #94
Comments
This script requires a couple of preparations to run. Firstly, you need using LinearElasticity
# Define problem
nels = (60,20,4)
sizes = (1.0,1.0,1.0)
E = 1.0;
ν = 0.3;
force = -1.0;
problem = PointLoadCantilever(nels, sizes, E, ν, force)
# Build element stiffness matrices and force vectors
einfo = ElementFEAInfo(problem);
# Assemble global stiffness matrix and force vector
ginfo = assemble(problem, einfo);
# Solve for node displacements
u = ginfo.K \ ginfo.f
mesh = problem.ch.dh.grid
node_dofs = problem.metadata.node_dofs
node_displacements = reshape(u[node_dofs], 3, JuAFEM.getnnodes(mesh))
# visualize(mesh, node_displacements) Please let me know if you run into difficulties or need more details on the internal representation of the mesh. |
The desired visualization here is to transform the nodes of the mesh by the corresponding displacements and bonus points if the color of the mesh changes proportionally to the norm of the displacement at that part of the mesh. |
Duplicate of #64 ? We'd (@ysimillides) would like to use this with FEniCS.jl as well, so it makes sense to have a standard trisurf tie-in that both JuliaFEM and FEniCS (and then whoever else comes in the future as well) build package-specific recipes on top of. |
The approach Simon used to visualize juafem cells using the above script is here https://github.com/JuliaPlots/Makie.jl/blob/sd/abstract/examples/fem.jl. I don't know how the fenics wrapper works but if you can sneak behind Python's back and reinterpret the (hopefully contiguous) data into a juafem-like unstructured grid then the same script above can be used. All I needed to generalize this script to other cell types was to define |
The api with |
* Conform to Cairo's notion of dash * Scale linestyle by linewidth * Account for linestyle = nothing
Following the brief discussion on slack, I am opening this issue to host relevant discussions. Here is the text of my question:
@SimonDanisch's response was:
A script to showcase the mesh representation, expected visualization and desired API is coming up next...
The text was updated successfully, but these errors were encountered: