metamaterialanalysiscode


Namemetamaterialanalysiscode JSON
Version 1.0 PyPI version JSON
download
home_page
SummaryPackage that cretaes metamaterial FEM models
upload_time2023-07-18 23:19:25
maintainer
docs_urlNone
author
requires_python>=3.10
licenseCopyright 2023 Manuel Sánchez García The following license affect the code but not the intellectual property of the patents used in the code. 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.
keywords mac preprocessing metamaterial fem
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![](https://pbs.twimg.com/media/F1WYyq3WYAYEguI?format=png&name=900x900 "MAC")


# Metamaterial Analysis Code

## 1. Introduction

This code is the core of the TFM (Final Master Project) "Simulación Mediante  Elementos Finitos Del Comportamiento No
Lineal De Metamateriales Auxéticos En Grandes Desplazamientos Para Uso Ingenieril." It is an OOP pacakage that
allows the user to generate .fem files with the mesh of components based on metamaterial structure.
This means that the material is not solid but consists of cells. Only works for Optistruct.

## 2. Version update

### v.1.0

- Bug fixing
- New classes for nonlinear analysis
- Expansion of functionalities

## 3. Property and License

The code is property of Manuel Sanchez and the ETSIAE. It follows the MIT license.

The Patent used in the code is exclusively property of their creators. Copy or modifying are not allowed
without permission of their owners.

## 4. Documentation

The package can be used by calling the functions that gets the different objects that are instances of
the different "MACClasses" defined in the code.

Importing the package:
````python
import metamaterialanalysiscode as mac
````

An example of generating a model:
````python
material1 = mac.set_material(id=1, type="MATS1", stressstrain=tabla_strainstress1, nonlinearity="PLASTIC",
                             yieldstress=0.02)

material2 = mac.set_material(id=2, type="MAT1", e=70000, nu=0.3)

beam2 = mac.set_property(id=2, type="PBEAM", material=[material2], area=2000, i1=0.0001, i2=1, i12=1, j=1)

beam1 = mac.set_property(id=1, type="PBEAML", material=[material2], section="ROD", dim1=1.0)

cellstructure1 = mac.set_structure(type="Auxetic", djoint=5.3, dstar=-0.3, heightstar=0.3, hcapas=3,
                                   hprisma=15, stepx=10, stepy=10, nelem=4)


modelo1 = mac.set_model(modeldimensions=(150, 300, 70), cellstructure=cellstructure1, cellmaterial=[material2],
                        cellproperty=[beam1])
````
 Printing the model into a .fem file:

````python
modelo1.write_fem(r"C:\Users\admin\Desktop\test1_model.fem")
````

Generating and printing an analyisis:
````python
enforcedispl1 = mac.set_load(id=1, type="SPC", nodes=nodesdisp, components=[3], displacement=-0.5, load=True)

constraint1 = mac.set_constraint(id=2, nodes=nodesdisp, components=[3], displacement=-0.5)

constraint2 = mac.set_constraint(id=2, nodes=nodespc, components=[1, 2, 3, 4, 5, 6], displacement=0)

subcase1 = mac.set_subcase(id=1, label="linear", loads=[enforcedispl1], constraints=[constraint1, constraint2])

analysis2 = mac.set_analysis(model=modelo1, subcases=[subcase1])

analysis2.write_fem(r"C:\Users\admin\Desktop\test1_analysis.fem")
````

As all the nodes and elements are saved in two dictionaries, the user can modify coords, properties, materials,
etc. 

A basic knowledge of OOP is needed to understand and use the advance functionalities that the package brings

Example:
```python
elementtodel = set()
nodetodel = set()
for elementkey in modelo1.ElementDict.keys():
    for node in modelo1.ElementDict[elementkey].Nodes:
        if node.Coords[2] < (minz+0.1) or node.Coords[2] > (maxz-0.1):
            nodetodel.add(node.ID)
            elementtodel.add(elementkey)

for elementkey in elementtodel:
    del modelo1.ElementDict[elementkey]

for nodekey in nodetodel:
    del modelo1.NodeDict[nodekey]
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "metamaterialanalysiscode",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "MAC,Preprocessing,Metamaterial,FEM",
    "author": "",
    "author_email": "Manuel S\u00e1nchez Garc\u00eda <msg.aerospace@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0a/94/0bae740255c93c53c3eefe044ade1ad6486516bc9d4a785dedcab0a46674/metamaterialanalysiscode-1.0.tar.gz",
    "platform": null,
    "description": "![](https://pbs.twimg.com/media/F1WYyq3WYAYEguI?format=png&name=900x900 \"MAC\")\r\n\r\n\r\n# Metamaterial Analysis Code\r\n\r\n## 1. Introduction\r\n\r\nThis code is the core of the TFM (Final Master Project) \"Simulaci\u00f3n Mediante  Elementos Finitos Del Comportamiento No\r\nLineal De Metamateriales Aux\u00e9ticos En Grandes Desplazamientos Para Uso Ingenieril.\" It is an OOP pacakage that\r\nallows the user to generate .fem files with the mesh of components based on metamaterial structure.\r\nThis means that the material is not solid but consists of cells. Only works for Optistruct.\r\n\r\n## 2. Version update\r\n\r\n### v.1.0\r\n\r\n- Bug fixing\r\n- New classes for nonlinear analysis\r\n- Expansion of functionalities\r\n\r\n## 3. Property and License\r\n\r\nThe code is property of Manuel Sanchez and the ETSIAE. It follows the MIT license.\r\n\r\nThe Patent used in the code is exclusively property of their creators. Copy or modifying are not allowed\r\nwithout permission of their owners.\r\n\r\n## 4. Documentation\r\n\r\nThe package can be used by calling the functions that gets the different objects that are instances of\r\nthe different \"MACClasses\" defined in the code.\r\n\r\nImporting the package:\r\n````python\r\nimport metamaterialanalysiscode as mac\r\n````\r\n\r\nAn example of generating a model:\r\n````python\r\nmaterial1 = mac.set_material(id=1, type=\"MATS1\", stressstrain=tabla_strainstress1, nonlinearity=\"PLASTIC\",\r\n                             yieldstress=0.02)\r\n\r\nmaterial2 = mac.set_material(id=2, type=\"MAT1\", e=70000, nu=0.3)\r\n\r\nbeam2 = mac.set_property(id=2, type=\"PBEAM\", material=[material2], area=2000, i1=0.0001, i2=1, i12=1, j=1)\r\n\r\nbeam1 = mac.set_property(id=1, type=\"PBEAML\", material=[material2], section=\"ROD\", dim1=1.0)\r\n\r\ncellstructure1 = mac.set_structure(type=\"Auxetic\", djoint=5.3, dstar=-0.3, heightstar=0.3, hcapas=3,\r\n                                   hprisma=15, stepx=10, stepy=10, nelem=4)\r\n\r\n\r\nmodelo1 = mac.set_model(modeldimensions=(150, 300, 70), cellstructure=cellstructure1, cellmaterial=[material2],\r\n                        cellproperty=[beam1])\r\n````\r\n Printing the model into a .fem file:\r\n\r\n````python\r\nmodelo1.write_fem(r\"C:\\Users\\admin\\Desktop\\test1_model.fem\")\r\n````\r\n\r\nGenerating and printing an analyisis:\r\n````python\r\nenforcedispl1 = mac.set_load(id=1, type=\"SPC\", nodes=nodesdisp, components=[3], displacement=-0.5, load=True)\r\n\r\nconstraint1 = mac.set_constraint(id=2, nodes=nodesdisp, components=[3], displacement=-0.5)\r\n\r\nconstraint2 = mac.set_constraint(id=2, nodes=nodespc, components=[1, 2, 3, 4, 5, 6], displacement=0)\r\n\r\nsubcase1 = mac.set_subcase(id=1, label=\"linear\", loads=[enforcedispl1], constraints=[constraint1, constraint2])\r\n\r\nanalysis2 = mac.set_analysis(model=modelo1, subcases=[subcase1])\r\n\r\nanalysis2.write_fem(r\"C:\\Users\\admin\\Desktop\\test1_analysis.fem\")\r\n````\r\n\r\nAs all the nodes and elements are saved in two dictionaries, the user can modify coords, properties, materials,\r\netc. \r\n\r\nA basic knowledge of OOP is needed to understand and use the advance functionalities that the package brings\r\n\r\nExample:\r\n```python\r\nelementtodel = set()\r\nnodetodel = set()\r\nfor elementkey in modelo1.ElementDict.keys():\r\n    for node in modelo1.ElementDict[elementkey].Nodes:\r\n        if node.Coords[2] < (minz+0.1) or node.Coords[2] > (maxz-0.1):\r\n            nodetodel.add(node.ID)\r\n            elementtodel.add(elementkey)\r\n\r\nfor elementkey in elementtodel:\r\n    del modelo1.ElementDict[elementkey]\r\n\r\nfor nodekey in nodetodel:\r\n    del modelo1.NodeDict[nodekey]\r\n```\r\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 Manuel S\u00e1nchez Garc\u00eda  The following license affect the code but not the intellectual property of the patents used in the code.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), 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 \u201cAS IS\u201d, 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.",
    "summary": "Package that cretaes metamaterial FEM models",
    "version": "1.0",
    "project_urls": {
        "ETSIAE": "https://www.etsiae.upm.es/",
        "GitHub": "https://github.com/ManuelSG96/MAC",
        "LinkedIn": "https://www.linkedin.com/in/manuel-s%C3%A1nchez-garc%C3%ADa-8aa683232/"
    },
    "split_keywords": [
        "mac",
        "preprocessing",
        "metamaterial",
        "fem"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59f859a1c3370b11b98f8e1a2d566fa5aa98405619e6a3fe8fb751d7279b05c3",
                "md5": "4a106adc7d2f63dc2316d2e3f7bd4f3a",
                "sha256": "1e75614a8733f70cf8dc9251344147dac303ce8a7b0de043d724e0f1b645c5e8"
            },
            "downloads": -1,
            "filename": "metamaterialanalysiscode-1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a106adc7d2f63dc2316d2e3f7bd4f3a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 25879,
            "upload_time": "2023-07-18T23:19:24",
            "upload_time_iso_8601": "2023-07-18T23:19:24.276807Z",
            "url": "https://files.pythonhosted.org/packages/59/f8/59a1c3370b11b98f8e1a2d566fa5aa98405619e6a3fe8fb751d7279b05c3/metamaterialanalysiscode-1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a940bae740255c93c53c3eefe044ade1ad6486516bc9d4a785dedcab0a46674",
                "md5": "551dd77b5f2c131cf90ea0bf17476ca5",
                "sha256": "78fcf5d53204a46725c1a0838885d9a9e56710f0c5cc248131321aa9a383e370"
            },
            "downloads": -1,
            "filename": "metamaterialanalysiscode-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "551dd77b5f2c131cf90ea0bf17476ca5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 21796,
            "upload_time": "2023-07-18T23:19:25",
            "upload_time_iso_8601": "2023-07-18T23:19:25.871461Z",
            "url": "https://files.pythonhosted.org/packages/0a/94/0bae740255c93c53c3eefe044ade1ad6486516bc9d4a785dedcab0a46674/metamaterialanalysiscode-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-18 23:19:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ManuelSG96",
    "github_project": "MAC",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "metamaterialanalysiscode"
}
        
Elapsed time: 0.10587s