Skip to content

Function Reference

This page auto-documents all symbols discovered in the main package module.

Full API (Including Internal Symbols)

MagmaThermoKinematics.Dike Type
julia
Structure that holds the geometrical parameters of the dike, which are slightly different
depending on whether we consider a 2D or a 3D case

General form: Dike(Width=.., Thickness=.., Center=[], Angle=[], Type="..", T=.., ΔP=.., E=.., ν=.., Q=..)

with

  • [Width]: width of dike (optional, will be computed automatically if ΔP and Q are specified

  • [Thickness]: (maximum) thickness of dike (optional, will be computed automatically if ΔP and Q are specified)

  • Center: center of the dike 2D - [x; z] 3D - [x; y; z] Angle: Dip (and strike) angle of dike 2D - [Dip] 3D - [Strike; Dip] Type: Type of dike "SquareDike" - square dike area "SquareDike_TopAccretion" - square dike area, which grows by underaccreting "CylindricalDike_TopAccretion" - cylindrical dike area, which grows by underaccreting "CylindricalDike_TopAccretion_FullModelAdvection" - cylindrical dike area, which grows by underaccreting; also material to the side of the dike is moved downwards "ElasticDike" - penny-shaped elastic dike in elastic halfspace "EllipticalIntrusion" - elliptical dike intrusion area with radius Width/2 and height Height/2 T: Temperature of the dike [Celcius] ν: Poison ratio of host rocks E: Youngs modulus of host rocks [Pa] [ΔP]: Overpressure of dike w.r.t. host rock [Pa], (optional in case we want to compute width/length directly [Q]: Volume of magma within dike [m^3],

julia
All parameters can be specified through keywords as shown above.
If keywords are not given, default parameters are employed.

The

source
MagmaThermoKinematics.DikeParam Type
julia
mutable struct DikeParam <: DikeParameters

This mutable structure represents parameters related to a dike in the simulation. It is used to store and manage values related to the dike's properties and behavior.

Fields

  • Type::String: Type of the dike.

  • Center::Vector{Float64}: Center of the dike.

  • T_in_Celsius::Float64: Temperature of the injected magma in Celsius.

  • W_in::Float64: Diameter of the dike.

  • H_in::Float64: Thickness of the dike.

  • AspectRatio::Float64: Aspect ratio of the dike.

  • SillRadius::Float64: Radius of the sill.

  • SillArea::Float64: Horizontal area of the sill.

  • InjectionInterval_year::Float64: Injection interval in years.

  • SecYear: Number of seconds in a year.

  • InjectionInterval::Float64: Injection interval in seconds.

  • nTr_dike::Int64: Number of tracers in the dike.

  • InjectVol: Injected volume into the dike.

  • Qrate_km3_yr: Dike insertion rate in km^3/year.

  • dike_poly: Polygon representing the dike.

  • dike_inj: Injection into the dike.

  • H_ran: Zone in which we vary the vertical location of the dike (if we add random dikes)

  • L_ran: Zone in which we vary the horizontal (x) location of the dike (if we add random dikes)

  • W_ran: Zone in which we vary the horizontal (y) location of the dike (if we add random dikes)

  • Dip_ran: maximum variation of dip (if we add random dikes)

  • Strike_ran: maximum variation of strike (if we add random dikes)

Examples

julia
dp = DikeParam(Type="MyDike", Center=[0., -7.0e3], ...)
source
MagmaThermoKinematics.NumParam Type

This mutable structure represents numerical parameters in the program. It is used to store and manage numerical values that are used throughout the program. mutable struct NumParam <: NumericalParameters

Fields

  • SimName::String: Name of the simulation.

  • FigTitle: Title of the figure.

  • Nx::Int64: Number of grid points in the x direction.

  • Nz::Int64: Number of grid points in the z direction.

  • W::Float64: Width of the domain.

  • H::Float64: Height of the domain.

  • dx::Float64: Grid spacing in the x direction.

  • dz::Float64: Grid spacing in the z direction.

  • Tsurface_Celcius::Float64: Surface temperature in Celsius.

  • Geotherm::Float64: Geothermal gradient in K/m.

  • maxTime_Myrs::Float64: Maximum simulation time in Myrs.

  • SecYear::Float64: Number of seconds in a year.

  • maxTime::Float64: Maximum simulation time in seconds.

  • SaveOutput_steps::Int64: Number of steps between output saves.

  • CreateFig_steps::Int64: Number of steps between figure creations.

  • flux_bottom_BC::Bool: Whether to apply a flux at the bottom boundary.

  • flux_bottom::Float64: Flux at the bottom boundary in W/m^2.

  • plot_tracers::Bool: Whether to plot tracers.

  • advect_polygon::Bool: Whether to advect a polygon around the intrusion area.

  • axisymmetric::Bool: Whether the simulation is axisymmetric.

  • κ_time::Float64: Thermal diffusivity.

  • fac_dt::Float64: Factor to multiply the time step by.

  • dt::Float64: Time step.

  • time::Float64: Current time.

  • nt::Int64: Total number of time steps.

  • it::Int64: Current iteration.

  • ω::Float64: Relaxation parameter for nonlinear iterations.

  • max_iter::Int64: Maximum number of nonlinear iterations.

  • verbose::Bool: Whether to print verbose output.

  • convergence::Float64: Convergence criterion for nonlinear iterations.

  • deactivate_La_at_depth::Bool: Whether to deactivate latent heating at the bottom of the model box.

  • deactivationDepth::Float64: Depth at which to deactivate latent heating.

  • USE_GPU: Whether to use a GPU.

  • AnalyticalInitialGeo::Bool: Whether to use an analytical initial geotherm.

  • qs_anal::Float64: Analytical surface heat flux.

  • qm_anal::Float64: Analytical mantle heat flux.

  • hr_anal::Float64: Analytical radiogenic heat production.

  • k_anal::Float64: Analytical thermal conductivity.

  • InitialEllipse::Bool: Whether to initialize with an ellipse.

  • a_init::Float64: Semi-major axis of initial ellipse.

  • b_init::Float64: Semi-minor axis of initial ellipse.

  • TrackTracersOnGrid::Bool: Whether to track tracers on the grid.

Examples

julia
np = NumParam(SimName="MySim", Nx=101, Nz=101, ...)
source
MagmaThermoKinematics.TimeDepProps Type
julia
mutable struct TimeDepProps <: TimeDependentProperties

This mutable structure represents time-dependent properties in the simulation. It is used to store and manage values that change over time.

Fields

  • Time_vec::Vector{Float64}: Vector storing the time points.

  • MeltFraction::Vector{Float64}: Vector storing the melt fraction at each time point.

  • Tav_magma::Vector{Float64}: Vector storing the average magma temperature at each time point.

  • Tmax::Vector{Float64}: Vector storing the maximum magma temperature at each time point.

Examples

julia
tdp = TimeDepProps(Time_vec=[0., 1., 2.], MeltFraction=[0.1, 0.2, 0.3], ...)

Note:

You can use multiple dispatch on this struct in your user code as long as the new struct

source
MagmaThermoKinematics.Tracer Type
julia
Structure that has information about the tracers

General form:
    Tracer(num, coord, T)

    with:

        num:   number of the tracer (integer)

        coord: coordinates of the tracer
                2D - [x; z]
                3D - [x; y; z]

        T:          Temperature of the tracer [Celcius]
        Phase:      Phase of tracer
        Phi:        Melt fraction of tracer
        time_vec:   Vector with time
        T_vec :     Vector with temperature values
source
MagmaThermoKinematics.AddDike Method
julia
T, Tracers, dike_poly = AddDike(T,Tracers, Grid, dike,nTr_dike)

Adds a dike, described by the dike polygon dike_poly, to the temperature field T (defined at points Grid). Also adds nTr_dike new tracers randomly distributed within the dike, to the tracers array Tracers.

source
MagmaThermoKinematics.AdvectPoints Function
julia
AdvPoints =   AdvectPoints(AdvPoints0, Grid,Velocity,dt, Method="RK2", InterpolationMethod="Linear");

Advects irregular points described by the (2D or 3D tuple) AdvPoints0, though a fixed Eulerian grid (Grid), with constant spacing (Spacing) on which the velocity components (Velocity) are defined. Advection is done for the time dt, and can use different methods

source
MagmaThermoKinematics.AdvectTemperature Function
julia
    Tnew = AdvectTemperature(T, Grid, Velocity, Spacing, dt, Method="RK2",DataInterpolationMethod="Quadratic")

Advects temperature for one timestep dt, using a semi-lagrangian advection scheme 

    Method: can be "Euler","RK2" or "RK4", for 1th, 2nd or 4th order explicit advection scheme, respectively.
source
MagmaThermoKinematics.AdvectTracers! Function
julia
    AdvectTracers!(Tracers, Grid, Velocity, dt, Method="RK2");

    Advects [Tracers] for one timestep (dt) using the [Velocity] defined on the points [Grid].

    Method: can be "Euler","RK2" or "RK4", for 1th, 2nd or 4th order explicit advection scheme, respectively.
source
MagmaThermoKinematics.ComputeDensityAndPressure Method
julia
This computes the density distribution and pressure in the domain

    General form:

    Rho_new, P_bar = ComputeDensityAndPressure(Rho, T, FullGrid, Grid, Tracers, ρ, PhaseDiagramData);

    with:

    out:
source
MagmaThermoKinematics.ComputeLithostaticPressure Method
julia
This computes the lithostatic pressure from a given densit matrix

    General form:

    P = ComputeLithostaticPressure(Rho, Grid);

    with:
        Grid:   2D or 3D arrays that describe the 1D grid coordinates
                2D - (x,z)
                3D - (x,y,z)

        Rho:    2D or 3D matrix with density distribution

    out:
        P:      2D or 3D matrix with pressure [in bar!]
source
MagmaThermoKinematics.ComputeSeismicVelocities Method
julia
This computes seismic velocities

    General form:

        Vp,Vs,VpVs = ComputeSeismicVelocities(Grid, T, P_bar, PhaseRatio, PhaseDiagramData)

    with:
source
MagmaThermoKinematics.CorrectBounds! Method
julia
CorrectBounds!(Points, Grid);

Ensures that the coordinates of Points stay within the bounds of the regular grid Grid, which is a tuple of 2 or 3 field (for 2D/3D)

julia
source
MagmaThermoKinematics.CorrectBounds_Array! Method
julia
CorrectBounds_Array!(Points, Grid);

Ensures that the coordinates of Points stay within the bounds of the regular grid Grid. Points is an array of size [nPoints, dim]

julia
source
MagmaThermoKinematics.CorrectTracersForTopography! Function
julia
    CorrectTracersForTopography!(Tracers, Topo, PhaseAir=1, PhaseRock=2)

    Corrects tracers for topography, such that 'rock' tracers above the topography
        are set to "air" and vice-versa

    Input:
        Tracers     -       Tracers structure

        Topo        -
                            (Topo_x, Topo_y, Topo_z)  : topography in 3D
                            (Topo_x, Topo_z)  :         topography in 2D
        PhaseAir    -       Phase of air
        PhaseRock   -       Phase of rock
source
MagmaThermoKinematics.CreatDikePolygon Function
julia
dike_poly = CreatDikePolygon(dike::Dike, numpoints=101)

Creates a new dike polygon with given orientation and width.
This polygon is used for plotting, and described by the struct dike
source
MagmaThermoKinematics.CreateDikePolygon Function
julia
dike_poly = CreateDikePolygon(dike::Dike, numpoints=101)

Creates a new dike polygon with given orientation and width.
This polygon is used for plotting, and described by the struct dike
source
MagmaThermoKinematics.CreateDikePolygon Function

Creates a polygon that describes the initial diking area

source
MagmaThermoKinematics.DisplacementAroundPennyShapedDike Method
julia
This computes the displacement around a fluid-filled penny-shaped sill that is
inserted inside in an infinite elastic halfspace.

Displacement, Bmax, p = DisplacementAroundPennyShapedDike(dike, CartesianPoint)

with:

        dike:           Dike structure, containing info about the dike

        CartesianPoint: Coordinate of the point @ which we want to compute displacments
                    2D - [dx;dz]
                    3D - [dx;dy;dz]

        Displacement:   Displacements of that point
                    2D - [Ux;Uz]
                    3D - [Ux;Uy;Uz]

        Bmax:           Max. opening of the dike
        p:              Overpressure of dike

Reference:
    Sun, R.J., 1969. Theoretical size of hydraulically induced horizontal fractures and
    corresponding surface uplift in an idealized medium. J. Geophys. Res. 74, 59956011.
    https://doi.org/10.1029/JB074i025p05995

    Notes:
        - We employ equations 7a and 7b from that paper, which assume that the dike is in a
            horizontal (sill-like) position; rotations have to be performed outside this routine

        - The center of the dike should be at [0,0,0]

        - This does not account for the presence of a free surface.

        - The values are in absolute displacements; this may have to be normalized
source
MagmaThermoKinematics.HostRockVelocityFromDike Method
julia
Host rock velocity obtained during opening of dike

General form:
    Velocity = HostRockVelocityFromDike( Grid, Points, Δ, dt, dike);

    with:

        Grid: coordinates of regular grid @ which we compute velocity
                2D - [X; Z]
                3D - [x; y; z]

        dike: structure that holds info about dike
        dt:   time in which the full dike is opened

Note: the velocity is computed in such a manner that a maximum opening
    increment of Δ = Vmax*dt is obtained after this timestep
source
MagmaThermoKinematics.InitializeTracers Function
julia
This evenly populates the grid with tracers

    General form:

    Tracers     = InitializeTracers(Grid, NumTracersDir=3, RandomPertur=true);

    with:
        Grid:   2D or 3D arrays that describe the grid coordinates
                2D - (X,Z)
                3D - (X,Y,Z)

        NumTracersDir:    The number of tracers per direction

        RandomPertur:     Add slight random noise on tracer location?

    out:
        Tracers:    Tracers structure
source
MagmaThermoKinematics.InjectDike Method
julia
This injects a dike in the computational domain in an instantaneous manner,
while "pushing" the host rocks to the sides.

The orientation and the type of the dike are described by the structure

General form:
      Tracers, Tnew, VolumeInjected, dike_poly, Velocity = InjectDike(Tracers, T, Grid, FullGrid, dike, nTr_dike; AdvectionMethod="RK2", InterpolationMethod="Quadratic", dike_poly=[])


with:
    T:          Temperature grid (will be modified)

    Tracers:    StructArray that contains the passive tracers (will be modified)

    Grid:       regular grid on which the temperature is defined
                2D - (X,Z)
                3D - (X,Y,Z)

    FullGrid:   2D or 3D matrixes with the full grid coordinates
                2D - (X,Z)
                3D - (X,Y,Z)

    nTr_dike:   Number of new tracers to be injected into the new dike area

optional input parameters with keywords (add them with: AdvectionMethod="RK4", etc.):

    AdvectionMethod:    Advection algorithm
                "Euler"     -    1th order accurate Euler timestepping
                "RK2"       -    2nd order Runga Kutta advection method [default]
                "RK4"       -    4th order Runga Kutta advection method

    InterpolationMethod: Interpolation Algorithm to interpolate data on advected points

                Note:  higher order is more accurate for smooth fields, but if there are very sharp gradients,
                    it may result in a 'Gibbs' effect that has over and undershoots.

                "Linear"    -    Linear interpolation
                "Quadratic" -    Quadratic spline
                "Cubic"     -    Cubic spline

    dike_poly: polygon that describes the circumferrence of a diking area (in 2D)
                Will be advected if specified
source
MagmaThermoKinematics.Interpolate! Function
julia
Performs a interpolation, either in 2D or 3D, using either linear of cubic interpolation


General form:
    Interpolate!(Data_interp, Grid, Data_grid, Points_irregular,  InterpolationMethod="Linear")

    with:

        Grid:               Tuple with 1D coordinate vectors that describe the grid
                2D - (x,z)
                3D - (x,y,z)

        Spacing:            (constant) spacing of the grid in each direction
                2D - (dx,dz)
                3D - (dx,dy,dz)
        
        DataGrid:           Data that is defined on the grid. Can have 1 field or 2 (2D), respectively 3 (3D) fields 

        Points_irregular:   Tuple with 2D or 3D arrays with coordinates of irregular points on which we want to interpolate the data
                2D - (X,Z)
                3D - (x,y,z)

        InterpolationMethod:   The interpolation method  
                "Linear"    -   Linear interpolation (default)
                "Quadratic" -   Quadratic interpolation
                "Cubic"     -   Cubix interpolation 

        Data_interp:   interpolated data field(s) on the irregular points. Same number of fields as Data_grid                          

        Note: we use the Julia package Interpolations.jl to perform the actual interpolation
source
MagmaThermoKinematics.LoadPhaseDiagrams Function
julia
This preloads phase diagram data from disk

    General form:

    PhaseDiagramData = LoadPhaseDiagrams(PhaseDiagramNames, PlotDiagrams=false);

    with:
        PhaseDiagramNames:  Array with names that are either [""] or contain the name & directory of the phase diagram
        PlotDiagrams:       Plot the diagrams [warning; to be removed]

    out:
        PhaseDiagramData:   Array with interpolation objects that describe the phase diagrams
source
MagmaThermoKinematics.PhaseRatioAverage! Method
julia
This computes the average of a certain property

    General form:

        PhaseRatioAverage!(Average, prop_vec,  PhaseRatio)

    with:
        PhaseRatio - PhaseRatio matrix for the current grid
source
MagmaThermoKinematics.PhaseRatioFromTracers! Method
julia
PhaseRatioFromTracers!(PhaseRatio::AbstractArray, Grid::GridData, Tracers; InterpolationMethod="Constant", BackgroundPhase=nothing, ReturnNumTracers=false)

This computes the PhaseRatio from the Tracers on the gridpoints described by Grid. The PhaseRatio is a matrix that has one dimension more than the size of the grid and, after calling this function, at every point we will have the fraction of that phase that is present in the grid.

optional Parameters:

  • InterpolationMethod: Interpolation method used to go from Tracers -> Grid "Constant" - All particles within a distance [dx,dy,dz] around the grid point "DistanceWeighted" - Particles closer to the grid point have a stronger weight. This follows what is described in: Duretz, T., May, D.A., Gerya, T.V., Tackley, P.J., 2011. Discretization errors and free surface stabilization in the finite difference and marker-in-cell method for applied geodynamics: A numerical study: Geochem. Geophys. Geosyst. 12, https://doi.org/10.1029/2011GC00356

  • BackgroundPhase: The background phase (used for places that don't have cells, nor surrounding cells )

  • ReturnNumTracers: Return the number of tracers on every grid cell (default=false)

source
MagmaThermoKinematics.PhaseRatioFromTracers Method
julia
This computes the PhaseRatio on the grid specified by Grid

    General form:

    PhaseRatio,NumTracers = PhaseRatioFromTracers(Grid, Tracers, InterpolationMethod, BackgroundPhase=2, RequestNumTracers=false; BackgroundPhase=2);

    with:
        Grid:   2D or 3D arrays that describe the grid coordinates
                2D - (X,Z)
                3D - (X,Y,Z)

        Tracers:    Tracers structure

        InterpolationMethod:    Interpolation method used to go from Tracers ->  Grid
                "Constant"          -   All particles within a distance [dx,dy,dz] around the grid point
                "DistanceWeighted"  -   Particles closer to the grid point have a stronger weight.
                                        This follows what is described in:
                                            Duretz, T., May, D.A., Gerya, T.V., Tackley, P.J., 2011. Discretization errors and
                                            free surface stabilization in the finite difference and marker-in-cell method for applied geodynamics:
                                            A numerical study: Geochem. Geophys. Geosyst. 12, https://doi.org/10.1029/2011GC00356

        BackgroundPhase:        The background phase (used for places that don't have cells, nor surrounding cells )

        RequestNumTracers:      Return the number of tracers on every grid cell (default=false)

    optional parameters:

        BackgroundPhase:        if this is defined, points where no tracers are present, will get the number BackgroundPhase.
                                You need to define this with a keywords as: (, BackgroundPhase=2)

    out:
        PhaseRatio:    Phase ratio on the gridpoints defined by Grid

        NumTracers:    The number of tracers per grid point
source
MagmaThermoKinematics.PhasesFromTracers! Method
julia
PhaseFromTracers!(Phases::AbstractArray, Grid::GridData, Tracers; InterpolationMethod="Constant", BackgroundPhase=nothing)

This computes the Phases from the Tracers on the gridpoints described by Grid. The Phases is a matrix with integers that indicates the dominant phase at that point

optional Parameters:

  • InterpolationMethod: Interpolation method used to go from Tracers -> Grid "Constant" - All particles within a distance [dx,dy,dz] around the grid point "DistanceWeighted" - Particles closer to the grid point have a stronger weight. This follows what is described in: Duretz, T., May, D.A., Gerya, T.V., Tackley, P.J., 2011. Discretization errors and free surface stabilization in the finite difference and marker-in-cell method for applied geodynamics: A numerical study: Geochem. Geophys. Geosyst. 12, https://doi.org/10.1029/2011GC00356

  • BackgroundPhase: The background phase (used for places that don't have cells, nor surrounding cells )

  • ReturnNumTracers: Return the number of tracers on every grid cell (default=false)

source
MagmaThermoKinematics.Process_ZirconAges Method
julia
Process_ZirconAges(dirname; ZirconData=ZirconAgeData())

Performs postprocessing which computes zircon ages from given Tt-paths of a simulation and saves the result in a JLD2 file

Example

julia
julia> using MagmaThermoKinematics, MagmaThermoKinematics.GeoParams
julia> ZirconData = ZirconAgeData(time_zr_growth=1e5);
julia> dirname = "Zassy_Geneva_zeroFlux_variable_k_2";
julia> Process_ZirconAges(dirname, ZirconData=ZirconData )
Save processed zircon age data to file: Zassy_Geneva_zeroFlux_variable_k_2/ZirconAges.jld2

Once this is done, you can load the data with

julia
julia> using MagmaThermoKinematics.JLD2
julia> Age_Ma, cum_PDF, norm_PDF, T_av_time  = JLD2.load("Zassy_Geneva_zeroFlux_variable_k_2/ZirconAges.jld2","Age_Ma","cum_PDF","prob","T_av_time")
source
MagmaThermoKinematics.RockAssemblage Method
julia
    RockType = RockAssemblage(PhaseRatio)

    Computes the most abundant rock assemblage @ every point
source
MagmaThermoKinematics.SolidFraction Method
julia
SolidFraction computes the solid fraction (= (1-phi) as a function of T
source
MagmaThermoKinematics.TracersToGrid! Function
julia
This averages a certain property from tracers -> grid. The data will ONLY be set on the grid if we have at least x tracers!
    if not, the origibal data will be kept

    General form:

        TracersToGrid!(Data, FullGrid, Grid, Tracers, Property="T", InterpolationMethod="Constant", RequestNumTracers=false);

    with:
        Data:       2D or 3D arrays that have the grid coordinates

        FullGrid:   2D or 3D arrays that describe the grid coordinates
                    2D - (X,Z)
                    3D - (X,Y,Z)

        Grid:       1D vectors describing the cartesian grid

        Tracers:    Tracers structure

        Property:   Property to be interpolated from Tracers2Grid
                    "T" - temperature

        InterpolationMethod:    Interpolation method used to go from Tracers ->  Grid
                "Constant"          -   All particles within a distance [dx,dy,dz] around the grid point
                "DistanceWeighted"  -   Particles closer to the grid point have a stronger weight.
                                        This follows what is described in:
                                            Duretz, T., May, D.A., Gerya, T.V., Tackley, P.J., 2011. Discretization errors and
                                            free surface stabilization in the finite difference and marker-in-cell method for applied geodynamics:
                                            A numerical study: Geochem. Geophys. Geosyst. 12, https://doi.org/10.1029/2011GC003567

        RequestNumTracers:    Return the number of tracers on every grid cell (default=false)

    out:
        PhaseRatio:    Phase ratio on the gridpoints defined by Grid

        NumTracers:    The number of tracers per grid point
source
MagmaThermoKinematics.UpdateTracers Function
julia
Function that updates properties on tracers

    General form:

    Tracers = UpdateTracers(Tracers, Grid, T, Phi, InterpolationMethod);


    with:
        Tracers:   StructArray that contains tracers

        Grid:   regular grid on which the parameters to be interpolated are defined
                2D - (X,Z)
                3D - (X,Y,Z)

        T:      Temperature that is defined on the grid.

        Phi:    Solid fraction defined on grid

        InterpolationMethod:    Interpolation method from grid->Tracers
                "Cubic"     -   Cubic interpolation
                "Quadratic" -   Quadratic interpolation (default)
                "Linear"    -   Linear interpolation

    out:
        Tracers:    Tracers structure with updated T and melt fraction fields
source
MagmaThermoKinematics.UpdateTracers_Field! Method
julia
UpdateTracers_Field!(Tracers::StructVector{TRACERS}, Grid::GridData{_T,dim}, Field::AbstractArray{_T,dim}, FieldName::Symbol);

In-place, non-allocating, function that interpolates Field, defined on the Grid, to the field FieldName on Tracers.

  • Tracers: StructVector that contains tracers, where we want to update the properties. Each tracer should at least contain the fields coord (coordinates) and FieldName.

  • `Grid``: Grid structure that describes the coordinates

  • Field: The 2D or 3D field

  • `FieldName``: Symbol of the name of the field on each of the Tracers

Note that we employ linear interpolation using custom functions

source
MagmaThermoKinematics.UpdateTracers_T_ϕ! Method
julia
UpdateTracers_T_ϕ!(Tracers, Grid::Tuple, T, Phi);

In-place function that interpolates T & Phi, defined on the Grid, to Tracers.

  • Tracers: StructArray that contains tracers, where we want to update

  • Grid: Regular grid on which the parameters to be interpolated are defined 2D - (X,Z) 3D - (X,Y,Z)

  • T: T field that is defined on the grid, to be interpolated to tracers

  • Phi: Phi field that is defined on the grid, to be interpolated to tracers

Note that we employ linear interpolation using custom functions

source
MagmaThermoKinematics.advect_dike_polygon! Function
julia
advect_dike_polygon!(poly, Grid, Velocity, dt=1.0)

Advects a dike polygon

source
MagmaThermoKinematics.interpolate_linear_2D Method

Implements 2D bilinear interpolation

source
MagmaThermoKinematics.interpolate_linear_3D Method

Implements 3D trilinear interpolation

source
MagmaThermoKinematics.isinside_dike Method
julia
in = isinside_dike(pt, dike::Dike)

Computes if a point [pt] is inside a dike area or not depending on the type of dike
source
MagmaThermoKinematics.simulate_zircon_growth_from_tracers Function
julia
simulate_zircon_growth_from_tracers(dirname; params, elements)

Requires ZirconGrowth.jl to be loaded. Load the extension with using ZirconGrowth.

source
MagmaThermoKinematics.update_Tvec! Method
julia
update_Tvec!(Tracers::StructArray, time)

Updates temperature & time vector on every tracer

source
MagmaThermoKinematics.volume_averaged_age Function
julia
volume_averaged_age(result)
volume_averaged_age(results)

Requires ZirconGrowth.jl to be loaded. Load the extension with using ZirconGrowth.

source
MagmaThermoKinematics.volume_dike Method
julia
A,V = volume_dike(dike::Dike)

Returns the area A and volume V of the injected dike

In 2D, the volume is compute by assuming a penny-shaped dike, with length=width
In 3D, the cross-sectional area in x-z direction is returned
source