Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
DynamicMeshChecker.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* DynamicMeshChecker.h (C) 2000-2025 */
9/* */
10/* Class providing mesh verification methods. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_DYNAMICMESHCHECKER_H
13#define ARCANE_MESH_DYNAMICMESHCHECKER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
20#include "arcane/core/IMeshChecker.h"
21
22#include "arcane/mesh/MeshGlobal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::mesh
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33class DynamicMesh;
34class ItemFamily;
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39class DynamicMeshChecker
40: public TraceAccessor
41, public IMeshChecker
42{
43 public:
44
45 explicit DynamicMeshChecker(IMesh* mesh);
46 ~DynamicMeshChecker();
47
48 public:
49
50 IMesh* mesh() override { return m_mesh; }
51 void setCheckLevel(Integer level) override { m_check_level = level; }
52 Integer checkLevel() const override { return m_check_level; }
53
54 void checkValidMesh() override;
55 void checkValidMeshFull() override;
56 void checkValidReplication() override;
57 void checkVariablesSynchronization() override;
58 void checkItemGroupsSynchronization() override;
59
60 void setIsCheckItemsOwner(bool v) override { m_is_check_items_owner = v; }
61 bool isCheckItemsOwner() const override { return m_is_check_items_owner; }
62
63 public:
64
66 void checkGhostCells();
67 void checkMeshFromReferenceFile();
68 void updateAMRFaceOrientation();
69 void updateAMRFaceOrientation(ArrayView<Int64> ghost_cell_to_refine);
70
71 private:
72
75 void _checkValidItemOwner(IItemFamily* family);
76 void _checkReplicationFamily(IItemFamily* family);
77
78 private:
79
80 IMesh* m_mesh = nullptr;
81 Integer m_check_level = 0;
82
83 VariableCellArrayInt64* m_var_cells_faces = nullptr;
84 VariableCellArrayInt64* m_var_cells_nodes = nullptr;
85
86 bool m_compare_reference_file = false;
87 bool m_is_check_items_owner = true;
88};
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93} // namespace Arcane::mesh
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98#endif /* ARCANE_MESH_DYNAMICMESHCHECKER_H */
Modifiable view of an array of type T.
Interface of an entity family.
Definition IItemFamily.h:83
Interface for mesh verification methods.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
bool isCheckItemsOwner() const override
Indicates whether entity owner verification is active (true by default).
void setCheckLevel(Integer level) override
Sets the mesh verification level.
void setIsCheckItemsOwner(bool v) override
Indicates whether entity owner verification is active.
void checkValidMeshFull() override
Verification of mesh validity.
void checkGhostCells()
Checks that the ghost cell layer is correct.
void _checkEdgesOrientation()
Checks that edges are correctly numbered.
void checkItemGroupsSynchronization() override
Checks synchronization on entity groups.
Integer checkLevel() const override
Current verification level.
void checkVariablesSynchronization() override
Checks variable synchronization.
IMesh * mesh() override
Associated mesh.
void checkValidMesh() override
Performs a preliminary check of mesh validity. The checks cover the following points:
void _checkFacesOrientation()
Checks that faces are correctly oriented and connected.
void checkValidReplication() override
Checks that subdomains are correctly replicated.
Implementation of a mesh.
Definition DynamicMesh.h:98
MeshVariableArrayRefT< Cell, Int64 > VariableCellArrayInt64
Quantity at cell centers of integer array type.
Int32 Integer
Type representing an integer.