This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
VTK Lagrange elements in 3D elements is not rendered correctly #297
Comments
I actually get a similar issue with tetrahedron, so is there something Im missing? |
I tried to install dolfinx but the instructions in https://github.com/FEniCS/dolfinx do not work. but then I get:
trying: Nonetheless I could reproduce the issue by copying the output you provided. |
I mostly use docker so all dependencies are right,
All dependencies are in the Dockerfile. If you rely on
|
I agree that the ordering seems strange, I think there is a bug in dolfinx after changing from FIAT to basix. I will get back to you with something with the correct ordering. It would be great if it was possible to extend UGrid to take in the topology, geometry, and celltype and return a mesh using the VTK arbitrary ordered lagrange elements: https://blog.kitware.com/modeling-arbitrary-order-lagrange-finite-elements-in-the-visualization-toolkit/ |
by reading at the links I think it should be doable! |
@marcomusy Btw. The bug with basix only affects second order geometries.
yielding |
..maybe i'm getting confused here but if I rotate by 90deg (which cannot change handedness) it actually looks clockwise - or anyway opposite to the green cube above: import vedo
import numpy as np
geo = np.array([[1., 0., 0.],
[0., 0., 0.],
[0., 1., 0.],
[1., 1., 0.],
[0., 0., 1.],
[1., 0., 1.],
[0., 1., 1.],
[1., 1., 1.]])
topo = np.array([1, 4, 6, 2, 0, 5, 7, 3])
geo2 = np.zeros((len(topo), 3))
for i in range(len(topo)):
geo2[i] = geo[topo[i], :]
pts = vedo.Points(geo2).rotateY(-90)
vedo.show(pts, pts.labels("id"), axes=1) |
If its clockwise or anti clockwise doesn't really matter, as one is just the reflection of the other, and should be able to render nicely (as it does in Paraview.:) |
So the plan would be the following:
|
True. What matters for the VTK readers is likely to be the order of insertion of the points which happens before the connectivity is loaded, and it's used to define the orientation. My guess is that paraview does it the other way around... but i'm not sure (i asked for it in the vtk discourse).
If I understand, at the end of the day you will need something that generates polygons (and associated data) for visualization of the different elements, as all the analysis would be already made upstream. |
Im not very familiar with VTK and vedo,but I figured that it would be something along the lines described in: https://blog.kitware.com/modeling-arbitrary-order-lagrange-finite-elements-in-the-visualization-toolkit/ to UGrid. |
Yes. |
There are a few ways to think about this. In the simplest case, the mesh data might only be on vertices. The idea is to deprecate the |
Sounds good! |
I'll generate som However for examples using higher order DG spaces, the only think I will be able to supply is numpy arrays of the geometry, topology and point clouds (+ VTK celltype), as we do not have support for this in our VTK readers. Thus It would be great to get a similar interface to UGrid as for Mesh;) |
I havent had a lot of time to look at this yet. However, if you want to start working on this, you could have a look at:
|
Hi @jorgensd , I'm trying the following: sudo docker pull dolfinx/dolfinx
sudo docker run -ti dolfinx/dolfinx
pip3 install vedo
apt update
apt install nano
git clone https://github.com/FEniCS/dolfinx.git
cd dolfinx
git pull origin pull/1161/head
cd cpp
mkdir build
cd build
cmake ..
make install -j3
cd ../../python
pip3 install . and it installs fine. But when import dolfinx i get:
error msg seems has to do with method |
Its tricky to reinstall dolfinx inside the prebuilt image. I would suggest using the
|
It still complains about MPI:
but I've checked that I have both |
Let me have a look, and I'll give you a complete set of tested instructions |
I forgot to add the
|
Thanks Jorgen! I'll get back to you as soon as i have something working smoothly. |
@marcomusy Im looking forward to it! Tools such as vedo would make my life so much easier (after spending one weekend trying to generalize our matplotlib support to quad/hexes, and failing massively). |
.. while i'm at this - for my research - I'm also implementing a mesher, to mesh arbitrary concave domains, which seems to work pretty well and fast (~50k triangles/sec) with simple syntax: from vedo import Spline, show
from vedo.pyplot import histogram
shape = Spline([[0, 0],
[1, 0],
[1.1, 4],
[1.0, 1.5],
[0.2, 5],
[-1.0, 3.0],
[0.4, 2.7],
[-1.0, 2.4],
],
closed=True).c('red4')
msh = shape.tomesh(resLine=400) # resample boundary
msh.smoothLaplacian().addQuality().addScalarBar3D()
histo = histogram(msh.getCellArray('Quality'),
aspect=3/4, c='RdYlBu', xtitle='triangle mesh quality')
show(shape.ps(3), msh, histo, N=3, sharecam=False) maybe dolfinx people will find it useful too |
That is quite interesting! Are you planning to generalize it to other cell types (quads) or 3D? |
oh i haven't thought about it! Not sure about quads, but for 3d it might be possible.. |
Let me know how you get along with things:) i've spent the day updating my dolfin-x tutorial after we removed matplotlib. When vedo is ready, Im ready to add it to some of the examples, such as: https://jorgensd.github.io/dolfinx-tutorial/chapter3/em.html or https://jorgensd.github.io/dolfinx-tutorial/chapter2/ns_code1.html |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
MWE using dolfinx:
yields:
and
while the correponding
VTU
file contains;Which is the same as the vedo mesh has, but yields
The text was updated successfully, but these errors were encountered: