diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json
index 0b8a38e8..63e771ea 100644
--- a/dev/.documenter-siteinfo.json
+++ b/dev/.documenter-siteinfo.json
@@ -1 +1 @@
-{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2023-10-23T00:10:39","documenter_version":"1.1.1"}}
\ No newline at end of file
+{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2023-10-24T21:18:10","documenter_version":"1.1.2"}}
\ No newline at end of file
diff --git a/dev/api/diagnostics/index.html b/dev/api/diagnostics/index.html
index 050a88c3..ec65c721 100644
--- a/dev/api/diagnostics/index.html
+++ b/dev/api/diagnostics/index.html
@@ -1,2 +1,2 @@
-
Computes active layer thickness annually. The active layer thickness is defined here as the maximum thaw depth throughout the calendar year. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Integrates the quantity X over the given grid, which is assumed to be spatially alligned, i.e. length(grid) == length(dims(X,Z)) + 1 and cells(grid) .≈ dims(X,Z) are necessary preconditions.
Computes depth of permafrost base for all years, i.e. the closest depth to the "bottom" at which the maximum annual temperature is strictly < 0°C. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Computes depth of permafrost table for all years, i.e. the closest depth to the surface at which the maximum annual temperature is strictly less than Tmelt. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Implements a simple, iterative spin-up procedure. Runs the model specified by setup over tspan until the profile mean up to maxdepth over the whole time span changes only within the given tolerance tol. Returns the ODESolution generated by the final iteration.
Computes sub-grid thaw depth (a.k.a freezing front) from temperature at all time steps. The sub-grid depth of the zero degree isotherm is determined by linearly interpolating between grid cell temperatures in T. Note that T is assumed to have units °C and dimensions Ti (time) and Z (depth) in any order.
Computes annual depth of zero amplitude (where |max - min| < threshold) and returns the result for each year. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Computes active layer thickness annually. The active layer thickness is defined here as the maximum thaw depth throughout the calendar year. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Integrates the quantity X over the given grid, which is assumed to be spatially alligned, i.e. length(grid) == length(dims(X,Z)) + 1 and cells(grid) .≈ dims(X,Z) are necessary preconditions.
Computes depth of permafrost base for all years, i.e. the closest depth to the "bottom" at which the maximum annual temperature is strictly < 0°C. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Computes depth of permafrost table for all years, i.e. the closest depth to the surface at which the maximum annual temperature is strictly less than Tmelt. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Implements a simple, iterative spin-up procedure. Runs the model specified by setup over tspan until the profile mean up to maxdepth over the whole time span changes only within the given tolerance tol. Returns the ODESolution generated by the final iteration.
Computes sub-grid thaw depth (a.k.a freezing front) from temperature at all time steps. The sub-grid depth of the zero degree isotherm is determined by linearly interpolating between grid cell temperatures in T. Note that T is assumed to have units °C and dimensions Ti (time) and Z (depth) in any order.
Computes annual depth of zero amplitude (where |max - min| < threshold) and returns the result for each year. Assumes T to have dimensions Ti (time) and Z (depth) in any order.
Helper type that stores the raw output from a CryoGrid run along with DimArray views of all logged variables. CryoGridOutput overrides Base.getproperty to allow for direct dot-syntax access of state variables. For example, if your model has a grid variable named T, out.T returns a DimArray with indexed time and depth axes. For OrdinaryDiffEq.jl outputs, the ODESolution can be accessed via out.sol, or for convenience, the continuous solution at time t can be computed via out(t) which is equivalent to withaxes(out.sol(t)).
Wraps a ModelParameters.Model parameter handler for CryoGrid types. It is recommended not to use this type directly in math or linear algebra operations but rather to use Base.values to obtain a normal array of parameter values.
Constructs a modelParameters.Model wrapped with CryoGridParams from obj. If full_metadata is true, additonal fields for nested Parameterization types will be added.
Helper type that stores the raw output from a CryoGrid run along with DimArray views of all logged variables. CryoGridOutput overrides Base.getproperty to allow for direct dot-syntax access of state variables. For example, if your model has a grid variable named T, out.T returns a DimArray with indexed time and depth axes. For OrdinaryDiffEq.jl outputs, the ODESolution can be accessed via out.sol, or for convenience, the continuous solution at time t can be computed via out(t) which is equivalent to withaxes(out.sol(t)).
Wraps a ModelParameters.Model parameter handler for CryoGrid types. It is recommended not to use this type directly in math or linear algebra operations but rather to use Base.values to obtain a normal array of parameter values.
Constructs a modelParameters.Model wrapped with CryoGridParams from obj. If full_metadata is true, additonal fields for nested Parameterization types will be added.
Loads forcing data from the given file according to the format specified by format. By default, the forcing format is automatically detected via detectformat. Returns a Forcings struct containing all forcing data and metadata
Loads forcing data from the given file according to the format specified by format. By default, the forcing format is automatically detected via detectformat. Returns a Forcings struct containing all forcing data and metadata
This module contains a wide range of numerical utilities including math and discretization routines, state variable array caches, and helper types for supporting automatic differentiation.
Represents the 1D spatial discretization on which time integration is performed. S is a GridOffset, either Edges or Cells (always edges upon initial construction). The grid representation can be converted (allocation free) between grid edges and cells via the cells and edges methods. G represents the geometry/volume on which the vertical 1D discretization is applied. A is the underlying array type, and Q is the numerical type (e.g. Float64 or a Unitful.Quantity).
Generic container for holding discretized state arrays from symbolic variables (Var types). The uproto field represetns a "prototype" of the prognostic state array which should fully define the state of the system at any given point.
StateVars(vars::NamedTuple, D::Numerics.AbstractDiscretization, cachector::Function, arrayproto::Type{A}=Vector) where {A<:AbstractVector}
Constructs a StateVars container from vars and the given discretization D. The function cachector must accept argments f(name::Symbol, x::AbstractVector) where name is the name of the state variable and x is the array generated by the discretization.
Calculates the first-order, non-linear spatial flux over a discretized variable x with conductivity k. x is assumed to have shape (N,), Δx shape (N-1,), and j and k shape (N+1,) such that j[2:end-1] represents the fluxes over the inner grid cell faces. Fluxes are added to existing values in j.
Constructs a Grid spanning bounds using the given strategy. makegrid can also be specified for specific Layer types when layers have specific discretization requirements.
Fast alternative to flux! and divergence! which computes fluxes and divergences (via _flux_kernel and _div_kernel) in a single pass. Note, however, that loop vectorization with @turbo is not possible because of necessary loop-carried dependencies. Fluxes and divergences are added to the existing values stored in j and dx.
Takes a function y = f(x) and vector-valued argument x and returns a tuple: (y, ∇ₓy). The gradient is calculated using forward-mode automatic differentiation.
This module contains a wide range of numerical utilities including math and discretization routines, state variable array caches, and helper types for supporting automatic differentiation.
Represents the 1D spatial discretization on which time integration is performed. S is a GridOffset, either Edges or Cells (always edges upon initial construction). The grid representation can be converted (allocation free) between grid edges and cells via the cells and edges methods. G represents the geometry/volume on which the vertical 1D discretization is applied. A is the underlying array type, and Q is the numerical type (e.g. Float64 or a Unitful.Quantity).
Generic container for holding discretized state arrays from symbolic variables (Var types). The uproto field represetns a "prototype" of the prognostic state array which should fully define the state of the system at any given point.
StateVars(vars::NamedTuple, D::Numerics.AbstractDiscretization, cachector::Function, arrayproto::Type{A}=Vector) where {A<:AbstractVector}
Constructs a StateVars container from vars and the given discretization D. The function cachector must accept argments f(name::Symbol, x::AbstractVector) where name is the name of the state variable and x is the array generated by the discretization.
Calculates the first-order, non-linear spatial flux over a discretized variable x with conductivity k. x is assumed to have shape (N,), Δx shape (N-1,), and j and k shape (N+1,) such that j[2:end-1] represents the fluxes over the inner grid cell faces. Fluxes are added to existing values in j.
Constructs a Grid spanning bounds using the given strategy. makegrid can also be specified for specific Layer types when layers have specific discretization requirements.
Fast alternative to flux! and divergence! which computes fluxes and divergences (via _flux_kernel and _div_kernel) in a single pass. Note, however, that loop vectorization with @turbo is not possible because of necessary loop-carried dependencies. Fluxes and divergences are added to the existing values stored in j and dx.
Takes a function y = f(x) and vector-valued argument x and returns a tuple: (y, ∇ₓy). The gradient is calculated using forward-mode automatic differentiation.
Represents the simple two-phase Stefan problem defined on a semi-infinite slab. The one-phase Stefan problem can be computed by setting the parameters T_s = T_m.
Material thermal properties, e.g. conductivity and heat capacity. By default, this includes the thermal properties of water, ice, and air. This can be extended by passing additional properties into the constructor.
Implementation of "free water" freezing characteristic for any subsurface layer. Assumes that state contains at least temperature (T), enthalpy (H), heat capacity (C), total water content (θwi), and liquid water content (θw).
Calculates freezing and thawing effects, including evaluation of the freeze curve. In general, this function should compute at least the liquid/frozen water contents and the corresponding heat capacity. Other variables such as temperature or enthalpy may also need to be computed depending on the thermal scheme being implemented.
Analytical solution to linear form of the heat equation on a semi-infinite rod with periodic fluctuations at the upper boundary. Solution taken from Riseborough et al. 2008.
Represents the simple two-phase Stefan problem defined on a semi-infinite slab. The one-phase Stefan problem can be computed by setting the parameters T_s = T_m.
Material thermal properties, e.g. conductivity and heat capacity. By default, this includes the thermal properties of water, ice, and air. This can be extended by passing additional properties into the constructor.
Implementation of "free water" freezing characteristic for any subsurface layer. Assumes that state contains at least temperature (T), enthalpy (H), heat capacity (C), total water content (θwi), and liquid water content (θw).
Calculates freezing and thawing effects, including evaluation of the freeze curve. In general, this function should compute at least the liquid/frozen water contents and the corresponding heat capacity. Other variables such as temperature or enthalpy may also need to be computed depending on the thermal scheme being implemented.
Analytical solution to linear form of the heat equation on a semi-infinite rod with periodic fluctuations at the upper boundary. Solution taken from Riseborough et al. 2008.
Simple, piecewise constant initializer for saturation state that takes a surface-level saturation sat0 and water table depth z_tab and produces a two-segment, piecewise constant profile with the saturation level set to (sat0 + 1.0) / 2 from the halfway point down to the water table.
Simple, piecewise constant initializer for saturation state that takes a surface-level saturation sat0 and water table depth z_tab and produces a two-segment, piecewise constant profile with the saturation level set to (sat0 + 1.0) / 2 from the halfway point down to the water table.
Retrieves the density of water ρw from the given SubSurface layer. Default implementation assumes that WaterBalance is provided as a field water on sub; this can of course, however, be overridden.
Retrieves the density of water ρw from the given SubSurface layer. Default implementation assumes that WaterBalance is provided as a field water on sub; this can of course, however, be overridden.
The SurfaceWaterBalance represents the closure of the water balance at the surface and acts as both a Neumann-type upper boundary condition for snow and water fluxes as well as an accountant for the water mass balance at the surface.
The SurfaceWaterBalance represents the closure of the water balance at the surface and acts as both a Neumann-type upper boundary condition for snow and water fluxes as well as an accountant for the water mass balance at the surface.
Represents a simple organic/mineral soil mixutre in terms of its characteristic fractions: i.e. natural porosity, saturation, and organic solid fraction. This is the standard CryoGrid representation of a discrete soil volume.
Represents a simple organic/mineral soil mixutre in terms of its characteristic fractions: i.e. natural porosity, saturation, and organic solid fraction. This is the standard CryoGrid representation of a discrete soil volume.
SoilHeatTile([heatop=:H], upperbc::BoundaryProcess, soilprofile::Profile, init::VarInitializer; grid::Grid=DefaultGrid_10cm, freezecurve::F=FreeWater(), tile_kwargs...) where {F<:FreezeCurve}
Builds a simple one-layer soil/heat-conduction model with the given grid and configuration. Uses the "free water" freeze curve by default, but this can be changed via the freezecurve parameter. For example, to use the Dall'Amico freeze curve, set freezecurve=SFCC(DallAmico()).
SoilHeatTile([heatop=:H], upperbc::BoundaryProcess, soilprofile::Profile, init::VarInitializer; grid::Grid=DefaultGrid_10cm, freezecurve::F=FreeWater(), tile_kwargs...) where {F<:FreezeCurve}
Builds a simple one-layer soil/heat-conduction model with the given grid and configuration. Uses the "free water" freeze curve by default, but this can be changed via the freezecurve parameter. For example, to use the Dall'Amico freeze curve, set freezecurve=SFCC(DallAmico()).
Constructs an EnsembleProblem from the given ensemble setup for a m x N parameter matrix Θ, where N is the size of the ensemble and m is the dimensionality of the ensmeble state space (e.g. the number of parameters). param_map must be a ParameterMapping with a transform function that accepts an m-dimensional vector and produces a parameter vector (or CryoGridParams instance) which matches the output of CryoGrid.parameters. By default, param_map is the identity function; however, it may be customized to permit the construction of reduced-rank or reparameterized ensembles for which the parameter space differs from the full CryoGrid model parameter space.
Keyword arguments:
output_func: a function (sol,i)::Any which processes the ODESolution for ensemble member i and returns the result. It is recommended to save output to disk for non-trivial time spans to avoid slowdowns from serialization time when running the ensemble using parallel workers.
reduction: a function (u,data,i) which accumulates the result of output_func in u. Defaults to just appending data to u.
output_dir: Only used to specify the output directory for the default implementation of output_func. If a custom output_func is provided, this arugment is ignored.
All additional keyword arguments will be passed to EnsembleProblem.
This document was generated with Documenter.jl version 1.1.1 on Monday 23 October 2023. Using Julia version 1.6.7.
+)
Constructs an EnsembleProblem from the given ensemble setup for a m x N parameter matrix Θ, where N is the size of the ensemble and m is the dimensionality of the ensmeble state space (e.g. the number of parameters). param_map must be a ParameterMapping with a transform function that accepts an m-dimensional vector and produces a parameter vector (or CryoGridParams instance) which matches the output of CryoGrid.parameters. By default, param_map is the identity function; however, it may be customized to permit the construction of reduced-rank or reparameterized ensembles for which the parameter space differs from the full CryoGrid model parameter space.
Keyword arguments:
output_func: a function (sol,i)::Any which processes the ODESolution for ensemble member i and returns the result. It is recommended to save output to disk for non-trivial time spans to avoid slowdowns from serialization time when running the ensemble using parallel workers.
reduction: a function (u,data,i) which accumulates the result of output_func in u. Defaults to just appending data to u.
output_dir: Only used to specify the output directory for the default implementation of output_func. If a custom output_func is provided, this arugment is ignored.
All additional keyword arguments will be passed to EnsembleProblem.
Constructs a Tile from the given stratigraphy and discretization strategy. arraytype keyword arg should be an array instance (of any arbitrary length, including zero, contents are ignored) that will determine the array type used for all state vectors.
This document was generated with Documenter.jl version 1.1.1 on Monday 23 October 2023. Using Julia version 1.6.7.
+)
Constructs a Tile from the given stratigraphy and discretization strategy. arraytype keyword arg should be an array instance (of any arbitrary length, including zero, contents are ignored) that will determine the array type used for all state vectors.
Trait that specifies the kind of boundary condition. This can be used to write generic implementations of interact! that are (relatively) agnostic to specific implementations of BoundaryProcess. A good example of this can be found in the boundaryflux method interface.
Abstract base type for boundary processes, i.e. processes that operate at the boundaries of the subsurface. A BoundaryProcess represents the boundary conditions of one or more SubSurfaceProcesses but may include its own diagnostic (or even prognostic) variables, if necessary.
Simple, lightweight implementation of the forward Euler integration algorithm. Does not include support for fancier features such as interpolation, adaptive timestepping, or event handling. In order to get these features, you must install the OrdinaryDiffEq package.
Coupled2{P1,P2} = CoupledProcesses{Tuple{T1,T2}} where {T1,T2}
Type alias for coupled processes, i.e. CoupledProcesses{Tuple{P1,P2}}. Coupled provides a simple mechanism for defining new behaviors on multi-processes systems.
Trait that specifies the kind of boundary condition. This can be used to write generic implementations of interact! that are (relatively) agnostic to specific implementations of BoundaryProcess. A good example of this can be found in the boundaryflux method interface.
Abstract base type for boundary processes, i.e. processes that operate at the boundaries of the subsurface. A BoundaryProcess represents the boundary conditions of one or more SubSurfaceProcesses but may include its own diagnostic (or even prognostic) variables, if necessary.
Simple, lightweight implementation of the forward Euler integration algorithm. Does not include support for fancier features such as interpolation, adaptive timestepping, or event handling. In order to get these features, you must install the OrdinaryDiffEq package.
Coupled2{P1,P2} = CoupledProcesses{Tuple{T1,T2}} where {T1,T2}
Type alias for coupled processes, i.e. CoupledProcesses{Tuple{P1,P2}}. Coupled provides a simple mechanism for defining new behaviors on multi-processes systems.
Trait for layer types that determines whether its spatial volume is temporally invariant, FixedVolume, or varying with time, DiagnosticVolume or PrognosticVolume.
Computes the flux dH/dt at the boundary layer. Calls boundaryflux(BCKind(B),...) to allow for generic implementations by boundary condition type. Note that this method uses a different argument order convention than interact!. This is intended to faciliate stratigraphy independent implementations of certain boundary conditions (e.g. a simple Dirichlet boundary could be applied in the same manner to both the upper and lower boundary).
Computes the value of the boundary condition specified by bc for the given layer/process combinations. Note that this method uses a different argument order convention than interact!. This is intended to faciliate stratigraphy independent implementations of certain boundary conditions (e.g. a simple Dirichlet boundary could be applied in the same manner to both the upper and lower boundary).
Returns true if and only if the given layer/process types are able to interact based on the current state. Defaults to checking whether both layers are currently active. This behavior should be overridden by subtypes where necessary.
Calculates all internal fluxes for a given layer. Note that an instance of computefluxes! must be provided for all non-boundary (subsurface) processes/layers.
Event criterion/condition. Should return a Bool for discrete events. For continuous events, this should be a real-valued function where the event is fired at the zeros/roots.
Optionally performs discontinuous/discrete-time updates to the layer state. Should return true if the prognostic state was modified and false otherwise. Defaults to returning false.
Trait for layer types that determines whether its spatial volume is temporally invariant, FixedVolume, or varying with time, DiagnosticVolume or PrognosticVolume.
Computes the flux dH/dt at the boundary layer. Calls boundaryflux(BCKind(B),...) to allow for generic implementations by boundary condition type. Note that this method uses a different argument order convention than interact!. This is intended to faciliate stratigraphy independent implementations of certain boundary conditions (e.g. a simple Dirichlet boundary could be applied in the same manner to both the upper and lower boundary).
Computes the value of the boundary condition specified by bc for the given layer/process combinations. Note that this method uses a different argument order convention than interact!. This is intended to faciliate stratigraphy independent implementations of certain boundary conditions (e.g. a simple Dirichlet boundary could be applied in the same manner to both the upper and lower boundary).
Returns true if and only if the given layer/process types are able to interact based on the current state. Defaults to checking whether both layers are currently active. This behavior should be overridden by subtypes where necessary.
Calculates all internal fluxes for a given layer. Note that an instance of computefluxes! must be provided for all non-boundary (subsurface) processes/layers.
Event criterion/condition. Should return a Bool for discrete events. For continuous events, this should be a real-valued function where the event is fired at the zeros/roots.
Optionally performs discontinuous/discrete-time updates to the layer state. Should return true if the prognostic state was modified and false otherwise. Defaults to returning false.
Defines the initial condition for a given Layer and possibly an initializer. initialcondition! should compute initial values into all relevant state variables in state.
Defines the initial condition for two processes on adjacent layers. initialcondition! should write initial values into all relevant state variables in state.
Defines the initial condition for a given Layer and possibly an initializer. initialcondition! should compute initial values into all relevant state variables in state.
Defines the initial condition for two processes on adjacent layers. initialcondition! should write initial values into all relevant state variables in state.
Defines a boundary interaction between two processes on adjacent layers. For any interaction, the order of the arguments follows decreasing depth, i.e. the first layer/process is always on top of the second layer/process. This ordering matters and separate dispatches must be provided for interactions in reverse order.
Returns a boolean whether or not this layer is currently active in the stratigraphy and should interact with other layers. Note that computediagnostic! and computefluxes! are always invoked regardless of the current state of isactive. The default implementation of isactive always returns true.
Fetches the process(es) attached to this layer, if any. Returned value must be of type Process. If the layer has more than one process, they should be combined together with Coupled(procs...).
Retrieves the recommended timestep for the given Process defined on the given Layer. The default implementation returns Inf which indicates no timestep restriction. The actual chosen timestep will depend on the integrator being used and other user configuration options.
Defines a boundary interaction between two processes on adjacent layers. For any interaction, the order of the arguments follows decreasing depth, i.e. the first layer/process is always on top of the second layer/process. This ordering matters and separate dispatches must be provided for interactions in reverse order.
Returns a boolean whether or not this layer is currently active in the stratigraphy and should interact with other layers. Note that computediagnostic! and computefluxes! are always invoked regardless of the current state of isactive. The default implementation of isactive always returns true.
Fetches the process(es) attached to this layer, if any. Returned value must be of type Process. If the layer has more than one process, they should be combined together with Coupled(procs...).
Retrieves the recommended timestep for the given Process defined on the given Layer. The default implementation returns Inf which indicates no timestep restriction. The actual chosen timestep will depend on the integrator being used and other user configuration options.
Get the volumetric fractions of each constituent in the volume (at grid cell i, if specificed). All implementations of volumetricfractions are expected to obey a semi-consistent order in the returned Tuple of fractions; the first three consituents should always be θw,θi,θa, i.e. water, ice, and air, followed by any number of additional constituents which may be defined by the specific layer. There is no feasible way to verify that client code actually obeys this ordering, so be sure to double check your implementation, otherwise this can cause very subtle bugs!
Get the volumetric fractions of each constituent in the volume (at grid cell i, if specificed). All implementations of volumetricfractions are expected to obey a semi-consistent order in the returned Tuple of fractions; the first three consituents should always be θw,θi,θa, i.e. water, ice, and air, followed by any number of additional constituents which may be defined by the specific layer. There is no feasible way to verify that client code actually obeys this ordering, so be sure to double check your implementation, otherwise this can cause very subtle bugs!
This module provides miscellaneous utility methods and types that are used throughout the CryoGrid.jl codebase. Note that the Utils module is not exported by the top-level CryoGrid module. It may, however, be explicitly imported by the user via using CryoGrid.Utils or import CryoGrid.Utils when needed.
Base type for container types that hold a NamedTuple of arbitrary field values. NamedTupleWrapper provides dispatches for getproperty and propertynames that forward property name queries to the NamedTuple container. Subtypes are by default assumed to have a field named values that corresponds to the NamedTuple container, but this can be overriden by providing a dispatch for Base.values.
Same as map for NTuples but with guaranteed type stability. fastmap is a @generated function which unrolls calls to f into a loop-free tuple construction expression.
Helper method for generalizing between arrays and scalars. Without an index, retrieves the first element of x if x is an array, otherwise simply returning x. If an index i, is specified, returns the ith value of x if x is an array, or x otherwise. Note that this method is not strictly necessary since Julia allows for scalar quantities to be accessed at the first index like an array; however, the point is to make it expliclty clear in scalar-typed code that a state variable is treated as such and is not a vector valued quantity.
Convenience macro, sym"val", for creating a Symbol from val. Equivalent to Symbol(val). Use in situations where normal Julia :val syntax is not possible, e.g. sym"1" instead of Symbol(1) or sym"my.var" instead of Symbol("my.var").
Prepends expr with Threads.@threads if and only if Threads.nthreads() > 1, thus avoiding the overhead of @threads when running in single-threaded mode.
Credit to @ranocha (Hendrik Ranocha) https://discourse.julialang.org/t/overhead-of-threads-threads/53964/22
This module provides miscellaneous utility methods and types that are used throughout the CryoGrid.jl codebase. Note that the Utils module is not exported by the top-level CryoGrid module. It may, however, be explicitly imported by the user via using CryoGrid.Utils or import CryoGrid.Utils when needed.
Base type for container types that hold a NamedTuple of arbitrary field values. NamedTupleWrapper provides dispatches for getproperty and propertynames that forward property name queries to the NamedTuple container. Subtypes are by default assumed to have a field named values that corresponds to the NamedTuple container, but this can be overriden by providing a dispatch for Base.values.
Same as map for NTuples but with guaranteed type stability. fastmap is a @generated function which unrolls calls to f into a loop-free tuple construction expression.
Helper method for generalizing between arrays and scalars. Without an index, retrieves the first element of x if x is an array, otherwise simply returning x. If an index i, is specified, returns the ith value of x if x is an array, or x otherwise. Note that this method is not strictly necessary since Julia allows for scalar quantities to be accessed at the first index like an array; however, the point is to make it expliclty clear in scalar-typed code that a state variable is treated as such and is not a vector valued quantity.
Convenience macro, sym"val", for creating a Symbol from val. Equivalent to Symbol(val). Use in situations where normal Julia :val syntax is not possible, e.g. sym"1" instead of Symbol(1) or sym"my.var" instead of Symbol("my.var").
Prepends expr with Threads.@threads if and only if Threads.nthreads() > 1, thus avoiding the overhead of @threads when running in single-threaded mode.
Credit to @ranocha (Hendrik Ranocha) https://discourse.julialang.org/t/overhead-of-threads-threads/53964/22
hello MyProcess on any SubSurface
-hello MyProcess on Bar
Thus, multiple dispatch allows us to write generic code in computediagnostic! that implements MyProcess for any SubSurface layer (i.e. the parent type of both Foo and Bar) in addition to adding specialized code for more specific layer types.
Settings
This document was generated with Documenter.jl version 1.1.1 on Monday 23 October 2023. Using Julia version 1.6.7.