Ejemplo n.º 1
0
        },
        'stiffness matrix': {
            'evaluation': 'closed form'
        }
    }
}

#---------------------------------------------------------------

# Mesh info
print("Meshing...\n")

L = 10000
n = 40

mesh = mesh_engine.Mesh()

mesh.Elements = n
mesh.Nodes = n + 1
mesh.NodesElement = 2
mesh.dofsNode = 1
mesh.d = 1
mesh.points = np.zeros(shape=(mesh.Nodes, 3))
mesh.points[:, 0] = np.linspace(0, L, mesh.Nodes)
mesh.elements = element_table(mesh)
mesh.elementMaterialTag = np.ones(n, dtype=int)
mesh.elementType = np.array([["diff_bar"] for i in range(n)])

# Load info
print("Applying BCs...\n")
Ejemplo n.º 2
0
"""
Created on Sat Mar 21 17:38:10 2020

@author: Umberto Bettinardi
         [email protected]
"""
import numpy as np

from FEM import FEM_engine as engine
from FEM import mesh_engine as mesher
from FEM import material_data as material
from FEM import boundaries

#------------------------------------------------------

mesh_info = mesher.Mesh()
material_info = material.Material()
load_info = boundaries.BoundaryConditions()

#------------------------------------------------------

# Mesh info
mesh_info.Elements = 4
mesh_info.Nodes = 4
mesh_info.NodesElement = 2
mesh_info.dofsNode = 1
mesh_info.elements = np.array([[0, 1], [1, 2], [1, 2], [2, 3]])

#------------------------------------------------------
# Material info
material_info.k_spring = np.array([20, 30, 2, 10])