Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ItemPairGroupBuilder.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/* ItemPairGroupBuilder.h (C) 2000-2025 */
9/* */
10/* Construction of the entity lists for the ItemPairGroup. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMPAIRGROUPBUILDER_H
13#define ARCANE_CORE_ITEMPAIRGROUPBUILDER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/ItemPairGroup.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Construction of the entity lists for the ItemPairGroup.
30 *
31 * This class is used when recalculating the entities of an ItemPairGroup.
32 *
33 * The user code must call the addNextItem() method for each entity
34 * of group().itemGroup() by specifying the localId() of the added entities.
35 * For example:
36 *
37 \code
38 * void functor(ItemPairGroupBuilder& builder)
39 * {
40 * Int32Array local_ids;
41 * ENUMERATE_ITEM(iitem.builder.group().itemGroup()){
42 * local_ids.clear();
43 * // Calculates the entities connected to \a iitem and adds them to \a local_ids.
44 * ...
45 * builder.addNextItem(local_ids);
46 * }
47 * }
48 \endcode
49 *
50 * For a more complete usage example, refer to the ItemPairGroup documentation.
51 */
52class ARCANE_CORE_EXPORT ItemPairGroupBuilder
53{
54 public:
55
56 //! \internal
57 explicit ItemPairGroupBuilder(const ItemPairGroup& group);
58 ~ItemPairGroupBuilder();
59
60 public:
61
62 //! Associated group.
63 const ItemPairGroup& group() { return m_group; }
64 //! Adds the entities \a sub_items to
65 void addNextItem(Int32ConstArrayView sub_items);
66
67 private:
68
69 ItemPairGroup m_group;
70 Int64 m_index = 0;
71 Array<Int64>& m_unguarded_indexes;
72 Array<Int32>& m_unguarded_local_ids;
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78} // End namespace Arcane
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83#endif
Base class for 1D data vectors.
const ItemPairGroup & group()
Associated group.
Table of entity lists.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482