Module handling the whole mechanical system, no matter if it’s a finite element system, defined by certain parameters or a multibody system.
amfe.mechanical_system.MechanicalSystem(stress_recovery=False)[source]¶Bases: object
Master class for mechanical systems with the goal to black-box the routines of assembly and element selection.
mesh_class¶instance of Mesh() – Class handling the mesh.
assembly_class¶instance of Assembly() – Class handling the assembly.
dirichlet_class¶instance of DirichletBoundary – Class handling the Dirichlet boundary conditions.
T_output¶list of floats – List of timesteps saved.
u_output¶list of ndarrays – List of unconstrained displacement arrays corresponding to the timesteps in T_output.
S_output¶list of ndarrays – List of stress arrays corresponding to the timesteps in T_output.
E_output¶list of ndarrays – List of strain arrays corresponding to the timesteps in T_output.
stress¶ndarray – Array of nodal stress of the last assembly run. Shape is (no_of_nodes, 6).
strain¶ndarray – Array of nodal strain of the last assembly run. Shape is (no_of_nodes, 6).
stress_recovery¶bool – Flag for option stress_recovery.
iteration_info¶ndarray – array containing the information of an iterative solution procedure. iteration_info[:,0] is the time information, iteration_info[:,1] is the number of iteations, iteration_info[:,3] is the residual.
D(u=None, t=0)[source]¶Return the damping matrix of the mechanical system
| Parameters: |
|
|---|---|
| Returns: | K – Stiffness matrix with applied constraints in sparse csr-format |
| Return type: | sp.sparse.sparse_matrix |
K(u=None, t=0)[source]¶Compute the stiffness matrix of the mechanical system
| Parameters: |
|
|---|---|
| Returns: | K – Stiffness matrix with applied constraints in sparse csr-format |
| Return type: | sp.sparse.sparse_matrix |
K_and_f(u=None, t=0)[source]¶Compute tangential stiffness matrix and nonlinear force vector in one assembly run.
M(u=None, t=0)[source]¶Compute the Mass matrix of the dynamical system.
| Parameters: |
|
|---|---|
| Returns: | M – Mass matrix with applied constraints in sparse csr-format |
| Return type: | sp.sparse.sparse_matrix |
S_and_res(u, du, ddu, dt, t, beta, gamma)[source]¶Compute jacobian and residual for implicit time integration.
| Parameters: |
|
|---|---|
| Returns: |
|
Notes
Time integration scheme: The iteration matrix is composed using the generalized-\(\alpha\) scheme:
which bases on the time discretization of the velocity and the displacement:
This method is using the variables/methods
- self.M()
- self.M_constr
- self.K_and_f()
- self.f_ext()
If these methods are implemented correctly in a daughter class, the time integration interface should work properly.
apply_dirichlet_boundaries(key, coord, mesh_prop='phys_group')[source]¶Apply dirichlet-boundaries to the system.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
apply_neumann_boundaries(key, val, direct, time_func=None, shadow_area=False, mesh_prop='phys_group')[source]¶Apply neumann boundaries to the system via skin elements.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
apply_rayleigh_damping(alpha, beta)[source]¶Apply Rayleigh damping to the system.
The damping matrix D is defined as
D = alpha*M + beta*K(0)
Thus, it is Rayleigh Damping applied to the linearized system around zero deformation.
| Parameters: |
|
|---|
deflate_mesh()[source]¶Remove free floating nodes not connected to a selected element from the mesh.
| Parameters: | None – |
|---|---|
| Returns: | |
| Return type: | None |
export_paraview(filename, field_list=None)[source]¶Export the system with the given information to paraview.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
f_ext(u, du, t)[source]¶Return the nonlinear external force of the right hand side of the equation, i.e. the excitation.
gen_alpha(q, dq, ddq, q_old, dq_old, ddq_old, f_ext_old, dt, t, alpha_m, alpha_f, beta, gamma)[source]¶Computation of Jacobian and residual for generalized-alpha time integration scheme.
TODO
load_mesh_from_csv(node_list_csv, element_list_csv, no_of_dofs_per_node=2, explicit_node_numbering=False, ele_type=False)[source]¶Loads the mesh from two csv-files containing the node and the element list.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
Examples
todo
load_mesh_from_gmsh(msh_file, phys_group, material, scale_factor=1)[source]¶Load the mesh from a msh-file generated by gmsh.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
tie_mesh(master_key, slave_key, master_prop='phys_group', slave_prop='phys_group', tying_type='fixed', verbose=False, conform_slave_mesh=False, fix_mesh_dist=0.001)[source]¶Tie nonconforming meshes for a given master and slave side.
| Parameters: |
|
|---|---|
| Returns: | |
| Return type: | None |
Notes
The master mesh has to embrace the full slave mesh. If this is not the case, the routine will fail, a slave point outside the master mesh cannot be addressed to a specific element.
amfe.mechanical_system.ReducedSystem(V_basis=None, assembly='indirect', **kwargs)[source]¶Bases: amfe.mechanical_system.MechanicalSystem
Class for reduced systems. It is directly inherited from MechanicalSystem. Provides the interface for an integration scheme and so on where a basis vector is to be chosen...
Notes
The Basis V is a Matrix with x = V*q mapping the reduced set of coordinates q onto the physical coordinates x. The coordinates x are constrained, i.e. the x denotes the full system in the sense of the problem set and not of the pure finite element set.
The system runs without providing a V_basis when constructing the method only for the unreduced routines.
Examples
TODO
K_unreduced(u=None, t=0)[source]¶Unreduced Stiffness Matrix.
| Parameters: |
|
|---|---|
| Returns: | K – Stiffness matrix |
| Return type: | sparse csr matrix |
export_paraview(filename, field_list=None)[source]¶Export the produced results to ParaView via XDMF format.