How to move a triangular mesh according to the force/moment generated by particles?

Asked by Bin Cheng on 2017-07-21


I am try to simulate a irregular body (represented by tri-mesh) impacting granular matter. So I need to add the socalled "moving mesh", which would has translation and rotation according to the force and moment generated by the granular system.

In other words, how to get the force vector and contact position of the particle-mesh interaction and how to add the increment to the position of all points in the mesh every timestep?

I have found some answers on this topic, but all of them just need to move the mesh according to the time (e.g., velocity*time), instead of considering the force and moment, so I really need your advice.

With kind regards,

Yours sincerely,

Bin Cheng.

Question information

English Edit question
ESyS-Particle Edit question
No assignee Edit question
Solved by:
Christoph Heiniger
Last query:
Last reply:

This question was reopened

Christoph Heiniger (heinigec) said : #1

Dear Bin,

I am currently working on a similar feature, but we only care about the resulting force acting on the mesh. Nevertheless the code might be helpful to you.

I intend to contribute my changes next week. I am in contact with the developers of ESyS-Particle. I will let you know as soon as I know more.

All the best,

Bin Cheng (bincheng) said : #2

Hi Christoph,

It is really cool that you have added this useful feature. Do you add this so called "dynamical mesh" through changing some source codes? If so, would you please send the related code to me? Or give me some suggestions on how to modify the code? As you kown, many classes and functions in ESyS-Particle is very hard to read and understand...

I should be most grateful if that is possible.

Thank you in advance for your kind assistance, and look forward to receiving your advice soon.

With kind regards,

Yours sincerely,

Bin Cheng

Christoph Heiniger (heinigec) said : #3

Hi Bin,

As far as I understand one has to modify the code to achieve this.

My suggestion would be to implement a function called getTriMeshForce() that returns the resulting force (see "definition" below) as a vector and takes the name of the mesh as a parameter. For my purposes this is sufficient.

I understand the problem as following:

A mesh is comprised of triangles. Each triangle stores the force acting on it. By resulting force, the sum over all forces acting on the triangles is meant.

In contrast to the storage of particles the mesh is known to all workers. Thus the resulting force is calculated on every worker and can be summed by a call of MPI_Reduce or MPI_Allreduce and is afterwards available on the master.

One could then move the mesh in a Runnable using the following pseudo code

f = sim.getTriMeshForce(meshname)
displacement = calculateDisplacement(f)
sim.translateMeshBy(meshname, displacement)

Let me review and test my code and I will try to publish it in some form next week.

Please let me know if something is unclear or seems wrong.

Furthermore, feedback about the approach is welcome as I am new to ESyS-Particle myself.

All the best,

Bin Cheng (bincheng) said : #4

Hi Christoph,

Thank you very much for your help.

 I have some questions on this topic:

1) A particle could contact with the mesh in triangles, edges or corners, thus we must add all the kinds of force acting on the mesh. Does ESyS-Particle have a "total-interaction' class including all the three types? Or I need to add the three kinds of force manually.

2) Could you please tell me which files should I read in the folder named Model? As you know, there are lots of files seem to associated with this problem. Maybe TriMesh.h/.cpp, ETriMeshInteraction.h, ETriMeshIP.h and ETriangleInteraction.h?

I'm in the beginner stage of coding with c++, thus I can not find how to start reading so many complicated classes (because I don't kown the use of many classes)...

3) So far as I know, ESyS-Particle doesn't include frictional wall/mesh. Have you added this feature in your code? Or do you want to add this feature in the code? Maybe we could do this tegether (although I didn't kowm this code very much).

With kind regards,

Yours sincerely,

Bin Cheng

Christoph Heiniger (heinigec) said : #5

Hi Bin,

Thank you for the feedback.

1) Judging from the source code (see Geometry/Edge.cpp and Geometry/Corner.cpp the method applyForce) this should already be handled correctly.

2) I would recommend to get an overview of the master / worker architecture of ESyS. In my approach, some of the classes I have changed are the following:

- Python/esys/lsm/LsmMpiPy.cpp (Definition of the python interface)
- Parallel/SubLattice.hpp ("Local" force summation of the mesh stored on the worker)
- Parallel/LatticeMaster.cpp (Receive resulting force)

3) I have not added frictional interaction to the code and do not intend to it at the moment. If this changes I am happy to come back to you.

I hope this helps.

All the best,

Bin Cheng (bincheng) said : #6

Thanks Christoph Heiniger, that solved my question.

Bin Cheng (bincheng) said : #7

Hi Christoph,

I have some problems when I read the source code of ESyS-Particle.

For instance, what the difference between some similar classes: xxxInteraction and xxxInteractionGroup?

Some kinds of interaction have both of these two, e.g., CElasticSphereBodyInteraction coupled with CESphereBodyInteractionGroup. However, some kinds of interaction only have the interaction class, e.g., CRorFricitonInteraction without "CRorFricitonInteractionGroup". Why the latter one only has the interaction class?

Thanks for your help in advance,

With kind regards,



Best Christoph Heiniger (heinigec) said : #8

This question is answered here by Dion Weatherley:

Bin Cheng (bincheng) said : #9

Thank your very much for your help!

Best wishes!


Bin Cheng (bincheng) said : #10

Thanks Christoph Heiniger, that solved my question.