simulate_one_element

simulate_one_element(X_at_nodes, U_at_nodes, element_type: str, load_name: str, folder: str, E: float = 1000.0, nu: float = 0.3, face_count: int = 0) dict[source]

Generate and simulate a one element model. The input is generated using the method :py:func`generate_abaqus_input`. For the simulation the script one_element_script.py is executed in Abaqus. The model is simulated in the given folder. After the simulation has completed successfully, a result file in the json format is writen into the folder.

This result file contains:

  • model data like the strain energy (ALLSE),

  • element data like the element volume (EVOL),

  • nodal data like the nodal coordinates (COORD),

  • integration point data like the integration point coordinates (COORD),

Note

If the result file already exists, no simulation is performed. Instead, the content of the result file is returned.

Examples

The result contains the strain energy (ALLSE), reaction forces (RF), strain energy densities (SENER) and the element volume (EVOL)

>>> result = simulate_one_element(
...     X_at_nodes=np.array([[0, 0], [1, 0], [0.5, 1]]),
...     U_at_nodes=np.array([[0, 0], [0, 0], [0, 1]]),
...     element_type="CPE3",
...     load_name="triangle_tension",
...     folder="res/tests/triangle_tension"
... )
>>> float(np.around(result["model"]["ALLSE"], 3))
336.538
>>> np.around(result["nodes"]["RF"], 3)
array([[-288.462, -336.538],
       [ 288.462, -336.538],
       [  -0.   ,  673.077]])
>>> np.around(result["integration_points"]["SENER"], 3)
array([[673.077]])
>>> float(np.around(result["element"]["EVOL"], 3))
0.5
Parameters:
  • X_at_nodes – array of shape (n, d) containing nodal coordinates

  • U_at_nodes – array of shape (n, d) containing nodal displacements

  • element_type – str, name of the element type

  • load_name – str, a valid load name in abaqus

  • folder – str, simulation folder

  • E – Young’s modulus

  • nu – Poisson’s ratio

  • face_count – number of faces an element has. For each face a surface set is generated.

Returns:

dict, containing the data of the result file