ARL_Topologies is an extensible topology optimization program meant to be both a research platform and usable in general. To achieve this, it separates concepts from topology optimization into three parts: Representation, optimizer, and objective function.
Currently, the following is implemented:
- Representation
- 2D and 3D element-based density discretization with SIMP interpolation
- 2D and 3D nodal-based density discretization using Heaviside projection and filtering
- General mesh input for both of the above (ExodusII or GMSH, both in ASCII) or pixel/voxel rectangular regions
- Optimizer
- Optimality criterion (with or without filtered sensitivities)
- Method of moving asymptotes (via NLOpt, with or without filtered sensitivities)
- BFGS (via NLOpt, with or without filtered sensitivities)
- Genetic algorithm
- Objective function
- Static, structural finite element
In addition, post-processing to STL is available for density-based representations in both 2D and 3D. Output file formats include VTK, GMSH, and Matlab.
To compile ARL_Topologies, a C++11 compatible compiler is required along with the following libraries:
- CGAL, version 4.6 or later
- PugiXML, version 1.7 or later
- NLOpt, version 2.4.2 or later
- Eigen, version 3.2.10 or later (required for the finite element solver)
- Catch, version 1.5.8 or later (required for testing)
- Install all libraries listed above:
- CGAL requires Boost, GMP, and MPFR and recent versions are header-only
- PugiXML must be compiled as a shared library (set CMake option
BUILD_SHARED_LIBS
toON
) - NLOpt must be compiled as a shared library
- Eigen is header-only and does not require compilation
- Catch is header-only
- Build ARL_Topologies (ARL_Topologies uses the CMake build system and an out-of-source build is recommended)
- Create a build directory
- Edit the file
cmake_script_config
- Change the paths to point toward the required libraries
- Change the last argument to point towards the top level directory of ARL_Topologies
- Edit the compilers if necessary
- Edit the installation path
- By default, ARL_Topologies compiles against MPI, this can be removed by deleting
-DUSE_MPI
from the configuration command
- Run
cmake_script_config
in the build directory - Run
make
- Run
make install
- By default, both Topologies main code and the FEM objective function will be built
- Note that
fem_ofv
may be moved and compiled separately, though in this case the CMake variableTOPOLOGIES_ROOT
must be set to the directory containing the topologies installation and source files
- Note that
- Test the installation
- After installing the FEM library, if desired, run
make test
in the ARL_Topologies build directory
- Note that all tests may take up to 5 minutes to complete
- After installing the FEM library, if desired, run
ARL_Topologies takes only 1 or 2 inputs:
./topologies [-mpi] input.xml
where -mpi
is to be used when MPI is enabled and useful (note that the included FEM library does not use MPI) and input.xml
is the input file to be executed.
ARL_Topologies (and the FEM library) uses an XML file format, a basic example of which is:
<?xml version="1.0" encoding="utf-8"?>
<topologies>
<representation type="pixel" tag="rep1"/>
<optimizer type="oc" tag="opt1"/>
<objective_function shared_library="topologies/lib/libfemofv.so" input_file="tof_geo.xml"/>
<initial_guess type="constant">
<constant_val>0.5</constant_val>
</initial_guess>
<output type="volume">
<file_name>mmvol</file_name>
<file_format>vtk</file_format>
<output_period>5</output_period>
<overwrite>false</overwrite>
<write_periodic_results>true</write_periodic_results>
</output>
</topologies>
<!-- Representation definition, can also be defined in separate file -->
<pixel tag="rep1">
<!-- Lists need an xml node as a delimiter, used <d/> below but could be anything -->
<dimensions>1.<d/>1.</dimensions>
<discretization_size>30<d/>30</discretization_size>
<mesh_element_type>quad</mesh_element_type>
<minimum_density>1.e-3</minimum_density>
<penalty_power>3.</penalty_power>
<threshold>0.5</threshold>
</pixel>
<!-- Optimizer definition, can also be defined in separate file -->
<oc tag="opt1">
<filter_size>0.101</filter_size>
<stop_tol>0.01</stop_tol>
<max_iterations>30</max_iterations>
</oc>
with a basic FEM input given by
<?xml version="1.0" encoding="utf-8"?>
<fem>
<dimension>2</dimension>
<volume_fraction>0.5</volume_fraction>
<youngs_modulus>1.</youngs_modulus>
<poissons_ratio>0.25</poissons_ratio>
<geo_bc>
<x_support>true</x_support>
<y_support>true</y_support>
<geometry>
<v_line intercept="0."/>
</geometry>
</geo_bc>
<load_case>
<geo_lc>
<load_vector>0.<d/>-1.</load_vector>
<geometry>
<point_2 x="1." y="0."/>
</geometry>
</geo_lc>
</load_case>
<load_case>
<geo_lc>
<load_vector>0.<d/>1.</load_vector>
<geometry>
<point_2 x="1." y="1."/>
</geometry>
</geo_lc>
</load_case>
</fem>
Running make install
will install several example input files in an examples
directory. Please see the files contained in that directory for more information on the input file format. In addition, see the xml_schema
directory for a set of xml schema files that define the input format.
Note that ARL_Topologies loads the objective function from a shared library, so that it is easy to extend to different problems. The path to the shared library to load is specified in the shared_library
attribute of the objective_function
XML node.
This project is a work of the United States government and is not subject to domestic copyright protection under 17 USC § 105. Any outside contributions must be accompanied by a Contributor License Agreement (CLA), which can be found here.
Please see ARL's open source guidance for more information.