Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ComponentConnectivityList.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/* ConstituentConnectivityList.h (C) 2000-2023 */
9/* */
10/* Management of constituent connectivity lists. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_CONSTITUENTCONNECTIVITYLIST_H
13#define ARCANE_MATERIALS_INTERNAL_CONSTITUENTCONNECTIVITYLIST_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/Ref.h"
20
21#include "arcane/core/VariableTypes.h"
22#include "arcane/core/IIncrementalItemConnectivity.h"
23
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::Materials
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
39class ConstituentConnectivityList
40: public TraceAccessor
43{
45
46 class ConstituantContainer;
47 class Container;
48
49 public:
50
51 explicit ConstituentConnectivityList(MeshMaterialMng* mm);
52 ~ConstituentConnectivityList();
53
54 public:
55
56 ConstituentConnectivityList(ConstituentConnectivityList&&) = delete;
57 ConstituentConnectivityList(const ConstituentConnectivityList&) = delete;
58 ConstituentConnectivityList& operator=(ConstituentConnectivityList&&) = delete;
59 ConstituentConnectivityList& operator=(const ConstituentConnectivityList&) = delete;
60
61 public:
62
63 void endCreate(bool is_continue);
64
65 void addCellsToEnvironment(Int16 env_id, ConstArrayView<Int32> cell_ids);
66 void removeCellsToEnvironment(Int16 env_id, ConstArrayView<Int32> cell_ids);
67
68 void addCellsToMaterial(Int16 mat_id, ConstArrayView<Int32> cell_ids);
69 void removeCellsToMaterial(Int16 mat_id, ConstArrayView<Int32> cell_ids);
70
73
75 Int16 cellNbMaterial(CellLocalId cell_id, Int16 env_id);
76
77 public:
78
79 // Implementation of IIncrementalItemSourceConnectivity
81 IItemFamily* sourceFamily() const override { return m_cell_family; }
82 void notifySourceFamilyLocalIdChanged(Int32ConstArrayView new_to_old_ids) override;
83 void notifySourceItemAdded(ItemLocalId item) override;
84 void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity) override;
85 void notifyReadFromDump() override;
88
89 private:
90
91 MeshMaterialMng* m_material_mng = nullptr;
92 IItemFamily* m_cell_family = nullptr;
93 Container* m_container = nullptr;
94
97
98 private:
99
100 void _addCells(Int16 env_id, ConstArrayView<Int32> cell_ids, ComponentContainer& component);
101 void _removeCells(Int16 env_id, ConstArrayView<Int32> cell_ids, ComponentContainer& component);
102};
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107} // namespace Arcane::Materials
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112#endif
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.
Constant view of an array of type T.
Interface for the source of an incremental connectivity.
Interface of an entity family.
Definition IItemFamily.h:83
Index of an Item in a variable.
Definition ItemLocalId.h:42
ConstArrayView< Int16 > cellsNbMaterial() const
Arrays of the total number of materials per cell (indexed by localId()).
void notifySourceItemAdded(ItemLocalId item) override
Notifies the connectivity that an entity has been added to the source family.
Int16 cellNbMaterial(CellLocalId cell_id, Int16 env_id)
Number of materials of the cell cell_id for environment index env_id.
ConstArrayView< Int16 > cellsNbEnvironment() const
Arrays of the total number of environments per cell (indexed by localId()).
void notifyReadFromDump() override
Notifies the connectivity that a read has been performed from a dump.
UniqueArray< Int16 > m_environment_for_materials
Index of the environment to which a material belongs.
void notifySourceFamilyLocalIdChanged(Int32ConstArrayView new_to_old_ids) override
Notifies the connectivity that the source family has been compacted.
IItemFamily * sourceFamily() const override
Source family.
Ref< IIncrementalItemSourceConnectivity > toSourceReference() override
Returns a reference to the instance.
void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity) override
Reserves memory for n source entities.
Implementation of a material manager.
Reference to an instance.
Thread-safe implementation of a reference counter.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
Always enables tracing in Arcane parts concerning materials.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
std::int16_t Int16
Signed integer type of 16 bits.
std::int32_t Int32
Signed integer type of 32 bits.