Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemFlags.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/* ItemFlags.h (C) 2000-2026 */
9/* */
10/* Flags containing the characteristics of an entity. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMFLAGS_H
13#define ARCANE_CORE_ITEMFLAGS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
38class ARCANE_CORE_EXPORT ItemFlags
39{
40 public:
41
42 using FlagType = Int32;
43
44 public:
45
46 // The 'readable' display of the flags is implemented in ItemPrinter.
47 // It must be updated if values here are modified or added.
48
49 enum : FlagType
50 {
51 II_Boundary = 1 << 1,
52 II_HasFrontCell = 1 << 2,
53 II_HasBackCell = 1 << 3,
56 II_Own = 1 << 6,
57 II_Added = 1 << 7,
58 II_Suppressed = 1 << 8,
59 II_Shared = 1 << 9,
61 //II_JustRemoved = 1 << 11, //!< The entity has just been removed
62 II_JustAdded = 1 << 12,
63 II_NeedRemove = 1 << 13,
64 II_SlaveFace = 1 << 14,
65 II_MasterFace = 1 << 15,
66 II_Detached = 1 << 16,
67 /*
68 * \brief The entity uses edges instead of faces.
69 *
70 * This is only used for 2D cells of non-manifold meshes. If set, it means that
71 * 1D entities are of type Edge and not of type Face.
72 */
73 II_HasEdgeFor1DItems = 1 << 17,
74
75 II_Coarsen = 1 << 18,
76 II_DoNothing = 1 << 19,
77 II_Refine = 1 << 20,
78 II_JustRefined = 1 << 21,
79 II_JustCoarsened = 1 << 22,
80 II_Inactive = 1 << 23,
82
87 II_Overlap = 1 << 25,
88
92 II_InPatch = 1 << 26,
93
94 II_UserMark1 = 1 << 30,
95 II_UserMark2 = 1 << 31
96 };
97
98 static const int II_InterfaceFlags = II_Boundary + II_HasFrontCell + II_HasBackCell +
99 II_FrontCellIsFirst + II_BackCellIsFirst;
100
101 static constexpr bool isOwn(FlagType f) { return (f & II_Own) != 0; }
102 static constexpr bool isShared(FlagType f) { return (f & II_Shared) != 0; }
103 static constexpr bool isBoundary(FlagType f) { return (f & II_Boundary) != 0; }
104 static constexpr bool isSubDomainBoundary(FlagType f) { return (f & II_Boundary) != 0; }
105 static constexpr bool hasBackCell(FlagType f) { return (f & II_HasBackCell) != 0; }
106 static constexpr bool isSubDomainBoundaryOutside(FlagType f)
107 {
108 return isSubDomainBoundary(f) && hasBackCell(f);
109 }
110
120 static constexpr Int32 backCellIndex(FlagType f)
121 {
122 if (f & II_HasBackCell)
123 return (f & II_BackCellIsFirst) ? 0 : 1;
124 return -1;
125 }
126
136 static constexpr Int32 frontCellIndex(FlagType f)
137 {
138 if (f & II_HasFrontCell)
139 return (f & II_FrontCellIsFirst) ? 0 : 1;
140 return -1;
141 }
142};
143
144/*---------------------------------------------------------------------------*/
145/*---------------------------------------------------------------------------*/
146
147} // End namespace Arcane
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152#endif
Arcane configuration file.
Flags for entity characteristics.
Definition ItemFlags.h:39
@ II_FrontCellIsFirst
The first cell of the entity is the front cell.
Definition ItemFlags.h:54
@ II_NeedRemove
The entity must be removed.
Definition ItemFlags.h:63
@ II_MasterFace
The entity is a master face of an interface.
Definition ItemFlags.h:65
@ II_Inactive
The entity is inactive //COARSEN_INACTIVE,.
Definition ItemFlags.h:80
@ II_Refine
The entity is marked for refinement.
Definition ItemFlags.h:77
@ II_Overlap
[AMR Patch] The entity is marked as overlapping with at least one AMR patch.
Definition ItemFlags.h:87
@ II_JustAdded
The entity has just been added.
Definition ItemFlags.h:62
@ II_InPatch
[AMR Patch] The entity is marked as being in an AMR patch.
Definition ItemFlags.h:92
@ II_Shared
The entity is shared by another subdomain.
Definition ItemFlags.h:59
@ II_HasBackCell
The entity has a back cell.
Definition ItemFlags.h:53
@ II_SubDomainBoundary
The entity is at the boundary of two subdomains.
Definition ItemFlags.h:60
@ II_JustRefined
The entity has just been refined.
Definition ItemFlags.h:78
@ II_Own
The entity is a domain-specific entity.
Definition ItemFlags.h:56
@ II_Suppressed
The entity has just been suppressed.
Definition ItemFlags.h:58
@ II_Detached
The entity is detached from the mesh.
Definition ItemFlags.h:66
@ II_Boundary
The entity is on the boundary.
Definition ItemFlags.h:51
@ II_Added
The entity has just been added.
Definition ItemFlags.h:57
@ II_SlaveFace
The entity is a slave face of an interface.
Definition ItemFlags.h:64
@ II_CoarsenInactive
The entity is inactive and has children tagged for coarsening.
Definition ItemFlags.h:81
@ II_UserMark2
User mark.
Definition ItemFlags.h:95
@ II_HasFrontCell
The entity has a front cell.
Definition ItemFlags.h:52
@ II_DoNothing
The entity is blocked.
Definition ItemFlags.h:76
@ II_BackCellIsFirst
The first cell of the entity is the back cell.
Definition ItemFlags.h:55
@ II_Coarsen
The entity is marked for coarsening.
Definition ItemFlags.h:75
@ II_JustCoarsened
The entity has just been coarsened.
Definition ItemFlags.h:79
@ II_UserMark1
User mark.
Definition ItemFlags.h:94
static constexpr Int32 backCellIndex(FlagType f)
Index in the face for the back cell.
Definition ItemFlags.h:120
static constexpr Int32 frontCellIndex(FlagType f)
Index in the face for the front cell.
Definition ItemFlags.h:136
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.