Code Monkey home page Code Monkey logo

ferriteviz.jl's Introduction

FerriteViz.jl

Build Status

Small package to visualize your Ferrite.jl results. Currently supports only Makie, but the goal is to extend it for different plotting packages.

The package is highly experimental and breaking changes about the internal machinery are about to come. Likely, only a small fraction of the interface will change over time.

Installation

pkg> add FerriteViz

Usage

Simply grab your solution vector and the corresponding dof handler to create a plotter:

import FerriteViz, GLMakie
dh, u   = solve_problem()
plotter = MakiePlotter(dh, u)
FerriteViz.solutionplot(plotter)

For a guide check out the tutorial section - or just enjoy the gallery below!

Features

  • solutionplot FE solution contour plot on arbitrary finite element mesh (in Makie called mesh plots)
  • ferriteviewer viewer with toggles and menus that update the plot
  • wireframe plots the finite element mesh and optionally labels nodes and cells
  • arrows - also called quiver plots, in paraview glyph filter
  • surface 2D solutions in 3D space as surface, in paraview warp by scalar filter
  • synchronous plotting while your simulation runs with any of the above listed options
  • mutating versions of the above listed functions (except for the viewer)
  • deformed plots available for solutionplot and wireframe
  • full integration into the Makie ecosystem, e.g. themes, layouts etc.
  • GPU powered plotting with GLMakie.jl, jupyter/pluto notebook plotting with WGLMakie.jl and vector graphics with CairoMakie.jl

Missing Features

  • correct visualization of nonlinear geometry faces/edges
  • visualization of boundary conditions
  • subdomain entity plotting, e.g. facesets, edgesets and so on
  • ...

For a detailed list of planned features take a look into the issue tracker. Helping hands are always welcome. Just join the discussion in the corresponding issues.

Gallery

Pulling the Ferrite.jl logo with a cohesive zone material model.

Credits to Kim Auth

ferriteviz.jl's People

Contributors

adarshpalaskar1 avatar dependabot[bot] avatar github-actions[bot] avatar janm12 avatar knutam avatar koehlerson avatar ranocha avatar simondanisch avatar termi-official avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ferriteviz.jl's Issues

docs

The plotting functions are not documented

what needs to be done

  • describe what the function does
  • describe the possible keyword args and their default setting
  • show integration with other Makie stuff, e.g. layouts

Element utilities

Debug utilities for element formulations can be helpful. For this we should have visualization helpers for

  • Reference vertex numbering in 1d, 2d, 3d for all reference shapes
  • Reference face numbering in 2d and 3d for all reference shapes
  • Reference edge numbering in 3d for all reference shapes
  • Visualization of individual basis functions for arbitrary interpolations (on suitable reference shapes)
  • Utils for orientations
  • Visualization of normals

ferriteviewer broken?

Or maybe I'm doing something wrong?
(fig = solutionplot(plotter) works)

# Versions
#=
  [c061ca5d] Ferrite v0.3.14
  [59d0093e] FerriteViz v0.2.1
  [276b4fcb] WGLMakie v0.8.9
  [37e2e46d] LinearAlgebra
  [2f01184e] SparseArrays
=#
julia> grid = generate_grid(Quadrilateral, (2,2));

julia> dh = DofHandler(grid); add!(dh, :u, 1); close!(dh);

julia> plotter = MakiePlotter(dh, zeros(ndofs(dh)));

julia> fig = ferriteviewer(plotter);
ERROR: You are using a matrix for vertices which uses neither dimension to encode the dimension of the space. Please have either size(verts, 1/2) in the range of 2-3. Found: (48, 1)
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] to_vertices(verts::Matrix{Float64})
    @ Makie C:\Users\meyer\.julia\packages\Makie\DekzU\src\conversions.jl:744
  [3] (::FerriteViz.var"#20#28"{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}})(arg1#295::Vector{Float64}, arg2#296::Symbol)
    @ FerriteViz C:\Users\meyer\.julia\packages\FerriteViz\noy5W\src\makieplotting.jl:57
  [4] #map#13
    @ C:\Users\meyer\.julia\packages\Observables\PHGQ8\src\Observables.jl:564 [inlined]
  [5] map(f::FerriteViz.var"#20#28"{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}, arg1::Observable{Vector{Float64}}, args::Observable{Any})
    @ Observables C:\Users\meyer\.julia\packages\Observables\PHGQ8\src\Observables.jl:562
  [6] plot!(SP::Combined{FerriteViz.solutionplot, Tuple{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}})
    @ FerriteViz C:\Users\meyer\.julia\packages\FerriteViz\noy5W\src\makieplotting.jl:52
  [7] plot!(scene::Scene, P::Type{Combined{FerriteViz.solutionplot, Tuple{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, attributes::Attributes, input::Tuple{Observable{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}, args::Observable{Tuple{MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}})
    @ Makie C:\Users\meyer\.julia\packages\Makie\DekzU\src\interfaces.jl:432
  [8] plot!(scene::Scene, P::Type{Combined{FerriteViz.solutionplot}}, attributes::Attributes, args::MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\meyer\.julia\packages\Makie\DekzU\src\interfaces.jl:344
  [9] plot!
    @ C:\Users\meyer\.julia\packages\Makie\DekzU\src\interfaces.jl:311 [inlined]
 [10] plot!(la::Axis, P::Type{Combined{FerriteViz.solutionplot}}, attributes::Attributes, args::MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\meyer\.julia\packages\Makie\DekzU\src\makielayout\blocks\axis.jl:792
 [11] plot!
    @ C:\Users\meyer\.julia\packages\Makie\DekzU\src\makielayout\blocks\axis.jl:779 [inlined]
 [12] #plot!#1390
    @ C:\Users\meyer\.julia\packages\Makie\DekzU\src\makielayout\blocks\axis.jl:809 [inlined]
 [13] plot!(P::Type{Combined{FerriteViz.solutionplot}}, args::MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}; kw_attributes::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:colormap, :deformation_field), Tuple{Symbol, Observable{Symbol}}}})
    @ Makie C:\Users\meyer\.julia\packages\Makie\DekzU\src\figureplotting.jl:69
 [14] plot!
    @ C:\Users\meyer\.julia\packages\Makie\DekzU\src\figureplotting.jl:64 [inlined]
 [15] #solutionplot!#16
    @ C:\Users\meyer\.julia\packages\MakieCore\6sckc\src\recipes.jl:38 [inlined]
 [16] solutionplot!
    @ C:\Users\meyer\.julia\packages\MakieCore\6sckc\src\recipes.jl:37 [inlined]
 [17] ferriteviewer(plotter::MakiePlotter{2, DofHandler{2, Grid{2, Quadrilateral, Float64}}, Float64, Nothing, Float32, GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{Point{2, Float32}, Vector{Point{2, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}})
    @ FerriteViz C:\Users\meyer\.julia\packages\FerriteViz\noy5W\src\makieplotting.jl:499
 [18] top-level scope
    @ REPL[26]:1

Problem library

Turns out it might make sense to have some parametrized off-the-shelf problems available for testing visualization. @koehlerson already started with the ferrite-examples in the docs folder. However, we could do better with the parametrization.

Parallel Viewer

A viewer which is capable of rendering larger meshes will be needed in the future (see Ferrite-FEM/Ferrite.jl#486). Not sure how to handle this one yet. For really large problems this mights require something like the Vulkan external memory extension (https://registry.khronos.org/vulkan/specs/1.0-extensions/html/vkspec.html#synchronization-device-group) in Makie.

Edit: It might make sense to have two viewers. One which just merges all parallel solutions on one processes with shared memory processing tools and one truely distributed viewer for really large simulations.

nonlinear geometries

  • to_triangles under resolves nonlinear geometry/fields
  • drawing edges(cell) or faces(cell) for cell::AbstractCell draws only a linear line

image

Cell data & higher order plotting

  • How do we plot stuff for cell dependent data instead of nodal data? Is it possible with Makie?
  • How to plot higher order stuff, possible in Makie?

Isosurface extraction

Another missing feature is isosurface extraction (e.g. Contour filter in ParaView) which should be implementable via Marching Cubes/Tets/...

Unexpected behavior when combining 2D surface and wireframe

Combining surface and wireframe plots does not what we would expect.

MWE:

using Ferrite, SparseArrays

# Manufactured Solution 
function u_anal(x) 
    val = 1.0
    for x_i in x
        val *= sin(x_i)
    end
    val
end

dim = 2
grid = generate_grid(Triangle, (2, 2), Vec(0.0,0.0), Vec(float(π), float(π)));
∂Ω = union(getfaceset.((grid, ), ["left", "right", "top", "bottom"])...);

ip = Ferrite.CrouzeixRaviart{dim, 1}()
ip_geo = Lagrange{dim, RefTetrahedron, 1}()
qr = QuadratureRule{dim, RefTetrahedron}(4)
cellvalues = CellScalarValues(qr, ip, ip_geo);
# for all the elements.
dh = DofHandler(grid)
push!(dh, :u, 1, ip)
close!(dh);

K = create_sparsity_pattern(dh);

ch = ConstraintHandler(dh);
dbc = Dirichlet(:u, ∂Ω, (x, t) -> 0)
add!(ch, dbc);
close!(ch)
update!(ch, 0.0);

function doassemble(cellvalues::CellScalarValues{dim}, K::SparseMatrixCSC, dh::DofHandler, u_anal) where {dim}
    n_basefuncs = getnbasefunctions(cellvalues)
    Ke = zeros(n_basefuncs, n_basefuncs)
    fe = zeros(n_basefuncs)

    f = zeros(ndofs(dh))
    assembler = start_assemble(K, f)

    @inbounds for cell in CellIterator(dh)
        fill!(Ke, 0)
        fill!(fe, 0)

        reinit!(cellvalues, cell)
        coords = getcoordinates(cell)

        for q_point in 1:getnquadpoints(cellvalues)
            dΩ = getdetJdV(cellvalues, q_point)
            coords_qp = spatial_coordinate(cellvalues, q_point, coords)
            for i in 1:n_basefuncs
                v  = shape_value(cellvalues, q_point, i)
                ∇v = shape_gradient(cellvalues, q_point, i)

                fe[i] += u_anal(coords_qp) * v *for j in 1:n_basefuncs
                    ∇u = shape_gradient(cellvalues, q_point, j)
                    Ke[i, j] += (∇v  ∇u) *end
            end
        end

        assemble!(assembler, celldofs(cell), fe, Ke)
    end
    return K, f
end
K, f = doassemble(cellvalues, K, dh, u_anal);

apply!(K, f, ch)
u = K \ f;

using FerriteVis, WGLMakie

plotter = MakiePlotter(dh,u);
FerriteVis.surface(plotter)
FerriteVis.wireframe!(plotter)

Screenshot from 2022-02-10 15-05-24

Global numberings

It can be quite helpful to visualize the numbering of different things for debugging purposes

  • Vertex numbering
  • Node numbering (#20)
  • Edge numbering, if existent
  • Face numbering, if existent
  • Cell numbering (#20)
  • DoF numbering

as well as having their positions visualized

Cut plane

Cut planes are essential for visualizing 3D stuff to inspect the interior of the domain. We want to add

  1. crinkle plane
  2. "clean" cut plane

for the latter we have to think about how to extract the plane efficiently in non-linear geometries

Subdomain utilities missing

For debugging purposes it can be helpful to visualize the ...

  • cellsets (partially addressed in #32)
  • facesets
  • nodesets
  • edgesets
    ... of meshes.

Occlusion culling

The code has become considerably slower through all the generalizations implemented with the last batch of PRs. At this point we have to think about optimizations. The renderer currently just extracts all faces brute-force, so a big optimization will be to introduce a simple occlusion culling for internal faces.

Reduction of Allocations -> make FerriteViz go vroom

With #63 we exploit something conceptually, however, the current implementation allocates rather much, because we run into

https://github.com/MakieOrg/Makie.jl/blob/adc9d9ae3523f746f9c32652c833a59bfc0167b2/src/conversions.jl#L581-L595

by e.g.

return Makie.mesh!(CP, coords, plotter.triangles, color=solution, shading=CP[:shading], scale_plot=CP[:scale_plot], colormap=CP[:colormap], transparent=CP[:transparent])

where instead we could directly provide a GLNormalMesh which shouldn't allocate further according to Simon. If that's the case it is a bug in Makie and we could circumvent it by directly overloading recipe internals, such as draw_atomic. Besides that we could directly use Makie.Buffer to construct the GLNormalMesh in the spirit of https://docs.makie.org/stable/examples/plotting_functions/mesh/index.html#using_geometrybasicsmesh_and_buffersampler_type

Getting ready for Ferrite v1.0.0 release

We need to change a couple of things with the breaking changes coming in v0.4.0. From the top of my head:

  • exclude all DofHandler specific dispatches
  • rename all MixedDofHandler methods to DofHandler
  • merge #78

Plots.jl support

https://juliaplots.org/RecipesBase.jl/dev/

allows to create plot recipes in a similar way to Makie. However, I'm not sure if something like observables are supported or in which way time dependent stuff should be done. By supporting Plots.jl we would get a lot of different backends matplotlib,plotly,pgfplots, unicodeplots etc

One-shot methods

It makes sense to also provide plotting methods which internally construct the plotter and throws it away instantly, for convenience.

Superquadrics for tensor-valued fields

We should be able to implement visualization of symmetric and non-symmetric matrix fields via superquadrics (e.g. [1,2]) with moderate effort. For this we might need some changes to Makie.jl, where we start from meshscatter and implement a new shader to render out the superquadrics. The matrix field should be evaluated either at quadrature points or nodes.

[1] Schultz, T., & Kindlmann, G. L. (2010). Superquadric glyphs for symmetric second-order tensors. IEEE transactions on visualization and computer graphics, 16(6), 1595-1604.

[2] Kratz, A., Auer, C., Stommel, M., & Hotz, I. (2013, February). Visualization and analysis of second‐order tensors: Moving beyond the symmetric positive‐definite case. In Computer Graphics Forum (Vol. 32, No. 1, pp. 49-74). Oxford, UK: Blackwell Publishing Ltd.

WGLMakie tries to plot NaN or Inf value in wireframe plot recipe

When trying to plot a wireframe plot from a Grid without cellsets WGLMakie errors that it cannot plot NaN or Inf values.
Cannot reproduce it with GLMakie locally.

I don't understand this, since the values are initialized to be 0:
https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/makieplotting.jl#L165-L172

MWE can be taken from the docs

import FerriteViz
using Ferrite
import WGLMakie #activating the backend, switch to GLMakie or CairoMakie (for 2D) locally

grid = generate_grid(Hexahedron,(3,3,3))
FerriteViz.wireframe(grid,markersize=50,strokewidth=2)

Visualization on quads underresolved

Splitting quads into two triangles underresolves the solution, because we loose one of the diagonal modes. This can be fixed by splitting quads into four triangles instead. The same problem occurs in 3D.

Solution data abstraction

For time dependent problems and cell data such as fluxes and stresses the solution data needs some abstraction, e.g.

abstract type AbstractSolutionData end
abstract type AbstractStaticData <: AbstractSolutionData end
abstract type AbstractTimeDependentData <: AbstractSolutionData end

...

with a proper interface, such that static and dynamic data as well as point and cell data can be distinguished while dispatching

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

pressure field example wrong?

I think this should look different and it seems that some ordering is broken due to recent changes

image

its the pressure field of the incompressible elasticity example. Behaves the same for linear,quadratic and triangle/quad. Probably something broken in the transfer_solution logic

Extension for different cells

Currently there is no documentation at all how to handle special types of cells.
The package should have some sort of interface how cells can be triangulated.

Probably https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/utils.jl#L26-L32, https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/utils.jl#L35, https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/utils.jl#L94-L98 together with a decompose! dispatch as here https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/utils.jl#L112-L207 is all that is needed.

ping @termi-official, @kimauth needs it for e.g. for trusses, so embedded lines and probably cohesive zone elements

Flux field example

Put together an example to visualize the piecewise discontinuous flux field.

I found several approaches to this.

  1. Actual flux field via piecewise discontinuous approximations (currently only Lagrange -> DiscontinuousLagrange via interpolation
  2. Actual flux field via piecewise discontinuous approximations (currently only Lagrange -> DiscontinuousLagrange via element-wise L2 projection
  3. Directly visualize vector data as vector field at (quadrature) points
  4. Visualize tensors at (quadrature) points via (super-)quadrics -> #54

Citation file missing

Since the system forces us to do it, we should include a citation.cff as a guideline to cite our repository, in case someone uses it and wants to give us credit.

Possible bug when using `getfielddim` and the `MixedDofHandler`

Hello,
I recently updated Ferrite to v0.3.14 and now a part of my old code fails with the following message:
"MethodError: no method matching getfielddim(::MixedDofHandler{3, Float64, Ferrite.Grid{3, Tetrahedron, Float64}}, ::Int64)"
If I am correct the problem is the following line:

field_dim = Ferrite.getfielddim(dh, field_idx)

Where field_idx::Int works for a DofHandler, but not for a MixedDofHandler.
Am I correct, or am I missing something?

plotting gradient, divergence, and other shenanigans

Any <: AbstractPlotter will probably hold a <: AbstractDofHandler and some solution vector u. It should be relatively easy to compute the gradient, divergence with the given information. This can be nicely integrated with #1 depending on the type of solution data, compute the gradient and divergence. Probably also worth to think about computing it once and safe it inside the plotter

Viewer for dynamic problems

Currently, only static plots supported, there should be an easy way to @lift the solution vector based on some time index and make it controlable by some Observable widget thing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.