Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ConstituentItemVectorBuildInfo.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/* ConstituentItemVectorBuildInfo.cc (C) 2000-2025 */
9/* */
10/* Build options for 'ComponentItemVector'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/materials/ConstituentItemVectorBuildInfo.h"
15
16#include "arcane/utils/FatalErrorException.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane::Materials
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
29: m_group(group)
30, m_build_list_type(eBuildListType::Group)
31{
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
39: m_view(view)
40, m_build_list_type(eBuildListType::VectorView)
41{}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
48: m_local_ids(local_ids)
49, m_build_list_type(eBuildListType::LocalIds)
50{}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55SmallSpan<const Int32> ConstituentItemVectorBuildInfo::
56_localIds() const
57{
58 switch (m_build_list_type) {
59 case eBuildListType::Group:
60 return m_group.view().localIds();
61 case eBuildListType::VectorView:
62 return m_view.localIds();
63 case eBuildListType::LocalIds:
64 return m_local_ids;
65 }
66 ARCANE_FATAL("Bad value '{0}' for build type", static_cast<int>(m_build_list_type));
67}
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72} // namespace Arcane::Materials
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
ItemVectorView view() const
View of the group entities.
Definition ItemGroup.cc:580
Int32ConstArrayView localIds() const
Array of local IDs of entities.
ConstituentItemVectorBuildInfo(const CellGroup &group)
Construction from entities of the group group.
View of an array of elements of type T.
Definition Span.h:805
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
ItemVectorViewT< Cell > CellVectorView
View over a vector of cells.
Definition ItemTypes.h:305
Always enables tracing in Arcane parts concerning materials.