kaipartmann / Peridynamics.jl

A Julia package for parallel peridynamics simulations
https://kaipartmann.github.io/Peridynamics.jl/
MIT License
43 stars 8 forks source link

Regarding use of precracks in conctact analysis. #17

Closed s-sanchit closed 9 months ago

s-sanchit commented 9 months ago

Hi ! I was using the peridynamics.jl package to model a contact simulation with the predefined crack in the target. But I am getting the following issue: MethodError: no method matching PDContactAnalysis(; name::String, body_setup::Vector{BodySetup}, contact::Vector{Contact}, td::VelocityVerlet, es::ExportSettings, precracks::Peridynamics.PreCrack)

Closest candidates are: PDContactAnalysis(; name, body_setup, contact, td, es) got unsupported keyword argument "precracks" @ Peridynamics C:\Users\PC.julia\packages\Peridynamics\X60e3\src\contact.jl:71

Stacktrace: [1] kwerr(kw::NamedTuple{(:name, :body_setup, :contact, :td, :es, :precracks), Tuple{String, Vector{BodySetup}, Vector{Contact}, VelocityVerlet, ExportSettings, Peridynamics.PreCrack}}, args::Type) @ Base .\error.jl:165 [2] top-level scope @ In[11]:1. Can you please help me with it.

Thank you.

kaipartmann commented 9 months ago

Hi @s-sanchit, Thank you for reaching out regarding your question!

You seem to be trying to specify a PreCrack with a PDContactAnalysis instance. But predefined cracks have to be stated within BodySetup as a Vector{PreCrack}: https://github.com/kaipartmann/Peridynamics.jl/blob/805f6a6343981cda75a72b889bf4d98703048910/src/contact.jl#L35C1-L49C4

e.g.:

pc = PointCloud(...)
mat = BondBasedMaterial(...)
cr = PreCrack(...)
targetbody = BodySetup(pc, mat; precracks=[cr]) 
#                                         ^--- expects a Vector{PreCrack}

Inside the PDContactAnalysis instance, it would be unclear which body the point IDs in the PreCrack belong. Therefore, it has to be inside the BodySetup.

However, the documentation could be more extensive in this regard, and we will add a more detailed description of the intended behavior in the next version of the package.

If you have any further questions, please don't hesitate to ask.

s-sanchit commented 9 months ago

Thank you for your input. It worked !