Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IPrimaryMesh.h
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/* IPrimaryMesh.h (C) 2000-2025 */
9/* */
10/* Interface for the geometry of a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPRIMARYMESH_H
13#define ARCANE_CORE_IPRIMARYMESH_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
20#include "arcane/core/IMesh.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31class IParallelMng;
33class XmlNode;
34class IMeshUtilities;
35class IMeshModifier;
36class Properties;
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41//INFO: The complete documentation is in Mesh.dox
43: public IMesh
44{
45 public:
46
47 virtual ~IPrimaryMesh() {} //<! Releases resources
48
49 public:
50
51 //! Node coordinates
53
54 /*!
55 * \brief Positions the mesh dimension (1D, 2D, or 3D).
56 *
57 * The dimension corresponds to the dimension of the cell elements.
58 * If cells of multiple dimensions are present, the highest dimension must be indicated.
59 *
60 * The dimension must be set before allocating cells if one
61 * uses allocateCells(), and must not be modified afterward.
62 */
63 virtual void setDimension(Integer dim) = 0;
64
65 /*! \brief Reloads the mesh from protected variables
66 */
67 virtual void reloadMesh() = 0;
68
69 //NOTE: Complete documentation for this method is in Mesh.dox
70 //! Allocation of a mesh.
71 virtual void allocateCells(Integer nb_cell, Int64ConstArrayView cells_infos, bool one_alloc = true) = 0;
72
73 /*!
74 * \brief Indicates the end of cell allocation.
75 *
76 * As long as this method has not been called, it is not valid to use this
77 * instance, except for allocating the mesh (allocateCells()).
78 *
79 * This method is collective.
80 */
81 virtual void endAllocate() = 0;
82
83 /*!
84 * \brief Deallocates the mesh.
85 *
86 * This deletes all entities and all entity groups.
87 * The mesh must then be reallocated via the call to allocateCells().
88 * This call also deletes the mesh dimension, which must
89 * be reset by setDimension(). It is therefore possible to change the
90 * mesh dimension afterward.
91 *
92 * This method is collective.
93 *
94 * \warning This method is experimental and many edge effects are
95 * possible. Notably, the current implementation does not support deallocation
96 * when there are partial variables on the mesh.
97 */
98 virtual void deallocate() = 0;
99
100 /*!
101 * \brief Specific initial allocator.
102 *
103 * If null, allocateCells() must be used.
104 */
105 virtual IMeshInitialAllocator* initialAllocator() { return nullptr; }
106
107 public:
108
109 /*!
110 * \brief Variable containing the identifier of the owning subdomain.
111 *
112 Returns the variable containing the identifier of the owning subdomain
113 of entities of the given kind.
114
115 \warning This variable is used for generating synchronization messages
116 between subdomains and must not
117 be modified.
118 */
120
121 //! Changes the owning subdomains of entities
122 virtual void exchangeItems() = 0;
123
124 public:
125
126 /*!
127 * \internal
128 * \brief Positions entity owners based on the cell owner.
129 *
130 Positions the owners of entities other than cells (Node, Edge, and Face)
131 based on the cell owner. This operation is only useful
132 in parallel and must only be called during initialization after
133 the endAllocate() method.
134 *
135 This operation is collective.
136 */
137 virtual void setOwnersFromCells() = 0;
138
139 /*!
140 * \internal
141 * \brief Positions partitioning information.
142 */
143 virtual void setMeshPartInfo(const MeshPartInfo& mpi) = 0;
144};
145
146/*---------------------------------------------------------------------------*/
147/*---------------------------------------------------------------------------*/
148
149} // End namespace Arcane
150
151/*---------------------------------------------------------------------------*/
152/*---------------------------------------------------------------------------*/
153
154#endif
Declarations of Arcane's general types.
Declarations of types on entities.
Interface for allocating mesh entities.
Mesh modification interface.
Interface of a class providing utility functions on meshes.
Interface of the parallelism manager for a subdomain.
Interface of a particle exchanger.
virtual VariableNodeReal3 & nodesCoordinates()=0
Node coordinates.
virtual IMeshInitialAllocator * initialAllocator()
Specific initial allocator.
virtual void exchangeItems()=0
Changes the owning subdomains of entities.
virtual void endAllocate()=0
Indicates the end of cell allocation.
virtual void allocateCells(Integer nb_cell, Int64ConstArrayView cells_infos, bool one_alloc=true)=0
Allocation of a mesh.
virtual void reloadMesh()=0
Reloads the mesh from protected variables.
virtual void setDimension(Integer dim)=0
Positions the mesh dimension (1D, 2D, or 3D).
virtual void deallocate()=0
Deallocates the mesh.
virtual VariableItemInt32 & itemsNewOwner(eItemKind kind)=0
Variable containing the identifier of the owning subdomain.
Information about a partitioned mesh.
List of properties.
Definition Properties.h:65
Node of a DOM tree.
Definition XmlNode.h:51
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
ItemVariableScalarRefT< Int32 > VariableItemInt32
32-bit integer type quantity
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
eItemKind
Mesh entity type.