Skip to content

Commit 4430274

Browse files
Removed warnings.
1 parent fbd78ce commit 4430274

File tree

1 file changed

+17
-60
lines changed

1 file changed

+17
-60
lines changed

arcane/src/arcane/impl/ArcaneBasicMeshSubdividerService.cc

+17-60
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,31 @@
1717

1818

1919

20-
#include "arcane/ItemGroup.h"
21-
#include "arcane/ItemPrinter.h"
20+
#include "arcane/core/ItemGroup.h"
21+
#include "arcane/core/ItemPrinter.h"
2222
#include "arcane/core/IItemFamily.h"
23-
#include "arcane/IGhostLayerMng.h"
24-
#include "arcane/MeshUtils.h"
25-
#include "arcane/IMeshModifier.h"
23+
#include "arcane/core/IGhostLayerMng.h"
24+
#include "arcane/core/MeshUtils.h"
25+
#include "arcane/core/IMeshModifier.h"
2626

2727
#include "arcane/core/SimpleSVGMeshExporter.h" // Write au format svg pour le 2D
2828
// Write variables
2929

3030
#include "arcane/core/ServiceBuilder.h"
3131
#include "arcane/core/Directory.h"
3232
#include "arcane/core/IVariableMng.h"
33-
#include "arcane/IParallelMng.h"
34-
#include "arcane/BasicService.h"
35-
#include<arcane/IPrimaryMesh.h>
33+
#include "arcane/core/IParallelMng.h"
34+
#include "arcane/core/BasicService.h"
35+
#include "arcane/core/IPrimaryMesh.h"
3636

3737
// get parameter
3838
#include "arcane/utils/ApplicationInfo.h"
3939
#include "arcane/utils/CommandLineArguments.h"
4040

4141
// utils
42-
#include <map>
4342
#include <unordered_set>
4443
#include <algorithm>
45-
#include <iostream>
4644
#include <iterator>
47-
#include <vector>
4845

4946
#include "arcane/core/IMeshUtilities.h"
5047

@@ -110,7 +107,6 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
110107
Int32 version = gm->builderVersion();
111108
if (version < 3)
112109
gm->setBuilderVersion(3);
113-
Int32 nb_ghost_layer = gm->nbGhostLayer();
114110
gm->setNbGhostLayer(0);
115111
mesh_modifier->setDynamic(true);
116112
mesh_modifier->updateGhostLayers();
@@ -124,7 +120,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
124120
// Compter les arrêtes
125121
// On cherche un moyen de compter les arrêtes pour faire un test facile sur le nombre de noeud inséré.
126122
// ARCANE_ASSERT((nb_edge_init+ nb_cell_init + nb_face_init)== nb_node_added,("Mauvais nombre de noeuds insérés"));
127-
//std::cout << "#NOMBRE INITS " << nb_node_init << " " << mesh->allEdges().size() << " " << edg.size() << " " << nb_face_init << " " << nb_cell_init << std::endl;
123+
//debug() << "#NOMBRE INITS " << nb_node_init << " " << mesh->allEdges().size() << " " << edg.size() << " " << nb_face_init << " " << nb_cell_init ;
128124

129125
// VARIABLES
130126
// Items à ajouter avec connectivités pour E F et C
@@ -138,7 +134,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
138134

139135
VariableNodeReal3& nodes_coords = mesh->nodesCoordinates();
140136
std::unordered_map<Int64, Real3> nodes_to_add_coords;
141-
std::cout << "ARRAY SIZE " << nodes_coords.arraySize() << std::endl;
137+
debug() << "ARRAY SIZE " << nodes_coords.arraySize() ;
142138
// Nodes on entities
143139
std::set<Int64> new_nodes; // Utiliser une map permet s'assurer qu'on ajoute une seule fois un noeud avec un uniqueId()
144140
std::set<Int64> new_faces; // ^--- Pareil pour les faces
@@ -160,44 +156,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
160156
nodes_to_add.reserve(nb_node_to_add_total);
161157
nodes_to_add_coords.reserve(nb_node_to_add_total);
162158

163-
IParallelMng* pm = mesh->parallelMng();
164-
// Calcul max_node_uid
165-
166-
Int64 max_node_uid = 0;
167159
Arcane::VariableNodeReal3& nodes_coordinates = mesh->nodesCoordinates();
168-
169-
ENUMERATE_NODE(inode,mesh->allNodes())
170-
{
171-
const Node& node = *inode;
172-
const Int64 uid = node.uniqueId();
173-
if (uid>max_node_uid)
174-
max_node_uid = uid;
175-
}
176-
Integer m_max_node_uid = 0, m_next_node_uid;
177-
if (pm->commSize() > 1)
178-
m_max_node_uid = pm->reduce(Parallel::ReduceMax, max_node_uid);
179-
else
180-
m_max_node_uid = max_node_uid;
181-
info() << "NODE_UID_INFO: MY_MAX_UID=" << max_node_uid << " GLOBAL=" << m_max_node_uid;
182-
m_next_node_uid = m_max_node_uid + 1 + my_rank;
183-
184-
// Calcul max_cell_uid
185-
Int64 max_cell_uid = 0;
186-
ENUMERATE_CELL(icell,mesh->allCells())
187-
{
188-
const Cell& cell = *icell;
189-
const Int64 uid = cell.uniqueId();
190-
if (uid>max_cell_uid)
191-
max_cell_uid = uid;
192-
}
193-
Integer m_max_cell_uid = 0;
194-
if (pm->commSize() > 1)
195-
m_max_cell_uid = pm->reduce(Parallel::ReduceMax, max_cell_uid);
196-
else
197-
m_max_cell_uid = max_cell_uid;
198-
199-
std::cout << "MAXCELLUID " << max_cell_uid << " " << m_max_cell_uid << std::endl;
200-
max_cell_uid ++;
201160
Integer ind_new_cell = 0 ;
202161

203162
ARCANE_ASSERT((mesh->nbEdge() == 0 ),("Wrong number of edge"));
@@ -252,12 +211,10 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
252211
node_in_cell[new_nodes_on_edges_couple[i][0]],
253212
node_in_cell[new_nodes_on_edges_couple[i][1]],
254213
};
255-
Int32 min_index=0; // tmp[0]
256214
if( tmp[0] > tmp[1] ){
257215
std::swap(tmp[0],tmp[1]);
258-
min_index=1;
259216
}
260-
std::cout << "#TMP " << "cell" << cell.uniqueId() << ' ' << tmp << std::endl;
217+
debug() << "#TMP " << "cell" << cell.uniqueId() << ' ' << tmp ;
261218
node_in_cell[index_27] = Arcane::MeshUtils::generateHashUniqueId(tmp.constView());
262219
// Coord on edge
263220
Arcane::Real3 middle_coord(0.0,0.0,0.0);
@@ -330,7 +287,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
330287
new_nodes.insert(node_in_cell[i]);
331288
}
332289
}
333-
std::cout << nodes_to_add_coords.size() << " " << nodes_to_add.size() << std::endl;
290+
debug() << nodes_to_add_coords.size() << " " << nodes_to_add.size() ;
334291

335292
ARCANE_ASSERT((nodes_to_add_coords.size() == static_cast<size_t>(nodes_to_add.size())),("Has to be same"));
336293
// Génération des Faces
@@ -368,7 +325,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
368325
faces_to_add.add(node_in_cell[internal_faces[i][3]]);
369326
// Ajouter dans tableau uids faces
370327
faces_uids.add(uidface);
371-
std::cout << 6+ nb_face_to_add << " " << uidface << std::endl;
328+
debug() << 6+ nb_face_to_add << " " << uidface ;
372329
nb_face_to_add++;
373330
new_faces.insert(uidface);
374331
}
@@ -473,9 +430,9 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
473430
UniqueArray<Int32> face_lid(faces_uids.size());
474431

475432
mesh->modifier()->addFaces(MeshModifierAddFacesArgs(nb_face_to_add, faces_to_add.constView(),face_lid.view()));
476-
std::cout << "addOneFac" << nb_face_to_add << std::endl;
433+
debug() << "addOneFac" << nb_face_to_add ;
477434
mesh->faceFamily()->itemsUniqueIdToLocalId(face_lid,faces_uids,true);
478-
std::cout << "NB_FACE_ADDED AFTER " << face_lid.size() << " " << new_faces.size() << std::endl ;
435+
debug() << "NB_FACE_ADDED AFTER " << face_lid.size() << " " << new_faces.size() ;
479436

480437
ARCANE_ASSERT((nb_face_to_add == (faces_to_add.size()/6)),("non consistant number of faces"));
481438

@@ -510,7 +467,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
510467
ENUMERATE_(Node, inode, mesh->allNodes()){
511468
Node node = *inode;
512469
auto it = std::min_element(node.cells().begin(),node.cells().end());
513-
Cell cell = node.cell(std::distance(node.cells().begin(),it));
470+
Cell cell = node.cell(static_cast<Int32>(std::distance(node.cells().begin(),it)));
514471
node_uid_to_owner[node.uniqueId().asInt64()] = cell.owner();
515472
}
516473

@@ -519,7 +476,7 @@ subdivideMesh([[maybe_unused]] IPrimaryMesh* mesh)
519476
ENUMERATE_(Face, iface, mesh->allFaces()){
520477
Face face = *iface;
521478
auto it = std::min_element(face.cells().begin(),face.cells().end());
522-
Cell cell = face.cell(std::distance(face.cells().begin(),it));
479+
Cell cell = face.cell(static_cast<Int32>(std::distance(face.cells().begin(),it)));
523480
face_uid_to_owner[face.uniqueId().asInt64()] = cell.owner();
524481
}
525482

0 commit comments

Comments
 (0)