Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemVectorView.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/* ItemVectorView.cc (C) 2000-2024 */
9/* */
10/* Vue sur une liste pour obtenir des informations sur les entités. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/Item.h"
15
16#include "arcane/IItemFamily.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27ItemVectorView::
28ItemVectorView(IItemFamily* family, ConstArrayView<Int32> local_ids)
29: m_index_view(local_ids)
30{
31 _init2(family);
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37ItemVectorView::
38ItemVectorView(IItemFamily* family, ItemIndexArrayView indexes)
39: m_index_view(indexes)
40{
41 _init2(family);
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47void ItemVectorView::
48_init2(IItemFamily* family)
49{
50 if (family){
51 ItemInfoListView info_view(family);
52 m_shared_info = info_view.m_item_shared_info;
53 }
54 else
55 m_shared_info = ItemSharedInfo::nullInstance();
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61void ItemVectorView::
62fillLocalIds(Array<Int32>& ids) const
63{
64 m_index_view.fillLocalIds(ids);
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70void ItemIndexArrayView::
71fillLocalIds(Array<Int32>& ids) const
72{
73 m_view.fillLocalIds(ids);
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79// Note: ces structures doivent avoir le même layout que la
80// version qui est dans NumericWrapper.h
81
82// Cette classe sert de type de retour pour wrapper la class ConstArrayView
83template<typename DataType> class ConstArrayViewPOD_T
84{
85 public:
86 Integer m_size;
87 const DataType* m_ptr;
88};
89
91{
92 public:
94 Int32 m_flags;
95};
96
98{
99 public:
100 ItemIndexArrayViewPOD m_local_ids;
101 ItemSharedInfo* m_shared_info;
102};
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107void ItemVectorView::
108_internalSwigSet(ItemVectorViewPOD* vpod)
109{
110 vpod->m_local_ids.m_local_ids.m_size = localIds().size();
111 vpod->m_local_ids.m_local_ids.m_ptr = localIds().unguardedBasePointer();
112 vpod->m_local_ids.m_flags = indexes().flags();
113 vpod->m_shared_info = m_shared_info;
114}
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
118
119} // End namespace Arcane
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
Structure interne partagée d'une entité de maillage.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-