Utility
Collections
Thunderbolt.InterpolationCollection — Type
InterpolationCollectionA collection of compatible interpolations over some (possilby different) cells.
Thunderbolt.ScalarInterpolationCollection — Type
ScalarInterpolationCollectionA collection of compatible scalar-valued interpolations over some (possilby different) cells.
Thunderbolt.VectorInterpolationCollection — Type
VectorInterpolationCollectionA collection of compatible vector-valued interpolations over some (possilby different) cells.
Thunderbolt.VectorizedInterpolationCollection — Type
VectorizedInterpolationCollection{order} <: InterpolationCollectionA collection of fixed-order vectorized Lagrange interpolations across different cell types.
Thunderbolt.LagrangeCollection — Type
LagrangeCollection{order} <: InterpolationCollectionA collection of fixed-order Lagrange interpolations across different cell types.
Thunderbolt.QuadratureRuleCollection — Type
QuadratureRuleCollection(order::Int)A collection of quadrature rules across different cell types.
Missing docstring for getquadraturerule. Check Documenter's build log for details.
Thunderbolt.CellValueCollection — Type
CellValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)Helper to construct and query the correct cell values on mixed grids.
Thunderbolt.FacetValueCollection — Type
FacetValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)Helper to construct and query the correct facet values on mixed grids.
Iteration
Thunderbolt.QuadraturePoint — Type
QuadraturePoint{dim, T}A simple helper to carry quadrature point information.
Thunderbolt.QuadratureIterator — Type
QuadratureIterator(::QuadratureRule)
QuadratureIterator(::FacetQuadratureRule, local_facet_idx::Int)
QuadratureIterator(::CellValues)
QuadratureIterator(::FacetValues)A helper to loop over the quadrature points in some rule or cache with type QuadraturePoint.
IO
Thunderbolt.JLD2Writer — Type
Missing docstring for store_timestep_celldata!. Check Documenter's build log for details.
Missing docstring for store_timestep_field!. Check Documenter's build log for details.
Missing docstring for store_coefficient!. Check Documenter's build log for details.
Missing docstring for store_green_lagrange!. Check Documenter's build log for details.
Missing docstring for finalize_timestep!. Check Documenter's build log for details.
Transfer Operators
Thunderbolt.NodalIntergridInterpolation — Type
NodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim}, field_name_from::Symbol, field_name_to::Symbol; subdomain_from = 1:length(dh_from.subdofhandlers), subdomains_to = 1:length(dh_to.subdofhandlers))
NodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim}, field_name::Symbol; subdomain_from = 1:length(dh_from.subdofhandlers), subdomains_to = 1:length(dh_to.subdofhandlers))
NodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim}; subdomain_from = 1:length(dh_from.subdofhandlers), subdomains_to = 1:length(dh_to.subdofhandlers))Construct a transfer operator to move a field field_name from dof handler dh_from to another dof handler dh_to, assuming that all spatial coordinates of the dofs for dh_to are in the interior or boundary of the mesh contained within dh_from. This is necessary to have valid interpolation values, as this operator does not have extrapolation functionality.
Thunderbolt.transfer! — Function
This is basically a fancy matrix-vector product to transfer the solution from one problem to another one.Postprocessing
ECG
Thunderbolt.PoissonECGReconstructionCache — Type
PoissonECGReconstructionCache(fₑₚ::GenericSplitFunction, Ωₜ::AbstractMesh, κᵢ, κ, electrodes::AbstractVector{<:Vec}; ground, linear_solver, solution_vector_type, system_matrix_type)Sets up a cache for calculating $\varphi_\mathrm{e}$ by solving the Poisson problem
\[\nabla \cdot (\boldsymbol{\kappa}_{\mathrm{i}} + \boldsymbol{\kappa}_{\mathrm{e}}) \nabla \varphi_{\mathrm{e}}=-\nabla \cdot\left(\boldsymbol{\kappa}_{\mathrm{i}} \nabla \varphi_\mathrm{m}\right)\]
as for example proposed in [26] and investigated in [27] (as well as other studies). Here κₑ is the extracellular conductivity tensor and κᵢ is the intracellular conductivity tensor. The cache includes the assembled stiffness matrix with applied homogeneous Dirichlet boundary condition at the first vertex of the mesh. As the problem is solved for each timestep with only the right hand side changing.
Keyword Arguments
ground = Set([VertexIndex(1, 1)])linear_solver = LinearSolve.KrylovJL_CG()solution_vector_type = Vector{Float64}system_matrix_type = ThreadedSparseMatrixCSR{Float64,Int64}
Thunderbolt.Plonsey1964ECGGaussCache — Type
Plonsey1964ECGGaussCache(op::AbstractBilinearOperator, φₘ::AbstractVector)Here φₘ is the solution vector containing the transmembranepotential, op is the associated diffusion opeartor and κₜ is the torso's conductivity.
Returns a cache to compute the lead field with the form proposed in [28] with the Gauss theorem applied to it, as for example described in [27]. Calling evaluate_ecg with this method simply evaluates the following integral efficiently:
\[\varphi_e(x)=\frac{1}{4 \pi \kappa_t} \int_\Omega \frac{ \kappa_ ∇φₘ \cdot (\tilde{x}-x)}{||(\tilde{x}-x)||^3}\mathrm{d}\tilde{x}\]
The important simplifications taken are:
- Surrounding volume is an infinite, homogeneous sphere with isotropic conductivity
- The extracellular space and surrounding volume share the same isotropic, homogeneous conductivity tensor
Thunderbolt.Geselowitz1989ECGLeadCache — Type
Geselowitz1989ECGLeadCache(problem, torso_grid, κ, κᵢ, electrode_sets, [ground, linear_solver, solution_vector_type, system_matrix_type])Here the lead field, Z, is computed using the discretization of problem. The lead field is computed as the solution of
\[\nabla \cdot(\mathbf{\kappa} \nabla Z)=\left\{\begin{array}{cl} -1 & \text { at the positive electrode } \\ 1 & \text { at the negative electrode } \\ 0 & \text { else where } \end{array}\right.\]
Where $\kappa$ is the bulk conductivity tensor.
Returns a cache contain the lead fields that are used to compute the lead potentials as proposed in [29]. Calling reinit! with this method simply evaluates the following integral efficiently:
\[V(t)=\int \nabla Z(\boldsymbol{x}) \cdot \boldsymbol{\kappa}_\mathrm{i} \nabla \varphi_\mathrm{m} \,\mathrm{d}\boldsymbol{x}.\]
Thunderbolt.evaluate_ecg — Function
evaluate_ecg(method::Plonsey1964ECGGaussCache, x::Vec, κₜ::Real)Compute the pseudo ECG at a given point x by evaluating:
\[\varphi_e(x)=\frac{1}{4 \pi \kappa_t} \int_\Omega \frac{ \kappa_ ∇φₘ \cdot (\tilde{x}-x)}{||(\tilde{x}-x)||^3}\mathrm{d}\tilde{x}\]
For more information please read the docstring for Plonsey1964ECGGaussCache