Skip to content

Commit f4b9ada

Browse files
authored
Merge pull request #210 from mdienst/dev-documentaion
Developer documentation
2 parents 2f3502c + dd7f8d5 commit f4b9ada

File tree

6 files changed

+132
-1
lines changed

6 files changed

+132
-1
lines changed

docs/make.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ makedocs(;
8484
joinpath("generated", "tutorial_cylinder.md"),
8585
joinpath("generated", "tutorial_brazilian_test.md"),
8686
],
87+
"Development" => [
88+
"dev_systems.md",
89+
"dev_materials.md",
90+
"dev_solvers.md",
91+
"dev_multithreading_mpi.md",
92+
],
8793
"API Reference" => [
8894
"public_api_reference.md",
8995
"private_api_reference.md",

docs/src/dev_materials.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Materials
2+
3+
!!! warning "Draft & Work in Progress"
4+
This documentation is a draft and work in progress. It will be extended and improved in the future.
5+
6+
The selected material specifies, which peridynamic formulation is employed in calculations.
7+
8+
## Implemented material models
9+
10+
- [`BBMaterial`](@ref): Bond-based peridynamics.
11+
- [`DHBBMaterial`](@ref): Dual-horizon bond-based peridynamics.
12+
- [`OSBMaterial`](@ref): Ordinary state-based peridynamics, also called linear peridynamic solid (LPS).
13+
- [`CMaterial`](@ref): Correspondence formulation.
14+
- [`CRMaterial`](@ref): Correspondence formulation with stress rotation for objectivity enforcement.
15+
- [`RKCMaterial`](@ref): Reproducing kernel peridynamics with bond-associated higher-order integration.
16+
- [`RKCRMaterial`](@ref): Reproducing kernel peridynamics with bond-associated higher-order integration with stress rotation for objectivity enforcement.
17+
- [`BACMaterial`](@ref): Bond-associated correspondence formulation of Chen and Spencer.
18+
- [`CKIMaterial`](@ref): Continuum-kinematics-inspired peridynamics.
19+
20+
## Custom materials
21+
22+
Custom materials can be defined for existing systems.
23+
Therefore the `<XYZ>Material` type has to be a subtype of an `Abstract<SystemName>Material`, which automatically sets methods for this type.
24+
Further it is necessary to:
25+
- link a point parameter type with `@params`.
26+
- link and create a storage with `@storage`.
27+
- define the `force_density_point!` function.

docs/src/dev_multithreading_mpi.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Multithreading & MPI
2+
3+
!!! warning "Draft & Work in Progress"
4+
This documentation is a draft and work in progress. It will be extended and improved in the future.
5+
6+
Multithreading and MPI are implemented based on a similar approach. The body is split into several chunks, that each have their own process.
7+
```@raw html
8+
<img src="https://github.com/user-attachments/assets/86caad93-8a56-495b-822a-ffccc5c43c9e" width="650"/>
9+
```
10+
There are two types of points. Each chunk consists of the local points, which lay inside the specific body chunk, as well as halo points, which lay on the surface of neighboring chunks and interact with local points of the considered chunk, because they lay inside their horizons.
11+
12+
This means that every point of a body exists locally in the body chunk that it originally lies in. Additionally one or more copies of the point can exist as halo points in other chunks.
13+
```@raw html
14+
<img src="https://github.com/user-attachments/assets/79340f51-cb62-42b2-8f1b-fd474f7fe8fb" width="350"/>
15+
```
16+
Since there are points that exist in multiple chunks (in one chunk as local points and possibly in one or more chunks as halo points) information has to be exchanged between these copies of specific points.
17+
Two types of exchanges are of importance for both methods:
18+
- local-to-halo exchange: Data from calculations in the chunk where the point is local is transferred to the halo versions of this point which exist in other chunks.
19+
```@raw html
20+
<img src="https://github.com/user-attachments/assets/34434920-a758-438a-a463-a259397f1bba" width="350"/>
21+
```
22+
- halo-to-local exchange: Data from calculations of the one or multiple halo versions of a point is transferred to the local version of the point.
23+
```@raw html
24+
<img src="https://github.com/user-attachments/assets/6265e5b8-bff5-4aa3-83b7-62a385578f37" width="350"/>
25+
```
26+
27+
A body chunk contains all information that is necessary for the simulation:
28+
29+
```@raw html
30+
<img src="https://github.com/user-attachments/assets/c2cd75de-065e-4568-abde-e753216f3e85" width="650"/>
31+
```
32+
33+
## Multithreading
34+
35+
To manage the body chunks that compose a body in multithreading a `ThreadsDataHandler` is employed. It combines information about all the body chunks of the system and all halo exchanges between them.
36+
```@raw html
37+
<img src="https://github.com/user-attachments/assets/48e61d30-cfd5-424c-bc36-c52485a00dc2" width="250"/>
38+
```
39+
40+
## MPI
41+
42+
For MPI simulations an `MPIDataHandler` is used for each body chunk, processing its halo exchanges and further MPI-related information.
43+
```@raw html
44+
<img src="https://github.com/user-attachments/assets/ab389e50-05f7-4d6e-8b0d-992fb6c79a75" width="250"/>
45+
```

docs/src/dev_solvers.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Time solvers
2+
3+
!!! warning "Draft & Work in Progress"
4+
This documentation is a draft and work in progress. It will be extended and improved in the future.
5+
6+
## VelocityVerlet
7+
8+
A time integration solver for the Velocity Verlet algorithm used for dynamic simulations.
9+
10+
## DynamicRelaxation
11+
12+
A time integration solver for the adaptive dynamic relaxation algorithm used for quasi-static simulations.
13+
14+
## Custom solvers
15+
16+
To create a custom time solver, the following steps are required:
17+
- define a type `MySolver<:AbstractTimeSolver`. It has to be a subtype of the type `AbstractTimeSolver`.
18+
- define the function `init_time_solver!(vv::MySolver, dh::AbstractDataHandler)`.
19+
- define the function `solve!(dh::AbstractDataHandler, vv::VelocityVerlet, options::AbstractJobOptions)`.

docs/src/dev_systems.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Systems
2+
3+
!!! warning "Draft & Work in Progress"
4+
This documentation is a draft and work in progress. It will be extended and improved in the future.
5+
6+
Systems are the backbone of the simulations.
7+
They contain all the required pre-defined data structures (e.g. bonds, point-families, interactions, ...).
8+
9+
## BondSystem
10+
11+
The standard system for bond-based ([`BBMaterial`](@ref)), ordinary state-based ([`OSBMaterial`](@ref)) and non-ordinary state-based correspondence formulation ([`CMaterial`](@ref)) material models. Used material models have to be subtypes of `AbstractBondSystemMaterial` or `AbstractCorrespondenceMaterial`.
12+
13+
## InteractionSystem
14+
15+
The system utilizing one-, two- and three-neighbor-interactions for the continuum-kinematics-inspired material model ([`CKIMaterial`](@ref)).
16+
Used material models have to be subtypes of `AbstractInteractionSystemMaterial`.
17+
18+
## BondAssociatedSystem
19+
20+
A system for the bond-associated correspondence model by Chen and Spencer ([`BACMaterial`](@ref)).
21+
Used material models have to be subtypes of `AbstractBondAssociatedSystemMaterial`.
22+
23+
## Custom systems
24+
25+
Custom systems are relatively free in how they are defined, only these things are required:
26+
- define an abstract type `Abstract<SystemName>Material` that all materials using this system have to be a subtype of.
27+
- define the `get_system(body::AbstractBody{Material}, pd::PointDecomposition, chunk_id::Int) where {Material<:Abstract<SystemName>Material}` function.
28+
- define the `system_type(mat::Abstract<SystemName>Material)` function that returns the system type.
29+
- define the `calc_timestep_point(system::<SystemType>, params::AbstractPointParameters, point_id::Int)` function.
30+
- define the `calc_force_density!(chunk::AbstractBodyChunk{<:<SystemType>}, t, Δt)` function.

src/discretization/body.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ Construct a `Body` for a peridynamics simulation.
1212
- [`OSBMaterial`](@ref): Ordinary state-based peridynamics, also called linear
1313
peridynamic solid (LPS).
1414
- [`CMaterial`](@ref): Correspondence formulation.
15-
- [`CRMaterial`](@ref): Correspondence formulation stress rotation for objectivity
15+
- [`CRMaterial`](@ref): Correspondence formulation with stress rotation for objectivity
1616
enforcement.
17+
- [`RKCMaterial`](@ref): Reproducing kernel peridynamics with bond-associated
18+
higher-order integration.
19+
- [`RKCRMaterial`](@ref): Reproducing kernel peridynamics with bond-associated
20+
higher-order integration with stress rotation for objectivity enforcement.
1721
- [`BACMaterial`](@ref): Bond-associated correspondence formulation of Chen and Spencer.
1822
- [`CKIMaterial`](@ref): Continuum-kinematics-inspired peridynamics.
1923
- `position::AbstractMatrix`: A `3×n` matrix with the point position of the `n` points.

0 commit comments

Comments
 (0)