moxon-frame-generator
simple generator for 3D-printed frames for a moxon rectangle antenna
Topology optimization using PETSc: a Python wrapper and extended functionality
git clone https://github.com/thsmit/TopOpt_in_PETSc_wrapped_in_Python.gitthsmit/TopOpt_in_PETSc_wrapped_in_PythonTopOpt_in_PETSc_wrapped_in_Python provides a Python wrapper called topoptlib and extends the functionality of the TopOpt_in_PETSc framework [1] [2] [3].
The Python interface simplifies the problem definition, is expanding the potential user-base and facilitates the use of a large-scale topology optimization framework for educational purposes. Furthermore, the functionality of the topology optimization framework is extended which contributes to its usability to real-world design applications. The functionality is demonstrated via the cantilever beam, bracket- and torsion ball examples. Several tests are provided which can be used to verify the proper working and compare the performance of the user’s system setup.
Large scale, high-resolution topology optimization including:
The framework should be compiled once, on a cluster or a desktop computer. A problem file can use the functionality of the framework without compiling thereafter. A Linux system is recommended. A Windows machine should also work, however not tested.
The framework uses [CMake](https://cmake.org) to compile. The following third party libraries are required and located using CMake's find_package.
It needs PETSc to be installed:
# Download PETSc source from its `release-snapshots <https://www.mcs.anl.gov/petsc/mirror/release-snapshots/>`_. # Then follow the guide on `Quickest Quick-start <https://petsc.org/release/install/install_tutorial/#qqtw-quickest-quick-start-in-the-west>`_. cd petsc-3.14.1 ./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=0 --download-f2cblaslapack=1 --with-debugging=0 # PETSC_DIR is the path to the PETSc just downloaded make PETSC_DIR=/home/ts/Documents/petsc PETSC_ARCH=arch-linux-c-opt all make PETSC_DIR=/home/ts/Documents/petsc PETSC_ARCH=arch-linux-c-opt check
To download this framework:
git clone https://github.com/thsmit/TopOpt_in_PETSc_wrapped_in_Python.git
To compile the framework (paths will differ):
export PETSC_ARCH=arch-linux-c-opt export PETSC_DIR=/home/ts/Documents/petsc cd TopOpt_in_PETSc_wrapped_in_Python mkdir build && cd build cmake .. -D PETSC_EXECUTABLE_RUNS=ON make -j $(nproc)
Running a 'hello world' example from the command line. Generates standard cantilever beam and output .vtr files for viewing in Paraview.
import topoptlib data = topoptlib.Data() data.solve()
To run the cantilever beam example on one CPU (adjust the problem's mesh according to the number of available CPU's):
cd TopOpt_in_PETSc_wrapped_in_Python cp examples/beam.py . python3 beam.py
Available examples:
beam.pymultiloads.pysphere.pybracket.pyenv2lmod module load gcc/4.8.5 cmake/3.16.5 openmpi/3.0.1 petsc/3.10.5 python/3.7.4 cd TopOpt_in_PETSc_wrapped_in_Python mkdir build cd build cmake .. make cd .. bsub -n 8 mpirun -n 8 python3 bracket.py
Or use run_topopt.sh for automated building and running
Several tests are provided to verify the proper working of the framework. To run a test using 4 CPU's use:
cd TopOpt_in_PETSc_wrapped_in_Python cp topoptlib/test/test_beam.py . mpirun -n 4 python3 test_beam.py
Implemented tests in /tests:
test_beam.pytest_multiload.pytest_continuation.pytest_projection.pytest_sphere.pytest_bracket.pytest_michell.pyOr use test_topopt.sh for automated building and running the tests
The framework can write .vtr files of the designs with in point data. The designs can be viewed in Paraview (https://www.paraview.org/). The point data can be transformed into cell data by using Paraview's PointToCellData filter. To generate .vtr files add the following command to the problem definition:
vtr(20)
After solving the problem the output is written to a output.dat file. The designs can be viewed in Paraview (https://www.paraview.org/).
To generate .vtu files from the output file use post_process_topopt.sh with Python 2 (with * the file path and name where the output file is stored):
cd TopOpt_in_PETSc_wrapped_in_Python ./post_process_topopt.sh *
The authors reserves all rights but does not guaranty that the code is free from errors. Furthermore, we shall not be liable in any event caused by the use of the program.
For citing this work use:
@article{Smit2021,
author = {Smit, Thijs and Aage, Niels and Ferguson, Stephen J and Helgason, Benedikt},
title = {{Topology optimization using PETSc : a Python wrapper and extended functionality}},
journal = {Structural and Multidisciplinary Optimization},
year = {2021}
publisher = {Springer Berlin Heidelberg},
doi = {10.1007/s00158-021-03018-7},
url = {https://doi.org/10.1007/s00158-021-03018-7},
}
| [1] | Aage, N., Andreassen, E., & Lazarov, B. S. (2015). Topology optimization using PETSc: An easy-to-use, fully parallel, open source topology optimization framework. Structural and Multidisciplinary Optimization, 51(3), 565–572. https://doi.org/10.1007/s00158-014-1157-0 |
| [2] | http://topopt.dtu.dk/PETSc |
| [3] | https://github.com/topopt/TopOpt_in_PETSc |
more like this
simple generator for 3D-printed frames for a moxon rectangle antenna
GPX 轨迹转 3D 可打印地形模型 | Hiking trail to 3D printable terrain | Electron + Vue。 一款面向户外爱好者与 3D 打印玩家的 Web 工具。将 GPX 徒步/骑行轨迹一键转…
Install and monitor KlipperScreen on Android via DroidKlipp APK, USB ADB forwarding, and WiFi fallback
search projects, people, and tags