DualSupport
Module containing functions that manage dual numbers used in Jems.jl.
Jems.DualSupport.StarDiffCache — Type
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.
Jems.DualSupport.StarDiffCache — Method
function StarDiffCache(nvars::Int, ::Type{TNUMBER}) where {TNUMBER}Instantiates a StarDiffCache object of size nvars+1, and fills it with zeros.
Jems.DualSupport.CellDualData — Type
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).
Jems.DualSupport.CellDualData — Method
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
Base.convert — Method
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.
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.
Jems.DualSupport.update_cell_dual_data_value! — Method
function update_cell_dual_data_value!(cd::CellDualData, value)Updates all data of the CellDualData object to the given value.
Jems.DualSupport.FaceDualData — Type
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).
Jems.DualSupport.FaceDualData — Method
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.