Define Truss Mesh in JuAFEM

Hello everybody :slight_smile:

I am new to Julia and JuAFEM. Now I am trying to understand the linear Elasticity demo in juAFEM see. I understood a lot but I have big problems to adjust the code for my own purpose.

I want to define a simple truss problem like:

ad77f25543945fc49ea841b49096b8dabfda8174

1 Element with 2 Nodes and 2 DoF in each node i.e. I am searching for the solution (u1_x, u2_x, u3_x, u4_x).

My first try lead to:

using JuAFEM
using BlockArrays, SparseArrays, LinearAlgebra
using Pandas
n = 1, l=2
function create__grid(l, n)

    # Ecken zuerst mit Koordinaten
    corners = [Vec{2}((0.0)),
               Vec{2}((l.0))]

    grid = generate_grid(Lagrange, n, corners);

    # facesets for boundary conditions
    addfaceset!(grid, "clamped", x -> norm(x[0]) ā‰ˆ 0.0);
    addfaceset!(grid, "traction", x -> norm(x[1]) ā‰ˆ 2.0);
    return grid
end

Is this the correct way?

That structure is unstable.

What do you mean with unstable? So how is the correct way to define a truss structure? For example something like:

bef301629066728b8b81f24ec2d29b8af51c1366

This would work. However Iā€™m not qualified to advise you on the construction of the grid.
I believe you will have to do it manually, the function you used above may be for one-dimensional grids only.