Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMeshMng.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/* IMeshMng.h (C) 2000-2025 */
9/* */
10/* Mesh manager interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMESHMNG_H
13#define ARCANE_CORE_IMESHMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Mesh manager interface.
30 *
31 * This interface manages a list of meshes and allows creating meshes
32 * or retrieving an existing mesh by its name.
33 *
34 * Mesh creation is done via 'IMeshFactoryMng' whose instance
35 * can be retrieved via meshFactoryMng(). Effective mesh creation cannot
36 * take place until after reading the dataset. However, it is possible
37 * to create a reference (via createMeshHandle()) to a mesh at any
38 * time.
39 */
40class ARCANE_CORE_EXPORT IMeshMng
41{
42 public:
43
44 //! Frees the resources.
45 virtual ~IMeshMng() = default;
46
47 public:
48
49 //! Trace manager associated with this manager
50 virtual ITraceMng* traceMng() const = 0;
51
52 //! Mesh factory associated with this manager
53 virtual IMeshFactoryMng* meshFactoryMng() const = 0;
54
55 //! Variable manager associated with this manager
56 virtual IVariableMng* variableMng() const = 0;
57
58 public:
59
60 /*!
61 * \brief Searches for the mesh with name \a name.
62 *
63 * If the mesh is not found, the method throws an exception
64 * if \a throw_exception is \a true or returns *nullptr* if \a throw_exception
65 * is \a false.
66 */
67 virtual MeshHandle* findMeshHandle(const String& name, bool throw_exception) = 0;
68
69 /*!
70 * \brief Searches for the mesh with name \a name.
71 *
72 * If the mesh is not found, the method throws an exception.
73 */
74 virtual MeshHandle findMeshHandle(const String& name) = 0;
75
76 /*!
77 * \brief Creates and returns a handle for a mesh with name \a name.
78 *
79 * Throws an exception if a handle associated with this name already exists.
80 */
81 virtual MeshHandle createMeshHandle(const String& name) = 0;
82
83 /*!
84 * \brief Destroys the mesh associated with \a handle.
85 *
86 * The mesh must be a mesh implementing IPrimaryMesh.
87 *
88 * \warning \a handle must no longer be used after this call
89 * and the associated mesh either. If references to these two
90 * objects remain, the behavior is undefined.
91 */
92 virtual void destroyMesh(MeshHandle handle) = 0;
93
94 //! Handle for the default mesh.
95 virtual MeshHandle defaultMeshHandle() const = 0;
96};
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101} // End namespace Arcane
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106#endif
Declarations of Arcane's general types.
Interface of the mesh factory manager.
Mesh manager interface.
Definition IMeshMng.h:41
virtual ITraceMng * traceMng() const =0
Trace manager associated with this manager.
virtual ~IMeshMng()=default
Frees the resources.
virtual MeshHandle findMeshHandle(const String &name)=0
Searches for the mesh with name name.
virtual IVariableMng * variableMng() const =0
Variable manager associated with this manager.
virtual void destroyMesh(MeshHandle handle)=0
Destroys the mesh associated with handle.
virtual MeshHandle createMeshHandle(const String &name)=0
Creates and returns a handle for a mesh with name name.
virtual IMeshFactoryMng * meshFactoryMng() const =0
Mesh factory associated with this manager.
virtual MeshHandle * findMeshHandle(const String &name, bool throw_exception)=0
Searches for the mesh with name name.
virtual MeshHandle defaultMeshHandle() const =0
Handle for the default mesh.
Variable manager interface.
Handle on a mesh.
Definition MeshHandle.h:48
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --