[](https://opensource.org/license/apache-2-0)
[](https://github.com/jonaspleyer/spatial-decomposition/actions)
[](https://crates.io/crates/spatial-decomposition)


# spatial_decomposition
This crate implements algorithms to decompose spaces into subdomains.
The created partitions can be reused within numerical solvers such as FETI (finite element tearing
and interconnect) or other methods.
# Kong Mount Roscoe Algorithm
This algorithms divides a given rectangle into multiple smaller rectangles and minimizes the
maximum rectangle perimeter.
## Square
<table style="width: 60%">
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square2.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square3.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square4.png"></td>
</tr>
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square5.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square6.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square7.png"></td>
</tr>
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square8.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square9.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/square10.png"></td>
</tr>
</table>
## Wide Rectangle
<table style="width: 60%">
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect2.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect3.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect4.png"></td>
</tr>
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect5.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect6.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/wide_rect7.png"></td>
</tr>
</table>
## Rectangle
<table style="width: 60%">
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect2.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect3.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect4.png"></td>
</tr>
<tr>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect5.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect6.png"></td>
<td><img style="width: 100%;" src="https://raw.githubusercontent.com/jonaspleyer/spatial-decomposition/refs/heads/main/plots/other_rect7.png"></td>
</tr>
</table>