Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Item.cc
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/* Item.cc (C) 2000-2024 */
9/* */
10/* Base class for a mesh element. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/Item.h"
15
16#include "arcane/utils/Iostream.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/NotSupportedException.h"
19#include "arcane/utils/ITraceMng.h"
20
21#include "arcane/core/ItemCompare.h"
22#include "arcane/core/ItemPrinter.h"
23#include "arcane/core/MeshItemInternalList.h"
24#include "arcane/core/IndexedItemConnectivityView.h"
26
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32namespace Arcane
33{
34
35std::atomic<int> Item::m_nb_created_from_internal = 0;
36std::atomic<int> Item::m_nb_created_from_internalptr = 0;
37std::atomic<int> Item::m_nb_set_from_internal = 0;
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42/*!
43 * \defgroup GroupItem Mesh elements
44 *
45 * This is the set of classes that handle mesh entities.
46 */
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
50
51// See Item.h and ItemSharedInfo.h for associated #ifdefs
52
55{
56 return ItemTypeMng::_legacyTypeName(t);
57}
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67void Item::
68_badConversion() const
69{
70#ifdef ARCANE_DEBUG
71 ARCANE_FATAL("Bad conversion from {0}", kind());
72#else /* ARCANE_DEBUG */
73 ARCANE_FATAL("Bad conversion");
74#endif /* ARCANE_DEBUG */
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83void IndexedItemConnectivityViewBase::
84_badConversion(eItemKind k1, eItemKind k2) const
85{
86 ARCANE_FATAL("Can not convert connectivity view ({0},{1}) to ({2},{3})",
87 m_source_kind, m_target_kind, k1, k2);
88}
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93void Item::
94dumpStats(ITraceMng* tm)
95{
96 tm->info() << "ItemStats: nb_created_from_internal = " << m_nb_created_from_internal;
97 tm->info() << "ItemStats: nb_created_from_internalptr = " << m_nb_created_from_internalptr;
98 tm->info() << "ItemStats: nb_set_from_internal = " << m_nb_set_from_internal;
99}
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
104void Item::
105resetStats()
106{
107 m_nb_created_from_internal = 0;
108 m_nb_created_from_internalptr = 0;
109 m_nb_set_from_internal = 0;
110}
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
115// For testing the instantiation of these classes
116template class ItemConnectedListViewT<Node>;
118template class ItemConnectedEnumeratorT<Node>;
119template class ItemConnectedEnumeratorT<Item>;
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124} // namespace Arcane
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Types and macros for iterating over mesh entities connected to another entity.
Types and macros for iterating over mesh entities.
Typed base class for enumerators over a list of connected entities.
Enumerator over a typed list of connected entities of type ItemType.
View of a list of entities connected to another.
static ItemInternal nullItemInternal
Null entity.
static String typeName(Int32 type)
Cell type name cell_type.
Definition Item.cc:54
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:264
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
eItemKind
Mesh entity type.