Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemVector.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* ItemVector.cc (C) 2000-2024 */
9/* */
10/* Vecteur d'entités de même genre. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/ItemVector.h"
15
16#include "arcane/utils/MemoryUtils.h"
17#include "arcane/utils/FatalErrorException.h"
18
19#include "arcane/core/IItemFamily.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26namespace
27{
28IMemoryAllocator* _getAllocator()
29{
30 return MemoryUtils::getDefaultDataAllocator();
31}
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
39: m_local_ids(_getAllocator())
40, m_family(afamily)
41{
42 _init();
43}
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
50: m_local_ids(_getAllocator())
51, m_family(afamily)
52{
53 _init();
54 m_local_ids.resize(local_ids.size());
55 MemoryUtils::copy(m_local_ids.span(),Span<const Int32>(local_ids));
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
63: m_local_ids(_getAllocator())
64, m_family(afamily)
65{
66 m_local_ids.resize(asize);
67 _init();
68}
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
75: m_local_ids(_getAllocator())
76{
77}
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82void ItemVector::
83_init()
84{
85 if (m_family) {
87 m_shared_info = info_view.m_item_shared_info;
88 }
89 else
90 m_shared_info = ItemSharedInfo::nullInstance();
91}
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
98{
99 m_local_ids.clear();
100 m_family = afamily;
101 _init();
102}
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107template class ItemVectorViewT<Node>;
108template class ItemVectorViewT<Edge>;
109template class ItemVectorViewT<Face>;
110template class ItemVectorViewT<Cell>;
111template class ItemVectorViewT<Particle>;
112template class ItemVectorViewT<DoF>;
113
114template class ItemVectorT<Node>;
115template class ItemVectorT<Edge>;
116template class ItemVectorT<Face>;
117template class ItemVectorT<Cell>;
118template class ItemVectorT<Particle>;
119template class ItemVectorT<DoF>;
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124} // namespace Arcane
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
Interface d'une famille d'entités.
Vue sur une liste pour obtenir des informations sur les entités.
ItemVector()
Créé un vecteur nul. Il faudra ensuite appeler setFamily() pour l'utiliser.
Definition ItemVector.cc:74
void setFamily(IItemFamily *afamily)
Positionne la famille associée.
Definition ItemVector.cc:97
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Span< const T > span() const
Vue immutable sur ce tableau.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
void clear()
Supprime les éléments du tableau.
Vue constante d'un tableau de type T.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-