Skip to content

Commit 02d89b9

Browse files
committed
[arcane,mesh] Add missing methods in PolyhedralMesh for a parallel run. No item exchanges yet.
1 parent 45cb2c9 commit 02d89b9

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

arcane/src/arcane/mesh/PolyhedralMesh.cc

+86
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "arcane/core/internal/IMeshInternal.h"
4444
#include "arcane/utils/Collection.h"
4545
#include "arcane/utils/List.h"
46+
#include "arcane/utils/PlatformUtils.h"
4647

4748
#include "neo/Mesh.h"
4849
#include "ItemConnectivityMng.h"
@@ -1338,6 +1339,70 @@ addNodes(Int64ConstArrayView nodes_uid, Int32ArrayView nodes_lid)
13381339
/*---------------------------------------------------------------------------*/
13391340
/*---------------------------------------------------------------------------*/
13401341

1342+
void mesh::PolyhedralMesh::
1343+
exchangeItems()
1344+
{
1345+
m_trace_mng->info() << "PolyhedralMesh::_exchangeItems() do_compact?=" << "false"
1346+
<< " nb_exchange=" << 0 << " version=" << 0;
1347+
_exchangeItems();
1348+
String check_exchange = platform::getEnvironmentVariable("ARCANE_CHECK_EXCHANGE");
1349+
if (!check_exchange.null()){
1350+
m_mesh_checker.checkGhostCells();
1351+
m_trace_mng->pwarning() << "CHECKING SYNCHRONISATION !";
1352+
m_mesh_checker.checkVariablesSynchronization();
1353+
m_mesh_checker.checkItemGroupsSynchronization();
1354+
}
1355+
if (checkLevel()>=2)
1356+
m_mesh_checker.checkValidMesh();
1357+
else if (checkLevel()>=1)
1358+
m_mesh_checker.checkValidConnectivity();
1359+
1360+
}
1361+
1362+
/*---------------------------------------------------------------------------*/
1363+
/*---------------------------------------------------------------------------*/
1364+
1365+
void mesh::PolyhedralMesh::
1366+
_exchangeItems()
1367+
{
1368+
; //todo
1369+
}
1370+
1371+
/*---------------------------------------------------------------------------*/
1372+
/*---------------------------------------------------------------------------*/
1373+
1374+
void mesh::PolyhedralMesh::
1375+
prepareForDump()
1376+
{
1377+
// do nothing for now
1378+
auto want_dump = false;
1379+
auto need_compact = false;
1380+
m_trace_mng->info(4) << "DynamicMesh::prepareForDump() name=" << name()
1381+
<< " need_compact?=" << need_compact
1382+
<< " want_dump?=" << want_dump
1383+
<< " timestamp=" << 0;
1384+
1385+
{
1386+
eMeshEventType t = eMeshEventType::BeginPrepareDump;
1387+
m_mesh_events.eventObservable(t).notify(MeshEventArgs(this,t));
1388+
}
1389+
1390+
// todo use Properties
1391+
if (want_dump) {
1392+
for (auto& family : m_arcane_families) {
1393+
family->prepareForDump();
1394+
}
1395+
}
1396+
1397+
{
1398+
eMeshEventType t = eMeshEventType::EndPrepareDump;
1399+
m_mesh_events.eventObservable(t).notify(MeshEventArgs(this,t));
1400+
}
1401+
}
1402+
1403+
/*---------------------------------------------------------------------------*/
1404+
/*---------------------------------------------------------------------------*/
1405+
13411406
CellGroup mesh::PolyhedralMesh::
13421407
allActiveCells()
13431408
{
@@ -1415,6 +1480,27 @@ utilities()
14151480
return m_mesh_utilities.get();
14161481
}
14171482

1483+
/*---------------------------------------------------------------------------*/
1484+
/*---------------------------------------------------------------------------*/
1485+
1486+
VariableItemInt32& mesh::PolyhedralMesh::
1487+
itemsNewOwner(eItemKind ik)
1488+
{
1489+
IItemFamily* item_family = _itemFamily(ik);
1490+
ARCANE_CHECK_POINTER(item_family);
1491+
return item_family->itemsNewOwner();
1492+
}
1493+
1494+
/*---------------------------------------------------------------------------*/
1495+
/*---------------------------------------------------------------------------*/
1496+
1497+
Integer mesh::PolyhedralMesh::
1498+
checkLevel() const
1499+
{
1500+
return m_mesh_checker.checkLevel();
1501+
}
1502+
1503+
14181504
/*---------------------------------------------------------------------------*/
14191505
/*---------------------------------------------------------------------------*/
14201506

arcane/src/arcane/mesh/PolyhedralMesh.h

+14
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ class PolyhedralMesh
253253

254254
IMeshCompactMng* _compactMng() override;
255255

256+
void exchangeItems() override;
257+
256258
// For now, use _internalAPI()->polyhedralMeshModifier instead of IMeshModifier not implemented yet
257259
IMeshModifier* modifier() override {return this;}
258260
bool isDynamic() const override {return true;} // wip parallel, IMesh API
@@ -272,9 +274,19 @@ class PolyhedralMesh
272274
FaceGroup innerActiveFaces() override;
273275
FaceGroup outerActiveFaces() override;
274276

277+
IMeshPartitionConstraintMng* partitionConstraintMng() override { return nullptr; }
278+
279+
VariableItemInt32& itemsNewOwner(eItemKind ik) override;
280+
281+
IItemFamilyNetwork* itemFamilyNetwork() override { return nullptr; }
282+
283+
Integer checkLevel() const override;
275284

276285
IUserDataList* userDataList() override { return m_mesh_handle.meshUserDataList(); }
277286
const IUserDataList* userDataList() const override { return m_mesh_handle.meshUserDataList(); }
287+
288+
void prepareForDump() override;
289+
278290
private:
279291

280292
void addItems(Int64ConstArrayView unique_ids, Int32ArrayView local_ids, eItemKind ik, const String& family_name);
@@ -284,6 +296,8 @@ class PolyhedralMesh
284296
PolyhedralFamily* _itemFamily(eItemKind ik);
285297
PolyhedralFamily* _findItemFamily(eItemKind ik, const String& name, bool create_if_needed = false);
286298

299+
void _exchangeItems();
300+
287301
#endif // ARCANE_HAS_POLYHEDRAL_MESH_TOOLS
288302

289303
private:

0 commit comments

Comments
 (0)