# Plot Nedelec edge elements (Makie)

**URL:** https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988
**Category:** General Usage
**Tags:** plotting
**Created:** [April 3, 2020, 9:11pm UTC](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988 "2020-04-03T21:11:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)
#### Post date: [April 3, 2020, 9:11pm UTC](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988/1 "2020-04-03T21:11:29Z")

</div>

How can I plot Nedelec finite element data in Julia, preferably with Makie? So far, I’ve been using the standard Lagrangian finite elements which can be plotted with nodal data points using Makie. Now, I’d like to plot the Nedelec finite elements, which are not point nodal but use the edge midpoints for data.

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [April 3, 2020, 11:24pm UTC](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988/2 "2020-04-03T23:24:31Z")

</div>

I’d be interested in a solution to this as well.

I’ve never tried with Makie specifically, but whenever I try plotting anything other than 1st order Lagrangian finite elements, I always resort to creating the explicit representation of the function (knowing the shape of basis functions). And then I plot that using a submesh (which is relatively easy for me since I’m lucky enough to almost always work with structured meshes).

---

<div class="post-metadata">

### Author: ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)
#### Post date: [April 4, 2020, 8:29pm UTC](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988/3 "2020-04-04T20:29:23Z")

</div>

Went ahead and implemented an explicit `nedelecmean` which can be combined with 1st order interpolation to plot `using Makie` in an easy way.

> <https://github.com/chakravala/Adapode.jl/blob/ef8effb458fbabebe9829d6fab778a05ee451bbf/src/element.jl#L265-L272>

Using the [Grassmann.jl](https://github.com/chakravala/Grassmann.jl) element API combined with the above Nedelec function in [Adapode.jl](https://github.com/chakravala/Adapode.jl) the code ends up being fairly simple for unstructured meshes having Nedelec edge values `u` to plot.

```plaintext
E = interp(t,nedelecmean(t,t2e,signs,real.(u)))
mesh(t,color=value.(abs.(E)),shading=false)
arrows!(p,E,arrowsize=0.02,lengthscale=0.02,arrowcolor=:white,linecolor=:white)

```

 ![Screenshot_2020-04-04_18-03-16](https://global.discourse-cdn.com/julialang/original/3X/f/7/f7c8a78f81055c9997c5fbadd9f678e0e1247092.png)
