Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AcceleratorMeshMaterialSynchronizerImpl.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/* MeshMaterialSynchronizer.h (C) 2000-2024 */
9/* */
10/* Synchronization of the list of materials/media of entities. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_MESHMATERIALSYNCHRONIZERIMPLACC_H
13#define ARCANE_MATERIALS_INTERNAL_MESHMATERIALSYNCHRONIZERIMPLACC_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/ArrayView.h"
19
21#include "arcane/core/MeshVariableArrayRef.h"
22
24#include "arcane/materials/MatItem.h"
25
26#include "arcane/accelerator/Accelerator.h"
27#include "arcane/materials/internal/IndexSelecter.h"
28
29#include "arcane/materials/internal/IMeshMaterialSynchronizerImpl.h"
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34namespace Arcane::Materials
35{
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
53class AcceleratorMeshMaterialSynchronizerImpl
54: public TraceAccessor
55, public IMeshMaterialSynchronizerImpl
56{
57 public:
58
59 explicit AcceleratorMeshMaterialSynchronizerImpl(IMeshMaterialMng* material_mng);
60
61 public:
62
72
73 private:
74
75 IMeshMaterialMng* m_material_mng;
76
77 public:
78
79 ARCCORE_HOST_DEVICE static void _setBit(Arcane::DataViewGetterSetter<unsigned char> bytes, Integer position)
80 {
81 Integer bit = position % 8;
82 unsigned char temp = bytes;
83 temp |= (Byte)(1 << bit);
84 bytes = temp;
85 }
86 ARCCORE_HOST_DEVICE static bool _hasBit(Arcane::DataViewGetterSetter<unsigned char> bytes, Integer position)
87 {
88 Integer bit = position % 8;
89 unsigned char temp = bytes;
90 return temp & (1 << bit);
91 }
92
93 private:
94
96 VariableCellArrayByte m_mat_presence;
97};
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102} // End namespace Arcane::Materials
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107#endif
Construction of a subset of indices from a criterion.
Class for accessing an element of a read/write view.
bool synchronizeMaterialsInCells()
Synchronization of the list of materials/media of entities.
Interface for the material and environment manager of a mesh.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
MeshVariableArrayRefT< Cell, Byte > VariableCellArrayByte
Quantity at cell centers of byte array type.
Always enables tracing in Arcane parts concerning materials.
Int32 Integer
Type representing an integer.
unsigned char Byte
Type of a byte.
Definition BaseTypes.h:43