Solution objects

Dense solution arrays

VoronoiFVM._addMethod
_add(U::Array{Tv, 2}, idof, val) -> Any

Add residual value into global degree of freedom

source

Sparse solution arrays

VoronoiFVM.SparseSolutionArrayType
struct SparseSolutionArray{Tv, Ti} <: AbstractArray{Tv, 2}

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

This class plays well with the abstract array interface.

Fields:

  • node_dof::SparseArrays.SparseMatrixCSC{Tv, Ti} where {Tv, Ti}: Sparse matrix holding actual data.
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

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::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