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

Fix bug in 'CellFamily::_addChildCellToCell()' when added child cell is not the last #1782

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions arcane/src/arcane/mesh/CellFamily.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,18 @@ _addChildCellToCell2(Cell iparent_cell,Cell child_cell)
/*---------------------------------------------------------------------------*/

void CellFamily::
_addChildCellToCell(Cell iparent_cell,Integer rank,Cell child_cell)
_addChildCellToCell(Cell iparent_cell,Integer position,Cell child_cell)
{
Cell parent_cell(iparent_cell);
// NOTE GG: Cette méthode ne semble fonctionner que si \a rank
// correspond parent_cell->nbHChildren().
// NOTE GG: L'ancienne méthode ci-dessous en commentaire ne semble
// fonctionner que si \a position correspond parent_cell->nbHChildren().
// Et dans ce cas il n'est pas nécessaire de faire 2 appels.
m_hchild_connectivity->addConnectedItem(parent_cell,ItemLocalId(NULL_ITEM_LOCAL_ID));
// m_hchild_connectivity->addConnectedItem(parent_cell,ItemLocalId(NULL_ITEM_LOCAL_ID));
Int32 nb_connected = m_hchild_connectivity->trueCustomConnectivity()->nbConnectedItem(parent_cell);
for( Int32 i=nb_connected; i<(position+1); ++i )
m_hchild_connectivity->addConnectedItem(parent_cell,ItemLocalId(NULL_ITEM_LOCAL_ID));
auto x = _topologyModifier();
x->replaceHChild(ItemLocalId(iparent_cell),rank,child_cell);
x->replaceHChild(ItemLocalId(iparent_cell),position,child_cell);
parent_cell.mutableItemBase().addFlags(ItemFlags::II_Inactive);
}

Expand Down
Loading