1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Mesh & modelling-related structures$
//!
//! This module contains code related to the mesh structure used to simulate the problem.
//! This includes the mesh itself as well as objects used for navigating it. The
//! characteristics of the mesh are defined as constants.
//!
//! The used mesh is made of cells (hexahedron), each divided in 12 sub-cells (tetrahedron).
//! TODO: insert an image?

//=================
// Internal modules
//=================

pub mod facets;
pub mod global_fcc_grid;
pub mod grid_assignment_object;
pub mod mc_cell_state;
pub mod mc_domain;
pub mod mc_location;
pub mod mesh_partition;

//===============
// Mesh constants
//===============

use crate::constants::Tuple4;

/// Number of points per tetrahedron facet.
pub const N_POINTS_PER_FACET: usize = 3;
/// Number of facets of a cell facing outward i.e. constituting
/// a border with another cell.
pub const N_FACETS_OUT: usize = 24;
/// Number of points defining a cell.
pub const N_POINTS_INTERSEC: usize = 14;
/// Offsets of the intersection points of a cell.
pub const CORNER_OFFSET: [Tuple4; N_POINTS_INTERSEC] = [
    (0, 0, 0, 0),
    (1, 0, 0, 0),
    (0, 1, 0, 0),
    (1, 1, 0, 0),
    (0, 0, 1, 0),
    (1, 0, 1, 0),
    (0, 1, 1, 0),
    (1, 1, 1, 0),
    (1, 0, 0, 1),
    (0, 0, 0, 1),
    (0, 1, 0, 2),
    (0, 0, 0, 2),
    (0, 0, 1, 3),
    (0, 0, 0, 3),
];
/// Number of faces defining a cell.
pub const N_FACES: usize = 6;
/// Offsets of the faces of a cell.
pub const FACE_OFFSET: [(i32, i32, i32); N_FACES] = [
    (1, 0, 0),
    (-1, 0, 0),
    (0, 1, 0),
    (0, -1, 0),
    (0, 0, 1),
    (0, 0, -1),
];