Added new functionality to generate DEM from SPH generator that allow…#409
Added new functionality to generate DEM from SPH generator that allow…#409
Conversation
…s for easy iteration of list of radii. Also added simple rotation to some DEM boundary classes.
| const auto p = position - mPoint; | ||
| const auto pnMag = p.dot(mAxis); | ||
| const auto pn = pnMag * mAxis; | ||
| const auto r = p - pn; // Radial vector from the axis to the position |
There was a problem hiding this comment.
Why did you remove the radial component here on the position, would that assume that mAngularVelocity and mAxis are aligned?
There was a problem hiding this comment.
Yeah I assume that the angular velocity is always around the central axis
| const Vector& axis, | ||
| const Scalar radius, | ||
| const Scalar length, | ||
| const RotationType& angularVelocity): |
There was a problem hiding this comment.
If angularVelocity must be aligned with the axis this should be enforced somehow
There was a problem hiding this comment.
What would you suggest for enforcement of that? I feel like keeping it a simple vector makes sense for conveying that it can't do complex rotation. But I'm open to ideas.
| #-------------------------------------------------- | ||
| if type(particleRadius) in [float,int]: | ||
| if isinstance(particleRadius, list): | ||
| radii = list(particleRadius) |
There was a problem hiding this comment.
ln 36 might not be need? its already a list right?
There was a problem hiding this comment.
The way it seemed to be working before was that if you input in a "particleRadius" argument it had to be a float, int, or function. So if you already have an exact list of particle dimensions that you want to be consistent from sph generation to dem generation it would not accept that list.
In particular I created a list of radii that fit a gaussian distribution from a custom sph generator, but without feeding in that list the sph-to-dem generator would overwrite the particle sizes with the radius guess from h below. Adding in the capability to just drop in a list of radii just seemed easier and more straightforward for future use than having to create a function for potentially every simulation.
| if isinstance(particleRadius, list): | ||
| radii = list(particleRadius) | ||
| counter = {"i" : 0} | ||
| def radiusFunc(position): |
There was a problem hiding this comment.
does this pattern work for SPH generators that are parallel?
There was a problem hiding this comment.
I have only tested for serial generation, but I would imagine that the list would have to be globally concatenated before passing it in for it to work.
…DEM tests to now work with rotating boundaries.
Made a very small change to GenerateDEMfromSPHGenerator.py in NodeGenerators, that adds functionality for easy iteration of list of radii for more complex particle generation. Also added simple rotation to some DEM boundary classes.
Summary
ToDo :
RELEASE_NOTES.mdwith notable changes.