How to couple Yade with other program?
Hello
I would like to use Yade coupled with my manual MPM (material point method) program (using C++ including Eigen). I need Yade to interact with MPM for information after a certain time steps of computation.
Specifically, (A) Yade passes particle coordinates, velocity, and radius information to the MPM, and (B) the MPM passes a specified force to each particle in Yade.
I am familiar with the use of Yade and parts of the source code (I've implemented my own constitutive model), but I don't know anything about the conversion from C++ to python and the complete runtime flow of the code. So I am now facing the following problems:
1. For process (A), the easy way I can think of is to extract the vector components of each particle in a python script and generate a list. But since my MPM code uses Eigen::Vector; Eigen::Matrix... , which is the same origin as the data form used in the Yade source code, so is there a quicker alternative? Would it be faster to implement this in C++? and how?
2. For process (B), I guess it would require me to write a new Global_Engine similar to 'NewtonIntegrator' or 'FoamCoupling' and it would need to receive force informations from the MPM. I plan to reserve a parameter in the New_Engine's 'applyForce()' function like 'void applyForce(
3.My manual MPM program is easy to run using Visual Studio (main() function), is there an easy way to integrate it directly into a Yade program? It would eliminate a lot of hassle for coupled use of the two methods.
The above are my rough thoughts and I hope someone can point out my faults and give me some advice.
Actually I've learned something about FoamCoupling, which uses MPI for data exchange between Openfoam and Yade, but I'm not very good at MPI programming, so I'm hoping someone can guide me if possible.
Thanks
Yu
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Wang Yu for more information if necessary.