PSI - Issue 78

Stefano Ercolessi et al. / Procedia Structural Integrity 78 (2026) 1497–1504

1499

Fig. 1. FEA workflow illustration.

them for information, which can be used in the analysis step to assign instances. Once, that the mesh and the physical groups of the model are defined by the Gmsh API is necessary to translate the geometry entities to TCL scripts, which can be launched by OpenSees. However, despite been manly written in C ++ OpenSees needs in its classical versions data written in TCL in order to perform analyses. Hence, a piece of software, named TCL generator is needed.

2.2. TCL generator

TCL generator is a lightweight header-only C ++ library, which was developed to facilitate the generation of TCL script for OpenSees. The library is structured within a dedicated namespace, named TCLgenerator , to ensure modu larity and avoiding naming conflicts. It provides a collection of functions and utilities for creating all the necessary OpenSees primitive, such as nodes, elements, boundary conditions and recorder, to name a few. Its header-only nature allows the tool to be easily integrated into larger C ++ workflows. The primary goal is to streamline the creation of input files for OpenSees simulations, particularly when combined with mesh data from external tools. The first func tion which needs to be called is a main initializer, which has the duty to set up the main TCL file, which is the one that is called by the OpenSees application. The main hosts the source calls for all the other required TCL files, such as the nodes, the elements, the boundary conditions, the recorders etc. The naming convention adopted within the li brary is straightforward and consistent. All functions - except those dedicated to configuring and defining the analysis and its options- are constructed using the prefix write followed by the corresponding OpenSees TCL command. This approach enhances code readability and provides a clear, direct mapping between the library and the OpenSees input syntax. As an example, in Code snippet 1 is reported one of the writeNode function declarations. Listing 1. TCLgenerator: writeNode declaration. / / Write Nodes void writeNode ( const std :: size t& ndm, const std :: size t& ndf , const std :: vector < std :: size t > & nodeTags , const std :: vector < std :: vector < double >> & nodeCoords ); On the other hand, the functions related to analysis setup and definition follow a di ff erent naming convention, where the corresponding OpenSees TCL commands are prefixed with the word add (c.f. Code snippet 2).

Made with FlippingBook Digital Proposal Maker