14#include "arcane/core/ItemInternal.h"
16#include "arcane/utils/NotImplementedException.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/Iostream.h"
19#include "arcane/utils/TraceInfo.h"
20#include "arcane/utils/CheckedConvert.h"
22#include "arcane/core/IItemFamily.h"
23#include "arcane/core/IItemFamilyTopologyModifier.h"
24#include "arcane/core/ItemPrinter.h"
40void impl::MutableItemBase::
41_checkUniqueId(
Int64 new_uid)
const
44 ARCANE_FATAL(
"Bad unique id - new_uid={0} local_id={1} current={2}",
45 new_uid, m_local_id,
uniqueId().asInt64());
56 _checkUniqueId(m_shared_info->m_unique_ids[m_local_id]);
58 m_shared_info->m_unique_ids[m_local_id] = NULL_ITEM_UNIQUE_ID;
67 if (m_unique_id > 2147483647)
68 ARCANE_FATAL(
"Unique id is too big to be converted to a Int32");
69 return (
Int32)(m_unique_id);
78 Int16 x = CheckedConvert::toInt16(v);
79 return ItemTypeId{ x };
90 ItemTypeInfo* linear_iti = m_shared_info->typeInfoFromId(linear_type_id);
92 return std::min(
nbNode(), nb_linear_node);
102operator<<(std::ostream& o,
const ItemUniqueId&
id)
117 top_it = top_it->_internalHParent(0);
118 ARCANE_ASSERT((!top_it->
null()), (
"topHParent Problem!"));
119 ARCANE_ASSERT((top_it->
level() == 0), (
"topHParent Problem"));
126impl::ItemBase impl::ItemBase::
127topHParentBase()
const
131 top_it = top_it.hParentBase(0);
132 ARCANE_ASSERT((!top_it.
null()), (
"topHParent Problem!"));
133 ARCANE_ASSERT((top_it.
level() == 0), (
"topHParent Problem"));
143 ItemInternal* top_it =
this;
144 while (top_it->nbHParent())
145 top_it = top_it->_internalHParent(0);
146 ARCANE_ASSERT((!top_it->null()), (
"topHParent Problem!"));
147 ARCANE_ASSERT((top_it->level() == 0), (
"topHParent Problem"));
157 ARCANE_ASSERT((this->
hasHChildren()), (
"item has non-child!"));
159 if (this->hChildId(c) == local_id)
170 ARCANE_ASSERT((this->
hasHChildren()), (
"item has non-child!"));
172 if (this->_internalHChild(c) == iitem)
181_internalActiveCells2(
Int32Array& local_ids)
const
184 for (
Integer icell = 0; icell < nbcell; ++icell) {
185 ItemBase cell = this->cellBase(icell);
188 local_ids.
add(local_id);
191 return ItemInternalVectorView(m_shared_info->m_items->m_cell_shared_info, local_ids, 0);
197void impl::MutableItemBase::
198_setFaceInfos(
Int32 mod_flags)
201 face_flags &= ~II_InterfaceFlags;
202 face_flags |= mod_flags;
218void impl::MutableItemBase::
219_setFaceBackAndFrontCells(
Int32 back_cell_lid,
Int32 front_cell_lid)
221 if (front_cell_lid == NULL_ITEM_LOCAL_ID) {
224 _setFaceInfos(mod_flags);
226 else if (back_cell_lid == NULL_ITEM_LOCAL_ID) {
251bool ItemInternalVectorView::
256 if (!m_local_ids.empty()) {
257 auto* items_data = _items().data();
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Base class for mesh entities.
ItemUniqueId uniqueId() const
Unique number of the entity.
Integer nbCell() const
Number of cells connected to the entity (for nodes, edges, and faces).
Int32 flags() const
Flags of the entity.
ItemTypeInfo * typeInfo() const
Type of the entity.
Int32 nbHParent() const
Number of parents for AMR.
bool hasHChildren() const
Int32 whichChildAmI(Int32 local_id) const
Int32 nbHChildren() const
Number of children for AMR.
Integer nbNode() const
Number of nodes of the entity.
bool null() const
True if the entity is the null entity.
Int32 localId() const
Local number (in the subdomain) of the entity.
@ II_FrontCellIsFirst
The first cell of the entity is the front cell.
@ II_HasBackCell
The entity has a back cell.
@ II_Boundary
The entity is on the boundary.
@ II_HasFrontCell
The entity has a front cell.
@ II_BackCellIsFirst
The first cell of the entity is the back cell.
Int32 whichChildAmI(const ItemInternal *iitem) const
const ItemInternal * topHParent() const
AMR.
static ItemTypeId fromInteger(Int64 v)
Creates an instance from an integer.
Info on a mesh entity type.
Integer nbLocalNode() const
Number of nodes of the entity.
Int16 linearTypeId() const
Type of the corresponding linear element.
void setFlags(Int32 f)
Sets the entity flags.
void unsetUniqueId()
Nullifies the uniqueId to the value NULL_ITEM_UNIQUE_ID.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
std::int16_t Int16
Signed integer type of 16 bits.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Output operator for a stream.
std::int32_t Int32
Signed integer type of 32 bits.