# Is there any interest in creating a FEM Julia organization?

**URL:** <https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035>\
**Category:** Community\
**Tags:** diffeq\
**Created:** [November 13, 2017, 5:27am UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035 "2017-11-13T05:27:15Z")\
**Posts on this page:** 11\
**Page:** 3

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [September 21, 2019, 9:17am UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/41 "2019-09-21T09:17:56Z")

</div>

> [@Javier](#):
>
> How about using the gmsh mesh format?

> **[GitHub - JuliaFEM/Gmsh.jl: Gmsh.jl contains API for Gmsh: a three-dimensional...](https://github.com/JuliaFEM/Gmsh.jl)**
>
> Gmsh.jl contains API for Gmsh: a three-dimensional finite element mesh generator. With the help of Gmsh.jl, it is possible add parametric model construction and/or automatic mesh generation to a FE...

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [September 21, 2019, 5:53pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/42 "2019-09-21T17:53:40Z")

</div>

Perhaps off topic… one of my students work with population balances, which in principle add attribute (internal) independent variables to spatial (external) variables. For such problems, higher dimensional grids than 3D may be needed. Examples could be description of particle size distribution, liquid content distribution, and porosity/gas content distribution. OK – perhaps other discretization methods are needed for such problems, I don’t know.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 21, 2019, 7:26pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/43 "2019-09-21T19:26:30Z")

</div>

> [@BLI](#):
>
> For such problems, higher dimensional grids than 3D may be needed. Examples could be description of particle size distribution, liquid content distribution, and porosity/gas content distribution. OK – perhaps other discretization methods are needed for such problems, I don’t know.

Matrix-free methods are what DiffEqOperators is doing, and higher dimensions use neural network based methods. For example, 100 dimensional PDEs are showcased here:

> **[GitHub - SciML/NeuralPDE.jl: Physics-Informed Neural Networks (PINN) and Deep...](https://github.com/SciML/NeuralPDE.jl)**
>
> Physics-Informed Neural Networks (PINN) and Deep BSDE Solvers of Differential Equations for Scientific Machine Learning (SciML) accelerated simulation - GitHub - SciML/NeuralPDE.jl: Physics-Informe...

The classical methods like FEM don’t do as well with high dimensions (if you can even represent them in memory), so this is an area where the newer SciML methods tend to shine.

---

<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:** [September 21, 2019, 7:44pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/44 "2019-09-21T19:44:25Z")

</div>

> [@PetrKryslUCSD](#):
>
> A fully general mesh framework needs to support, in addition to the basic cube -like and simplex -like shapes with the minimum number of vertices, analogous shapes with higher numbers of vertices (mid-edge, interior, and such), and also shapes with variable number of vertices (Voronoi-type polyhedra and so on).

> [@BLI](#):
>
> add attribute (internal) independent variables to spatial (external) variables. For such problems, higher dimensional grids than 3D may be needed.

> [@CAD in Julia?](https://discourse.julialang.org/t/cad-in-julia/28557/13):
>
> A very good universal API for points, vertices, faces, edges, spheres, circles, lines, areas, volumes, etc can be phrased in terms of geometric algebra and homological algebra… So I recommend using the number system I am developing in the Grassmann package as an underlying type for the geometry. Then we can build the specific geometry types by storing the geometric numbers from Grassmann in that struct. To see what I’m talking about, have a look at this [presentation](http://geometry.mrao.cam.ac.uk/wp-content/uploads/2015/11/GA2015_Lecture7.pdf) where conformal geometric al…

As I have mentioned in the other threads before here, the [Grassmann.jl](https://github.com/chakravala/Grassmann.jl) differential geometric algebriac number system would be well suited to this, since it naturally supports homological algebra with simplices and faces and edges and points and lattices and so on. It also generalizes to any number of dimensions and works with projective geometry. Also, it supports multivariable differential operators and differential forms.

> **[Simplicial homology](https://en.wikipedia.org/wiki/Simplicial_homology)**
>
> In algebraic topology, simplicial homology is the sequence of homology groups of a simplicial complex. It formalizes the idea of the number of holes of a given dimension in the complex. This generalizes the number of connected components (the case of dimension 0).
> Simplicial homology arose as a way to study topological spaces whose building blocks are n-simplices, the n-dimensional analogs of triangles. This includes a point (0-simplex), a line segment (1-simplex), a triangle (2-simplex) and a t...

That is to say, I have not created a mesh geometry framework with it yet… but I believe it would be beneficial to use this universal mathematical language as a foundational building block for such things… since it is a universal language that can be used for automatic differentiation and geometry simultaneously.

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [September 21, 2019, 8:20pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/45 "2019-09-21T20:20:26Z")

</div>

I should probably look into this some time (SciML) – at least get an idea of the principle. With PDEs, one doesn’t have data (as with traditional machine learning). Is the idea similar to weighted residual methods, where instead of formalizing a trial solution (e.g., using finite support basis functions such as in FEM), one uses a neural network as “trial solution”, and trains the NN to minimize some weighted residual of the PDE + BCs?

Btw. my impression is that special discretization methods are used with population balances. Maybe I can talk my student into testing Sci ML in Julia as an alternative to the current MATLAB implementation, when back from a leave.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 21, 2019, 8:23pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/46 "2019-09-21T20:23:00Z")

</div>

> [@BLI](#):
>
> I should probably look into this some time (SciML) – at least get an idea of the principle. With PDEs, one doesn’t have data (as with traditional machine learning). Is the idea similar to weighted residual methods, where instead of formalizing a trial solution (e.g., using finite support basis functions such as in FEM), one uses a neural network as “trial solution”, and trains the NN to minimize some weighted residual of the PDE + BCs?

Exactly. For high dimensions, it’s just too impractical to do any point-wise or element-wise representation of the space. You get around the curse of dimensionality by expressing the solution through a neural network and training said network. These methods are not necessarily as efficient as say FDM/FEM for low dimensions, but when you get to high dimensions then the memory advantage really begins to be a computational advantage.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [September 22, 2019, 5:01am UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/47 "2019-09-22T05:01:14Z")

</div>

Is the limitation to simplices crucial? Can it represent cube-like complexes? With arbitrary number of vertices?

---

<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:** [September 22, 2019, 9:49am UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/48 "2019-09-22T09:49:13Z")

</div>

That’s a good question, I will investigate some more on that. There is a general cellular homology theory

> **[Cellular homology](https://en.m.wikipedia.org/wiki/Cellular_homology)**
>
> In mathematics, cellular homology in algebraic topology is a homology theory for the category of CW-complexes. It agrees with singular homology, and can provide an effective means of computing homology modules.
> If 
>   
>     
>       
> X
>       
>     
> {\\displaystyle X}
>   
> is a CW-complex with n-skeleton 
>   
>     
>       
>         
> X
>           
> n
>           
>         
>       
>     
> {\\displaystyle X\_{n}}
>   
> , the cellular-homology modules are defined as the homology groups ...

> **[n-skeleton](https://en.m.wikipedia.org/wiki/N-skeleton)**
>
> In mathematics, particularly in algebraic topology, the n-skeleton of a topological space X presented as a simplicial complex (resp. CW complex) refers to the subspace Xn that is the union of the simplices of X (resp. cells of X) of dimensions m ≤ n. In other words, given an inductive definition of a complex, the n-skeleton is obtained by stopping at the n-th step.
> These subspaces increase with n. The 0-skeleton is a discrete space, and the 1-skeleton a topological graph. The skeletons of a spac...

> **[Simplicial set](https://en.m.wikipedia.org/wiki/Simplicial_set)**
>
> In mathematics, a simplicial set is an object composed of simplices in a specific way. Simplicial sets are higher-dimensional generalizations of directed graphs, partially ordered sets and categories. Formally, a simplicial set may be defined as a contravariant functor from the simplex category to the category of sets. Simplicial sets were introduced in 1950 by Samuel Eilenberg and Joseph A. Zilber.
> Every simplicial set gives rise to a "nice" topological space, known as its geometric realization...

So the answer is yes, it seems that hyper cubes are possible to represent with a simplicial set… it is closely tied together with the CW-complex. Simplicial set is a generalization, taking unions of subspaces.

For example, if we have 4 vertices (to make a square) we might use `v12 - v14 + v23 + v34` to represent the boundary of the square by using 1-simplices. So I’d say you can represent them… you can also get that result by computing (on `master`) the boundary of the 2-cube square `v123 + v134` itself:

```plaintext
julia> using Grassmann, Leibniz; @basis tangent(ℝ^4,2,4); #master branch

julia> ∂(v1234) # boundary of 3-simplex
0 - 1∂₄v₁₂₃ + 1∂₃v₁₂₄ - 1∂₂v₁₃₄ + 1∂₁v₂₃₄

julia> ∂(v123+v134) # boundary of 2-cube
0 + 1∂₃v₁₂ - 1∂₂v₁₃ + 1∂₄v₁₃ - 1∂₃v₁₄ + 1∂₁v₂₃ + 1∂₁v₃₄

```

Note the extra edges `1∂₄v₁₃ - 1∂₂v₁₃` which cancel out if you set `∂ᵢ = ∂ⱼ` for `i≠j` so it works.

---

<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:** [September 22, 2019, 4:38pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/50 "2019-09-22T16:38:14Z")

</div>

> [@PetrKryslUCSD](#):
>
> Is the limitation to simplices crucial? Can it represent cube-like complexes? With arbitrary number of vertices?

In case anyone is confused, the answer I gave above shows that n-cubes come from n-simplices.

This totally makes sense, because for example a quadrilateral `v123 + v134` is made up of two triangles.

Hope that explains to you why simplices are crucial and that cubes with arbitrary number of vertices work.

---

<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:** [September 23, 2019, 11:08pm UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/51 "2019-09-23T23:08:19Z")

</div>

To help with understanding, tensor simplices can be converted into graphs by newly defined methods for `LightGraphs.SimpleDiGraph(::TensorAlgebra)` on the `master` branch of `Grassmann`

```plaintext
using Grassmann, LightGraphs, GraphPlot, Compose # Grassmann master
graph(x,n="simplex.pdf",a=16cm,b=16cm) = draw(PDF(n,a,b), gplot(SimpleDiGraph(x),layout=circular_layout,nodelabel=collect(1:grade(vectorspace(x)))))
@basis tangent(V"8",2,1); # 8 vertices, single differential operator (2nd order)

```

Here are some of the results  
 ![simplex-3](https://global.discourse-cdn.com/julialang/original/3X/6/b/6b9f4e6596316691945b670f2e71e21862c598ce.png)  
3-simplex and 2-simplex `graph(v1234+v678)`  
 ![simplex-2cube](https://global.discourse-cdn.com/julialang/original/3X/6/7/67d70d075a1cee281251a8a7866d6cbfec5c9105.png)  
2-cube and 2-simplex `graph(v123+v134+v678)` _note_ that this time the internal edges cancel out, because only a single differential operator is used (with multiple you would retain internal edges)  
 ![simplex-3cube](https://global.discourse-cdn.com/julialang/original/3X/9/e/9e0b73da5ebb8def5f3b52ffc544113b83248575.png)  
3-cube attempt `graph(v1246+v2346+v1267+v2678+v2568-v2356)`

Note that the 3-cube attempt has 2 extra edges… it is a union of 6 simplices, but I only figured this one out by trial and error… since the orientation of each simplex matters, I am not sure yet of a fully general method for figuring out arbitrary n-cube representations using oriented simplices, but it’s possible.

What’s interesting about this to me is the relationship between tensor calculus and graph theory…

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [September 24, 2019, 7:11am UTC](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035/52 "2019-09-24T07:11:53Z")

</div>

That is interesting. By the way, it is possible to tile a cube with 6 tetrahedra or with 5 tetrahedra.

[Previous page](https://discourse.julialang.org/t/is-there-any-interest-in-creating-a-fem-julia-organization/7035.md?page=2)
