fastiron/geometry/
mod.rs

1//! Mesh & modelling-related structures$
2//!
3//! This module contains code related to the mesh structure used to simulate the problem.
4//! This includes the mesh itself as well as objects used for navigating it. The
5//! characteristics of the mesh are defined as constants.
6//!
7//! The used mesh is made of cells (hexahedron), each divided in 12 sub-cells (tetrahedron).
8//! TODO: insert an image?
9
10//=================
11// Internal modules
12//=================
13
14pub mod facets;
15pub mod global_fcc_grid;
16pub mod grid_assignment_object;
17pub mod mc_cell_state;
18pub mod mc_domain;
19pub mod mc_location;
20pub mod mesh_partition;
21
22//===============
23// Mesh constants
24//===============
25
26use crate::constants::Tuple4;
27
28/// Number of points per tetrahedron facet.
29pub const N_POINTS_PER_FACET: usize = 3;
30/// Number of facets of a cell facing outward i.e. constituting
31/// a border with another cell.
32pub const N_FACETS_OUT: usize = 24;
33/// Number of points defining a cell.
34pub const N_POINTS_INTERSEC: usize = 14;
35/// Offsets of the intersection points of a cell.
36pub const CORNER_OFFSET: [Tuple4; N_POINTS_INTERSEC] = [
37    (0, 0, 0, 0),
38    (1, 0, 0, 0),
39    (0, 1, 0, 0),
40    (1, 1, 0, 0),
41    (0, 0, 1, 0),
42    (1, 0, 1, 0),
43    (0, 1, 1, 0),
44    (1, 1, 1, 0),
45    (1, 0, 0, 1),
46    (0, 0, 0, 1),
47    (0, 1, 0, 2),
48    (0, 0, 0, 2),
49    (0, 0, 1, 3),
50    (0, 0, 0, 3),
51];
52/// Number of faces defining a cell.
53pub const N_FACES: usize = 6;
54/// Offsets of the faces of a cell.
55pub const FACE_OFFSET: [(i32, i32, i32); N_FACES] = [
56    (1, 0, 0),
57    (-1, 0, 0),
58    (0, 1, 0),
59    (0, -1, 0),
60    (0, 0, 1),
61    (0, 0, -1),
62];