Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,14 @@ jobs:
run: |
for pkg in dist/*/*.tar.bz2; do
conda run -n base anaconda upload "$pkg" --force
done
done
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: "v${{ env.VERSION }}"
release_name: "v${{ env.VERSION }}"
body: "Automated release for version ${{ env.VERSION }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Contributions
* Edward Villegas Pulgarin (`@cosmoscalibur`)
* Guillaume Huet (`@guillaumehuet`)
* Marc Gehring (`mg494`)

* Kevin Sepúlveda-García (`@kssgarcia`)

4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.1.0
title: 'SolidsPy: 2D-Finite Element Analysis with Python'
title: 'SolidsPy: 2D/3D-Finite Element Analysis with Python'
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand All @@ -23,7 +23,7 @@ identifiers:
url: 'https://github.com/AppliedMechanics-EAFIT/SolidsPy'
abstract: >-
SolidsPy is a simple finite element analysis code
for 2D elasticity problems. The code uses as input
for 2D/3D elasticity problems. The code uses as input
simple-to-create text files defining a model in
terms of nodal, element, material, and load data.
keywords:
Expand Down
20 changes: 14 additions & 6 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
History
-------

2.0.0 (2025-01-01)
~~~~~~~~~~~~~~~~~~~~

* Fix compatibility with Python 3.11, 3.12 and 3.13
* Update meshio version to 5.3.5
* Add 3D elements
* Add 3D visualization using pyvista

1.1.0 (2023-11-03)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~

* Remove NumPy types in the code that were removed since NumPy 1.24

1.0.15 (2018-05-09)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~

* Fix element ordering in `rectgrid` and doctests.

1.0.14 (2018-05-08)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~

* Add Jacobian checks.
* Pytest catch exceptions.

1.0.13 (2018-05-07)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~

* Update meshio syntax for physical groups.
* Add citation information to package.

1.0.12 (2018-04-16)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~

* Documentation built with Sphinx.
* Docs in ReadTheDocs.

1.0.0 (2017-07-17)
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~

* First release on PyPI.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2015 - 2018 Juan Gomez and Nicolás Guarín-Zapata
Copyright (c) 2015 - 2025 Juan Gomez and Nicolás Guarín-Zapata

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
Expand Down
163 changes: 78 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,103 @@
# SolidsPy: 2D-Finite Element Analysis with Python
# SolidsPy: 2D/3D-Finite Element Analysis with Python

![](https://raw.githubusercontent.com/AppliedMechanics-EAFIT/SolidsPy/master/docs/img/wrench.png)
[![PyPI download](https://img.shields.io/pypi/v/solidspy.svg)](https://pypi.python.org/pypi/continuum_mechanics)
![Wrench under bending](https://raw.githubusercontent.com/AppliedMechanics-EAFIT/SolidsPy/master/docs/img/wrench.png)

[![PyPI version](https://img.shields.io/pypi/v/solidspy.svg)](https://pypi.python.org/pypi/continuum_mechanics)
[![Documentation Status](https://readthedocs.org/projects/solidspy/badge/?version=latest)](https://solidspy.readthedocs.io/en/latest/)
[![Downloads frequency](https://img.shields.io/pypi/dm/solidspy)](https://pypistats.org/packages/solidspy)
[![image](https://zenodo.org/badge/48294591.svg)](https://zenodo.org/badge/latestdoi/48294591)
[![DOI](https://zenodo.org/badge/48294591.svg)](https://zenodo.org/badge/latestdoi/48294591)

A simple finite element analysis code for 2D elasticity problems. The code uses
as input simple-to-create text files defining a model in terms of nodal,
element, material and load data.
A simple finite element analysis code for 2D/3D elasticity problems, written in Python. The code uses easily created text files defining a model in terms of nodal, element, material, and load data.

- Documentation: <http://solidspy.readthedocs.io>
- GitHub: <https://github.com/AppliedMechanics-EAFIT/SolidsPy>
- PyPI: <https://pypi.org/project/solidspy/>
- Free and open source software: [MIT license](http://en.wikipedia.org/wiki/MIT_License)
- **Documentation**: http://solidspy.readthedocs.io
- **GitHub**: https://github.com/AppliedMechanics-EAFIT/SolidsPy
- **PyPI**: https://pypi.org/project/solidspy/
- **License**: [MIT license](http://en.wikipedia.org/wiki/MIT_License)
- **Year**: 2025

## Features

- It is based on an open-source environment.
- It is easy to use.
- The code allows to find displacement, strain and stress solutions
for arbitrary two-dimensional domains discretized into finite
elements and subject to point loads.
- The code is organized in independent modules for pre-processing,
assembly and post-processing allowing the user to easily modify it
or add features like new elements or analyses pipelines.
- It was created with academic and research purposes.
- It has been used to tech the following courses:
- Introduction to Solid Mechanics.
- Computational Modeling.
- Introduction to the Finite Element Methods.
- Introduction to Soil Mechanics.
* **Open-Source Environment**: Entirely written in Python, leveraging popular libraries like NumPy and SciPy.

## Installation
* **Easy to Use**: Simple text input files; minimal overhead to set up new simulations.

* **2D/3D Elasticity**: Solve displacement, strain, and stress for arbitrary 2D/3D domains using finite elements.

* **Modular Code**: Independent modules for pre-processing, assembly, and post-processing. Extend or modify as needed.

* **Academic & Research**: Ideal for teaching courses such as:
- Computational Modeling
- Introduction to the Finite Element Methods

and for rapid prototyping of new FEM elements.

The code is written in Python and it depends on `numpy`, and `scipy` and. It
has been tested under Windows, Mac, Linux and Android.
* **Wide Compatibility**: Tested under Windows, macOS, Linux, and even Android (via Termux).

To install *SolidsPy* open a terminal and type:
## Installation

pip install solidspy
SolidsPy runs on Python 3.11+ and depends on numpy and scipy.

To specify through a GUI the folder where the input files are stored you will
need to install [easygui](http://easygui.readthedocs.org/en/master/).
Install via PyPI:
```bash
pip install solidspy
```

To easily generate the required SolidsPy text files out of a
[Gmsh](http://gmsh.info/) model you will need [meshio](https://github.com/nschloe/meshio).
For a GUI file selector, install:
```bash
pip install easygui
```

These two can be installed with:
To convert Gmsh models ([gmsh.info](http://gmsh.info/)) to SolidsPy input files, install:
```bash
pip install meshio
```

pip install easygui
pip install meshio
Install via Conda:
```bash
conda install solidspy
```

## How to run a simple model

For further explanation check the [docs](http://solidspy.readthedocs.io/en/latest/).

Let's suppose that we have a simple model represented by the following files
(see [tutorials/square example](http://solidspy.readthedocs.io/en/latest/tutorials/square_example.html)
for further explanation).

- `nodes.txt`
Let's suppose that we have a simple model represented by the following files (see [tutorials/square example](http://solidspy.readthedocs.io/en/latest/tutorials/square_example.html) for further explanation).

- nodes.txt
```
0 0.00 0.00 0 -1
1 2.00 0.00 0 -1
2 2.00 2.00 0 0
3 0.00 2.00 0 0
4 1.00 0.00 -1 -1
5 2.00 1.00 0 0
6 1.00 2.00 0 0
7 0.00 1.00 0 0
8 1.00 1.00 0 0
0 0.00 0.00 0 -1
1 2.00 0.00 0 -1
2 2.00 2.00 0 0
3 0.00 2.00 0 0
4 1.00 0.00 -1 -1
5 2.00 1.00 0 0
6 1.00 2.00 0 0
7 0.00 1.00 0 0
8 1.00 1.00 0 0
```


- `eles.txt`

- eles.txt
```
0 1 0 0 4 8 7
1 1 0 4 1 5 8
2 1 0 7 8 6 3
3 1 0 8 5 2 6
0 1 0 0 4 8 7
1 1 0 4 1 5 8
2 1 0 7 8 6 3
3 1 0 8 5 2 6
```


- `mater.txt`

- mater.txt
```
1.0 0.3
1.0 0.3
```


- `loads.txt`

- loads.txt
```
3 0.0 1.0
6 0.0 2.0
2 0.0 1.0
3 0.0 1.0
6 0.0 2.0
2 0.0 1.0
```


Run it in Python as follows:

``` python
```python
import matplotlib.pyplot as plt # load matplotlib
from solidspy import solids_GUI # import our package
disp = solids_GUI() # run the Finite Element Analysis
Expand All @@ -114,29 +108,28 @@ For Mac users it is suggested to use an IPython console to run the example.

## License

This project is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License).
The documents are licensed under [Creative Commons Attribution License](http://creativecommons.org/licenses/by/4.0/).
This project is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). The documents are licensed under [Creative Commons Attribution License](http://creativecommons.org/licenses/by/4.0/).

## Citation

To cite SolidsPy in publications use
To cite SolidsPy in publications use:

> Nicolás Guarín-Zapata, Juan Gomez (2023). SolidsPy: Version 1.1.0
> (Version v1.1.0). Zenodo. <https://doi.org/10.5281/zenodo.7694030>
> Nicolás Guarín-Zapata, Juan Gomez (2025). SolidsPy: Version 2.0.0 (Version v2.0.0). Zenodo. http://doi.org/10.5281/zenodo.4029270

A BibTeX entry for LaTeX users is
A BibTeX entry for LaTeX users is:

```bibtex
@software{solidspy,
title = {SolidsPy: 2D-Finite Element Analysis with Python},
version = {1.1.0},
title = {SolidsPy: 2D/3D-Finite Element Analysis with Python},
version = {2.0.0},
author = {Guarín-Zapata, Nicolás and Gómez, Juan},
year = 2023,
year = 2020,
keywords = {Python, Finite elements, Scientific computing, Computational mechanics},
abstract = {SolidsPy is a simple finite element analysis code for 2D elasticity
problems. The code uses as input simple-to-create text files defining a model
in terms of nodal, element, material and load data.},
abstract = {SolidsPy is a simple finite element analysis code for
2D/3D elasticity problems. The code uses as input simple-to-create text
files defining a model in terms of nodal, element, material and
load data.},
url = {https://github.com/AppliedMechanics-EAFIT/SolidsPy},
doi = {https://doi.org/10.5281/zenodo.7694030}
doi = {http://doi.org/10.5281/zenodo.4029270}
}
```
```
Loading
Loading