Public Interface
Oetqf.assemble — Methodassemble(gf₁₁::AbstractArray, gf₁₂::AbstractMatrix, gf₂₁::AbstractMatrix, gf₂₂::AbstractMatrix,
pf::RateStateQuasiDynamicProperty, pa::ViscosityProperty, u0::ArrayPartition, tspan::NTuple{2};
se::StateEvolutionLaw=DieterichStateLaw(), kwargs...)Construct an ODEProblem for viscoelastic rate-and-state friction model with quasi-dynamic evolution.
Arguments
gf₁₁: Greens function array for fault-fault interactiongf₁₂: Greens function array for fault-mantle interactiongf₂₁: Greens function array for mantle-fault interactiongf₂₂: Greens function array for mantle-mantle interactionpf: rate-and-state quasi-dynamic property for faultpa: viscosity property for mantleu0: initial state partition, must be anArrayPartitionwith 5 components: velocity, state variable, strain, stress, and fault sliptspan: time span for the simulation, a tuple of two values (start, stop)se: state evolution law, defaults toDieterichStateLaw()
Returns
- An
ODEProblemobject that can be solved usingOrdinaryDiffEq.jl
Oetqf.assemble — Methodassemble(gf::AbstractArray, p::RateStateQuasiDynamicProperty, u0::ArrayPartition, tspan::NTuple{2};
se::StateEvolutionLaw=DieterichStateLaw(), kwargs...)Construct an ODEProblem for rate-and-state friction model with quasi-dynamic evolution.
Arguments
gf: Greens function array for the faultp: rate-and-state quasi-dynamic propertyu0: initial state partition, must be anArrayPartitionwith 3 components: velocity, state variable, and fault sliptspan: time span for the simulation, a tuple of two values (start, stop)se: state evolution law, defaults toDieterichStateLaw()
Returns
- An
ODEProblemobject that can be solved usingOrdinaryDiffEq.jl.
Oetqf.assemble — Methodassemble(gf::AbstractArray, p::RateStateQuasiDynamicProperty, dila::DilatancyProperty, u0::ArrayPartition, tspan::NTuple{2};
se::StateEvolutionLaw=DieterichStateLaw(), kwargs...)Construct an ODEProblem for rate-and-state friction model with dilatancy and quasi-dynamic evolution.
Arguments
gf: Greens function array for the faultp: rate-and-state quasi-dynamic propertydila: dilatancy propertyu0: initial state partition, must be anArrayPartitionwith 4 components: velocity, state variable, pressure, and fault sliptspan: time span for the simulation, a tuple of two values (start, stop)se: state evolution law, defaults toDieterichStateLaw()
Returns
- An
ODEProblemobject that can be solved usingOrdinaryDiffEq.jl
Oetqf.gen_gmsh_mesh — Methodgen_gmsh_mesh(::Val{:BEMHex8Mesh},
llx::T, lly::T, llz::T, dx::T, dy::T, dz::T, nx::I, ny::I, nz::I;
rfx::T=one(T), rfy::T=one(T), rfzh::AbstractVector=ones(nz),
rfxType::AbstractString="Bump", rfyType::AbstractString="Bump",
output::AbstractString="temp.msh"
) where {T, I}Gernate a box using 8-node hexahedron elements by vertically extruding transfinite curve on xy plane, allowing total flexibility on the mesh size in z direction, and refinement in xy plane.
Arguments
llx,lly,llz: coordinates of low-left corner on the top surfacedx,dy,dz: x-, y-, z-extensionnx,ny: number of cells along x-, y-axisrfx,rfy: refinement coefficients along x-, y-axis using Bump algorithm, please refergmsh.model.geo.mesh.setTransfiniteCurverfzh: accumulated height of cells along z-axis which will be normalized automatically, please referheightsingmsh.model.geo.extrude
Returns
- A GMSH mesh file of the
BEMHex8Mesh` for the mantle deformation modeling.
Oetqf.gen_mesh — Methodgen_mesh(::Val{:BEMHex8Mesh}, file::AbstractString;
rotation::Real=0.0, transpose::Bool=false)Load a BEM Hex8 mesh from a GMSH file.
Arguments
file::AbstractString: path to the GMSH mesh filerotation::Real=0.0: rotation angle in degrees to apply to the meshtranspose::Bool=false: if true, transpose the mesh coordinates
Returns
- A
BEMHex8Meshobject representing the mantle mesh for modeling.
Oetqf.gen_mesh — Methodgen_mesh(::Val{:RectOkada},
x::T, ξ::T, Δx::T, Δξ::T, dip::T) where TGenerate a rectangular mesh for Okada's fault model in 2D.
Arguments
x: length of the fault along strikeξ: length of the fault along downdipΔx: cell size along strikeΔξ: cell size along downdipdip: dipping angle of the fault in degrees
Returns
- A
RectOkadaMeshobject representing the transfinite mesh suitable for fault modeling.
Oetqf.gen_pvd — Methodgen_pvd(mf::RectOkadaMesh, mafile, solh5, tstr, ufstrs, uastrs, steps, output;
tscale=365*86400, mafiletype=Val(:BEMHex8Mesh))This function generates a Paraview collection file from the Okada mesh (fault plane) and the volume mesh, and solution data stored in an HDF5 file.
Arguments
mf::RectOkadaMesh: the rectangular Okada mesh objectmafile: the mesh file for the BEM modelsolh5: the HDF5 file containing the solution datatstr: the name of the time data in the HDF5 fileufstrs: a vector of strings representing the names of the solution components (fault) in the HDF5 fileuastrs: a vector of strings representing the names of the solution components (mantle) in the HDF5 filesteps: a vector of integers representing the time steps to be included in the outputoutput: the output directory for the Paraview collection filetscale: a scaling factor for the time data (default is 365*86400 seconds, which is one year)mafiletype: the type of the mesh file, default is:BEMHex8Mesh, which indicates a BEM mesh with Hex8 elements
Returns
- A Paraview collection file containing the mesh and solution data at specified time steps.
Oetqf.gen_vtk_grid — Methodgen_vtk_grid(mesh::RectOkadaMesh)This function creates a grid suitable for visualization in Paraview or similar tools.
Arguments
mesh::RectOkadaMesh: the rectangular Okada mesh object
Returns
- A tuple containing the x, y, and z coordinates of the grid points.
Oetqf.gen_vtk_grid — Methodgen_vtk_grid(t::Val{:BEMHex8Mesh}, mesh)This function uses GMSH to read the Hex8 mesh and convert it into a VTK grid format for visualization in Paraview or similar tools.
Arguments
t::Val{:BEMHex8Mesh}: a value type indicating the mesh typemesh: the mesh object to be converted
Returns
- A tuple containing the points and cells of the mesh in VTK format.
Oetqf.gmsh_quadrature — Methodgmsh_quadrature(etype::Integer, qtype::String)::QuadratureTypeThis function retrieves the integration points and weights for a given element type and quadrature type from GMSH.
Arguments
etype::Integer: the element type ID in GMSHqtype::String: the quadrature type, e.g., "Gauss1"
Returns
- A tuple containing the local coordinates and weights for the quadrature points.
Oetqf.stress_greens_function — Methodstress_greens_function(ma::BEMHex8Mesh, mf::RectOkadaMesh, λ::T, μ::T;
ftype::FaultType=StrikeSlip(),
) where {T}This function computes the stress Green's function for a source in Hex8 mesh to a receiver on Okada mesh.
Arguments
ma::BEMHex8Mesh: the BEM Hex8 mesh objectmf::RectOkadaMesh: the rectangular Okada mesh objectλ::T: Lamé's first parameterμ::T: shear modulusftype::FaultType=StrikeSlip(): type of fault, eitherStrikeSliporDipSlip
Returns
- A 2D array of stress Green's functions, where each column corresponds to a source
mantle patch and each row corresponds to a receiver fault patch.
Oetqf.stress_greens_function — Methodstress_greens_function(
mesh::BEMHex8Mesh,
λ::T, μ::T;
qtype::Union{String, Tuple{AbstractVecOrMat, AbstractVector}}="Gauss1",
checkeigvals::Bool=true,
) where {T}This function computes the stress Green's function for a BEM Hex8 mesh.
Arguments
mesh::BEMHex8Mesh: the BEM Hex8 mesh objectλ::T: Lamé's first parameterμ::T: shear modulusqtype::Union{String, Tuple{AbstractVecOrMat, AbstractVector}}quadrature type for integration, can be a string or a tuple of local coordinates and weightscheckeigvals::Bool=true: if true, check the eigenvalues of the resulting stress matrix and print the maximum real part
Returns
- A 2D array of stress Green's functions, where each column corresponds to a source
mantle patch and each row corresponds to another mantle patch.
Oetqf.stress_greens_function — Methodstress_greens_function(
mf::RectOkadaMesh, ma::BEMHex8Mesh,
λ::T, μ::T;
ftype::FaultType=StrikeSlip(),
qtype::Union{String, Tuple{AbstractVecOrMat, AbstractVector}}="Gauss1",
nrept::Integer=2, buffer_ratio::Real=0,
) where {T}This function computes the stress Green's function for a source in Okada mesh to a receiver on Hex8 mesh.
Arguments
mf::RectOkadaMesh: the rectangular Okada mesh objectma::BEMHex8Mesh: the BEM Hex8 mesh objectλ::T: Lamé's first parameterμ::T: shear modulusftype::FaultType=StrikeSlip(): type of fault, eitherStrikeSliporDipSlipqtype::Union{String, Tuple{AbstractVecOrMat, AbstractVector}}: quadrature type for integration, can be a string or a tuple of local coordinates and weightsnrept::Integer=2: number of repetitions for the dislocationbuffer_ratio::Real=0: ratio of buffer zone around the mesh
Returns
- A 2D array of stress Green's functions, where each column corresponds to a source fault patch
and each row corresponds to a receiver mantle patch.
Oetqf.stress_greens_function — Methodstress_greens_function(mesh::RectOkadaMesh, λ::T, μ::T;
ftype::FaultType=StrikeSlip(), fourier::Bool=true,
nrept::Integer=2, buffer_ratio::Real=0, fftw_flags::UInt32=FFTW.PATIENT
) where {T <: Real}This function computes the stress Green's function for a rectangular Okada mesh fault.
Arguments
mesh::RectOkadaMesh: the rectangular Okada mesh objectλ::T: Lamé's first parameterμ::T: shear modulusftype::FaultType=StrikeSlip(): type of fault, eitherStrikeSliporDipSlipfourier::Bool=true: if true, return the Fourier transform of the Green's functionnrept::Integer=2: number of repetitions for the dislocationbuffer_ratio::Real=0: ratio of buffer zone around the meshfftw_flags::UInt32=FFTW.PATIENT: flags for FFTW plan
Returns
- If
fourieris true, returns the Fourier transform of the stress Green's function, otherwise, returns the stress Green's function as a 3D array. The array considers the translational symmetry of the transfinite mesh.
Oetqf.wsolve — Methodwsolve(prob::ODEProblem, alg::OrdinaryDiffEqAlgorithm,
file, nstep, getu, ustrs, tstr; kwargs...)Write the solution to HDF5 file while solving the ODE. The interface is exactly the same as solve an ODEProblem except a few more about the saving procedure. Notice, it will set save_everystep=false so to avoid memory blow up. The return code will be written as an attribute in tstr data group.
Extra Arguments
file::AbstractString: name of file to be savednstep::Integer: number of steps after which a saving operation will be performedgetu::Function: function handler to extract desired solution for saving, which should have the signaturegetu(u, t, integrator), whereuis the current solution,tis the current time, andintegratoris the current integrator object. The output should be a tuple of arrays or vectors to be saved.ustr::AbstractVector: list of names to be assigned for each components, whose length must equal the length ofgetuoutputtstr::AbstractString: name of time data
KWARGS
stride::Integer=1: downsampling rate for saving outputsappend::Bool=false: if true then append solution after the end offileforce::Bool=false: force to overwrite the existing solution file
Returns
sol::ODESolution: the solution object ofOrdinaryDiffEq.jl