Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
UnstructuredMeshConnectivity.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* UnstructuredMeshConnectivity.cc (C) 2000-2023 */
9/* */
10/* Informations de connectivité d'un maillage non structuré. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/UnstructuredMeshConnectivity.h"
15
16#include "arcane/utils/FatalErrorException.h"
17
18#include "arcane/core/IMesh.h"
19#include "arcane/core/IItemFamily.h"
20#include "arcane/core/internal/IItemFamilyInternal.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace
32{
33
34inline constexpr Int32 _IDX(Node*) { return ItemInternalConnectivityList::NODE_IDX; }
35inline constexpr Int32 _IDX(Edge*) { return ItemInternalConnectivityList::EDGE_IDX; }
36inline constexpr Int32 _IDX(Face*) { return ItemInternalConnectivityList::FACE_IDX; }
37inline constexpr Int32 _IDX(Cell*) { return ItemInternalConnectivityList::CELL_IDX; }
38
39template<typename ConnectivityView> inline void
40_internalInit(ConnectivityView& cview,IMesh* mesh)
41{
42 using ItemType1 = typename ConnectivityView::ItemType1Type;
43 using ItemType2 = typename ConnectivityView::ItemType2Type;
44
47
48 IItemFamily* family = mesh->itemFamily(ik1);
49 ItemInternalConnectivityList* clist = family->_internalApi()->unstructuredItemInternalConnectivityList();
50 auto item_index_type = _IDX((ItemType2*)nullptr);
51 auto container_view = clist->containerView(item_index_type);
52 cview = IndexedItemConnectivityViewBase(container_view,ik1,ik2);
53}
54}
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
59void UnstructuredMeshConnectivityView::
60setMesh(IMesh* mesh)
61{
62 m_mesh = mesh;
63
64 _internalInit(m_cell_node_connectivity_view,mesh);
65 _internalInit(m_cell_edge_connectivity_view,mesh);
66 _internalInit(m_cell_face_connectivity_view,mesh);
67
68 _internalInit(m_face_node_connectivity_view,mesh);
69 _internalInit(m_face_edge_connectivity_view,mesh);
70 _internalInit(m_face_cell_connectivity_view,mesh);
71
72 _internalInit(m_node_edge_connectivity_view,mesh);
73 _internalInit(m_node_face_connectivity_view,mesh);
74 _internalInit(m_node_cell_connectivity_view,mesh);
75
76 _internalInit(m_edge_node_connectivity_view,mesh);
77 _internalInit(m_edge_face_connectivity_view,mesh);
78 _internalInit(m_edge_cell_connectivity_view,mesh);
79}
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84void UnstructuredMeshConnectivityView::
85_checkValid() const
86{
87 if (!m_mesh)
88 ARCANE_FATAL("Can not use unitialised UnstructuredMeshConnectivityView.\n"
89 "Call the method setMesh() before");
90}
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95} // End namespace Arcane
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
static eItemKind kind()
Genre de l'entité
Definition ItemTypes.h:624
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 -*-
eItemKind
Genre d'entité de maillage.