Skip to main content

Package for generating FEM models based on cells

Project description

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

As this is the first version, there are no updates.

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:

import metamaterialanalysiscode as mac

An example of generating a model:

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:

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

Generating and printing an analyisis:

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:

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]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metamaterialanalysiscode-0.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metamaterialanalysiscode-0.1-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file metamaterialanalysiscode-0.1.tar.gz.

File metadata

  • Download URL: metamaterialanalysiscode-0.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for metamaterialanalysiscode-0.1.tar.gz
Algorithm Hash digest
SHA256 ab46f2b376a7341c44f4d21523e173e81c4a15c8453ba411df42c2491a1b9f90
MD5 860b0576071fc41fc46c368a71659525
BLAKE2b-256 9ab23edad8589ff649490b88c0e9bea7b9814565cc0f7b57378137c9c434c3d2

See more details on using hashes here.

File details

Details for the file metamaterialanalysiscode-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for metamaterialanalysiscode-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a28e6b3af4beaaf948bd5b454c8958e662bca30ce1af4e68a7df4a1173719efd
MD5 ae600fbb59a6d59f7f48fa709cf2c779
BLAKE2b-256 41695be8df7031604a6c0a69c79451073a9e39cf353218d0e630a84af55c54d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page