Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
GhostItemsVariableParallelOperation.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/* GhostItemsVariableParallelOperation.cc (C) 2000-2023 */
9/* */
10/* Parallel operations on ghost entities. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/parallel/GhostItemsVariableParallelOperation.h"
15
16#include "arcane/ItemGroup.h"
17#include "arcane/IItemFamily.h"
18#include "arcane/ItemEnumerator.h"
19#include "arcane/Item.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane::Parallel
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30GhostItemsVariableParallelOperation::
31GhostItemsVariableParallelOperation(IItemFamily* family)
32: VariableParallelOperationBase(family->parallelMng())
33{
34}
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42/*!
43 * \brief Builds the list of entities to send.
44 *
45 * These are the ghost entities.
46*/
47void GhostItemsVariableParallelOperation::
48_buildItemsToSend()
49{
50 auto& items_to_send = _itemsToSend();
51
52 ItemGroup all_items = itemFamily()->allItems();
53 ENUMERATE_ITEM (iitem, all_items) {
54 Item item = *iitem;
55 if (!item.isOwn()) {
56 items_to_send[item.owner()].add(item);
57 }
58 }
59}
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // namespace Arcane::Parallel
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
#define ENUMERATE_ITEM(name, group)
Generic enumerator for a node group.
Interface of an entity family.
Definition IItemFamily.h:83
Mesh entity group.
Definition ItemGroup.h:51
Base class for a mesh element.
Definition Item.h:84
Int32 owner() const
Owner subdomain number of the entity.
Definition Item.h:252
constexpr bool isOwn() const
true if the entity belongs to the subdomain
Definition Item.h:267
Interface for a class of parallel operations on variables.
IItemFamily * itemFamily() override
Entity family on which the operation is performed.
Concurrency implementation.