Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshMaterialModifier.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/* MeshMaterialModifier.h (C) 2000-2024 */
9/* */
10/* Object allowing material modification. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHMATERIALMODIFIER_H
13#define ARCANE_MATERIALS_MESHMATERIALMODIFIER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::Materials
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \ingroup ArcaneMaterials
31 * \brief Object allowing modification of materials or media.
32 *
33 * This class provides methods to modify the list of
34 * cells composing a material or a medium.
35 *
36 * Modifications are made directly on the materials. The corresponding media
37 * are automatically updated. It is possible
38 * either to add cells to a material (addCells())
39 * or to remove them (removeCells()). The modifications are not
40 * taken into account until endUpdate() is called. This last method
41 * does not need to be called explicitly: it is called automatically
42 * when the destructor is called.
43 * \todo add example.
44 */
45class ARCANE_MATERIALS_EXPORT MeshMaterialModifier
46{
47 public:
48
49 explicit MeshMaterialModifier(IMeshMaterialMng*);
50 ~MeshMaterialModifier() ARCANE_NOEXCEPT_FALSE;
51
52 public:
53
54 /*!
55 * \brief Adds the cells with local indices \a ids to the material \a mat.
56 */
58
59 /*!
60 * \brief Removes the cells with local indices \a ids from the material \a mat.
61 */
63
64 /*!
65 * \brief Updates the structures after a modification.
66 *
67 * This method is automatically called in the instance's destructor if necessary.
68 */
69 void endUpdate();
70
71 /*!
72 * \brief Indicates whether values are copied between pure and partial states when
73 * a change in the cell state occurs.
74 *
75 * If true (the default), the partial value
76 * of a cell is copied into the pure value when the partial cell
77 * transitions to a pure cell.
78 */
80
81 /*!
82 * \brief Indicates whether newly created material or environment cells are initialized.
83 *
84 * If true (the default), the newly created constituent cells
85 * are initialized. The value used for initialization depends on
86 * IMeshMaterialMng::isDataInitialisationWithZero().
87 */
88 void setDoInitNewItems(bool v);
89
90 /*!
91 * \brief Indicates whether work buffers are preserved between modifications.
92 *
93 * If true (the default), the work buffers are preserved between
94 * instances of this class. This prevents these buffers from being reallocated between
95 * each use of this class, but consequently, memory consumption may increase.
96 */
97 void setPersistantWorkBuffer(bool v);
98
99 private:
100
101 MeshMaterialModifierImpl* m_impl = nullptr;
102 bool m_has_update = false;
103 void _checkHasUpdate();
104};
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109} // namespace Arcane::Materials
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114#endif
Declarations of types used in Arcane.
Interface for the material and environment manager of a mesh.
void setDoInitNewItems(bool v)
Indicates whether newly created material or environment cells are initialized.
void endUpdate()
Updates the structures after a modification.
void addCells(IMeshMaterial *mat, SmallSpan< const Int32 > ids)
Adds the cells with local indices ids to the material mat.
void setPersistantWorkBuffer(bool v)
Indicates whether work buffers are preserved between modifications.
void removeCells(IMeshMaterial *mat, SmallSpan< const Int32 > ids)
Removes the cells with local indices ids from the material mat.
void setDoCopyBetweenPartialAndPure(bool v)
Indicates whether values are copied between pure and partial states when a change in the cell state o...
View of an array of elements of type T.
Definition Span.h:805
Always enables tracing in Arcane parts concerning materials.
class ARCANE_MATERIALS_EXPORT(64) SimdMatVarIndex
SIMD indexer on a component.