14#include "arcane/utils/String.h"
16#include "arcane/core/ItemPrinter.h"
17#include "arcane/core/ItemInternalEnumerator.h"
18#include "arcane/core/IItemFamily.h"
19#include "arcane/core/IMesh.h"
20#include "arcane/core/MeshPartInfo.h"
59print(std::ostream& o)
const
62 if (m_has_item_kind) {
83print(std::ostream& ostr)
const
86 ostr <<
"(null Item)";
98 if (m_item.nbNode() != 0)
102 if (m_item.nbEdge() != 0)
105 if (m_item.nbFace() != 0)
109 if (m_item.nbCell() != 0)
117void NeighborItemPrinter::
118_printSubItems(std::ostream& ostr,
Integer level,
Integer levelmax,
122 for (
Item sub_item : sub_items) {
123 indent(ostr, levelmax - level) <<
"\t" << name;
124 print(ostr, sub_item, level - 1, levelmax);
135 impl::ItemBase item = xitem.itemBase();
137 ostr <<
"(null Item)";
150 if (item.nbNode() != 0)
151 _printSubItems(ostr, level, levelmax, item.nodeList(),
"node");
152 if (item.nbEdge() != 0)
153 _printSubItems(ostr, level, levelmax, item.edgeList(),
"edge");
154 if (item.nbFace() != 0)
155 _printSubItems(ostr, level, levelmax, item.faceList(),
"face");
157 if (item.nbCell() != 0)
158 _printSubItems(ostr, level, levelmax, item.cellList(),
"cell");
163std::ostream& NeighborItemPrinter::
164indent(std::ostream& ostr,
Integer level)
166 for (
Integer l = 0; l < level; ++l)
182 <<
",owner=" << item.
owner()
196 o << ((position++) ?
"|" :
"") <<
"Boundary";
198 o << ((position++) ?
"|" :
"") <<
"HasFrontCell";
200 o << ((position++) ?
"|" :
"") <<
"HasBackCell";
202 o << ((position++) ?
"|" :
"") <<
"FrontCellIsFirst";
204 o << ((position++) ?
"|" :
"") <<
"BackCellIsFirst";
206 o << ((position++) ?
"|" :
"") <<
"Own";
208 o << ((position++) ?
"|" :
"") <<
"Added";
210 o << ((position++) ?
"|" :
"") <<
"Suppressed";
212 o << ((position++) ?
"|" :
"") <<
"Shared";
214 o << ((position++) ?
"|" :
"") <<
"SubDomainBoundary";
218 o << ((position++) ?
"|" :
"") <<
"JustAdded";
220 o << ((position++) ?
"|" :
"") <<
"NeedRemove";
222 o << ((position++) ?
"|" :
"") <<
"SlaveFace";
224 o << ((position++) ?
"|" :
"") <<
"MasterFace";
226 o << ((position++) ?
"|" :
"") <<
"Detached";
227 if (flags & ItemFlags::II_HasEdgeFor1DItems)
228 o << ((position++) ?
"|" :
"") <<
"HasEdgeFor1DItems";
230 o << ((position++) ?
"|" :
"") <<
"Coarsen";
232 o << ((position++) ?
"|" :
"") <<
"DoNothing";
234 o << ((position++) ?
"|" :
"") <<
"Refine";
236 o << ((position++) ?
"|" :
"") <<
"JustRefined";
238 o << ((position++) ?
"|" :
"") <<
"JustCoarsened";
240 o << ((position++) ?
"|" :
"") <<
"Inactive";
242 o << ((position++) ?
"|" :
"") <<
"CoarsenInactive";
244 o << ((position++) ?
"|" :
"") <<
"Overlap";
246 o << ((position++) ?
"|" :
"") <<
"InPatch";
248 o << ((position++) ?
"|" :
"") <<
"UserMark1";
250 o << ((position++) ?
"|" :
"") <<
"UserMark2";
262 ItemBase parent = item.parentBase(0);
263 o <<
",parent uid/lid="
278 const char* str =
", error=";
281 if (item.
isOwn() != (mesh_rank == item.
owner()))
282 o << ((nerror++ == 0) ? str :
"|") <<
"WRONG ISOWN";
285 ItemBase parent = item.parentBase(0);
287 o << ((nerror++ == 0) ? str :
"|") <<
"PARENT UID MISMATCH";
289 o << ((nerror++ == 0) ? str :
"|") <<
"SUPPRESSED PARENT";
291 o << ((nerror++ == 0) ? str :
"|") <<
"PARENT OWNER MISMATCH";
301 ostr <<
" " << name <<
" count=" << enumerator.
size();
303 for (
Item item : enumerator) {
304 if (item.localId() != NULL_ITEM_ID) {
306 ostr <<
" " << item.uniqueId();
314 for (
Item item : enumerator) {
315 if (item.localId() != NULL_ITEM_ID) {
317 ostr <<
" " << item.localId();
void print(std::ostream &o) const
Write to stream of the current Item and its sub-items.
virtual IMesh * mesh() const =0
Associated mesh.
virtual const MeshPartInfo & meshPartInfo() const =0
Mesh part information.
Base class for mesh entities.
bool isSuppressed() const
True if the entity is suppressed.
ItemUniqueId uniqueId() const
Unique number of the entity.
eItemKind kind() const
Kind of the entity.
IItemFamily * family() const
Family the entity belongs to.
Int32 owner() const
Number of the owning subdomain of the entity.
ItemTypeInfo * typeInfo() const
Type of the entity.
bool isOwn() const
True if the entity belongs to the subdomain.
Integer nbParent() const
Number of parent for sub-meshes.
Int32 localId() const
Local number (in the subdomain) of the entity.
@ II_FrontCellIsFirst
The first cell of the entity is the front cell.
@ II_NeedRemove
The entity must be removed.
@ II_MasterFace
The entity is a master face of an interface.
@ II_Inactive
The entity is inactive //COARSEN_INACTIVE,.
@ II_Refine
The entity is marked for refinement.
@ II_Overlap
[AMR Patch] The entity is marked as overlapping with at least one AMR patch.
@ II_JustAdded
The entity has just been added.
@ II_InPatch
[AMR Patch] The entity is marked as being in an AMR patch.
@ II_Shared
The entity is shared by another subdomain.
@ II_HasBackCell
The entity has a back cell.
@ II_SubDomainBoundary
The entity is at the boundary of two subdomains.
@ II_JustRefined
The entity has just been refined.
@ II_Own
The entity is a domain-specific entity.
@ II_Suppressed
The entity has just been suppressed.
@ II_Detached
The entity is detached from the mesh.
@ II_Boundary
The entity is on the boundary.
@ II_Added
The entity has just been added.
@ II_SlaveFace
The entity is a slave face of an interface.
@ II_CoarsenInactive
The entity is inactive and has children tagged for coarsening.
@ II_HasFrontCell
The entity has a front cell.
@ II_DoNothing
The entity is blocked.
@ II_BackCellIsFirst
The first cell of the entity is the back cell.
@ II_Coarsen
The entity is marked for coarsening.
@ II_JustCoarsened
The entity has just been coarsened.
void print(std::ostream &o) const
Write to stream of the current Item.
String typeName() const
Type name.
View on a vector of entities.
Int32 size() const
Number of elements in the vector.
Base class for a mesh element.
void print(std::ostream &o) const
Write to stream of the current Item and its sub-items.
Unicode character string.
static String plural(const Integer n, const String &str, const bool with_number=true)
Standard plural form by adding an 's'.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
eItemKind
Mesh entity type.
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Edge
Edge mesh entity.
const char * itemKindName(eItemKind kind)
Entity kind name.
std::int32_t Int32
Signed integer type of 32 bits.
static void _printParents(std::ostream &o, ItemBase item)
Writes information about the parents.
static void _printBasics(std::ostream &o, ItemBase item)
Writes the basic information of the item.
static void _printFlags(std::ostream &o, Integer flags)
Writes the item flags explicitly.
static void _printErrors(std::ostream &o, ItemBase item)
Writes information about the parents.
static void _printItemSubItems(std::ostream &ostr, String name, const ItemVectorView &enumerator)
Writes the information of an item enumeration.