Arcane  4.1.12.0
Developer 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
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
53 virtual const String& name() const { return m_name; }
54 virtual const CellGroup& cells() const { return m_cells; }
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
73
74 void build();
78
79 private:
80
83
86
89
92
95};
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100} // namespace Arcane::Materials
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
104
105#endif
Constant view of an array of type T.
View over a list of cells with environment information.
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
String m_name
Material name.
Definition MeshBlock.h:88
UniqueArray< IMeshEnvironment * > m_environments
List of materials/environments in this block.
Definition MeshBlock.h:94
IMeshMaterialMng * m_material_mng
Material manager.
Definition MeshBlock.h:82
Int32 m_block_id
Material identifier (index of this material in the list of materials).
Definition MeshBlock.h:85
virtual const String & name() const
Block name.
Definition MeshBlock.h:53
virtual IMeshMaterialMng * materialMng()
Associated manager.
Definition MeshBlock.h:52
CellGroup m_cells
List of cells for this material.
Definition MeshBlock.h:91
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.