Solution objects

Dense solution arrays

VoronoiFVM._addMethod
_add(U::VoronoiFVM.DenseSolutionArray, idof, val) -> Any

Add residual value into global degree of freedom

(Internal method)

source
VoronoiFVM._setMethod
_set(U::VoronoiFVM.DenseSolutionArray, idof, val) -> Any

Set residual value for global degree of freedom

(Internal method)

source

Sparse solution arrays

VoronoiFVM.SparseSolutionArrayType
mutable struct SparseSolutionArray{T, N, Ti} <: AbstractSolutionArray{T, N}

Struct holding solution information for SparseSystem. Solution is stored in a sparse matrix structure.

This class plays well with the abstract array interface.

Fields:

  • u::SparseArrays.SparseMatrixCSC{T, Ti} where {T, Ti}: Sparse matrix holding actual data.
  • history::Union{Nothing, NewtonSolverHistory}
source
VoronoiFVM.SparseSolutionArrayMethod
SparseSolutionArray(
    a::SparseArrays.SparseMatrixCSC{Tv, Ti}
) -> VoronoiFVM.SparseSolutionArray{_A, 2} where _A

SparseSolutionArray constructor

source
Base.copyMethod
copy(this)

Create a copy of sparse solution array

source
Base.similarMethod
similar(this)

Create a similar uninitialized sparse solution array

source
VoronoiFVM._addMethod
_add(U::VoronoiFVM.SparseSolutionArray, idof, val) -> Any

Add residual value into global degree of freedom

(internal)

source
VoronoiFVM._setMethod
_set(U::VoronoiFVM.SparseSolutionArray, idof, val) -> Any

Set residual value for global degree of freedom

(internal)

source
VoronoiFVM.dofMethod
dof(a, i, j)

Get number of degree of freedom. Return 0 if species is not defined in node.

source

Transient solution

VoronoiFVM.TransientSolutionType
mutable struct TransientSolution{T, N, A, B} <: VoronoiFVM.AbstractTransientSolution{T, N, A, B}

Transient solution structure

Fields

  • u::Any: Vector of solutions
  • t::Any: Vector of times
  • history::Union{VoronoiFVM.DiffEqHistory, TransientSolverHistory}: History

Interface

Object of this type adhere to the AbstractDiffEqArray interface. For indexing and interpolation, see https://diffeq.sciml.ai/stable/basics/solution/.

In particular, a TransientSolution sol can be accessed as follows:

  • sol[i] contains the solution for timestep i
  • sol[ispec,:,i] contains the solution for component ispec at timestep i
  • sol(t) returns a (linearly) interpolated solution value for t.
  • sol.t[i] is the corresponding time for timestep i
  • sol[ispec,ix,i] refers to solution of component ispec at node ix at moment i
source
VoronoiFVM.TransientSolutionMethod
TransientSolution(t0,inival;
                  in_memory=true,
                  keep_open=true,
                  fname=tempname(pwd())*".jld2"

Constructor of transient solution with initial value and initial time.

  • in_memory: if true (default), data are kept in main memory, otherwise on disk (via JLD2)
  • keep_open: if true, disk file is not closed during the existence of the object
  • fname: file name for the disk file
source
VoronoiFVM.VectorOfDiskArraysMethod
VectorOfDiskArrays(firstobj:AbstractArray;
                   keep_open=true,
                   fname= fname=tempname(pwd())*".jld2")

Constructor of vector of arrays stored on disk (via JLD2).

  • keep_open: if true, disk file is not closed during the existence of the object
  • fname: file name for the disk file

The disk file is automatically removed if the object is garbage collected.

source
Base.append!Function
append!(tsol::AbstractTransientSolution, t, sol)

Append time step solution sol as solution at time t to tsol. sol will be directly references in tsol. This method does not copy sol. If during a time steping process it is the same vector, a copy should appended.

Defined in VoronoiFVM.jl.

source