Closed oldninja closed 3 months ago
First, thank you, @oldninja, for reaching out; this is a very good point! You are right regarding the expected behavior of the precrack feature. It should indeed be what you describe — a form of 'filtering' bonds before calculation. So, the current behavior is intended, but mainly because I wanted to see the predefined cracks.
We are currently rewriting the package and transforming the API. The examples in the dev
version of the documentation will be updated soon.
I think it would be an easy fix to make that behavior standard and preserve the old via a keyword in the precrack!
function, which is the way to add predefined cracks in the new API. A possible solution could be something like this:
# define a Body instance `body`
body = Body(...)
# add two point sets `set_a` and `set_b`
# with the `point_set!` function
point_set!(...)
# behavior as described by you
# points in the pre-cracked area have no damage
precrack!(body, :set_a, :set_b)
# behavior as it is now
# damage value gets updated and points in
# the pre-cracked area have damage
precrack!(body, :set_a, :set_b; update_dmg=true)
What do you think about this?
I think that is an elegant solution. I could try to help in the implementation if you point me in the right direction. I couldn't quickly find where to effectively change the precrack! function.
Thank you very much @oldninja for your offer to contribute! Unfortunately, I struggled to point you in the right direction and to consider how this could be implemented. The internal structure has yet to be finalized, so I ended up restructuring half of the package and added the feature during that process.
I talked to my students working with the package, and they preferred the standard setting update_dmg=true
. Maybe this will change, but I will keep it that way for now.
You can try it out with this code:
using Peridynamics
l, Δx, δ, a = 1.0, 1/50, 3.015/50, 0.5
pos, vol = uniform_box(l, l, 0.1l, Δx)
b = Body(BBMaterial(), pos, vol)
material!(b; horizon=3.015Δx, E=2.1e5, rho=8e-6, Gc=2.7)
point_set!(p -> p[1] ≤ -l/2+a && 0 ≤ p[2] ≤ 2δ, b, :set_a)
point_set!(p -> p[1] ≤ -l/2+a && -2δ ≤ p[2] < 0, b, :set_b)
precrack!(b, :set_a, :set_b; update_dmg=false)
point_set!(p -> p[2] > l/2-Δx, b, :set_top)
point_set!(p -> p[2] < -l/2+Δx, b, :set_bottom)
velocity_bc!(t -> -30, b, :set_bottom, :y)
velocity_bc!(t -> 30, b, :set_top, :y)
vv = VelocityVerlet(steps=2000)
job = Job(b, vv; path=joinpath("results", "mode_I"))
submit(job);
Keep in mind that you have to install the current state of the main branch:
pkg> add Peridynamics#main
@oldninja Please feel free to reopen the issue if you have any further suggestions! I just closed it to keep track of my tasks :)
name: 💡 Enhancement Request about: Request an enhancement or clarification on pre-cracked surfaces title: '[ENHANCEMENT] Clarification on pre-cracked surfaces'
Requested Enhancement/Clarification:
1) First, thank you, @kaipartmann, for putting together such a nice and well-written peridynamic implementation. 2) I would like to better understand the pre-crack option per the example on tutorial_tension_precrack: I noticed that the pre-cracked area gets a damage value when initially placed. Say the damage variable equals 0.5 on the nodes at the edge and less towards the inner portion of the body. However, I believe the pre-cracked surfaces should be "undamaged" at the beginning of the simulation. The only difference with respect to the other neighbors is that these nodes on the crack surfaces have fewer neighbors compared to the bulk of the material. Is this how it is intended to be (as-is)?
Anything else:
tutorial_tension_precrack