# contact of polyhedron

Hi:

I use polyhedrons in my simulation and it segmentation fault. I search where it got error and find that it got error in function: Simplify in Polyhedra_

However, I don't know in what situations will it get error. And it seems it is more likely to get error when the displacement is very small.

Can you provide some situations that this function will get error? I really want to paste my codes here but my codes contains other input files.

Yours,

Joe

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- Yade Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- zhou qian

- Solved:
- 2019-08-23

- Last query:
- 2019-08-23

- Last reply:
- 2019-08-23

zhou qian (zhoug15) said : | #1 |

Since my problem is likely to be associated with the size of polyhedrons. Here is one of my polyhedrons:

4 vertices:

-0.01841946 -0.01834445 -0.01710164

-0.01667621 -0.016184 -0.007231501

-0.01121877 -0.01043363 -0.009731257

-0.01786081 -0.01001629 -0.01491588

My other polyhedrons are also 4 vertices and have the similar size of the polyhedron above.

Robert Caulk (rcaulk) said : | #2 |

Please read [1] if you wish to solicit help :-)

zhou qian (zhoug15) said : | #3 |

Hi Robert:

I know my description may be unclear but I tried to provide more information.

I read the codes about polyhedron and found that my codes blocked in function Polyhedron Simplify(Polyhedron P,Real limit) in Polyhedra_

I want to know

1.what is this function used for?

I also checked the errored interaction and its relative polyhedrons, and found that the 2 polyhedrons,

Poly1 init dofs:

Vector3(

Vector3(

Vector3(

Vector3(

Poly2 init dofs:

Vector3(

Vector3(

Vector3(

Vector3(

the 2 polys have a common point and in my simulation, they will have a very very small intersection at this point after several steps.

I want to know

2. If the intersection is very very small, will it got wrong? and why?

In fact, if I adjust the time step to a larger one, it does run smoothly. I guess that's because the intersection is larger?

3.Will reducing SIMPLIFY_LIMIT work?

Yours,

Joe

Robert Caulk (rcaulk) said : | #4 |

Thank you so much for helping create a sustainable resource for future users.

Let's start with item 2) from [1].

"If you encounter an error, share it." In other words, copy and paste the error here.

Next, let's look at item 3) from [1]. Without an MWE, we cannot reproduce the "error" that you are referring to and therefore we are throwing darts at a pool table ;-)

If you prefer that we don't investigate your particular error, instead but you simply want to talk about the code, then at the very least we need to make sure we are looking at the same trunk, the same file, the same line. Can you link to the line number for this function "Simplify(

Jan Stránský (honzik) said : | #5 |

Also please provide information about operating system, yade version, method installation (package/source) and CGAL version and how it was installed.

Thanks

Jan

zhou qian (zhoug15) said : | #6 |

Hi Robert Jan:

Here are my codes:

from libyade import yade

from yade import *

from yade import utils,polyhedra

from minieigen import Vector3, Matrix3, Matrix6

# basic materials

matS = PolyhedraMat(

O.materials.

POLY1=[

Vector3(

Vector3(

Vector3(

Vector3(

POLY2=[

Vector3(

Vector3(

Vector3(

Vector3(

poly1 = utils.polyhedro

poly2 = utils.polyhedro

O.bodies.

O.bodies.

# basic YADE engines

O.engines=[

ForceResetter(),

InsertionSor

InteractionLoop(

[

[

[

),

NewtonIntegr

]

O.dt = 0.00001

O.step()

POLY1 and POLY2 contain the coordinates of the 2 polys when it got error. It got error in line 271-289 in function Simplify in /pkg/dem/

I use yade-2017.01a on Ubuntu16.04, but I can't get my CGAL version. CGAL is installed in 2015, so I think its version>4.5. I didn't enable lbmflow linsolv pfvflow sph which don't have any influence on polyhedron mudule.

Thanks for your patience!

Yours,

Joe

Robert Caulk (rcaulk) said : | #7 |

I run your code and I do not get an error. Is there a certain number of iterations required to reproduce the error? What is the error we are looking for....?

zhou qian (zhoug15) said : | #8 |

Hi Robert:

I still got segmentation fault (core dumped) even if I changed a device...

I decide to check the error myself but I want to know what is the function Simplify( line 271-289 /pkg/dem/

Yours,

Joe

Jan Stránský (honzik) said : | #9 |

I **think** (cannot find any reference but I am concerned I read it somewhere) that with newer CGAL, this kind of errors was solved..

Could you try the same code on a newer system (could be just virtual machine)?

Jan

zhou qian (zhoug15) said : | #10 |

Hi Jan:

It works!

Thanks for your reply!

Yours,

Joe