Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshBuildInfo.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/* MeshBuildInfo.h (C) 2000-2023 */
9/* */
10/* Information for building a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESHBUILDINFO_H
13#define ARCANE_MESHBUILDINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18
19#include "arcane/core/IParallelMng.h"
20#include "arcane/core/ItemGroup.h"
21#include "arcane/core/MeshKind.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32/*!
33 * \brief Parameters necessary for building a mesh.
34 *
35 * Only the name (name()) is essential. The other parameters are
36 * optional depending on the desired creation type. If they are not
37 * defined and useful, a default value will be used.
38 *
39 * There are two possibilities for creation:
40 *
41 * - creation of a new mesh. In this case, it is necessary to specify
42 * the associated \a IParallelMng via addParallelMng().
43 * - creation of a sub-mesh of an existing mesh. In this case, it is necessary
44 * to position the group via addItemGroup(). The
45 * associated IParallelMng must be that of the parent mesh. The
46 * created sub-mesh will include the cells of this group.
47 */
48class ARCANE_CORE_EXPORT MeshBuildInfo
49{
50 public:
51
52 /*!
53 * \brief Constructs a default mesh with the name \a name.
54 */
55 explicit MeshBuildInfo(const String& name);
56
57 public:
58
59 //! Sets the factory name to create this mesh
60 MeshBuildInfo& addFactoryName(const String& factory_name);
61 //! Sets the parallelism manager to create the mesh
63 //! Sets the cell group for a sub-mesh
64 MeshBuildInfo& addParentGroup(const ItemGroup& parent_group);
65 /*!
66 * \brief Indicates whether the generator needs to call a partitioner.
67 *
68 * This is the case, for example, if the reader can only generate sequential meshes.
69 */
71
72 //! Sets the mesh characteristics
74
75 //! Name of the new mesh
76 const String& name() const { return m_name; }
77 //! Factory name to create the mesh (via IMeshFactory)
78 const String& factoryName() const { return m_factory_name; }
79 //! Parallelism manager in the case of a new mesh.
80 Ref<IParallelMng> parallelMngRef() const { return m_parallel_mng; }
81 //! Parent group in the case of a sub-mesh, null otherwise.
82 const ItemGroup& parentGroup() const { return m_parent_group; }
83 //! Indicates if the reader/generator requires partitioning
84 bool isNeedPartitioning() const { return m_is_need_partitioning; }
85 //! Mesh characteristics
86 const MeshKind meshKind() const { return m_mesh_kind; }
87
88 private:
89
90 String m_name;
91 String m_factory_name;
92 Ref<IParallelMng> m_parallel_mng;
93 ItemGroup m_parent_group;
94 bool m_is_need_partitioning = false;
95 MeshKind m_mesh_kind;
96};
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101} // End namespace Arcane
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106#endif
Mesh entity group.
Definition ItemGroup.h:51
const String & name() const
Name of the new mesh.
const ItemGroup & parentGroup() const
Parent group in the case of a sub-mesh, null otherwise.
const MeshKind meshKind() const
Mesh characteristics.
MeshBuildInfo & addNeedPartitioning(bool v)
Indicates whether the generator needs to call a partitioner.
MeshBuildInfo & addParallelMng(Ref< IParallelMng > pm)
Sets the parallelism manager to create the mesh.
MeshBuildInfo & addParentGroup(const ItemGroup &parent_group)
Sets the cell group for a sub-mesh.
bool isNeedPartitioning() const
Indicates if the reader/generator requires partitioning.
MeshBuildInfo(const String &name)
Constructs a default mesh with the name name.
Ref< IParallelMng > parallelMngRef() const
Parallelism manager in the case of a new mesh.
const String & factoryName() const
Factory name to create the mesh (via IMeshFactory).
MeshBuildInfo & addMeshKind(const MeshKind &v)
Sets the mesh characteristics.
MeshBuildInfo & addFactoryName(const String &factory_name)
Sets the factory name to create this mesh.
Characteristics of a mesh.
Definition MeshKind.h:113
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --