Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshMaterialModifierImpl.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* MeshMaterialModifierImpl.h (C) 2000-2024 */
9/* */
10/* Implémentation de la modification des matériaux et milieux. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_MESHMATERIALMODIFIERIMPL_H
13#define ARCANE_MATERIALS_INTERNAL_MESHMATERIALMODIFIERIMPL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array.h"
19
21#include "arcane/materials/IMeshMaterial.h"
22#include "arcane/materials/internal/IncrementalComponentModifier.h"
23
24#include "arcane/accelerator/RunQueue.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::Materials
30{
31class MeshMaterialMng;
32class MaterialModifierOperation;
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
38: public TraceAccessor
39{
40 private:
41
43
45 {
46 public:
48 public:
49 void add(Operation* o);
50 void clear();
51 ConstArrayView<Operation*> values() const { return m_operations.constView(); }
52 public:
53 UniqueArray<Operation*> m_operations;
54 };
55
56 public:
57
59
60 public:
61
62 void initOptimizationFlags();
63 void setDoCopyBetweenPartialAndPure(bool v) { m_do_copy_between_partial_and_pure = v; }
64 void setDoInitNewItems(bool v) { m_do_init_new_items = v; }
65 void setPersistantWorkBuffer(bool v) { m_is_keep_work_buffer = v; }
66
67 public:
68
69 void reset();
70
71 void addCells(IMeshMaterial* mat, SmallSpan<const Int32> ids);
72 void removeCells(IMeshMaterial* mat, SmallSpan<const Int32> ids);
73
74 void endUpdate();
75 void beginUpdate();
76 void dumpStats();
77
78 private:
79
80 void _addCellsToGroupDirect(IMeshMaterial* mat, SmallSpan<const Int32> ids);
81 void _removeCellsToGroupDirect(IMeshMaterial* mat, SmallSpan<const Int32> ids);
82
83 void _applyOperationsNoOptimize();
84 void _updateEnvironmentsNoOptimize();
85 bool _checkMayOptimize();
86
87 private:
88
89 MeshMaterialMng* m_material_mng = nullptr;
90 OperationList m_operations;
91 RunQueue m_queue;
92 std::unique_ptr<IncrementalComponentModifier> m_incremental_modifier;
93
94 Int32 nb_update = 0;
95 Int32 nb_save_restore = 0;
96 Int32 nb_optimize_add = 0;
97 Int32 nb_optimize_remove = 0;
98 Int32 m_modification_id = 0;
99
100 bool m_allow_optimization = false;
101 bool m_allow_optimize_multiple_operation = false;
102 bool m_allow_optimize_multiple_material = false;
103 bool m_use_incremental_recompute = false;
104 bool m_print_component_list = false;
105
106 bool m_do_copy_between_partial_and_pure = true;
107 bool m_do_init_new_items = true;
108 bool m_is_keep_work_buffer = true;
109
110 bool m_is_debug = false;
111
112 private:
113
114 void _endUpdate();
115};
116
117/*---------------------------------------------------------------------------*/
118/*---------------------------------------------------------------------------*/
119
120}
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125#endif
126
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Opération d'ajout ou suppression de mailles d'un matériau.
Implémentation d'un gestion des matériaux.
void endUpdate()
Applique les opérations enregistrées.
Active toujours les traces dans les parties Arcane concernant les matériaux.