Skip to content

Feature/ls checkmaniball parmmg#208

Merged
Algiane merged 7 commits intoMmgTools:developfrom
laetitia-m:feature/ls-checkmaniball-parmmg
Apr 18, 2023
Merged

Feature/ls checkmaniball parmmg#208
Algiane merged 7 commits intoMmgTools:developfrom
laetitia-m:feature/ls-checkmaniball-parmmg

Conversation

@laetitia-m
Copy link
Copy Markdown
Contributor

MMG3D_chkmaniball has been modified for ParMmg:

  • if a point, an edge, a triangle or a tetra has the tag PARBDY, do not raise a non-manifold error - at least for now, as the "missing" element(s) of the ball might be on another partition. An additional check will be added in ParMmg later.

Copy link
Copy Markdown
Member

@Algiane Algiane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks for this PR.

Feedback on Mmg modifications

I think that it is not possible to check the manifoldness of a point along a parallel interface with the knowledge of one partition only so I agree to simply skip this check along points marked as MG_PARBDY for now (it will allow you to not be blocked by this check) and to try to implement a clean parallel check inside ParMmg later (it is not the easiest thing to do so maybe we can postpone this for when you will be more confortable with the ParMmg data structure).

To do that, I think that we may simply ignore MG_PARBDY points in the MMG3D_chkmani function (here).
If MMG3D_chkmaniball is called only on level-set points that are not along the interfaces between the partitions, we should not cross MG_PARBDY entities when travelling the ball so I don't think that it is needed to modify this function.

Ideas for parallel implementation of the check of the implicit domain manifoldness

If we follow the outline of the serial algo, for each point belonging to the level-set, we will have to:

  1. build the list of the tetrahedra of the ball of the point with the same ref of the starting tetrahedron and reachable by face adjacency without crossing another reference. It has to be done by travelling through partitions and with respect to the order of travel inside the ball;
  2. complete the ball of the point with the remaining tetrahedra (again, it has to be done through the parallel interfaces end it may imply pultiple MPI processes);
  3. check that we don't have a tetra with the initial reference in the second part of the list (tetra not reachable without crossing a different reference). Otherwise, it means that we have a domain connected to itself by only an edge or a point.

With our current data structures, It seems pretty hard to do this without a large amount of very small MPI communications. In a first guess, I would propose (but we have to check possible difficulties in the implementation ;-) ):

  1. to build the layer of the neighbouring tetrahedra of the partition on each MPI process (a tetrahedra is considered as a neighbour if at least one of its vertices belongs to the partition boundary). It can be seen as the building of an overlap for each partition.
  2. that each process travel the tetra at the interface of its partition (I suppose that we have 1 partition per MPI process), and to check the manifoldness of points that are both along the partitions interfaces and the level-set using the array(s) of the neighbouring tetra.
  3. The manifoldness of other points will be checked by the serial Mmg function.

Normally we will have MPI communications only during the first step and it will be possible to gather the infos to be sent to have very few comms per pairs of MPI processes. By the way, I think that having the overlap will also be useful to check the level-set snapping/unsnapping.

Best

return 0;
pxt = mesh->xtetra[pt->xt];
pmmg_bdy=0;
/* if an edge is MG_PARBDY: this is not a non-manifold topology */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot know in fact:the topology may be manifold or not. We have to travel the entire ball of the point through the different processors to decide.

Comment on lines +1519 to +1530
/* - True for centralized input in parmmg */
/* - Wrong for distributed input in parmmg: TODO */
for (iedge=0; iedge<6; iedge++) {
if ( !(pxt.tag[iedge] & MG_PARBDY) ) continue;
pmmg_bdy=1;
}
/* if the starting point is MG_PARBDY: this is not a non-manifold topology */
/* - True for centralized input in parmmg */
/* - Wrong for distributed input in parmmg: TODO */
if ( mesh->point[nump].tag & MG_PARBDY) {
pmmg_bdy=1;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, here, you are just skipping the test of manifoldness along entites belonging to boundary faces marked as parallel. It avoid some cases of spurious detection of non-manifold situations but doesn't allow to detect true non-manifold cases on points belonging to parallel interfaces.
In the following picture (2D for sake of simplicity), the left-hand side case has to be detected as manifold while the right-hand side case has to be detected as non-manifold.
Capture d’écran 2023-04-17 à 12 02 39

Taken separately, the informations of each MPI process are not sufficient to make a decision.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's why I wrote Wrong for distributed input in parmmg: TODO in the code. I did that to skip this warning in parmmg for now. But I agree in the distributed input version we need to be able to detect true and false non-manifold situation.
For centralized input as the ls discretisation is done on the centralised mesh, we do not have any issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that what I miss is why you need to test the presence of PARBDY entities inside the ball of point (so in the chkmaniball function)? I think that it is not possible to try to travel through a PARBDY face if the point is not PARBDY. Thus, it seems sufficient for me to check if the point is PARBDY in the chkmani function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally right. I have modified the code in accordance. Thanks.

@Algiane Algiane requested review from Algiane and dapogny April 17, 2023 15:20
@Algiane Algiane added the part: ls discretization isovalue discretiztion mode specificity label Apr 17, 2023
Copy link
Copy Markdown
Member

@Algiane Algiane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

@Algiane Algiane merged commit ace4d5d into MmgTools:develop Apr 18, 2023
@laetitia-m laetitia-m deleted the feature/ls-checkmaniball-parmmg branch May 9, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part: ls discretization isovalue discretiztion mode specificity

Development

Successfully merging this pull request may close these issues.

2 participants