Arcane  4.1.11.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ConstituentItemIndexedSelectionView.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/* ConstituentItemIndexedSelectionView.cc (C) 2000-2026 */
9/* */
10/* Vue sur un sous ensemble d'un conteneur de ConstituentItem. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/materials/ConstituentItemIndexedSelectionView.h"
15
16#include "arcane/utils/FatalErrorException.h"
17
18#include "arcane/core/materials/internal/IMeshMaterialMngInternal.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::Materials
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29ConstituentItemIndexedSelectionViewBase::
30ConstituentItemIndexedSelectionViewBase(IndexArrayView indices)
31: m_selection_view(indices)
32{
33}
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38ConstituentItemIndexedSelectionViewBase::
39ConstituentItemIndexedSelectionViewBase(IMeshComponent* constituent, Int32 selection_size)
40{
41 SmallSpan<const Int32> v = constituent->materialMng()->_internalApi()->identitySelectionView();
42 // Vérifie que la vue retournée a une taille au moins égale à la sélection.
43 if (v.size() < selection_size)
44 ARCANE_FATAL("Invalid size for identity selection (selection_size={0} identity={1})",
45 selection_size, v.size());
46 m_selection_view = SmallSpan<const Int32>{ v.data(), selection_size };
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52} // End namespace Arcane::Materials
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Active toujours les traces dans les parties Arcane concernant les matériaux.