README.md 4.27 KB
Newer Older
webmanue's avatar
webmanue committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!---
 © 2020 ETH Zurich, Mechanics and Materials Lab
 © 2020 California Institute of Technology

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

# AE108

webmanue's avatar
webmanue committed
20
21
## Introduction

webmanue's avatar
webmanue committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
The aim of this project is to provide a C++ foundation for computational solid mechanics simulations using a variational framework, primarily focusing on the Finite Element Method (FEM).
See the [Computational Solid Mechanics lecture notes](https://www.mm.ethz.ch/) for more information about the approach that is used.
The code is developed by the Mechanics & Materials Lab at ETH Zurich.

## Summary

The following libraries are provided:

- ```ae108-cmdline```: Read command line parameters.

    A simple library for reading command line parameters with few lines of code (based on Boost.Program_options).

- ```ae108-cpppetsc```: Create a mesh.

    A library for creating a FEM mesh and managing the degrees of freedom associated with the elements and their vertices (based on PETSc's DMPLEX). It also provides wrappers around PETSc's solvers (KSP, SNES, and TAO).

webmanue's avatar
webmanue committed
38
39
40
41
- ```ae108-elements```: Define elements.

    A library for specifying the behaviour of the elements that make up the mesh. For instance, use this library to define the energy needed to deform an element.

webmanue's avatar
webmanue committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
- ```ae108-assembly```: Assemble local data.

    A library for assembling MPI-local data in ```cpppetsc``` meshes. For instance, assemble the local energy by summing the energy of all local element instances.

- ```ae108-solve```: Minimize the total energy.

    A library for minimizing the assembled total energy using PETSc's solvers or optimizers as provided by ```cpppetsc```.

## Installation

The project uses [CMake](https://cmake.org) as its build system generator. The following third party libraries are required and located using CMake's ```find_package```.

- [Boost](https://www.boost.org) (component program_options): version 1.67
- [Eigen](http://eigen.tuxfamily.org): version 3.3
- [Google Test](https://github.com/google/googletest): version 1.8.1
webmanue's avatar
webmanue committed
57
- [HDF5](https://www.hdfgroup.org/solutions/hdf5/): version 1.10
webmanue's avatar
webmanue committed
58
- [MPI](https://cmake.org/cmake/help/latest/module/FindMPI.html): version 3.1
webmanue's avatar
webmanue committed
59
60
61
- [PETSc](https://www.mcs.anl.gov/petsc/): version 3.15
- [Range-v3](https://github.com/ericniebler/range-v3): version 0.11
- [SLEPc](https://slepc.upv.es/): version 3.15
webmanue's avatar
webmanue committed
62

webmanue's avatar
webmanue committed
63
Of course, these libraries are covered by their own license terms. Since PETSc and SLEPc do not provide a CMake configuration file, these libraries are found using the provided find modules in ```cmake/modules/```, which in turn are based on ```pkg-config```.
webmanue's avatar
webmanue committed
64
65
66
67

Once you have installed these libraries, run CMake to build the project, choosing a location to install the library to by specifying ```CMAKE_INSTALL_PREFIX```; see the following example. Of course, depending on your setup, you might need to add a ```-DCMAKE_PREFIX_PATH='...'``` parameter to tell CMake the location of the third party library installations.

```bash
68
cmake \
webmanue's avatar
webmanue committed
69
70
    -S . \
    -B build \
71
    -DCMAKE_BUILD_TYPE=Release \
webmanue's avatar
webmanue committed
72
    -DCMAKE_INSTALL_PREFIX='install/to/path'
webmanue's avatar
webmanue committed
73
74
```

webmanue's avatar
webmanue committed
75
Now use ```cmake``` to build and install:
webmanue's avatar
webmanue committed
76
77

```bash
webmanue's avatar
webmanue committed
78
cmake --build build --target install -- -j$(nproc)
webmanue's avatar
webmanue committed
79
80
81
82
83
84
85
86
```

## Usage

To link and use the libraries point CMake to the installation using ```-DCMAKE_PREFIX_PATH='...'``` and use CMake's ```find_package``` to find the package ```ae108```. Now link the libraries that you want to link using CMake's ```target_link_libraries```. The following targets are installed:

- ```ae108::cmdline```
- ```ae108::cpppetsc```
webmanue's avatar
webmanue committed
87
- ```ae108::elements```
webmanue's avatar
webmanue committed
88
89
- ```ae108::assembly```
- ```ae108::solve```
webmanue's avatar
webmanue committed
90
91
92
93

## License

AE108 is available under the [Apache 2.0 license](https://choosealicense.com/licenses/apache-2.0/).
94

95
96
97
## Releases

The latest release is v0.1.0. It is also available via the ETH library: [ae108](https://search.library.ethz.ch/permalink/f/13kse66/data_archiveIE15605648).