How to run a simulation
The key ingredient to run a simulation is to use the function solve!. For examples check out the scripts/ directory.
ConvexDamage.solve! — Functionfunction solve!(globaldata::StructuralModel{dim,refshape,material,NewtonSolver};savedir="simulations/temp")Runs a simulation with the given globaldata and stores the displacement field, materialhistory and if set a paraview pvd.
ConvexDamage.step! — Functionstep!(globaldata::StructuralModel{T1,T2,T3,solvertype}, state::StructuralStateVariables) where {T1,T2,T3,solvertype<:NewtonSolver}Newton solver step, solution of one increment in the incremental problem setting. Function is called in solve!
For this a model::StructuralModel is needed. This struct stores all information of a discrete model (finite element model) including history of discplacements, material, geometry, interpolation order and so on.
ConvexDamage.StructuralModel — TypeStructuralModel{dim,refshape<:Ferrite.AbstractRefShape,material<:Material,solvertype<:AbstractSolver} <: FEModelThis struct defines one finite element model with a given setup, i.e. geometry, discretization, history etc. One custom constructor is defined, which simplifies the initialization. Model can be later used to export or visualize data after solve! was called.
Constructor
StructuralModel(grid::Grid{dim}, ip_order::Int, dirichletBCs::Vector, nbcs::NeumannBC, material::String, material_kwargs, solver, λ; ip_geo_order=ip_order, ref_type=RefCube, quad_order_ele=2, quad_order_face=1, vtk_save=true,jld2_save=true, stringtag="testing") where dimFields
grid::Gridip::Interpolation{dim,refshape}ip_geo::Interpolation{dim,refshape}ref_type::refshapequad_order_ele::Intquad_order_face::Intqr_ele::QuadratureRule{dim,refshape}qr_face::QuadratureRulecv::CellVectorValues{dim}fv::FaceVectorValuesmaterial::Stringmaterialstates::Vector{Vector{material}}dh::DofHandler{dim}dbcs::ConstraintHandlernbcs::NeumannBC{dim}solver::solvertypedhistory::Vector{Vector{Float64}}reactionhistory::Vector{Vector{Float64}}materialhistory::Vector{Vector{Vector{material}}}λ::StepRangeLenvtk_save::Booljld2_save::Boolmaterialhistory_save::Boolreactionhistory_save::Boolstringtag::String
ConvexDamage.StructuralStateVariables — TypeStructuralStateVariablesDefines the computational state of the finite element problem
Constructor
StructuralStateVariables(model::StructuralModel)Constructor is called in solve!()
Fields
system_arrays::SystemArraysλ::Float64Δλ::Float64newton_itr::Intstep_tries::Intd::Vectordn::VectorΔd::VectorΔΔd::VectorL::Float64ΔL::Float64step::Int
ConvexDamage.SystemArrays — TypeSystemArraysStores the system arrays of a structural problem. One system_array::SystemArrays will be used in StructuralStateVariables.
Fields
K::SparseMatrixCSCfⁱ::Vectorfᵉ::Vectorfᴬ::Vectorq::Vectorr::Vector
ConvexDamage.NewtonSolver — TypeNewtonSolver{linearsolve_type <: Function} <: AbstractSolverNewton solver implementation for finite elements, specialized in linear solving function.
Constructor
NewtonSolver(;maxitr=30,tol=1.0e-9,linearsolver=\)Constructor is defined by keyword arguments.
Fields
`maxitr = 30`
`tol = 1.0e-9`
`linearsolver::linearsolve_type = \`