Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap val for level-set discretization PMMG_snpval_ls #124

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from

Conversation

laetitia-m
Copy link

WARNING not to be merged for now because:

  • Not fully finished and tested yet - need to properly transfer data
  • Need to have mmg PR#280 and ParMmg PR#123 merged to be able to test and merged this PR.
  • Some parts of PMMG_snapval_ls function are copy-paste of MMG3D_snpval_ls function. Need to see if we can factorise the functions.
  • Need to add ci tests

Creation of the snap value function PMMG_snpval_ls in file ls_pmmg.c when in LS mode.

laetitia-m and others added 30 commits April 4, 2024 11:22
… Adding tetra works but then fail in the analysis for now
Copy link
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.

Sorry for the ongoing work. I commit the review to feed or remote discussions.

src/ls_pmmg.c Outdated Show resolved Hide resolved
src/ls_pmmg.c Outdated Show resolved Hide resolved
src/ls_pmmg.c Outdated
for (i=0; i < nitem_ext; i++) {
/* Get the indices of the nodes in internal communicators */
idx_ext = ext_comm->int_comm_index[i];
idx_int = grp->node2int_node_comm_index2[idx_ext];
Copy link
Member

@Algiane Algiane Sep 5, 2024

Choose a reason for hiding this comment

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

Misunderstanding of the array content / index error: see #123 (comment)

I think that we have to do something as the following piece of pseudo-code:

alloc ( parmesh->int_node_comm );
memset ( parmesh->int_node_comm, 0 );

for (icomm=0; icomm<next_comm; icomm++) {
...
   for (i=0; i < nitem_ext; i++) {
      idx_ext = ext_comm->int_comm_index[i];
      val_max =  parmesh->int_node_comm [idx_ext];
      parmesh->int_node_comm [idx_ext] = MG_MAX ( val_max, MG_MAX(color_in, color_out)  ); 
   }

for ( i = 0; i<parmesh->ngrps; ++i ) {
   grp = parmhesh->grp[i];
   
   for ( k = 0; k<= grp->nitem_int_node_comm; ++k ) {
     ip = grp->node2int_node_comm_index1[k];
     pos_buf = grp->node2int_node_comm_index2[k];
     mesh->point[ip].s =  parmesh->int_node_comm[ pos_buf ];
   }
}

Copy link
Author

@laetitia-m laetitia-m Sep 6, 2024

Choose a reason for hiding this comment

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

Ok for the misunderstand - this has been modified accordingly.
By filling intvalues with point index ip

for( i = 0; i < grp->nitem_int_node_comm; i++ ){
    ip   = grp->node2int_node_comm_index1[i];
    idx  = grp->node2int_node_comm_index2[i];
    int_comm->intvalues[idx] = ip;
  }

Then, I still guess that what I was doing to find the proc owner is okay because only one group is allowed for PMMG_snpval_ls. (An assert has been added to ensure it assert(parmesh->ngrp == 1 && "more than one group per rank not implemented");)

src/ls_pmmg.c Outdated Show resolved Hide resolved
src/ls_pmmg.c Show resolved Hide resolved
if (p0->tag & MG_OVERLAP) continue; // Ignore overlap points
/* Snap points in the interior of the partition and
interface points with proc owner being this proc color */
if ( (p0->s == -1) || (p0->s == parmesh->myrank)) {
Copy link
Member

Choose a reason for hiding this comment

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

To check:

  • What happens if the ls of one point is snapped by one of the neighbour (because it is in the interface+overlap but owned by the neighbour), another point is snaped by the current rank and both snap creates a non-manifold situation?
  • I think that we are not abble to detect that without gathering the "snaped" points through all process a first time, then checking the manifoldness and then unsnapping the values and shared the unsnap info again ?

Copy link
Author

Choose a reason for hiding this comment

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

Need to think about it to be sure I fully understand what you mean, but I think this case will be covered.

src/ls_pmmg.c Show resolved Hide resolved
Copy link

codecov bot commented Sep 8, 2024

Codecov Report

Attention: Patch coverage is 88.32808% with 37 lines in your changes missing coverage. Please review.

Project coverage is 63.52%. Comparing base (c224b90) to head (4192277).

Files with missing lines Patch % Lines
src/ls_pmmg.c 62.50% 28 Missing and 5 partials ⚠️
src/overlap_pmmg.c 98.67% 1 Missing and 2 partials ⚠️
src/debug_pmmg.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #124      +/-   ##
===========================================
+ Coverage    63.14%   63.52%   +0.37%     
===========================================
  Files           46       47       +1     
  Lines        18962    19274     +312     
  Branches      3548     3610      +62     
===========================================
+ Hits         11974    12243     +269     
- Misses        6060     6088      +28     
- Partials       928      943      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants