| 
				
					
						 | 
			2 years ago | |
|---|---|---|
| 3rd | 2 years ago | |
| assets | 2 years ago | |
| cmake | 2 years ago | |
| docs/imgs | 2 years ago | |
| examples | 2 years ago | |
| ref | 2 years ago | |
| src | 2 years ago | |
| .gitignore | 2 years ago | |
| CMakeLists.txt | 2 years ago | |
| README.md | 2 years ago | |
		
			
				
				README.md
			
		
		
	
	Thermo-elastic/Mechanical Topology Optimization/Simuation
 (Optional) temperature limits, optimization of voxel mesh. 
This is the implementation of the paper Thermo-elastic topology optimization with stress and temperature constraints. By the way, this procedure realized the thermo-elastic TO(topology optimization)(Thermo-elastic topology optimization with stress and temperature constraints., mechanical TO(top3d.pdf) and corresponding simulations.
Files
3rd/: third-party libraryassets/: user-defined assetsexamples/: several teaching examplesdefined_model_writer: User defined voxel mesh/model as TO/simulation input.clamped_model_writer: Clamped to 0 or 1 of the optimized density.sim_mechanical: Mechanical simulation.sim_thermoelastic: Thermo-elastic simulation.top_mechanical: Mechanical TO.top_thermoelastic: Thermoelastic TO.
output/: output directoryref/: reference materialsrc/: source codecmake/: CMake files
Dependencies
Inside libraries:
- mma: constrained optimization algorithm
 - Eigen: linear algebra
 - libigl: basic geometry functions
 - AMGCL: Linear solver. Optional.
 - json: parsing input JSON scenes
 - spdlog: logging information
 - OpenMP: CPU parallel processing.
sudo apt install libomp-dev 
The following dependencies require user installation:
- SuiteSparse: Linear solver. Optional, NOTE: Use of the Intel MKL BLAS is strongly recommended.
 - CUDA Toolkit: CUDA support. Optional (Strongly recommend).
 
Select a Linear solver
If your matrix has less than 50w of freedom, then it is recommended to choose a direct solver (e.g. SuiteSparse):
- install SuiteSparse.
 - Set 
ENABLE_AMGCLtoOFFand setENABLE_SUITESPARSEtoONin CMakeLists.txt. 
Otherwise, it is recommended to choose an iterative solver (e.g. AMGCL),in CPU:
- install OpenMP and AMGCL.
 - Set 
ENABLE_AMGCLtoON,ENABLE_AMGCL_CUDAtoOFFandENABLE_SUITESPARSEtoOFFin CMakeLists.txt. 
Further, CUDA can be used to speed up the iterative solver:
- install OpenMP, CUDA Toolkit and AMGCL.
 - Set 
ENABLE_AMGCLtoON,ENABLE_AMGCL_CUDAtoONandENABLE_SUITESPARSEtoOFFin CMakeLists.txt. 
Finally, if all options are set to OFF, then the Eigen build-in iterative solver will be chosen.(not recommended).
Build
- set path in CMakeLists.txt.
 
set(CMAKE_CUDA_COMPILER "/path/to/nvcc") # set path to nvcc(if AMGCL_CUDA is ON)
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j 16
Usage
updated: top and sim sequence
- Use 
example/defined_model_writerto generate a user-defined voxel mesh/model as TO input. - Use 
example/top_mechanicalto run mechanical TO. - Use 
example/top_thermoelasticto run thermo-elastic TO.(||Fth|| / ||Fm||means the ratio of the thermal force to the mechanical force, the value suggested is0.1-10). - Use 
example/clamped_model_writerto clamp the optimized density to 0 or 1(select a suitable threshold) as SIM input. - Use 
example/sim_mechanicalto run mechanical simulation. - Use 
example/sim_thermoelasticto run thermo-elastic simulation. 
Note:
- open 
*.vtkvia Paraview. - Input
- Set parameters in *.json. see comments in 
assets/top-thermoelastic-*.json(see comments inassets/config_biclamed.jsonand ref paper for MeTh parameters; see comments inassets/top/config_Lshape.json) - Redirect in 
main.cppormain.cuif ENABLE_AMGCL_CUDA is ON: "//*"inconfig_*.jsonfile mean comments.
 - Set parameters in *.json. see comments in 
 - Output see 
output/txt/${example_name},output/txt/${example_name}/${clamed_example_name*}/andoutput/vtk/${example_name}/${clamed_example_name*}/. - you can modify 
OUTPUT_DIRandASSETS_DIRinCMAKEList.txt. - you can modify the linear solver arguments 
prm.solver.tolandprm.solver.maxiterinsrc/LinearSolver/Amgcl.horsrc/LinearSolver/AmgclCuda.h. - you should modify example content in 
*.cpprather than*.cu, the latter is copied from the former by cmake.