Finite element discretization
In SpinDoctor, the finite element mesh generation is performed using an external package called Tetgen in 3D [2], and Triangle in 2D [19]. Each finite element mesh consists of
a list of
nodes in three dimensions: ;a list of
tetrahedral elements ( indices referencing the nodes).
The list of nodes includes double nodes that are placed at the interfaces between compartments connected by permeable membranes. This allows for representing discontinuous magnetization fields
In SpinDoctor, the finite element space is the space of compartment-wise continuous piecewise linear functions on tetrahedral elements in three dimensions. This space has a set of basis functions whose number is exactly the number of finite element nodes (including double nodes), and that are defined on the entire domain
Let the finite element nodes be denoted by
Any function
where
To discretize the Bloch-Torrey and Laplace operators, we construct the following finite element matrices:
the latter being defined as the sum of interface integrals:
We remind the reader that
The weak form of the Bloch-Torrey PDE also requires computing the first order moments of the product of pairs of finite element basis functions. We let these three matrices be denoted by
where
In addition, we define the finite element relaxation matrix
In SpinDoctor, these matrices are assembled from local element matrices and the assembly process is based on vectorized routines from [20], which replace expensive loops over elements by operations with 3-dimensional arrays. All local element matrices in the assembly of
The matrices
With compartment-wise constant
Finite element solution to the Bloch-Torrey PDE
The solution to the Bloch-Torrey partial differential equation may be projected onto the finite element nodal basis
where
Finite element solution to the HADC model
Similarly, given an isolated compartment
where
where
The boundary integral
where
Finite element Matrix Formalism signal representation
Both of the above ODEs are of dimension
of which we will retain the
where the entries of the eigenvector
Then it is clear that the first order moments of the product of pairs of Laplace eigenfunctions can be written as:
These three matrices are computed using a total of six matrix-matrix multiplications. Similarly, the eigenfunction basis relaxation matrix \mathbf{T} may be obtained from the finite element nodal basis relaxation matrix \mathbf{R} by