Package that cretaes metamaterial FEM models
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
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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file metamaterialanalysiscode-1.0.tar.gz
.
File metadata
- Download URL: metamaterialanalysiscode-1.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fcf5d53204a46725c1a0838885d9a9e56710f0c5cc248131321aa9a383e370 |
|
MD5 | 551dd77b5f2c131cf90ea0bf17476ca5 |
|
BLAKE2b-256 | 0a940bae740255c93c53c3eefe044ade1ad6486516bc9d4a785dedcab0a46674 |
File details
Details for the file metamaterialanalysiscode-1.0-py3-none-any.whl
.
File metadata
- Download URL: metamaterialanalysiscode-1.0-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e75614a8733f70cf8dc9251344147dac303ce8a7b0de043d724e0f1b645c5e8 |
|
MD5 | 4a106adc7d2f63dc2316d2e3f7bd4f3a |
|
BLAKE2b-256 | 59f859a1c3370b11b98f8e1a2d566fa5aa98405619e6a3fe8fb751d7279b05c3 |