Utility

Collections

Missing docstring.

Missing docstring for getinterpolation. Check Documenter's build log for details.

Missing docstring.

Missing docstring for getquadraturerule. Check Documenter's build log for details.

Thunderbolt.CellValueCollectionType
CellValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)

Helper to construct and query the correct cell values on mixed grids.

source
Thunderbolt.FacetValueCollectionType
FacetValueCollection(::QuadratureRuleCollection, ::InterpolationCollection)

Helper to construct and query the correct face values on mixed grids.

source

Iteration

Thunderbolt.QuadratureIteratorType
QuadratureIterator(::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.

source

TODO TimeChoiceIterator https://github.com/termi-official/Thunderbolt.jl/issues/32

IO

Missing docstring.

Missing docstring for store_timestep!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for store_timestep_celldata!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for store_timestep_field!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for store_coefficient!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for store_green_lagrange!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for finalize_timestep!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for finalize!. Check Documenter's build log for details.

Transfer Operators

Thunderbolt.NodalIntergridInterpolationType
NodalIntergridInterpolation(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.

Note

We assume a continuous coordinate field, if the interpolation of the named field is continuous.

source
Thunderbolt.transfer!Function
This is basically a fancy matrix-vector product to transfer the solution from one problem to another one.
source

Postprocessing

ECG

Thunderbolt.PoissonECGReconstructionCacheType
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 [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}
source
Thunderbolt.Plonsey1964ECGGaussCacheType
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 [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:

  1. Surrounding volume is an infinite, homogeneous sphere with isotropic conductivity
  2. The extracellular space and surrounding volume share the same isotropic, homogeneous conductivity tensor
source
Thunderbolt.Geselowitz1989ECGLeadCacheType
Geselowitz1989ECGLeadCache(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}.\]

source
Thunderbolt.evaluate_ecgFunction
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

source