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]
Release files for metamaterialanalysiscode 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metamaterialanalysiscode-1.0.tar.gz | 21.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metamaterialanalysiscode-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.7 kB
Release files / metamaterialanalysiscode-1.0.tar.gz
| Download URL | metamaterialanalysiscode-1.0.tar.gz |
|---|---|
| Size | 21.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78fcf5d53204a46725c1a0838885d9a9e56710f0c5cc248131321aa9a383e370
|
|
BLAKE2b-256 checksum How to use checksums |
0a940bae740255c93c53c3eefe044ade1ad6486516bc9d4a785dedcab0a46674
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / metamaterialanalysiscode-1.0-py3-none-any.whl
| Download URL | metamaterialanalysiscode-1.0-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e75614a8733f70cf8dc9251344147dac303ce8a7b0de043d724e0f1b645c5e8
|
|
BLAKE2b-256 checksum How to use checksums |
59f859a1c3370b11b98f8e1a2d566fa5aa98405619e6a3fe8fb751d7279b05c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|