Ferrite.jl icon indicating copy to clipboard operation
Ferrite.jl copied to clipboard

Regular P^2 triangulations for quadratic tetrahedral elements

Open natschil opened this issue 5 years ago • 2 comments

This is https://github.com/KristofferC/JuAFEM.jl/pull/228 but without the erroneous commits at the end.

Add a function for generating regular P2 triangulations with Quadratic Tetrahedral elements I've briefly tested the code and it seems to work. Somebody should go over the code that creates the boundary facesets, as I don't understand it and just copied the relevant sections from generate_grid(Tetrahedron, ....)

natschil avatar Feb 05 '20 12:02 natschil

Thanks for the PR. We don't really have a good way to export a visualization of facesets but as a workaround I created dirichlet boundary conditions on all faces and exported that:

grid = generate_grid(QuadraticTetrahedron, (5,5,5))
dh = DofHandler(grid)
push!(dh, :u, 3) 
close!(dh)
dbcs = ConstraintHandler(dh)
foreach(x -> add!(dbcs, Dirichlet(:u, getfaceset(grid, x), (x,t) -> [0.0, 0.0, 0.0], [1, 2, 3])),  keys(grid.facesets))
close!(dbcs)

vtk = vtk_grid("quadtetra", grid)
vtk_point_data(vtk, dbcs)
vtk_save(vtk) 

I then get something that looks like:

image

Maybe this means that some faces are not part of the boundary? I would have assumed the whole boundary to have the value 1 otherwise.

Note that I haven't thought through this properly so there might be something I miss.

KristofferC avatar Feb 05 '20 13:02 KristofferC

Maybe you can just add addfaceset! etc to create the sets.

fredrikekre avatar Feb 05 '20 13:02 fredrikekre