Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshBlock.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/* MeshBlock.h (C) 2000-2016 */
9/* */
10/* Block of a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHBLOCK_H
13#define ARCANE_MATERIALS_MESHBLOCK_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
19#include "arcane/core/ItemGroup.h"
20
21#include "arcane/materials/IMeshBlock.h"
22#include "arcane/materials/MeshBlockBuildInfo.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::Materials
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33/*!
34 * \internal
35 * \brief Block of a mesh.
36 *
37 * This class is for internal use in Arcane and should not be used
38 * explicitly. The IMeshBlock interface must be used to access
39 * the materials.
40 */
41class MeshBlock
42: public TraceAccessor
43, public IMeshBlock
44{
45 public:
46
47 MeshBlock(IMeshMaterialMng* mm, Int32 block_id, const MeshBlockBuildInfo& infos);
48 virtual ~MeshBlock() {}
49
50 public:
51
52 virtual IMeshMaterialMng* materialMng() { return m_material_mng; }
53 virtual const String& name() const { return m_name; }
54 virtual const CellGroup& cells() const { return m_cells; }
56 {
57 return m_environments;
58 }
59 virtual Integer nbEnvironment() const
60 {
61 return m_environments.size();
62 }
63 virtual Int32 id() const
64 {
65 return m_block_id;
66 }
67
68 virtual AllEnvCellVectorView view();
69
70 public:
71
72 //! Public functions but reserved for IMeshMaterialMng
73 //@{
74 void build();
77 //@}
78
79 private:
80
81 //! Material manager
82 IMeshMaterialMng* m_material_mng;
83
84 //! Material identifier (index of this material in the list of materials)
85 Int32 m_block_id;
86
87 //! Material name
88 String m_name;
89
90 //! List of cells for this material
91 CellGroup m_cells;
92
93 //! List of materials/environments in this block.
94 UniqueArray<IMeshEnvironment*> m_environments;
95};
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100} // namespace Arcane::Materials
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
104
105#endif
Constant view of an array of type T.
Interface for the material and environment manager of a mesh.
Brief: Information for the creation of a block.
void addEnvironment(IMeshEnvironment *env)
Adds the environment env to the block.
Definition MeshBlock.cc:69
virtual const String & name() const
Block name.
Definition MeshBlock.h:53
virtual IMeshMaterialMng * materialMng()
Associated manager.
Definition MeshBlock.h:52
virtual Integer nbEnvironment() const
Number of environments in the block.
Definition MeshBlock.h:59
void build()
Public functions but reserved for IMeshMaterialMng.
Definition MeshBlock.cc:46
void removeEnvironment(IMeshEnvironment *env)
Removes the environment env from the block.
Definition MeshBlock.cc:88
virtual AllEnvCellVectorView view()
View of the environments cells corresponding to this block.
Definition MeshBlock.cc:54
virtual Int32 id() const
Block identifier. It is also the index (starting from 0) of this block in the list of blocks.
Definition MeshBlock.h:63
virtual const CellGroup & cells() const
Cell group of this block.
Definition MeshBlock.h:54
virtual ConstArrayView< IMeshEnvironment * > environments()
List of environments in this block.
Definition MeshBlock.h:55
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
Always enables tracing in Arcane parts concerning materials.
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.