Skip to content

Commit

Permalink
Merge pull request #47 from kssgarcia/2.0_merge
Browse files Browse the repository at this point in the history
2.0 merge master changes
  • Loading branch information
nicoguaro authored Dec 27, 2024
2 parents fc299b1 + 0cf97a4 commit 4faa023
Show file tree
Hide file tree
Showing 10 changed files with 501 additions and 142 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches:
- main
- "2.0"
- "2.0_merge"
tags:
- "v*.*.*"
pull_request:
branches:
- main
- "2.0"
- "2.0_merge"

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -150,4 +152,4 @@ jobs:
run: |
for pkg in dist/*/*.tar.bz2; do
conda run -n base anaconda upload "$pkg" --force
done
done
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Contributions

* Edward Villegas Pulgarin (`@cosmoscalibur`)
* Guillaume Huet (`@guillaumehuet`)
* Marc Gehring (`mg494`)


35 changes: 35 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.1.0
title: 'SolidsPy: 2D-Finite Element Analysis with Python'
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Nicolás
family-names: Guarín-Zapata
email: nguarinz@eafit.edu.co
affiliation: Universidad EAFIT
orcid: 'https://orcid.org/0000-0002-9435-1914'
- given-names: Juan David
family-names: Gómez
email: jgomezc1@eafit.edu.co
affiliation: Universidad EAFIT
identifiers:
- type: doi
value: 10.5281/zenodo.4029270
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
simple-to-create text files defining a model in
terms of nodal, element, material, and load data.
keywords:
- finite element method
- scientific computing
- computational mechanics
- elasticity
- python
license: MIT
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
History
-------

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)
~~~~~~~~~~~~~~~~~~

Expand Down
142 changes: 142 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# SolidsPy: 2D-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)
[![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)

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.

- 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)

## 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.

## Installation

The code is written in Python and it depends on `numpy`, and `scipy` and. It
has been tested under Windows, Mac, Linux and Android.

To install *SolidsPy* open a terminal and type:

pip install solidspy

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/).

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).

These two can be installed with:

pip install easygui
pip install meshio

## 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`

```
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`

```
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`

```
1.0 0.3
```


- `loads.txt`

```
3 0.0 1.0
6 0.0 2.0
2 0.0 1.0
```


Run it in Python as follows:

``` python
import matplotlib.pyplot as plt # load matplotlib
from solidspy import solids_GUI # import our package
disp = solids_GUI() # run the Finite Element Analysis
plt.show() # plot contours
```

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/).

## Citation

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>
A BibTeX entry for LaTeX users is

```bibtex
@software{solidspy,
title = {SolidsPy: 2D-Finite Element Analysis with Python},
version = {1.1.0},
author = {Guarín-Zapata, Nicolás and Gómez, Juan},
year = 2023,
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.},
url = {https://github.com/AppliedMechanics-EAFIT/SolidsPy},
doi = {https://doi.org/10.5281/zenodo.7694030}
}
```
103 changes: 48 additions & 55 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ SolidsPy: 2D-Finite Element Analysis with Python
================================================

.. figure:: https://raw.githubusercontent.com/AppliedMechanics-EAFIT/SolidsPy/master/docs/img/wrench.png
:alt: Wrench under bending.


:alt: Wrench under bending

.. image:: https://img.shields.io/pypi/v/solidspy.svg
:target: https://pypi.python.org/pypi/continuum_mechanics
Expand All @@ -18,6 +16,8 @@ SolidsPy: 2D-Finite Element Analysis with Python
:target: https://pypistats.org/packages/solidspy
:alt: Downloads frequency

.. image:: https://zenodo.org/badge/48294591.svg
:target: https://zenodo.org/badge/latestdoi/48294591


A simple finite element analysis code for 2D elasticity problems.
Expand Down Expand Up @@ -57,8 +57,8 @@ Features
Installation
------------

The code is written in Python and it depends on ``numpy``, ``scipy`` and
``sympy``. It has been tested under Windows, Mac, Linux and Android.
The code is written in Python and it depends on ``numpy``, and ``scipy``
and. It has been tested under Windows, Mac, Linux and Android.

To install *SolidsPy* open a terminal and type:

Expand Down Expand Up @@ -90,63 +90,54 @@ 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).

.. code:: python

import numpy as np
from solidspy.solids_GUI import solids_auto
- ``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

### Define the data
nodes = np.array([
[0, 0.00, 0.00],
[1, 2.00, 0.00],
[2, 2.00, 2.00],
[3, 0.00, 2.00],
[4, 1.00, 0.00],
[5, 2.00, 1.00],
[6, 1.00, 2.00],
[7, 0.00, 1.00],
[8, 1.00, 1.00]])
- ``eles.txt``

cons = np.array([
[0, -1],
[0, -1],
[0, 0],
[0, 0],
[-1, -1],
[0, 0],
[0, 0],
[0, 0],
[0, 0]])
::

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``

elements = np.array([
[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]])
::

mats = np.array([[1.0, 0.3]])
1.0 0.3

loads = np.array([
[2, 0.0, 1.0],
[3, 0.0, 1.0],
[6, 0.0, 2.0]])
- ``loads.txt``

data = {"nodes": nodes,
"cons": cons,
"elements": elements,
"mats": mats,
"loads": loads}
::

### Run the simulation
disp = solids_auto(data)
plt.show()
3 0.0 1.0
6 0.0 2.0
2 0.0 1.0

Run it in Python as follows:

Save it as ``example_solidspy.py`` and run it in your terminal:
.. code:: python
.. code:: bash
import matplotlib.pyplot as plt # load matplotlib
from solidspy import solids_GUI # import our package
disp = solids_GUI() # run the Finite Element Analysis
plt.show() # plot contours
python example_solidspy.py
For Mac users it is suggested to use an IPython console to run the example.


License
Expand All @@ -162,21 +153,23 @@ Citation

To cite SolidsPy in publications use

Juan Gómez, Nicolás Guarín-Zapata (2018). SolidsPy: 2D-Finite
Element Analysis with Python, <https://github.com/AppliedMechanics-EAFIT/SolidsPy>.
Nicolás Guarín-Zapata, Juan Gomez (2020). SolidsPy: Version 1.0.16
(Version v1.0.16). Zenodo. http://doi.org/10.5281/zenodo.4029270

A BibTeX entry for LaTeX users is

.. code:: bibtex
@software{solidspy,
title = {SolidsPy: 2D-Finite Element Analysis with Python},
author = {Gómez, Juan and Guarín-Zapata, Nicolás},
year = 2018,
version = {1.0.16},
author = {Guarín-Zapata, Nicolás and Gómez, Juan},
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.},
url = {https://github.com/AppliedMechanics-EAFIT/SolidsPy}
url = {https://github.com/AppliedMechanics-EAFIT/SolidsPy},
doi = {http://doi.org/10.5281/zenodo.4029270}
}
Loading

0 comments on commit 4faa023

Please sign in to comment.