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!Function
function 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.

source
ConvexDamage.step!Function
step!(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!

source

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.StructuralModelType
StructuralModel{dim,refshape<:Ferrite.AbstractRefShape,material<:Material,solvertype<:AbstractSolver} <: FEModel

This 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 dim

Fields

  • grid::Grid
  • ip::Interpolation{dim,refshape}
  • ip_geo::Interpolation{dim,refshape}
  • ref_type::refshape
  • quad_order_ele::Int
  • quad_order_face::Int
  • qr_ele::QuadratureRule{dim,refshape}
  • qr_face::QuadratureRule
  • cv::CellVectorValues{dim}
  • fv::FaceVectorValues
  • material::String
  • materialstates::Vector{Vector{material}}
  • dh::DofHandler{dim}
  • dbcs::ConstraintHandler
  • nbcs::NeumannBC{dim}
  • solver::solvertype
  • dhistory::Vector{Vector{Float64}}
  • reactionhistory::Vector{Vector{Float64}}
  • materialhistory::Vector{Vector{Vector{material}}}
  • λ::StepRangeLen
  • vtk_save::Bool
  • jld2_save::Bool
  • materialhistory_save::Bool
  • reactionhistory_save::Bool
  • stringtag::String
source
ConvexDamage.StructuralStateVariablesType
StructuralStateVariables

Defines the computational state of the finite element problem

Constructor

StructuralStateVariables(model::StructuralModel)

Constructor is called in solve!()

Fields

  • system_arrays::SystemArrays
  • λ::Float64
  • Δλ::Float64
  • newton_itr::Int
  • step_tries::Int
  • d::Vector
  • dn::Vector
  • Δd::Vector
  • ΔΔd::Vector
  • L::Float64
  • ΔL::Float64
  • step::Int
source
ConvexDamage.SystemArraysType
SystemArrays

Stores the system arrays of a structural problem. One system_array::SystemArrays will be used in StructuralStateVariables.

Fields

  • K::SparseMatrixCSC
  • fⁱ::Vector
  • fᵉ::Vector
  • fᴬ::Vector
  • q::Vector
  • r::Vector
source
ConvexDamage.NewtonSolverType
NewtonSolver{linearsolve_type <: Function} <: AbstractSolver

Newton 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 = \`
source