Custom Pre-Processing Tool
Greetings,
I'm going to need to develop a custom pre-processing tool capable of importing a series of STLs, automatically detecting their positions & filling them with boundary particles, and using them as DEM objects in my model.
Ricardo advised me at the 2nd Users Workshop that DEM objects with complex shapes (such as in the Rocky Debris Flow model on the DualSPHysics YouTube channel) can be created with MATLAB, python, or similar. I'm confident enough with MATLAB and python to proceed with this, but as far as understanding how to take 3D mesh points and assemble & write them to Case.bi4, I'm lost, and would appreciate the guidance of anyone who has built their own DualSPHysics pre-processing tool before.
Specific questions:
- Is it possible to use a second pre-processing tool IN ADDITION TO, not instead of, GenCase? Presumably something which appends to or can write into Case.bi4? I'm not trying to replace GenCase if I don't have to, only add functionality.
- How do you save data as .bi4? Are there resources other than the ToVtk code to understand the structure of .bi4?
- Can the GenCase source code be made available? I don't do much with C++, but seeing the structure of the code could help me create a pre-processing tool in MATLAB. Understanding the structure of arrays of position, velocity and density and headers is my major concern.
- If you are reading this and have written your own DualSPHysics pre-processing tool (even a very basic one), would you be open to sharing it with me as an example?
Many thanks,
Nick Richmond
TAGS: GenCase, Pre-Processing, DEM, @RCanelas, @Alex
I'm going to need to develop a custom pre-processing tool capable of importing a series of STLs, automatically detecting their positions & filling them with boundary particles, and using them as DEM objects in my model.
Ricardo advised me at the 2nd Users Workshop that DEM objects with complex shapes (such as in the Rocky Debris Flow model on the DualSPHysics YouTube channel) can be created with MATLAB, python, or similar. I'm confident enough with MATLAB and python to proceed with this, but as far as understanding how to take 3D mesh points and assemble & write them to Case.bi4, I'm lost, and would appreciate the guidance of anyone who has built their own DualSPHysics pre-processing tool before.
Specific questions:
- Is it possible to use a second pre-processing tool IN ADDITION TO, not instead of, GenCase? Presumably something which appends to or can write into Case.bi4? I'm not trying to replace GenCase if I don't have to, only add functionality.
- How do you save data as .bi4? Are there resources other than the ToVtk code to understand the structure of .bi4?
- Can the GenCase source code be made available? I don't do much with C++, but seeing the structure of the code could help me create a pre-processing tool in MATLAB. Understanding the structure of arrays of position, velocity and density and headers is my major concern.
- If you are reading this and have written your own DualSPHysics pre-processing tool (even a very basic one), would you be open to sharing it with me as an example?
Many thanks,
Nick Richmond
TAGS: GenCase, Pre-Processing, DEM, @RCanelas, @Alex
Comments
You don't really have to use the *.bi4 format, you could have your own ASCII files to be used with the solver,
cheers,
G.
it did this a while ago. And it turned out to be a very very painful lession. Basically you are coding the gencase in to your private enviroment. If you are finally able to do any geometries with it that represnet your case, you have to think about the particle lists. Coordinates rhop inicial veloicties pressure. Than you need to think about how to get these into DualSphysics. I couldnt figure out any way to load a ascii file in version 4, it was possible in verion 3. Maybe I am jut to stupid for that but I never could find out how the bi4 file format is actually written. Maybe I just have overseen it in the partvtk4. So In verion 4 I just brutforced my particle list into dualsphysics, by overwirting anything which is related to loading a binary4, by a fread command in c++.It may take some time because one needs to to identify all enties. At the end it works quite well, if you find out how to write a bi4 file format in matlab phyton whatever let me know. Best
GenCase is not going to be released as open source. GenCase is just a code to create particles defining the initial position, velocity, density.... that is it. This can be created by the user with other codes.