API Reference

The API reference is organized into several categories:

  • Core Types — The main cache types (ConductivityEvaluatorCache, FIMCache).
  • Solver — The main solver entry point.
  • Active List Management — Functions for managing the active list.
  • Utilities — Helper functions for conductivity evaluation and caches reinitialization.

Core Types

FastIterativeMethod.ConductivityEvaluatorCacheType
ConductivityEvaluatorCache{CC, T, QPT, ConductivityT}

A cache wrapper that stores conductivity information and evaluation points.

Fields

  • cell_cache::CC — Optional cell cache for backend-specific implementations (e.g., Ferrite).
  • quadtrature_points::QPT — Vector of 7 reference evaluation points used internally.
  • conductivity::ConductivityT — Conductivity value or callable; designed to be extended by other packages/extensions.

Notes

The package provides a default implementation where cell_cache = Nothing and conductivity is a constant scalar. Other implementations can extend the evaluate, reinit!, and change_conductivity! functions for custom backends.

See also FIMCache, evaluate.

FastIterativeMethod.FIMCacheType
FIMCache{T, CECT, ACT, V2CT}

The main cache structure for the Fast Iterative Method solver. Holds mesh topology, field values, and state required to run solve!.

Fields

  • vertices::Vector{Vec{3, T}} — 3D vertex coordinates.
  • cells::Vector{NTuple{4, Int}} — Cell connectivity (each cell contains 4 vertex indices).
  • vertex_to_cell::V2CT — Mapping from vertex index to cell indices containing that vertex.
  • active_list::ACT — Active list of vertices to be updated (see init_active_list).
  • Φ::Vector{T} — Field values (typically arrival times) at each vertex; updated in-place by solve!.
  • can_reset::BitVector — Flag per vertex indicating whether Φ can be reset to Inf during initialization.
  • conductivity_evaluator_cache::CECTConductivityEvaluatorCache managing conductivity evaluation.

Notes

Construct a FIMCache by specifying all fields. The package does not provide a high-level constructor because mesh setup varies by backend. See the documentation for usage examples.

See also solve!, reset!, ConductivityEvaluatorCache.

FastIterativeMethod.UniqueVectorType
UniqueVector{VT}

An active list implementation using a vector to store active vertex indices and a BitVector to track visited status. This provides ordered iteration over active vertices uniquely.

Fields

  • data::VT — Vector storing active vertex indices.
  • isvisited::BitVector — Tracks which vertices have been added to active list.

See also init_active_list, BitVector.


Solver

FastIterativeMethod.solve!Function
solve!(fim_cache::FIMCache, vertex_set=Set(eachindex(fim_cache.vertices)); ϵ=1e-6)

Run the Fast Iterative Method solver on the given cache. Updates fim_cache.Φ in-place.

Arguments

  • fim_cache::FIMCache — The FIM cache containing mesh, field, and solver state.
  • vertex_set — Optional set of vertex indices to solve for (defaults to all vertices).
  • ϵ — Convergence tolerance (default: 1e-6).

Notes

The solver modifies fim_cache.Φ and fim_cache.active_list in-place. Use reset! to reinitialize the cache before solving.

See also FIMCache, reset!.

FastIterativeMethod.reset!Function
reset!(fim_cache::FIMCache)

Reset the FIM cache by reinitializing the active list and setting Φ values to Inf for vertices that can be reset.

See also FIMCache, solve!.


Active List Management


Utilities

FastIterativeMethod.create_custom_quadrature_pointsFunction
create_custom_quadrature_points(indices)

Generate 7 custom evaluation points on a reference tetrahedron based on vertex index permutation.

Arguments

  • indices — Vector/tuple of 4 vertex indices used to permute the reference coordinates.

Returns

A static vector of 7 Vec{3,Float64} evaluation points.

Notes

This function is used internally during FIM solve operations to compute conductivity-weighted distances. The 7 points include edge midpoints, face centroids, and the element centroid.

See also ConductivityEvaluatorCache, reinit!.

FastIterativeMethod.change_conductivity!Function
change_conductivity!(conductivity_cache::ConductivityEvaluatorCache, val)

Update the conductivity value in the cache. Designed to be overridden by backend-specific implementations (e.g., for Ferrite or Thunderbolt).

Notes

The default implementation raises an error for non-Nothing cell caches. Backends should override this function to handle conductivity updates appropriately.

See also ConductivityEvaluatorCache, evaluate.

FastIterativeMethod.reinit!Function
reinit!(conductivity_cache::ConductivityEvaluatorCache, cell_id::Int) -> ConductivityEvaluatorCache

Reinitialize the conductivity cache for a specific cell. Designed to be overridden by backend-specific implementations.

Notes

The default implementation for ConductivityEvaluatorCache{Nothing} is a no-op. Other backends should override this function to update internal cell-specific state.

See also ConductivityEvaluatorCache, evaluate.

reinit!(conductivity_cache::ConductivityEvaluatorCache{Nothing}, cell_id::Int)

No-op reinitialize for the default constant-conductivity cache.

reinit!(fim_cache::FIMCache, cell_id::Int, active_vertex::Int) -> SVector{4, Int}

Reinitialize FIM cache state for a given cell and active vertex. Returns the reordered vertex indices with the active vertex first.

Notes

This function updates the evqluation points and conductivity cache for the cell, and reorders vertices so the active vertex is at index 1.

See also FIMCache, solve!.