fibermat


Namefibermat JSON
Version 1.0.12 PyPI version JSON
download
home_pageNone
SummaryA mechanical solver to simulate fiber packing and perform statistical analysis.
upload_time2024-04-12 11:15:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords timoshenko fiber mat mechanics mesostructure porous
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Welcome to FiberMat’s documentation!

<a href="https://github.com/fmahe/fibermat">
    <img alt="banner" src="https://github.com/fmahe/fibermat/raw/main/images/banner.png">
</a>

[![pypi version](https://img.shields.io/pypi/v/fibermat?logo=pypi)](https://pypi.org/project/fibermat/)
[![GitHub Badge](https://img.shields.io/badge/Github-fibermat-blue?logo=github)](https://github.com/fmahe/fibermat)
[![Read the Docs](https://img.shields.io/readthedocs/fibermat)](https://fibermat.readthedocs.io/en/latest/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![François Mahé](https://img.shields.io/badge/Author-François%20Mahé-green)](https://img.shields.io/badge/francois.mahe@ens--rennes.fr-Univ%20Rennes,%20ENS%20Rennes,%20CNRS,%20IPR%20--%20UMR%206251,%20F--35000%20Rennes,%20France-royalblue)
[![Mail](https://img.shields.io/badge/✉-francois.mahe@ens--rennes.fr-royalblue)](mailto:francois.mahe@ens-rennes.fr)

<details>
<summary>
<b> License </b> <a id="license"></a>

</summary>

```
                                        ██╖
████████╖  ████┐  ████╖       ██╖      ██╓╜
██╔═════╝  ██╔██ ██╔██║       ██║    ██████╖
█████─╖    ██║ ███╓╜██║██████╖██████╖██║ ██║
██╔═══╝    ██║ ╘══╝ ██║██║ ██║██╓─██║██╟───╜
██║    ██┐ ██║      ██║███ ██║██║ ██║│█████╖
╚═╝    └─┘ ╚═╝      ╚═╝╚══╧══╝╚═╝ ╚═╝╘═════╝
 █████┐       █████┐       ██┐
██╔══██┐     ██╓──██┐      └─┘       █╖████╖
 ██╖ └─█████ └███ └─┘      ██╖██████╖██╔══█║
██╔╝  ██╔══██   ███╖ ████╖ ██║██║ ██║██║  └╜
│██████╓╜   ██████╓╜ ╚═══╝ ██║██████║██║
╘══════╝    ╘═════╝        ╚═╝██╔═══╝╚═╝
      Rennes                  ██║
                              ╚═╝
@author: François Mahé
@mail: francois.mahe@ens-rennes.fr
(Univ Rennes, ENS Rennes, CNRS, IPR - UMR 6251, F-35000 Rennes, France)

@project: FiberMat
@version: v1.0

License
-------
MIT License

Copyright (c) 2024 François Mahé

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description
-----------
A mechanical solver to simulate fiber packing and perform statistical analysis.

References
----------
Mahé, F. (2023). Statistical mechanical framework for discontinuous composites:
  application to the modeling of flow in SMC compression molding (Doctoral
  dissertation, École centrale de Nantes).

```
</details>

**FiberMat** is a mechanical solver to simulate fiber packing and perform statistical analysis. It generates realistic 3D fiber mesostructures and computes internal forces and deformations.

This code is the result of thesis work that can be found in:
> [Mahé, F. (2023). Statistical mechanical framework for discontinuous composites:
  application to the modeling of flow in SMC compression molding (Doctoral
  dissertation, École centrale de Nantes).](https://theses.hal.science/tel-04189271/)

## Installation

Requirements:

![Python versions](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11-blue)

### Install the package with Pip

Run the following commands:
```shell
# Install `FiberMat`
pip install fibermat

# Try it out
python -c "import fibermat"

```

### Install the package in an Anaconda environment

1. Create a conda environment:
    ```shell
    # Create conda environment
    conda create -n fibermat python=3.11

    # Activate the environment
    conda activate fibermat

    # Optional
    pip install jupyter

    ```

2. Install FiberMat:
    ```shell
    # Install `FiberMat`
    pip install --upgrade fibermat

    # Try it out
    python -c "import fibermat"

    ```

3. To leave `fibermat` environment, run ``conda deactivate``.

### Directly from the sources

Clone the repository and run `pip` command:
```shell
# Clone the repository
git clone git@github.com:fmahe/fibermat.git
cd ./fibermat

# Install `FiberMat`
pip install --upgrade .

```

### Build the sources

FiberMat's documentation is created using [Sphinx](https://www.sphinx-doc.org/en/master/) [<sup>[1]</sup>](#note-1).

1. Clone the repository:
    ```shell
    # Clone the repository
    git clone git@github.com:fmahe/fibermat.git
    cd ./fibermat

    ```

2. Install dependencies required to compile documentation:

    - Install the packages listed in `requirements.txt` with Pip:
        ```shell
        # Install dependencies
        pip install -r requirements.txt

        ```

    - Alternatively, you can create a new environment that already meets the requirements:
        ```shell
        # Create an environment from the `environment.yml` file
        conda env create -n fibermat -f ./environment.yml

        # Activate the environment
        conda activate fibermat

        ```

3. Execute `./make` script:
    ```shell
    # Build the sources
    ./make --all

    ```

4. Test the library:
    ```shell
    pytest

    ```

<a id="note-1"> [1] </a> : Here a tutorial (fr) for Sphinx: [Introduction à Sphinx, un outil de documentation puissant](https://blog.flozz.fr/2020/09/07/introduction-a-sphinx-un-outil-de-documentation-puissant/).

## Documentation

See the tutorial in `jupyter-notebook.ipynb`.

## Example

```python
from fibermat import *

# Generate a set of fibers
mat = Mat(100, length=25., width=2., thickness=0.5, size=50., shear=1., tensile=2500.)
# Build the fiber network
net = Net(mat, periodic=True)
# Stack fibers
stack = Stack(net, threshold=10)
# Create the fiber mesh
mesh = Mesh(stack)

# Solve the mechanical packing problem
sol = solve(Model(mesh), packing=4.)

# Export as VTK
msh = vtk_mesh(
    mesh,
    sol.displacement(1),
    sol.rotation(1),
    sol.force(1),
    sol.torque(1),
)
msh.plot(scalars="force", cmap=plt.cm.twilight_shifted)
msh.save("outputs/msh.vtk")

```

![example](https://github.com/fmahe/fibermat/raw/main/images/example.png)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fibermat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Timoshenko, fiber, mat, mechanics, mesostructure, porous",
    "author": null,
    "author_email": "Fran\u00e7ois Mah\u00e9 <francois.mahe@ens-rennes.fr>",
    "download_url": "https://files.pythonhosted.org/packages/00/9d/e4bc48f2610eb029bd0fa31927bdf5bb26605137086a671d336e48869397/fibermat-1.0.12.tar.gz",
    "platform": null,
    "description": "# Welcome to FiberMat\u2019s documentation!\n\n<a href=\"https://github.com/fmahe/fibermat\">\n    <img alt=\"banner\" src=\"https://github.com/fmahe/fibermat/raw/main/images/banner.png\">\n</a>\n\n[![pypi version](https://img.shields.io/pypi/v/fibermat?logo=pypi)](https://pypi.org/project/fibermat/)\n[![GitHub Badge](https://img.shields.io/badge/Github-fibermat-blue?logo=github)](https://github.com/fmahe/fibermat)\n[![Read the Docs](https://img.shields.io/readthedocs/fibermat)](https://fibermat.readthedocs.io/en/latest/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Fran\u00e7ois Mah\u00e9](https://img.shields.io/badge/Author-Fran\u00e7ois%20Mah\u00e9-green)](https://img.shields.io/badge/francois.mahe@ens--rennes.fr-Univ%20Rennes,%20ENS%20Rennes,%20CNRS,%20IPR%20--%20UMR%206251,%20F--35000%20Rennes,%20France-royalblue)\n[![Mail](https://img.shields.io/badge/\u2709-francois.mahe@ens--rennes.fr-royalblue)](mailto:francois.mahe@ens-rennes.fr)\n\n<details>\n<summary>\n<b> License </b> <a id=\"license\"></a>\n\n</summary>\n\n```\n                                        \u2588\u2588\u2556\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2556  \u2588\u2588\u2588\u2588\u2510  \u2588\u2588\u2588\u2588\u2556       \u2588\u2588\u2556      \u2588\u2588\u2553\u255c\n\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u2550\u255d  \u2588\u2588\u2554\u2588\u2588 \u2588\u2588\u2554\u2588\u2588\u2551       \u2588\u2588\u2551    \u2588\u2588\u2588\u2588\u2588\u2588\u2556\n\u2588\u2588\u2588\u2588\u2588\u2500\u2556    \u2588\u2588\u2551 \u2588\u2588\u2588\u2553\u255c\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2556\u2588\u2588\u2588\u2588\u2588\u2588\u2556\u2588\u2588\u2551 \u2588\u2588\u2551\n\u2588\u2588\u2554\u2550\u2550\u2550\u255d    \u2588\u2588\u2551 \u2558\u2550\u2550\u255d \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2553\u2500\u2588\u2588\u2551\u2588\u2588\u255f\u2500\u2500\u2500\u255c\n\u2588\u2588\u2551    \u2588\u2588\u2510 \u2588\u2588\u2551      \u2588\u2588\u2551\u2588\u2588\u2588 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2502\u2588\u2588\u2588\u2588\u2588\u2556\n\u255a\u2550\u255d    \u2514\u2500\u2518 \u255a\u2550\u255d      \u255a\u2550\u255d\u255a\u2550\u2550\u2567\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u2558\u2550\u2550\u2550\u2550\u2550\u255d\n \u2588\u2588\u2588\u2588\u2588\u2510       \u2588\u2588\u2588\u2588\u2588\u2510       \u2588\u2588\u2510\n\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2510     \u2588\u2588\u2553\u2500\u2500\u2588\u2588\u2510      \u2514\u2500\u2518       \u2588\u2556\u2588\u2588\u2588\u2588\u2556\n \u2588\u2588\u2556 \u2514\u2500\u2588\u2588\u2588\u2588\u2588 \u2514\u2588\u2588\u2588 \u2514\u2500\u2518      \u2588\u2588\u2556\u2588\u2588\u2588\u2588\u2588\u2588\u2556\u2588\u2588\u2554\u2550\u2550\u2588\u2551\n\u2588\u2588\u2554\u255d  \u2588\u2588\u2554\u2550\u2550\u2588\u2588   \u2588\u2588\u2588\u2556 \u2588\u2588\u2588\u2588\u2556 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551  \u2514\u255c\n\u2502\u2588\u2588\u2588\u2588\u2588\u2588\u2553\u255c   \u2588\u2588\u2588\u2588\u2588\u2588\u2553\u255c \u255a\u2550\u2550\u2550\u255d \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u255d    \u2558\u2550\u2550\u2550\u2550\u2550\u255d        \u255a\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2550\u255d\u255a\u2550\u255d\n      Rennes                  \u2588\u2588\u2551\n                              \u255a\u2550\u255d\n@author: Fran\u00e7ois Mah\u00e9\n@mail: francois.mahe@ens-rennes.fr\n(Univ Rennes, ENS Rennes, CNRS, IPR - UMR 6251, F-35000 Rennes, France)\n\n@project: FiberMat\n@version: v1.0\n\nLicense\n-------\nMIT License\n\nCopyright (c) 2024 Fran\u00e7ois Mah\u00e9\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nDescription\n-----------\nA mechanical solver to simulate fiber packing and perform statistical analysis.\n\nReferences\n----------\nMah\u00e9, F. (2023). Statistical mechanical framework for discontinuous composites:\n  application to the modeling of flow in SMC compression molding (Doctoral\n  dissertation, \u00c9cole centrale de Nantes).\n\n```\n</details>\n\n**FiberMat** is a mechanical solver to simulate fiber packing and perform statistical analysis. It generates realistic 3D fiber mesostructures and computes internal forces and deformations.\n\nThis code is the result of thesis work that can be found in:\n> [Mah\u00e9, F. (2023). Statistical mechanical framework for discontinuous composites:\n  application to the modeling of flow in SMC compression molding (Doctoral\n  dissertation, \u00c9cole centrale de Nantes).](https://theses.hal.science/tel-04189271/)\n\n## Installation\n\nRequirements:\n\n![Python versions](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11-blue)\n\n### Install the package with Pip\n\nRun the following commands:\n```shell\n# Install `FiberMat`\npip install fibermat\n\n# Try it out\npython -c \"import fibermat\"\n\n```\n\n### Install the package in an Anaconda environment\n\n1. Create a conda environment:\n    ```shell\n    # Create conda environment\n    conda create -n fibermat python=3.11\n\n    # Activate the environment\n    conda activate fibermat\n\n    # Optional\n    pip install jupyter\n\n    ```\n\n2. Install FiberMat:\n    ```shell\n    # Install `FiberMat`\n    pip install --upgrade fibermat\n\n    # Try it out\n    python -c \"import fibermat\"\n\n    ```\n\n3. To leave `fibermat` environment, run ``conda deactivate``.\n\n### Directly from the sources\n\nClone the repository and run `pip` command:\n```shell\n# Clone the repository\ngit clone git@github.com:fmahe/fibermat.git\ncd ./fibermat\n\n# Install `FiberMat`\npip install --upgrade .\n\n```\n\n### Build the sources\n\nFiberMat's documentation is created using [Sphinx](https://www.sphinx-doc.org/en/master/) [<sup>[1]</sup>](#note-1).\n\n1. Clone the repository:\n    ```shell\n    # Clone the repository\n    git clone git@github.com:fmahe/fibermat.git\n    cd ./fibermat\n\n    ```\n\n2. Install dependencies required to compile documentation:\n\n    - Install the packages listed in `requirements.txt` with Pip:\n        ```shell\n        # Install dependencies\n        pip install -r requirements.txt\n\n        ```\n\n    - Alternatively, you can create a new environment that already meets the requirements:\n        ```shell\n        # Create an environment from the `environment.yml` file\n        conda env create -n fibermat -f ./environment.yml\n\n        # Activate the environment\n        conda activate fibermat\n\n        ```\n\n3. Execute `./make` script:\n    ```shell\n    # Build the sources\n    ./make --all\n\n    ```\n\n4. Test the library:\n    ```shell\n    pytest\n\n    ```\n\n<a id=\"note-1\"> [1] </a> : Here a tutorial (fr) for Sphinx: [Introduction \u00e0 Sphinx, un outil de documentation puissant](https://blog.flozz.fr/2020/09/07/introduction-a-sphinx-un-outil-de-documentation-puissant/).\n\n## Documentation\n\nSee the tutorial in `jupyter-notebook.ipynb`.\n\n## Example\n\n```python\nfrom fibermat import *\n\n# Generate a set of fibers\nmat = Mat(100, length=25., width=2., thickness=0.5, size=50., shear=1., tensile=2500.)\n# Build the fiber network\nnet = Net(mat, periodic=True)\n# Stack fibers\nstack = Stack(net, threshold=10)\n# Create the fiber mesh\nmesh = Mesh(stack)\n\n# Solve the mechanical packing problem\nsol = solve(Model(mesh), packing=4.)\n\n# Export as VTK\nmsh = vtk_mesh(\n    mesh,\n    sol.displacement(1),\n    sol.rotation(1),\n    sol.force(1),\n    sol.torque(1),\n)\nmsh.plot(scalars=\"force\", cmap=plt.cm.twilight_shifted)\nmsh.save(\"outputs/msh.vtk\")\n\n```\n\n![example](https://github.com/fmahe/fibermat/raw/main/images/example.png)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A mechanical solver to simulate fiber packing and perform statistical analysis.",
    "version": "1.0.12",
    "project_urls": {
        "Documentation": "https://fibermat.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/fmahe/fibermat",
        "Issues": "https://github.com/fmahe/fibermat/issues"
    },
    "split_keywords": [
        "timoshenko",
        " fiber",
        " mat",
        " mechanics",
        " mesostructure",
        " porous"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be2f4181784ed1aeedcb42ac9a4f0e04c4d3fd4bd7e9f0cf8672b81754f22a26",
                "md5": "fb4d47ea143583ac4a0af9f162c8df62",
                "sha256": "e8cfe32b7c46f9bc3cc379622243d6356f0ccebab7cbc24531c48ea7b464e0e8"
            },
            "downloads": -1,
            "filename": "fibermat-1.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fb4d47ea143583ac4a0af9f162c8df62",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 40536,
            "upload_time": "2024-04-12T11:14:47",
            "upload_time_iso_8601": "2024-04-12T11:14:47.017754Z",
            "url": "https://files.pythonhosted.org/packages/be/2f/4181784ed1aeedcb42ac9a4f0e04c4d3fd4bd7e9f0cf8672b81754f22a26/fibermat-1.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "009de4bc48f2610eb029bd0fa31927bdf5bb26605137086a671d336e48869397",
                "md5": "6f1bdf06a87c8b0ec0027942f07c61d6",
                "sha256": "f069fc49eb5d2f298aadf47f56077906ca260e1bd3af1a952b7a0f2dfbe195a0"
            },
            "downloads": -1,
            "filename": "fibermat-1.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "6f1bdf06a87c8b0ec0027942f07c61d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5677158,
            "upload_time": "2024-04-12T11:15:21",
            "upload_time_iso_8601": "2024-04-12T11:15:21.810719Z",
            "url": "https://files.pythonhosted.org/packages/00/9d/e4bc48f2610eb029bd0fa31927bdf5bb26605137086a671d336e48869397/fibermat-1.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-12 11:15:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fmahe",
    "github_project": "fibermat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "fibermat"
}
        
Elapsed time: 0.21216s