Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IParticleFamily.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/* IParticleFamily.h (C) 2000-2025 */
9/* */
10/* Interface of a particle family. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPARTICLEFAMILY_H
13#define ARCANE_CORE_IPARTICLEFAMILY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \ingroup Mesh
31 * \brief Interface of a particle family.
32 *
33 * A particle family is a family of entities (IItemFamily).
34 * This interface only contains methods specific to particles.
35 * For generic entity operations, you must go through
36 * the IItemFamily interface via itemFamily().
37 *
38 * There can be several particle families per mesh.
39 * Unlike classical mesh entities (node, cell, ...),
40 * particles can be created directly.
41 *
42 */
43class ARCANE_CORE_EXPORT IParticleFamily
44{
45 public:
46
47 virtual ~IParticleFamily() {} //<! Releases resources
48
49 public:
50
51 virtual void build() = 0;
52
53 //! Sets the flag to manage ghost particles for the family.
54 virtual void setEnableGhostItems(bool value) = 0;
55
56 //! Retrieves the flag to manage ghost particles for the family.
57 virtual bool getEnableGhostItems() const = 0;
58
59 public:
60
61 //! Name of the family.
62 virtual String name() const = 0;
63
64 //! Full name of the family (including the mesh name).
65 virtual String fullName() const = 0;
66
67 //! Number of entities.
68 virtual Integer nbItem() const = 0;
69
70 //! Group of all particles.
71 virtual ItemGroup allItems() const = 0;
72
73 public:
74
75 /*!
76 * \brief Allocates particles.
77 *
78 * Allocates particles whose uniqueId() are given by the
79 * array \a unique_ids.
80 *
81 * After calling this operation, you must call endUpdate() to notify
82 * the instance that modifications are finished. It is possible to chain several
83 * allocations before calling endUpdate(). Note that the returned view
84 * may be invalidated after calling endUpdate() if compression is active.
85 * \a items_local_id must have the same number of elements as unique_ids.
86 */
88 Int32ArrayView items_local_id) = 0;
89 virtual ParticleVectorView addParticles2(Int64ConstArrayView unique_ids,
91 Int32ArrayView items) = 0;
92
93 /*!
94 * \brief Allocates particles in cells.
95 *
96 * This method is similar to addParticles() but allows specifying
97 * directly the cells in which the particles will be created.
98 */
100 Int32ConstArrayView cells_local_id,
101 Int32ArrayView items_local_id) = 0;
102
103 virtual void removeParticles(Int32ConstArrayView items_local_id) = 0;
104
105 /*!
106 * \sa IItemFamily::endUpdate().
107 */
108 virtual void endUpdate() = 0;
109
110 /*!
111 * \brief Moves the particle \a particle into the cell \a new_cell.
112 */
113 virtual void setParticleCell(Particle particle, Cell new_cell) = 0;
114
115 /*!
116 * \brief Moves the list of particles \a particles into the new cells \a new_cells.
117 */
118 virtual void setParticlesCell(ParticleVectorView particles, CellVectorView new_cells) = 0;
119
120 public:
121
122 /*!
123 * \brief Exchanging entities.
124 *
125 * This method is only supported for particle families.
126 * For mesh elements such as nodes, faces, or cells, you must use IMesh::exchangeItems().
127 *
128 * The new owners of the entities are given by itemsNewOwner().
129 *
130 * This operation is blocking and collective.
131 */
132 virtual void exchangeParticles() = 0;
133
134 public:
135
136 //! Interface on the family.
137 virtual IItemFamily* itemFamily() = 0;
138};
139
140/*---------------------------------------------------------------------------*/
141/*---------------------------------------------------------------------------*/
142
143} // namespace Arcane
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148#endif
Declarations of Arcane's general types.
Declarations of types on entities.
Cell of a mesh.
Definition Item.h:1300
Interface of an entity family.
Definition IItemFamily.h:83
Interface of a particle family.
virtual Integer nbItem() const =0
Number of entities.
virtual String name() const =0
Name of the family.
virtual void setParticleCell(Particle particle, Cell new_cell)=0
Moves the particle particle into the cell new_cell.
virtual void setEnableGhostItems(bool value)=0
Sets the flag to manage ghost particles for the family.
virtual void endUpdate()=0
virtual bool getEnableGhostItems() const =0
Retrieves the flag to manage ghost particles for the family.
virtual void exchangeParticles()=0
Exchanging entities.
virtual ParticleVectorView addParticles(Int64ConstArrayView unique_ids, Int32ArrayView items_local_id)=0
Allocates particles.
virtual ItemGroup allItems() const =0
Group of all particles.
virtual IItemFamily * itemFamily()=0
Interface on the family.
virtual void setParticlesCell(ParticleVectorView particles, CellVectorView new_cells)=0
Moves the list of particles particles into the new cells new_cells.
virtual ParticleVectorView addParticles(Int64ConstArrayView unique_ids, Int32ConstArrayView cells_local_id, Int32ArrayView items_local_id)=0
Allocates particles in cells.
virtual String fullName() const =0
Full name of the family (including the mesh name).
Mesh entity group.
Definition ItemGroup.h:51
Particle.
Definition Item.h:1529
ItemVectorViewT< Cell > CellVectorView
View over a vector of cells.
Definition ItemTypes.h:305
ItemVectorViewT< Particle > ParticleVectorView
View over a vector of particles.
Definition ItemTypes.h:310
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:453