Xara
Nonlinear finite element analysis.
*xara* is a Python package that provides an intuitive and performant API for nonlinear finite element analysis, implemented in C++ through the OpenSeesRT framework. OpenSees features state-of-the-art finite element formulations and solution algorithms, including mixed formulations for beams and solids, over 200 material models, and an extensive collection of continuation algorithms to solve highly nonlinear problems. The project is written primarily in C++, distributed under the BSD 2-Clause "Simplified" License license, first published in 2022. Key topics include: computational-mechanics, finite-element-analysis, opensees, peridynamics, python.
xara is a Python package that provides an intuitive and performant API for nonlinear
finite element analysis, implemented in C++ through the OpenSeesRT framework.
OpenSees features state-of-the-art finite element formulations and solution
algorithms, including mixed formulations for beams and solids, over 200 material models, and an
extensive collection of continuation algorithms to solve highly nonlinear
problems.
This package may be used as a drop-in replacement for both OpenSees.exe and
OpenSeesPy (see Getting Started below), and generally provides a substantial performance boost.
Getting Started
The xara package can be installed into a Python environment
in the standard manner. For example, using pip:
shellpip install xara
There are several ways to use the xara package:
-
The standard way to use
xarafrom Python is to create axara.Model,
and invoke its methods:pythonmodel = xara.Model(ndm=2, ndf=2) # Create a 2D model with 2 DOFs per node model.node(1, 2.0, 3.0) ...Most of the functions from the OpenSeesPy library can be invoked directly
as methods of axara.Modelwithout any changes in syntax, although it is
generally encouraged to use the safer variants supported byxara. For
example:python# BAD model.pattern("Plain", 1, "Linear") model.load(1, 2.0, 3.0) # GOOD model.pattern("Plain", 1, "Linear") model.load(1, 2.0, 3.0, pattern=1) -
To start an interactive Tcl interpreter run the shell command:
bashpython -m openseesTo quit the interpreter, just run
exit:tclopensees > exit -
To execute Tcl procedures programmatically from Python, create an instance
of thexara.Modelclass and call itseval()method to evaluate Tcl code:pythonmodel = xara.Model() model.eval("model Basic -ndm 2") model.eval("print -json") -
The
xarapackage exposes a compatibility layer that exactly reproduces
the OpenSeesPy functions, but does so without mandating a single
global program state. To run OpenSeesPy scripts, just change the import:pythonimport openseespy.openseesto
pythonimport opensees.openseespyFor true stateless modeling, the
Modelclass should be used instead of the legacy
modelfunction; see the documentation here.
Development
To compile the project see about/compiling
Support
<table align="center" style="border: 0;"> <tr> <td> <a href="https://peer.berkeley.edu"> <img src="https://raw.githubusercontent.com/claudioperez/sdof/master/docs/assets/peer-black-300.png" alt="PEER Logo" width="200"/> </a> </td> <td> <a href="https://dot.ca.gov/"> <img src="https://raw.githubusercontent.com/claudioperez/sdof/master/docs/assets/Caltrans.svg.png" alt="Caltrans Logo" width="200"/> </a> </td> </tr> </table>Contributors
Showing top 12 contributors by commit count.
