diff --git a/docs/about.md b/docs/about.md new file mode 100644 index 0000000..b209333 --- /dev/null +++ b/docs/about.md @@ -0,0 +1,213 @@ +# Contribution + +## Regras para realizar upload {*commit*} no projeto myfempy + +Este repositório destina-se ao gerenciamento das versões de desenvolvimento do projeto **myfempy**. Para que se tenha um código claro e limpo, as seguintes regras são aplicadas para manter um padrão geral do projeto. + +# 1 - Estilos gerais utilizados no projeto + +## 1.1 - Estilo dos códigos *.py* + +O padrão utilizado na sintax da escrita dos códigos é o [PEP8](https://peps.python.org/pep-0008). + +### 1.1.1 - Padrão de criação de classes *class AbcAbc* + +```python + +# the file name is abcabc.py + +class AbcAbc: # class name + + def __init__(self, x:int, y:float, z:str): # constructor method in python + + # add parameter in class + self.x = x + self.y = y + self.z = z + +``` + +### 1.1.2 - Padrão de criação de funções *def abc_abc* + +```python + +# the file name is abcabc.py + +def abc_abc(x:int, y:float): # function + + soma_x = x + x + div_y = x/y + + return div_y + +``` + +## 1.2 - ```__doc__``` de classes e funções + +Toda classe e função deve conter sua documentação interna {```__doc__```}. + +### 1.2.1 - Procedimento + +1. Utilizar a referência [PEP8](https://peps.python.org/pep-0008). + +2. Apresentar em uma única linha o que aquela classe ou função executa. + +3. Use comentarios para informações adicionais. + +4. Todas as entradas e saídas e a tipagem de dados deve ser indicados. + +5. O idioma padrão é o inglês técnico. + +Exemplo: + +```python + +# the file name is abcabc.py +# '__doc__' to a short documentation, try AbcAbc.__doc__ .... + +__doc__ = """ +This is a short documentation of class AbcAbc... +""" +class AbcAbc: # class name + """ + Abc: class + + This class do... + """ + + def __init__(self, x:int, y:float, z:str): # constructor method in python + """ + This class do... + + Args: + x (int): int number + y (float): float number + z (str): string name + """ + + # add parameter in class + self.x = x + self.y = y + self.z = z + + def abc_abc(self): # class function + + """ + This function do... + + Returns: + div_y (float): _description_ + """ + + soma_x = self.x + self.x + div_y = self.x/soma_x + + return div_y +``` + +## 1.3 - Documentação online + +O padrão utilizado para escrever a documentação oficial do projeto é no formato [Markdown](https://www.markdownguide.org/basic-syntax). + +Atualmente o projeto utiliza o pacote [mkdocs](https://www.mkdocs.org/) para gerar a documentação online {*.html*}, que é hospedada no site [GitHub Page](https://avgcampos.github.io/myfempy/). + +O *sphinx* converte arquivos *.rst* {reStruturedText} para *.html/pdf* de uma forma prática. Também é possível converter arquivos *.md* {markdown} em *.rst*, uma opção interessante é [mdToRst](https://github.com/kata198/mdToRst) ou de forma onlline com o [vertopal](https://www.vertopal.com/). + +### 1.3.1 - Procedimento de atualização da documentação online + +1. Para editar a documentação online oficial do projeto basta atualizar os arquivos *.md* na pasta **\docs**. + +2. Gere uma documentação automática a partir do arquivo de configuração *mkdocs.yml* com o comando: + +```bash + +>> mkdocs build # constroe os arquivos em \site + +>> mkdocs gh-deploy # deploy para o endereço de hospedagem no github pages + +``` + +Veja a seção [1.2 - ```__doc__``` de classes e funções] + +6.Verificar se não a **bugs** na documentação. + +# 2 - Testes, bugs, e documentação + +## 2.1 - Utilizando o line_profiler para verificar performance do código, linha-linha + +```python + +@profile +def slow_function(a, b, c): + ... + +``` + +```bash + +>> kernprof -l -v 'script_to_profile.py' + +>> python -m line_profiler script_to_profile.py.lprof + +``` + +## 2.2 - Teste de verificação manual, antes realizar o commit para o _main_ + +Executar na pasta principal do projeto \myfempy + +```bash + +>> black nome_do_script.py/ # biblioteca que formata o código de acordo com a PEP 8 + + +>> flake8 --extend-ignore=E501{line too long (82>79 characters) erro} nome_do_script.py/ #framework que checa o estilo e qualidade de código Python + +>> isort nome_do_script.py/ # biblioteca Python para formatar automaticamente as importações de acordo com a PEP 8 + +>> interrogate -vv nome_do_script.py/ # framework para verificar a ausência de documentações (docstring) no código. + +``` + +Estes sistemas também podem ser verificados de forma automatica via *Makefile*. Faça, + +```bash +>> make install # instala o pacote com poetry + +>> make format # verifica a formação com black e isort + +>> make lint # verifica a o estilo (PEP 08) com flake8 e interrogate + +>> make test # test arquivos de itegração do pacote com pytest + +>> make sec # verifica vulnerabilidades com pip-audit +``` + +https://medium.com/gbtech/aprimorando-qualidade-de-c%C3%B3digo-python-com-black-flake8-isort-e-interrogate-d5c089121357 + +# 3 - Git + +Utilize commits para subir atualizações no repositório do github (https://github.com/easycae-3d/simple_myfempy_oop). + +Faça, + +```bash +git status # verifica as modificações no sistema + +git add ... # to update what will be committed + +git commit -m 'Commit menssage' # commit + +git push # push para a _main_ do projeto +``` + +Após realizar o envio das modificações, faça realeases quando necessário, utilize tags das versões como marcadores e gere os changelogs para documentar as modificações ao longo do projeto. + +# 4 - Instalação do pacote + +Faça, + +```bash + +pip install . # instala o pacote myfempy do pyproject.toml + +``` \ No newline at end of file diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png new file mode 100644 index 0000000..e9c8a20 Binary files /dev/null and b/docs/assets/favicon.png differ diff --git a/docs/assets/logo.png b/docs/assets/logo.png new file mode 100644 index 0000000..b5e4c94 Binary files /dev/null and b/docs/assets/logo.png differ diff --git a/docs/documentation.md b/docs/documentation.md new file mode 100644 index 0000000..36b1b18 --- /dev/null +++ b/docs/documentation.md @@ -0,0 +1,5 @@ +# Documentation + +Descrição da documentação do código, links para acessar docstring dos principais módulos + +::: myfempy.felib.elements.plane.Plane diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 0000000..0788228 --- /dev/null +++ b/docs/examples.md @@ -0,0 +1,3 @@ +# Examples + +Exemplos com uso de códigos do git diff --git a/docs/history.md b/docs/history.md new file mode 100644 index 0000000..30e8647 --- /dev/null +++ b/docs/history.md @@ -0,0 +1,71 @@ +# Project History + +Este repositório tem como objetivo principal desenvolver testes e configurar uma nova versão do projeto **myfempy** (new version) baseando-se totalmente em programação orientada a objetos (OOP). Esta nova versão permitirá uma expansão da atual versão do **myfempy** para alta performance computacional (HPC), além de uma capacidade grande de leitura de dados, o que não é possível atualmente devido a sua complexidade de classes. Um avanço futuro, será de enviar dados para que o solver execute a solução em paralelo (multi-core) e também realizar a análise em multi-física (FSI, FTI, TMI). + +Esta nova versão permite a inclusão de módulos e códigos escritos em C/Cython e os solvers avançados utilizando os pacotes [PETSc](https://petsc.org/release/) e [SLEPc](https://slepc.upv.es/), além da possibilidade de utilizar o [JAX](https://jax.readthedocs.io/en/latest/index.html) para computação de alta performance. + +Após a nova implementação, foi feito um _merge_ no repositório **myfempy_dev** (repositório oficial para desenvolvimento e testes), e após passar por todos os teste será feito o upload para o repositório principal **myfempy** do projeto. + +Com o objetivo de deixar o projeto limpo e claro nesta jornada de desenvolvimento, será utilizado as normativas da _clean archicteture_ e da _bridge design pattern_ para códigos com OOP. + +## Etapas de desenvolvimento + +1. Estudar as caracteristicas de um código FEM com OOP; + +2. Extender as funcionalidades com OOP para o projeto **myfempy**; + +3. Gerar um mapa UML das clases nas layers do código, disponibilizando estes mapas na documentação do **User's Manual**; + +4. Usar _bridge design pattern_ para escrerver as principais classes do sistema, assim como as suas _feacture()_ e _method()_; + +5. Desenvolver um código OOP para o projeto **myfempy**; + +6. Testar o programa para resolver o problema de elasticidade bidimensinal de placa (Modelo de Mindlin)/ casca (Plate+PlaneStress) retangular; + +7. Implementar as seguintes soluções de análise: + + 1. Estático: + 1. Linear + - [X] Elastico + 2. Non-linear + - [ ] Grande deslocamento + - [ ] Plasticidade + - [ ] Estabilidade (flambagem) + - [ ] Contato sem atrito?? + 2. Dinamica linear: + 1. Domínio frequência + - [X] Modal + - [X] Força harmônica + 2. Transiênte linear + - [ ] Algo. implicito + - [ ] Algo. explicito? + 3. Multi-domínio: + 1. Multi-material + - [X] Interface de multi-material (multi E, v, ...) + 2. Acoplamento multi-físico + - [ ] FSI + - [ ] TMI + - [ ] Kratos/ openfoam? + 4. Comportamento mecânico e material: + - [X] Plane stress + - [X] Plane strain + - [X] Solid isotropic + - [ ] Plate Kirchhoff + - [ ] Plate Reissner-Mindlin + - [ ] Cyclic symmetry boundary + - [ ] Homogeinização/ micro escala (tensor) + +8. Validar a análise com a implementação seguintes tipos de elementos isoparametrico: + + - [X] tria3 - triagular 3 nós + - [ ] tria6 - triagular 6 nós + - [X] quad4 - quadrilateral 4 nós + - [ ] quad8 - quadrilateral 8 nós + - [X] tetr4 - tetraedro 4 nós + - [ ] tetr10 - tetraedro 10 nós + - [X] hexa8 - hexaedro 8 nós + - [ ] hexa20 - hexaedro 20 nós + +9. Desenvolver um gerador de malha interno utilizando o gmsh (pygmsh?) com leitor de malha .msh1 e .vtk; + +10. Desenvolver a saida dos resultados por meio de arquivos .vtk; \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..d98d349 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,274 @@ +**Under Development** + +![myfempy_logo](assets\logo.png) + +## Welcome to myfempy's online documentation + +Copyright © Antonio Vinicius G. Campos 2022. Processo INPI BR512022001484-0 + +## MathJax Test Page + +When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are + +\begin{equation} +ax^2 + bx + c = 0 +\end{equation} + +$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ + +## FlowChart with mermaid + +``` mermaid +flowchart + doc --> abc + + abc --> 123 + +``` + +## About + +**Myfempy** is a python package based on finite element method for +scientific analysis. The code is open source and *intended for +educational and scientific purposes only, not recommended to commercial +use*. You can help us by contributing with a donation on the main +project page, read the support options. **If you use myfempy in your +research, the developers would be grateful if you could cite in your +work.** + +## Installation + +### To install myfempy manually in your directory, following the steps + +1. Clone/ Download the main code \[latest version\] from + [github/myfempy/main](https://github.com/easycae-3d/myfempy/) +2. Unzip the pack in your preferred location +3. In the **myfempy-main** folder, open a terminal and enter with the + command: + +``` bash +>> python -m pip install --upgrade pip + +>> pip install . + +or + +>> python -m pip install --upgrade build + +>> python -m build +``` + +**Note: is recommend to create a virtual environment previously the +installation of** myfempy\*\* and dependencies packs. You can use the +[virtualenv](https://virtualenv.pypa.io/en/latest/) or [conda +environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)\*\* + +## Dependencies + +**Myfempy** can be used in systems based on Linux, MacOS and Windows. +**Myfempy** requires Python 3. + +### Installation prerequisites, required to build **myfempy** + +You can use either of two python development environments to run myfempy + +- [Python 3.x](https://www.python.org/) - *Python is a programming + language that lets you work quickly and integrate systems more + effectively.* +- [Anaconda](https://www.anaconda.com/) - *Anaconda offers the easiest + way to perform Python/R data science and machine learning on a + single machine.* + +### Python packages required for using **myfempy** + +The following python packages are required to run myfempy. Before to +install myfempy-main, install this packages. Check if they are already +installed on your machine + +- [numpy](https://numpy.org/) - The fundamental package for scientific + computing with Python +- [cython](https://cython.org/) - Cython is a language that makes + writing C extensions for Python as easy as Python itself +- [scipy](https://scipy.org/) - Fundamental algorithms for scientific + computing in Python +- [vedo](https://vedo.embl.es/) - A python module for scientific + analysis and visualization of эd objects +- [vtk](https://pypi.org/project/vtk/)(optional) - VTK is an + open-source toolkit for 3D computer graphics, image processing, and + visualization +- try + +``` bash +>> pip install numpy, cython, scipy, vedo +``` + +#### Outhers prerequisites + +- [gmsh/External Generator Mesh](https://gmsh.info/) - Gmsh is an open + source 3D finite element mesh generator with a built-in CAD engine + and post-processor. *Notes: 1 - Gmsh is NOT part of myfempy + projects; 2 - Is Needed install Gmsh manually* +- try + +``` bash +>> pip install --upgrade gmsh +``` + +- [gmsh PyPi](https://pypi.org/project/gmsh/) + +## Tutorial + +A **Basic Tutorial** is available +[here](https://myfempy.readthedocs.io/en/1.dev9/tutorial.html). + +Many **Examples** are available +[here](https://github.com/easycae-3d/myfempy/tree/master/examples). + +## Documentation + +The myfempy is documented using Mkdocs under **docs**. The myfempy's +documents versions can be found in web version and pdf [link](). + +## Release + +The all release versions is available +[here](https://github.com/easycae-3d/myfempy/releases) + +## Features + +The *main myfempy features* are available here: + +- [Features + List](https://github.com/easycae-3d/myfempy/blob/main/docs/Myfempy%20Features.pdf) + +## License + +**myfempy** is published under the [GPLv3 +license](https://www.gnu.org/licenses/gpl-3.0.en.html). See the +[myfempy/LICENSE](https://github.com/easycae-3d/myfempy/blob/main/LICENSE.txt). + +```{=html} + +``` +## Citing + +Have you found this software useful for your research? Star the project +and cite it as: + +- APA: + +``` bash +Antonio Vinicius Garcia Campos. (2022). myfempy (1.5.1). Zenodo. https://doi.org/10.5281/zenodo.6958796 +``` + +- BibTex: + +``` bash +@software{antonio_vinicius_garcia_campos_2022_6958796, +author = {Antonio Vinicius Garcia Campos}, +title = {myfempy}, +month = aug, +year = 2022, +publisher = {Zenodo}, +version = {1.5.1}, +doi = {10.5281/zenodo.6958796}, +url = {https://doi.org/10.5281/zenodo.6958796} +} +``` + +## References + +- [Myfempy](https://myfempy.readthedocs.io/) - *A python package for + scientific analysis based on finite element method.* +- [FEM](https://en.wikipedia.org/wiki/Finite_element_method) - *The + finite element method (FEM) is a popular method for numerically + solving differential equations arising in engineering and + mathematical modeling.* +- [Solid Mechanics](https://en.wikipedia.org/wiki/Solid_mechanics) + -*Solid mechanics, also known as mechanics of solids, is the branch + of continuum mechanics that studies the behavior of solid materials, + especially their motion and deformation under the action of forces, + temperature changes, phase changes, and other external or internal + agents.* +- [PDE](https://en.wikipedia.org/wiki/Partial_differential_equation) + *In mathematics, a partial differential equation (PDE) is an + equation which imposes relations between the various partial + derivatives of a multivariable function.* + +------------------------------------------------------------------------ + +## Changelog + +The changelog is available +[here](https://github.com/easycae-3d/myfempy/wiki/Changelog) + +# Project tree structure + +``` bash +/myfempy +│ +├───core +│ alglin.py +│ harmonicforced.py +│ mesh.py +│ modallinear.py +│ solver.py +│ staticlinear.py +│ utils.py +│ +│ +├───felib +│ │ +│ ├───elements +│ │ element.py +│ │ plane.py +│ │ platekc.py +│ │ solid.py +│ │ +│ ├───geometry +│ │ geometry.py +│ │ rectangle.py +│ │ thickness.py +│ │ +│ │ +│ ├───material +│ │ material.py +│ │ planestrain.py +│ │ planestress.py +│ │ solid.py +│ │ +│ ├───physic +│ │ bcstruct.py +│ │ loadstruct.py +│ │ structural.py +│ │ +│ ├───shapes +│ hexa8.py +│ line.py +│ line2.py +│ quad4.py +│ shape.py +│ tetr4.py +│ tria3.py +│ +├───io +│ iocsv.py +│ iogmsh.py +│ iovtk.py +│ +│ +├───misc +│ logo.png +│ logo.txt +│ path.py +│ utils.py +│ +├───plots + meshquality.py + physics.py + plotmesh.py + plotxy.py + postplot.py + + +``` diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..1bca5fb --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,69 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile docs/requirements.in +# +click==8.1.3 + # via mkdocs +ghp-import==2.1.0 + # via mkdocs +griffe==0.22.0 + # via mkdocstrings-python +importlib-metadata==4.12.0 + # via mkdocs +jinja2==3.1.2 + # via + # mkdocs + # mkdocstrings +markdown==3.3.7 + # via + # markdown-include + # mkdocs + # mkdocs-autorefs + # mkdocstrings + # pymdown-extensions +markdown-include==0.6.0 + # via -r docs/requirements.in +markupsafe==2.1.1 + # via + # jinja2 + # mkdocstrings +mergedeep==1.3.4 + # via mkdocs +mkdocs==1.3.0 + # via + # -r docs/requirements.in + # mkdocs-autorefs + # mkdocstrings +mkdocs-autorefs==0.4.1 + # via mkdocstrings +mkdocstrings[python]==0.19.0 + # via + # -r docs/requirements.in + # mkdocstrings-python +mkdocstrings-python==0.7.1 + # via mkdocstrings +python-markdown-math==0.8 +mkdocs-with-pdf==0.9.3 +mkdocs-mermaid2-plugin==1.1.1 +packaging==21.3 + # via mkdocs +pymdown-extensions==9.5 + # via mkdocstrings +pyparsing==3.0.9 + # via packaging +python-dateutil==2.8.2 + # via ghp-import +pyyaml==6.0 + # via + # mkdocs + # pyyaml-env-tag +pyyaml-env-tag==0.1 + # via mkdocs +six==1.16.0 + # via python-dateutil +watchdog==2.1.9 + # via mkdocs +zipp==3.8.0 + # via importlib-metadata diff --git a/docs/theory.md b/docs/theory.md new file mode 100644 index 0000000..a2c5bb8 --- /dev/null +++ b/docs/theory.md @@ -0,0 +1,3 @@ +# Theory Basic + +Teoria FEM básica diff --git a/docs/user_guide.md b/docs/user_guide.md new file mode 100644 index 0000000..32410b4 --- /dev/null +++ b/docs/user_guide.md @@ -0,0 +1,449 @@ +# User's Guide + +Guia do Usuário, introdução ao projeto, objetivos, como instalar, como usar os exemplos básicos... + +https://www.thecloudtutorial.com/user-manual-for-software-applications/ + +## Pre-Process + +```myfempy.mesh.genmesh.ModelGen.get_model(meshdata: dict{})``` + +### Model Setting + +### ```meshdata{"PROPMAT"}: list[mat_set_1: dict{}, ..., mat_set_n: dict{}]``` + +```python +mat_set_n = { +# parameters + "NAME":str(def.val.='mat_1') # material name def + "EXX":float(def.val.=1.0) # elasticity modulus in x direction [link](https://en.wikipedia.org/wiki/Young%27s_modulus) + "VXX":float(def.val.=1.0) # poisson's ratio in x direction [link](https://en.wikipedia.org/wiki/Poisson%27s_ratio) + "GXX":float(def.val.=1.0) # shear modulus in x direction [link](https://en.wikipedia.org/wiki/Shear_modulus) + "EYY":float(optional) # elasticity modulus in y direction, to orthotropic material only + "VYY":float(optional) # poisson's ratio in y direction, to orthotropic material only + "GYY":float(optional) # shear modulus in y direction, to orthotropic material only + "RHO":float(optional) # density, to dynamic analysis only [link](https://en.wikipedia.org/wiki/Density) + "STIF":float(optional) # stiffness lumped, to lumped model + "DAMP":float(optional) # damping lumped, to lumped model + "MAT":str(def.val.='isotropic') # material definition + # options + 'springlinear' # spring linear lumped + 'springnonlin' # spring non linear lumped + 'isotropic' # isotropic stress/strain material + 'orthotropic' # orthotropic stress/strain material + "DEF":str(def.val.='planestress') # material behavior + # options + 'lumped' # lumped material + 'axial' # axial{rod, beams...} behavior material + 'planestress' # plane stress behavior + 'planestrain' # plane strain behavior + 'solid' # solid behavior material + +``` + + +### ```meshdata{"PROPGEO"}: list[geo_set_1: dict{}, ..., geo_set_n: dict{}]``` + +```python + +geo_set_n = { +# parameters + "NAME":str(def.val.='geo_1') # geometry name def + "AREACS":float(def.val.=1.0) # area cross section + "INERXX":float(def.val.=1.0) # inercia x diretion [link](https://en.wikipedia.org/wiki/List_of_moments_of_inertia) + "INERYY":float(def.val.=1.0) # inercia y diretion + "INERZZ":float(def.val.=1.0) # inercia z diretion + "THICKN":float(def.val.=1.0) # thickness of plane/plate + "SEC":str(optional) # type of cross section, view list + "DIM":dict(optional)(def.val.={ # dimensional cross section def, view list Cross Section Dimensions + "b":float(def.val.=1.0) # b size + "h":float(def.val.=1.0) # h size + "t":float(def.val.=1.0) # t size + "d":float(def.val.=1.0)}) # d size + +``` + + +### ```meshdata{"FORCES"}: list[force_set_1: dict{},..., force_set_n: dict{}]``` + +```python + +force_set_n = { +# parameters + "DEF":str(def.val.='forcenode') # type force n def. + # options + 'forcenode' # force in nodes, concentrated load + 'forceedge' # force in edge, distributed load + 'forcebeam' # force in beam only opt., distributed load [legacy version] + 'forcesurf' # force in surface, distributed load + "DOF":str(def.val.='fx') # dof direction of force n + # options + 'fx' # force in x dir. + 'fy' # force in y dir. + 'fz' # force in z dir. + 'tx' # torque/moment in x dir. + 'ty' # torque/moment in y dir. + 'tz' # torque/moment in z dir. + 'masspoint' # mass concentrated applied in node/point + 'spring2ground' # spring connected node to ground/fixed end + 'damper2ground' # damper connected node to ground/fixed end + "DIR":str(def.val.='node') # set direction Axis Diretions + # options + # ----- OPT. WITH LOC SEEKERS + 'node' # node in mesh + 'lengthx' # length line in x dir., beam only option [legacy version] + 'lengthy' # length line in y dir., beam only option [legacy version] + 'lengthz' # length line in z dir., beam only option [legacy version] + 'edgex' # edge def in x dir. >'LOC': {'x':float(coord. x nodes), 'y':999(select all node in y dir.), 'z':float(coord. z nodes)} + 'edgey' # edge def in y dir. + 'edgez' # edge def in z dir. + 'surfxy' # surf def in xy plane >'LOC': {'x':999, 'y': 999, 'z':float(coord. z nodes)} + 'surfyz' # surf def in yz plane + 'surfzx' # surf def in zx plane + # ----- OPT. WITH TAG SEEKERS + 'point' # point number in tag list + 'edge' # edge number in tag list + 'surf' # surface number in tag list + "LOC":dict(def.val.={ # coord. node locator Axis Diretions + 'x':float(def.val.=1.0) # x coord. node + 'y':float(def.val.=1.0) # y coord. node + 'z':float(def.val.=0.0)}) # z coord. node + "TAG":int(optional) # tag number of regions type, used with gmsh mesh gen, view list + "VAL":list(def.val.=[-1.0]) # value list of force on steps, signal +/- is the direction + # options + [val_force_step_1, # force on steps, in solver opt. is possible to indicate the one step or all steps number + ..., + val_force_step_n] + +``` + +### ```meshdata{"BOUNDCOND"}: list[boundcond_set_1: dict{},..., boundcond_set_n: dict{}]``` + +```python + +boundcond_set_n = { +# parameters + "DEF":str(def.val.='fixed') # type force n def. + # options + 'fixed' # fixed boundary condition u=0. More in [link](https://en.wikipedia.org/wiki/Boundary_value_problem) + 'displ' # displ boundary condition u!=0. [dev] + "DOF":str(def.val.='all') # dof direction of force n + # options + 'ux' # force in x dir. + 'uy' # force in y dir. + 'uz' # force in z dir. + 'rx' # torque/moment in x dir. + 'ry' # torque/moment in y dir. + 'rz' # torque/moment in z dir. + 'all' # mass concentrated applied in node/point + "DIR":str(def.val.='edgex') # set direction Axis Diretions + # options + # ----- OPT. WITH LOC SEEKERS + 'node' # node in mesh + 'edgex' # edge def in x dir. >'LOC': {'x':float(coord. x nodes), 'y':999(select all node in y dir.), 'z':float(coord. z nodes)} + 'edgey' # edge def in y dir. + 'edgez' # edge def in z dir. + 'surfxy' # surf def in xy plane >'LOC': {'x':999, 'y': 999, 'z':float(coord. z nodes)} + 'surfyz' # surf def in yz plane + 'surfzx' # surf def in zx plane + # ----- OPT. WITH TAG SEEKERS + 'point' # point number in tag list + 'edge' # edge number in tag list + 'surf' # surface number in tag list + "LOC":dict(def.val.={ # coord. node locator Axis Diretions + 'x':float(def.val.=0.0) # x coord. node + 'y':float(def.val.=999) # y coord. node + 'z':float(def.val.=0.0)}) # z coord. node + "TAG":int(optional) # tag number of regions type, used with gmsh mesh gen, view list + "VAL":list(def.val.=[1.0]) # value list of dislp on steps [dev] + # options + [val_displ_step_1, # dislp on steps, in solver opt. is possible to indicate the one step or all steps number + ..., + val_displ_step_n] + +``` + +See Table 3 Consistent Units + +### ```meshdata{"QUADRATURE"}: dict{}``` + +```python + +# parameters + 'meth':str(def.val.='no_interpol') # method to integration + # options + 'gaussian' # [link](https://en.wikipedia.org/wiki/Gaussian_quadrature) + 'no_interpol' + 'npp':int(def.val.=0) # number of points to integrations + # options + 1 + 2 + 3 + 4 + 8 + +``` + +### ```meshdata{"DOMAIN"}: str``` + +```python + + # options + 'structural' # set a structural model + +``` + +### Mesh Legacy Options +### ```meshdata{"LEGACY"}: dict{} # LEGACY mesh return a rectangular plane only [test option]``` + +```python + +# parameters + 'lx':float(def.val.=1.0) # set a length in x diretion + 'ly':float(def.val.=1.0) # set a length in y diretion + 'nx':int(def.val.=10) # set a number of elements in x diretion + 'yx':int(def.val.=10) # set a number of elements in y diretion + 'mesh':str(def.val.=tria3) # set a type of mesh used in analysis + Table 1 Mesh List + 'elem':str(def.val.=plane31) # set a type of element used in analysis + Table 2 Elements List + +``` + +### ```meshdata{"ELEMLIST"}: list[] # ELEMLIST return a element list from a manual mesh [old option]``` + +```python + +# set + [ + [elem_number_n:int, 'elem':str, mat_set_n{'NAME'}(set first mat_set_n:dict{}), geo_set_n{'NAME'}(set first geo_set_n:dict{}), nodes_list_conec_n:list[]] + ... + ] + >> [[1, 'plane31', 'steel', 'geo', [1, 2, 3]]] + +``` + +### ```meshdata{"NODELIST"}: list[] # NODELIST return a nodes list from a manual mesh [old option]``` + +```python + +# set + [ + [node_number_n:int, coord_x:float, coord_y:float, coord_z:float] + ... + ] + >> [[1, 0, 0, 0] + [2, 1, 0, 0] + [3, 0, 1, 0]] +``` + +### Gmsh Mesh Options + +Notes: 1 - Gmsh is NOT part of myfempy projects; +2 - Is Needed install Gmsh manually + +### ```meshdata{"GMSH"}: dict{} # GMSH mesh return a advacend mesh from gmsh external lib [link](https://pypi.org/project/gmsh/) [advanced option]``` + +```python + +# parameters + 'filename':str # name of files exit + 'meshimport':dict{} # opt. to import a external gmsh mesh + # option + 'object':str(object name .msh1) # file .msh1 only, legacy mesh from gmsh [current version] + 'cadimport':dict{} # opt. to import a cad model from any cad program [link](https://en.wikipedia.org/wiki/Computer-aided_design) [FreeCAD](https://www.freecad.org/index.php?lang=pt_BR) + # option + 'object':str(object name .step) # file .step/.stp only [current version] + *** Options to build a self model in .geo file (from gmsh) + 'pointlist':list[] # poinst coord. list + # set + [ + [coord_x_point_1:float, coord_y_point_1:float, coord_z_point_1:float] + ... + [coord_x_point_n:float, coord_y_point_n:float, coord_z_point_n:float] + ] + + # y + # | + # | + # (1)----x + # \ + # \ + # z + + #-- lines points conec., counterclockwise count + # set + [ + [point_i_line_1:int, point_j_line_1:int] + ... + [point_i_line_n:int, point_j_line_n:int] + ] + + # (i)-----{1}-----(j) + + 'planelist':list[] # planes lines conec., counterclockwise count + # set + [ + [line_1_plane_1:int, ..., line_n_plane_1:int] + ... + [line_1_plane_n:int, ..., line_n_plane_n:int] + ] + + # (l)-----{3}-----(k) + # | | + # | | + # {4} [1] {2} + # | | + # | | + # (i)-----{1}-----(j) + + 'arc':list[] # arc line set, counterclockwise count + # set + [ + [R,[CX,CY,CZ],[A0, A1]] # arc_1 + ... + [R,[CX,CY,CZ],[A0, A1]] # arc_n + ] + + # A1 ^ + # | / + # | / + # | R + # | / + # |/ + # (i:CX,CY,CZ)------A0 + + # options + R:float # radius + CX:float # point i center x coord. + CY:float # point i center y coord. + CZ:float # point i center z coord. + A0:str(def.val.='0') # angle begin rad + A1:str(def.val.='Pi/2') # angle end rad + + 'meshconfig':dict{} # mesh configuration inputs + # options + 'mesh':str # set a type of mesh used in analysis + Table 1 Mesh List + 'elem':str # set a type of element used in analysis + Table 2 Elements List + 'sizeelement':float # size min. of elements + 'numbernodes':int # select a number of nodes in line, only to 'line2' Table 1 Mesh List + 'meshmap':dict{} # gen. a mapped structured mesh + # option + 'on':bool # turn on(true/ false) + True + False + 'edge':two opt. # select edge to map (only in 'on':True) + 'numbernodes':int # select a number of nodes in edge + 'all'/ TAG NUMB:int # select all edge or a specific edge + 'extrude':float # extrude dimensional, in z diretion, from a xy plane + +``` + +## Preview analysis + +## Solver Set + +## Post-Process + +## Appendix + +## Table 2 Mesh List + +| mesh | supported elements | +|---------|-------------------------------------------| +| "line2" | "truss21", "beam21", "frame21", "frame22" | +| "tria3" | "plane31" | +| "quad4" | "plane41" | +| "hexa8" | "solid81" | +| "tetr4" | "solid41" | +| | | + +## Table 2 Elements List + +| element | key/id | description | +|------------|--------|-----------------------------------------------------------------------------| +| 'spring21' | 110 | spring 2D 2-node linear Finite Element | +| 'truss21' | 120 | truss 2D 2-node linear Finite Element | +| 'beam21' | 130 | beam 1D 2-node linear Finite Element | +| 'frame21' | 140 | frame 2D 2-node linear Finite Element | +| 'frame22' | 141 | frame 3D 2-node linear Finite Element | +| 'plane31' | 210 | triagular Plane 3-node linear Finite Element | +| 'plane41' | 220 | quatrangular Isoparametric Plane 4-node linear Finite Element | +| 'plate41' | 221 | quatrangular Isoparametric Plate Mindlin 4-node linear Finite Element [dev] | +| 'solid41' | 310 | tetrahedron Isoparametric Solid 8-node linear Finite Element | +| 'solid81' | 320 | hexahedron Isoparametric Solid 8-node linear Finite Element | +| | | | + +## Table 3 Consistent Units + +| Quantity | SI(m) | SI(mm) | +|----------|----------|-------------| +| length | m | mm | +| force | N | N | +| mass | kg | ton(kg E03) | +| time | s | s | +| stress | Pa(N/m^2) | MPa(N/mm^2) | +| energy | J | mJ(J E-03) | +| density | kg/m^3 | ton/mm^3 | +| | | | + +## Axis Diretions + +```python + +# | +# [Y] +# | P1 -- principal plane +# | P2 -- secondary plane +# |__edgey__ +# /| | +# / | P1 | +# / | surfxy edgex +# / f| | +# / r |_________|____________[X]__ +# | u / / +# |s z/ P2 / +# | y/ surfzx edgez +# | / / +# |/__________/ +# / +# [Z] +#/ + +``` + +## Cross Section Dimensions + +```python + +# : +# [Y] +# : +# ___ ___________:___________ +# | |_______ : _______| +# | | : | +# | -->| : |<-------------(t) +# | | : | +# | | : | +# | | : | +# (h) | (CG).|..........[Z].. +# | | | +# | | | +# | | | +# | | | +# | _______| |_______ ___ +# _|_ |_______________________| _|_(d) + + +# |-----------(b)---------| + +``` + +## Tag Legends + +* [advanced option]: Inputs advanced options, require a external package +* [current version]: Inputs options in the latest stable version of myfempy +* [dev]: Inputs options in development (next update), to test only +* [legacy version]: Inputs of legacy/old version diff --git a/myfempy/__about__.py b/myfempy/__about__.py index 77648b6..984fc57 100644 --- a/myfempy/__about__.py +++ b/myfempy/__about__.py @@ -1 +1 @@ -__version__ = "0.2.1" \ No newline at end of file +__version__ = "0.2.2" \ No newline at end of file