Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ConstituentModifierWorkInfo.cc
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/* ConstituentModifierWorkInfo.h (C) 2000-2024 */
9/* */
10/* Structure de travail utilisée lors de la modification des constituants. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/materials/internal/ConstituentModifierWorkInfo.h"
15
16#include "arcane/materials/internal/MaterialModifierOperation.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane::Materials
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27ConstituentModifierWorkInfo::
28ConstituentModifierWorkInfo(const MemoryAllocationOptions& opts, eMemoryRessource mem)
29: pure_local_ids(opts.allocator())
30, partial_indexes(opts.allocator())
31, cells_changed_in_env(opts)
32, cells_unchanged_in_env(opts)
33, m_saved_matvar_indexes(opts.allocator())
34, m_saved_local_ids(opts.allocator())
35, m_cells_current_nb_material(opts)
36, m_cells_is_partial(mem)
37, m_removed_local_ids_filter(mem)
38, m_cells_to_transform(mem)
39{
40 cells_changed_in_env.setDebugName("WorkInfoCellsChangedInEnv");
41 cells_unchanged_in_env.setDebugName("WorkInfoCellsUnchangedInEnv");
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47void ConstituentModifierWorkInfo::
48initialize(Int32 max_local_id, Int32 nb_material, Int32 nb_environment, RunQueue& queue)
49{
50 m_is_materials_modified.resizeHost(nb_material);
51 m_is_environments_modified.resizeHost(nb_environment);
52 m_cells_to_transform.resize(max_local_id);
53 m_cells_to_transform.fill(false, &queue);
54 m_removed_local_ids_filter.resize(max_local_id);
55 m_removed_local_ids_filter.fill(false, &queue);
56
57 m_saved_matvar_indexes.resizeHost(max_local_id);
58 m_saved_local_ids.resizeHost(max_local_id);
59
60 // Utilise toujours la mémoire du device pour le tableau contenant les données de copie
61 if (queue.isAcceleratorPolicy())
62 m_variables_copy_data = NumArray<CopyBetweenDataInfo, MDDim1>(eMemoryRessource::Device);
63}
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68void ConstituentModifierWorkInfo::
69setRemovedCells(ConstArrayView<Int32> local_ids, bool value)
70{
71 // Positionne le filtre des mailles supprimées.
72 for (Int32 lid : local_ids)
73 m_removed_local_ids_filter[lid] = value;
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79void ConstituentModifierWorkInfo::
80setCurrentOperation(MaterialModifierOperation* operation)
81{
82 m_is_add = operation->isAdd();
83}
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88} // namespace Arcane::Materials
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
File d'exécution pour un accélérateur.
bool isAcceleratorPolicy() const
Indique si l'instance est associée à un accélérateur.
Definition RunQueue.cc:324
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.
bool isAdd() const
Indique si l'opération consiste à ajouter ou supprimer des mailles du matériau.
Active toujours les traces dans les parties Arcane concernant les matériaux.
eMemoryRessource
Liste des ressources mémoire disponibles.