Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemConnectivitySelector.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* ItemConnectivitySelector.cc (C) 2000-2021 */
9/* */
10/* Sélection entre les connectivités historiques et à la demande. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/IMesh.h"
17#include "arcane/IIncrementalItemConnectivity.h"
18
19#include "arcane/mesh/ItemConnectivitySelector.h"
20#include "arcane/mesh/ItemFamily.h"
21
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane::mesh
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32ItemConnectivitySelector::
33ItemConnectivitySelector(ItemFamily* source_family,IItemFamily* target_family,
34 const String& connectivity_name,Integer connectivity_index)
35: TraceAccessor(source_family->traceMng())
36, m_source_family(source_family)
37, m_target_family(target_family)
38, m_connectivity_name(connectivity_name)
39, m_pre_allocated_size(0)
40, m_item_connectivity_index(connectivity_index)
41, m_item_connectivity_list(m_source_family->itemInternalConnectivityList())
42, m_is_built(false)
43{
44}
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
48
49void ItemConnectivitySelector::
50build()
51{
52 if (m_is_built)
53 return;
54
55 _createCustomConnectivity(m_connectivity_name);
56 info(4) << "Family: " << m_source_family->fullName()
57 << " create new connectivity: " << m_connectivity_name;
58
59 _buildCustomConnectivity();
60 m_is_built = true;
61}
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66void ItemConnectivitySelector::
67setPreAllocatedSize(Integer size)
68{
69 m_pre_allocated_size = size;
70 auto c = customConnectivity();
71 // Pour les nouvelles connectivités, la valeur de pré-allocation est sauvée
72 // lors d'une protection et n'est pas prise en compte en reprise.
73 if (c)
74 c->setPreAllocatedSize(size);
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80} // End namespace Arcane::mesh
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/