ElastoPlasm Reference
ElastoPlasm.get_dt
— Methodget_dt(mp, mesh, yd, t, time) -> Float64
Computes the adaptive time step for the simulation based on mesh spacing and material point velocities.
Arguments
mp
: Material point data structure, must containvmax
.mesh
: Mesh data structure, must containh
.yd
: Small offset added to velocity for stability.t
: Current simulation time.time
: Total simulation time.
Returns
Float64
: The computed time step, limited by remaining simulation time.
Example
dt = get_dt(mp, mesh, 1e-6, t, time)
ElastoPlasm.get_g
— Methodget_g(t::Float64, tg::Float64, ndim::Int64) -> Vector{Float64}
Calculates the gravity vector for the current time, ramping up to full gravity over duration tg
.
Arguments
t::Float64
: Current simulation time.tg::Float64
: Gravity ramp duration.ndim::Int64
: Number of spatial dimensions.
Returns
Vector{Float64}
: Gravity vector for the current time and dimension.
Example
g = get_g(t, tg, 2)
ElastoPlasm.get_spacetime
— Methodget_spacetime(mp, mesh, cmpr, instr, t, tg, te, time) -> Tuple{Vector{Float64}, Float64}
Updates simulation state, including plasticity status, adaptive time step, and gravity vector.
Arguments
mp
: Material point data structure.mesh
: Mesh data structure.cmpr
: Compression or constitutive model data.instr
: Instruction/configuration dictionary.t
: Current simulation time.tg
: Gravity ramp duration.te
: End time for gravity ramp.time
: Total simulation time.
Returns
(g, dt)
: Tuple containing the gravity vector and computed time step.
Example
g, dt = get_spacetime(mp, mesh, cmpr, instr, t, tg, te, time)
ElastoPlasm.plasming!
— Methodplasming!(mp, mesh, cmpr, time, instr) -> Any
Runs the explicit time-stepping workflow for ElastoPlasm, updating material points and mesh state over time.
Arguments
mp
: Material point data structure.mesh
: Mesh data structure.cmpr
: Compression or constitutive model data.time
: Time data structure.instr
: Named tuple containing simulation instructions and plotting options.
Returns
- The result of the final call to
savlot
, typically a plot or saved state.
Behavior
- Initializes simulation time and progress bar.
- Advances the simulation in time steps, updating mesh and material points.
- Handles adaptive time stepping and gravity ramping.
- Plots and saves results at specified intervals.
- Tracks and displays progress.
Example
result = plasming!(mp, mesh, cmpr, g, 10.0, 5.0, 2.0, instr)