90 if (nb_node!=nodes_to_merge_local_id.
size())
92 for(
Integer i=0; i<nb_node; ++i ){
93 Node node(nodes_internal[nodes_local_id[i]]);
94 Node node_to_merge(nodes_internal[nodes_to_merge_local_id[i]]);
97 info(4) <<
"ADD CORRESPONDANCE node=" << node.
uniqueId() <<
" node_to_merge=" << node_to_merge.
uniqueId();
98 m_nodes_correspondance.insert(std::make_pair(node_to_merge,node));
104 std::set<Face> marked_faces;
113 if (m_nodes_correspondance.find(node)!=m_nodes_correspondance.end()){
115 marked_faces.insert(face);
118 if (nb_merged_node==nb_node){
123 face_new_nodes_uid.
resize(nb_node);
124 face_new_nodes_sorted_uid.
resize(nb_node);
125 Node new_face_first_node;
127 Node new_node = m_nodes_correspondance.find(*inode)->second;
128 if (inode.index()==0)
129 new_face_first_node = new_node;
130 face_new_nodes_uid[inode.index()] = new_node.
uniqueId();
131 info(4) <<
" OLD_node=" << (*inode).uniqueId() <<
" new=" << new_node.
uniqueId();
134 Face new_face = ItemTools::findFaceInNode2(new_face_first_node,face.
type(),face_new_nodes_sorted_uid);
136 ARCANE_FATAL(
"Can not find corresponding face nodes_uid={0}",face_new_nodes_sorted_uid);
138 m_faces_correspondance.insert(std::make_pair(face,new_face));
141 marked_faces.erase(marked_faces.find(face));
147 std::set<Cell> marked_cells;
151 if (m_nodes_correspondance.find(*inode)!=m_nodes_correspondance.end())
152 marked_cells.insert(cell);
156 for(
Cell cell : marked_cells ){
158 info(4) <<
"MARKED CELL2=" << cell.localId();
161 auto x = m_nodes_correspondance.find(node);
162 if (x!=m_nodes_correspondance.end()){
163 Node new_node = x->second;
165 m_node_family->removeCellFromNode(node,cell_local_id);
166 m_node_family->addCellToNode(new_node,cell);
167 m_cell_family->replaceNode(cell,inode.index(),new_node);
172 auto x = m_faces_correspondance.find(face);
173 if (x!=m_faces_correspondance.end()){
174 Face new_face = x->second;
175 m_face_family->removeCellFromFace(face,cell_local_id);
177 m_face_family->addBackCellToFace(new_face,cell);
179 m_face_family->addFrontCellToFace(new_face,cell);
180 m_cell_family->replaceFace(cell,iface.index(),new_face);
186 for(
Face face : marked_faces ){
187 info(4) <<
"MARKED FACE=" << face.localId();
190 auto x = m_nodes_correspondance.find(node);
191 if (x!=m_nodes_correspondance.end()){
192 Node new_node = x->second;
193 m_node_family->removeFaceFromNode(node,face);
194 m_node_family->addFaceToNode(new_node,face);
195 m_face_family->replaceNode(face,inode.index(),new_node);
204 for(
Face face : marked_faces ){
210 for(
const auto& x : m_faces_correspondance ){
212 m_face_family->removeFaceIfNotConnected(face);
216 for(
const auto& x : m_nodes_correspondance ){
218 m_node_family->removeNodeIfNotConnected(node);
221 m_mesh->modifier()->endUpdate();