PeriHub / PeriLab.jl

Welcome to Peridynamic Laboratory (PeriLab), a powerful software solution designed for tackling Peridynamic problems.
https://perihub.github.io/PeriLab.jl/
BSD 3-Clause "New" or "Revised" License
21 stars 3 forks source link

[Feature]: Time-depending material and damage parameters #159

Open JTHesse opened 3 months ago

JTHesse commented 3 months ago

What are you trying to do and how would you want to do it differently?

I would like to be able to use time-depending values directly in the input deck. For example:

Damage Models:
      Damage:
        Critical Value: 0.1 * t
...

Is it something you currently cannot do? Is this related to an issue/problem?

Implementation is currently unclear, as we have to provide functions for each variable.

Implementation details

Would you be willing to submit a PR?

Yes

franciscoyapor commented 1 month ago

Hello! I tried the method at https://github.com/PeriHub/PeriLab.jl/issues/143#issuecomment-2041515228 , for a 2d plate model with varying material properties. However, I am getting the following error message:

[ Info: Run Verlet Solver]
ERROR: LoadError: DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 6000 and 18
Stacktrace:
  [1] _bcs1
    @ ./broadcast.jl:555 [inlined]
  [2] _bcs
    @ ./broadcast.jl:549 [inlined]
  [3] broadcast_shape
    @ ./broadcast.jl:543 [inlined]
  [4] combine_axes
    @ ./broadcast.jl:524 [inlined]
  [5] _axes
    @ ./broadcast.jl:236 [inlined]
  [6] axes
    @ ./broadcast.jl:234 [inlined]
  [7] combine_axes
    @ ./broadcast.jl:524 [inlined]
  [8] _axes
    @ ./broadcast.jl:236 [inlined]
  [9] axes
    @ ./broadcast.jl:234 [inlined]
 [10] combine_axes
    @ ./broadcast.jl:524 [inlined]
 [11] _axes
    @ ./broadcast.jl:236 [inlined]
 [12] axes
    @ ./broadcast.jl:234 [inlined]
 [13] combine_axes
    @ ./broadcast.jl:524 [inlined]
 [14] _axes
    @ ./broadcast.jl:236 [inlined]
 [15] axes
    @ ./broadcast.jl:234 [inlined]
 [16] combine_axes
    @ ./broadcast.jl:524 [inlined]
 [17] instantiate
    @ ./broadcast.jl:306 [inlined]
 [18] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(/), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(*), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(/), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(*), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(*), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(*), Tuple{Float64, Vector{Float64}}}, Vector{Float64}}}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(-), Tuple{Vector{Float64}, Vector{Float64}}}}}, Vector{Float64}}}, Matrix{Float64}}}, Vector{Float64}}})
    @ Base.Broadcast ./broadcast.jl:903
 [19] compute_forces(datamanager::Module, nodes::Vector{Int64}, material_parameter::Dict{Any, Any}, time::Float64, dt::Float64, to::TimerOutputs.TimerOutput)
    @ PeriLab.Solver.Physics.Material.Set_modules.Bondbased_Elastic ~/download/PeriLab.jl/src/Physics/Material/Material_Models/BondBased/Bondbased_Elastic.jl:102
 [20] compute_forces(datamanager::Module, nodes::Vector{Int64}, model_param::Dict{Any, Any}, time::Float64, dt::Float64, to::TimerOutputs.TimerOutput)
    @ PeriLab.Solver.Verlet.Physics.Material ~/download/PeriLab.jl/src/Physics/Material/Material_Factory.jl:131

I can share the mesh and input files if that helps with debugging.

J-T1 commented 1 month ago

Hi @franciscoyapor I can take a look tomorrow, but in the meantime the .yaml and a section of the mesh file would be great.

CWillberg commented 1 month ago

@franciscoyapor Please send me your mesh and yaml. I will have a look.