LMesh.jl

*Basic building block for other codes *

Basic types

LMesh.MeshType

Supertype for Mesh2D and Mesh3D

LMesh.Mesh2DType

Basic structure for 2D Meshes

Mesh2D(bmesh::Bmesh2D,materials::Vector{Material}, geometries::Vector{Geometry},hebc::Matrix{Int64}, nbc::Matrix{Float64} ; matele = Int64[], geoele = Int64[], options=Dict{Symbol,Matrix{Float64}}())

where <br/>

bmesh = Background mesh (2D) <br/>

materials = Vector with Materials definitions

geometries = Vector with Geometries definitions

hebc = Matrix with homogeneous essential boundary conditions

nbc = Matrix with natural boundary conditions

mat_ele = Vector linking each element to a given material

geo_ele = Vector linking each element to a given geometry

options = Dictionary with optional data

LMesh.Mesh3DType

Basic structure for 3D Meshes

Mesh3D(bmesh::Bmesh3D,materials::Vector{Material}, geometries::Vector{Geometry},hebc::Matrix{Int64}, nbc::Matrix{Float64} ; matele = Int64[], geoele = Int64[], options=Dict{Symbol,Matrix{Float64}}())

where

bmesh = Background mesh (3D)

materials = Vector with Materials definitions

geometries = Vector with Geometries definitions

hebc = Matrix with homogeneous essential boundary conditions

nbc = Matrix with natural boundary conditions

mat_ele = Vector linking each element to a given material

geo_ele = Vector linking each element to a given geometry

options = Dictionary with optional data

Iterator

Base.iterateFunction

Iterator for Mesh. Iterates from 1 to the number of elements in the mesh. To be used in loops like for ele in m ... end

Material

LMesh.MaterialType

Basic structure to store material data

Material(;Ex=1.0,νxy=0.0, α_T=0.0, density=1.0, model=:EPT,
          limit_stress=1.0,
          custom=[1.0 1.0 ; 1.0 1.0])

where all inputs are named.

Ex = Young's mudule (in X) [Pa] νxy = Poisson's ratio αT = Thermal expansion 1/Temperature density = material density [Kg/m³] model = 2D elasticity (:EPT or :EPD) or :Custom limitstress = limit stress (von-Mises criteria) [Pa]

Custom is a custom constitutive Matrix given by the user.

Geometry

LMesh.GeometryType

Basic structure to store geometrical data

Geometry(;A=1.0,thickness=1.0)

where all inputs are named.

Base

LMesh.Free_DOFsFunction

Return a vector with all the free (not constrained) DOFs in the mesh. This function is used to build Mesh.free_dofs

Free_DOFs(bmesh::Bmesh2D,nhebc::Int64,hebc::Matrix{Int64},loadcase::Int64)

where

bmesh = background mesh nhebc = number of essential boundary conditions hebc = matrix with essential boundary condition data loadcase = the load case to consider

Return a vector with all the free (not constrained) DOFs in the mesh. This function is used to build Mesh.free_dofs

Free_DOFs(bmesh::Bmesh3D,nhebc::Int64,hebc::Matrix{Int64},loadcase::Int64)

where

bmesh = background mesh nhebc = number of homogeneous essential boundary conditions hebc = matrix with homogeneous essential boundary condition data loadcase = the load case to consider

BMesh.Nodal_coordinatesFunction

(Overloaded from BMesh) Return vectors x and y with the nodal coordinates of element ele

Nodal_coordinates(mesh::Mesh2D,ele::Int64)

where mesh is a 2D Mesh and ele a valid element.

(Overloaded from BMesh) Return vectors x, y and z with the nodal coordinates of element ele

Nodal_coordinates(mesh::Mesh3D,ele::Int64)

where mesh is a 3D Mesh and ele a valid element.

BMesh.CentroidFunction

(Overloaded from BMesh) Return a vector with the centroidal coordinates of element ele

Centroid(mesh::Mesh2D,ele::Int64)

Return a vector with the centroidal coordinates of element ele

Centroid(mesh::Mesh3D,ele::Int64)

LMesh.Get_dimFunction

Return 2 for 2D problems and 3 for 3D problems

Get_dim(mesh::Mesh)

LMesh.Get_materialFunction

Material data for element ele

Get_material(mesh::Mesh,ele::Int64)

LMesh.Get_geometryFunction

Geometry data for element ele

Get_geometry(mesh::Mesh,ele::Int64)

LMesh.Get_neFunction

Number of elements in this mesh

Get_ne(mesh::Mesh)

LMesh.Get_nnFunction

Number of nodes in this mesh

Get_nn(mesh::Mesh)

Overloaded from BMesh

BMesh.ConnectFunction

(Overloaded from BMesh) Return the connectivities of element ele

Connect(mesh::Mesh,ele::Int64)

as an Int64 vector.

BMesh.CoordFunction

(Overloaded from BMesh) Return the coordinates of node

Coord(mesh::Mesh,node::Int64)

as a vector [x;y;(z)]

BMesh.LengthFunction

(Overloaded from BMesh) Return the distance between two nodes of the element

Length(mesh::Mesh,ele::Int64;nodes=(1,2))

where the default is the distance between (local) nodes 1 and 2

BMesh.DOFsFunction

(Overloaded from BMesh) Return a dim*n vector with the global DOFs of element ele

DOFs(mesh::Mesh,ele::Int64)

where n is the number of nodes of ele and dim=2 or 3.

BMesh.T_matrixFunction

(Overloaded from BMesh) Evaluate the rotation matrix T that maps from global to local reference systems. This version evaluates Rotation internally.

T_matrix(mesh::Mesh, ele::Int64, α=0.0)

Plot

RecipesBase.plotFunction

Overload plot to show the mesh and boundary conditions. Just for truss elements.

plot(mesh::Mesh2D; name="", factor=6.0)

factor is used to scale arrows to a fraction of the total dimension.