Utility
Collections
Thunderbolt.InterpolationCollection
— TypeInterpolationCollection
A collection of compatible interpolations over some (possilby different) cells.
Missing docstring for getinterpolation
. Check Documenter's build log for details.
Thunderbolt.ScalarInterpolationCollection
— TypeScalarInterpolationCollection
A collection of compatible scalar-valued interpolations over some (possilby different) cells.
Thunderbolt.VectorInterpolationCollection
— TypeVectorInterpolationCollection
A collection of compatible vector-valued interpolations over some (possilby different) cells.
Thunderbolt.VectorizedInterpolationCollection
— TypeVectorizedInterpolationCollection{order} <: InterpolationCollection
A collection of fixed-order vectorized Lagrange interpolations across different cell types.
Thunderbolt.LagrangeCollection
— TypeLagrangeCollection{order} <: InterpolationCollection
A collection of fixed-order Lagrange interpolations across different cell types.
Thunderbolt.QuadratureRuleCollection
— TypeQuadratureRuleCollection(order::Int)
A collection of quadrature rules across different cell types.
Missing docstring for getquadraturerule
. Check Documenter's build log for details.
Thunderbolt.CellValueCollection
— TypeCellValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)
Helper to construct and query the correct cell values on mixed grids.
Thunderbolt.FacetValueCollection
— TypeFacetValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)
Helper to construct and query the correct face values on mixed grids.
Iteration
Thunderbolt.QuadraturePoint
— TypeQuadraturePoint{dim, T}
A simple helper to carry quadrature point information.
Thunderbolt.QuadratureIterator
— TypeQuadratureIterator(::QuadratureRule)
QuadratureIterator(::FacetQuadratureRule, local_face_idx::Int)
QuadratureIterator(::CellValues)
QuadratureIterator(::FacetValues)
A helper to loop over the quadrature points in some rule or cache with type QuadraturePoint
.
TODO TimeChoiceIterator https://github.com/termi-official/Thunderbolt.jl/issues/32
IO
Thunderbolt.ParaViewWriter
— TypeThunderbolt.JLD2Writer
— TypeMissing docstring for store_timestep!
. Check Documenter's build log for details.
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.
Missing docstring for finalize!
. Check Documenter's build log for details.
Transfer Operators
Thunderbolt.NodalIntergridInterpolation
— TypeNodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim}, field_name_from::Symbol, field_name_to::Symbol)
NodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim}, field_name::Symbol)
NodalIntergridInterpolation(dh_from::DofHandler{sdim}, dh_to::DofHandler{sdim})
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.
We assume a continuous coordinate field, if the interpolation of the named field is continuous.
Thunderbolt.transfer!
— FunctionThis is basically a fancy matrix-vector product to transfer the solution from one problem to another one.
Postprocessing
ECG
Thunderbolt.PoissonECGReconstructionCache
— TypePoissonECGReconstructionCache(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 [23] and investigated in [24] (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
— TypePlonsey1964ECGGaussCache(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 [25] with the Gauss theorem applied to it, as for example described in [24]. 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
— TypeGeselowitz1989ECGLeadCache(problem, κ, κᵢ, electordes, electrode_pairs, [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 [26]. 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
— Functionevaluate_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