DualSupport

Module containing functions that manage dual numbers used in Jems.jl.

Jems.DualSupport.StarDiffCacheType
struct StarDiffCache{SIZE, TNUMBER}

Definition of StarDiffCache, a cache that makes room to store partial derivatives. Parametric in types SIZE, the size of the array, and TNUMBER, the type of the number used for calculations.

source
Jems.DualSupport.StarDiffCacheMethod
function StarDiffCache(nvars::Int, ::Type{TNUMBER}) where {TNUMBER}

Instantiates a StarDiffCache object of size nvars+1, and fills it with zeros.

source
Jems.DualSupport.CellDualDataType
struct CellDualData{NVARSP1, THREENVARSP1, TNUMBER}

Definition of CellDualData, that holds the information needed to construct partial derivatives wrt its own properties as well as its neighbors. Parametric in types NVARSP1, the number of independent variables plus one, THREENVARSP1, three times the number of independe variables plus one, and TNUMBER, the type of the number used for the calculations (usually floats, but can be duals themselves).

source
Jems.DualSupport.CellDualDataMethod
function CellDualData(nvars::Int, ::Type{TNUMBER}; is_ind_var=false, ind_var_i=0)

Instantiates an object of type CellDualData, that holds the information needed to construct partial derivatives wrt its own properties as well as its neighbors. Use is_ind_var=True and ind_var_i=i to instantiate a CellDualData of a base independent variable, with ones assigned in the appropriate spots

source
Base.convertMethod
function Base.convert(::Type{CellDualData{SIZE1, SIZE2, TN1}}, x::TN2) where {SIZE1, SIZE2, TN1<:Number, TN2<:Number}

Convert x of type TN2 to a CellDualData object of types SIZE1, SIZE2 and TN1.

source
Base.zeroMethod
function Base.zero(::Type{CellDualData{SIZE1,SIZE2,TNUMBER}}) where {SIZE1, SIZE2, TNUMBER}

Instantiates a CellDualData with zero entries (the neutral element for duals).

source
Jems.DualSupport.update_cell_dual_data!Method
function update_cell_dual_data!(cd::CellDualData{SIZE1, SIZE2, TNUMBER}, dual::TDSC) where {SIZE1, SIZE2, TNUMBER, TDSC}

Updates all data of the CellDualData object to the data of a given dual number.

source
Jems.DualSupport.FaceDualDataType
struct FaceDualData{TWONVARSP1, THREENVARSP1, TNUMBER}

Definition of FaceDualData, that holds the information needed to construct partial derivatives wrt its own properties (the face) as well as its neighbors. Parametric in types TWONVARSP1, two times the number of independent variables plus one, THREENVARSP1, three times the number of independe variables plus one, and TNUMBER, the type of the number used for the calculations (usually floats, but can be duals themselves).

source
Jems.DualSupport.FaceDualDataMethod
function CellDualData(nvars::Int, ::Type{TNUMBER}; is_ind_var=false, ind_var_i=0)

Instantiates an object of type FaceDualData, that holds the information needed to construct partial derivatives wrt its own properties as well as its neighbors.

source