Closed HanyMKhalil closed 4 years ago
Here is the code you use for plastic damage in 3D, I tried to adopt the half spaces to make a rectangular but failed, since the lines that follow the spherical damage only defines the centre of the sphere
def gaussian(xx, centre, width): return ( np.exp( -(xx - centre)*2 / width )) maxDamage = 0.22 Model.plasticStrain.data[:] = maxDamage np.random.rand(*Model.plasticStrain.data.shape[:])
Model.plasticStrain.data[:,0] = gaussian(Model.swarm.particleCoordinates.data[:,0], (GEO.nd(Model.maxCoord[0] - Model.minCoord[0])) / 2.0, GEO.nd(2.0 u.kilometer))
Model.plasticStrain.data[:,0] = gaussian(Model.swarm.particleCoordinates.data[:,1], GEO.nd(256. u.kilometer) , GEO.nd(2.0 * u.kilometer))
Model.plasticStrain.data[:,0] = gaussian(Model.swarm.particleCoordinates.data[:,2], GEO.nd(-35. u.kilometer) , GEO.nd(5.0 * u.kilometer))
Hi @HanyMKhalil,
You can use any predefined box shape or create your own function. That function could be a cube.
R
Hi Romain, you mean I create a rectangular seed and assign same viscosity and density like surrounding but only change plasticity? but how I transfer the magnitude of plastic damage to plasticity values (cohesion and strain softening), I though its easier to write a gaussian function to define plastic damage shape as rectangular or cylinder, instead of a sphere, but its really hard for me.
OK. Let me cook something for you. I can't guarantee that I will do that today though... Give it some thoughts and I will get back to you.
Thanks so much Romain really ^_^
Hi Romain:
I tried it in this way and seems to work nicely
maxDamage = 0.22 Model.plasticStrain.data[:] = maxDamage np.random.rand(Model.plasticStrain.data.shape[:])
Model.plasticStrain.data[:,0] =(Model.swarm.particleCoordinates.data[:,0]>(GEO.nd(100.0u.kilometer))) & (Model.swarm.particleCoordinates.data[:,0]<(GEO.nd(150.0*u.kilometer)))
Model.plasticStrain.data[:,0] =(Model.swarm.particleCoordinates.data[:,1]<(GEO.nd(-40.0u.kilometer))) & (Model.swarm.particleCoordinates.data[:,1]>(GEO.nd(-60.0*u.kilometer)))
Model.plasticStrain.data[:,0] =(Model.swarm.data[:,2]<(GEO.nd(-100.0u.kilometer))) & (Model.swarm.data[:,2]>(GEO.nd(0.0*u.kilometer)))
Sorry it took so long @HanyMKhalil. That's one way to do it. There are others of course.
Hi @rbeucher
I am trying to add a plastic damage in 3D. However, is there a possibility to make it 3D rectangular so that its same along the axis instead of a sphere? How can I adjust the gaussian equation in the plastic damage to make that?
Thanks a lot for the help ^_^