14#include "arcane/utils/FunctorUtils.h"
16#include "arcane/core/IItemFamilySerializeStep.h"
17#include "arcane/core/IMesh.h"
18#include "arcane/core/IItemFamily.h"
19#include "arcane/core/IItemFamilyPolicyMng.h"
20#include "arcane/core/ItemFamilySerializeArgs.h"
21#include "arcane/core/ISerializer.h"
23#include "arcane/materials/MeshMaterialExchangeMng.h"
24#include "arcane/materials/MeshMaterialIndirectModifier.h"
25#include "arcane/materials/IMeshMaterialVariable.h"
27#include "arcane/materials/internal/MeshMaterialMng.h"
46 , m_exchange_mng(exchange_mng)
47 , m_material_mng(exchange_mng->m_material_mng)
49 , m_indirect_modifier(
nullptr)
54 info() <<
"DESTROY SERIALIZE_CELLS_MATERIAL";
61 if (m_exchange_mng->m_is_in_mesh_material_exchange)
63 m_exchange_mng->m_is_in_mesh_material_exchange =
false;
68 m_indirect_modifier->beginUpdate();
82 info() <<
"NOTIFY_ACTION BEGIN_RECEIVE";
83 m_indirect_modifier->endUpdate();
84 delete m_indirect_modifier;
85 m_indirect_modifier =
nullptr;
88 info() <<
"NOTIFY_ACTION END_RECEIVE";
95 m_indirect_modifier->beginUpdate();
100 info() <<
"SERIALIZE_CELLS_MATERIAL rank=" << args.
rank()
106 info() <<
"SERIALIZE_MESH_MATERIAL_VARIABLE name=" << mv->name();
107 mv->serialize(sbuf, args.
localIds());
114 m_indirect_modifier->endUpdate();
115 delete m_indirect_modifier;
116 m_indirect_modifier =
nullptr;
117 m_exchange_mng->m_is_in_mesh_material_exchange =
false;
119 ePhase phase()
const override {
return IItemFamilySerializeStep::PH_Variable; }
124 MeshMaterialExchangeMng* m_exchange_mng;
138 ExchangeCellFactory(MeshMaterialExchangeMng* exchange_mng)
139 : m_exchange_mng(exchange_mng)
150 if (m_exchange_mng->materialMng()->isKeepValuesAfterChange())
157 MeshMaterialExchangeMng* m_exchange_mng;
163MeshMaterialExchangeMng::
166, m_material_mng(material_mng)
167, m_serialize_cells_factory(nullptr)
168, m_is_in_mesh_material_exchange(false)
175MeshMaterialExchangeMng::
176~MeshMaterialExchangeMng()
178 if (m_serialize_cells_factory) {
181 delete m_serialize_cells_factory;
191void MeshMaterialExchangeMng::
208 if (m_serialize_cells_factory)
221 return m_material_mng;
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
constexpr Integer size() const noexcept
Number of elements in the array.
virtual void removeSerializeStep(IItemFamilySerializeStepFactory *factory)=0
Removes a factory for a serialization step.
virtual void addSerializeStep(IItemFamilySerializeStepFactory *factory)=0
Adds a factory for a serialization step.
Factory for creating a step in the serialization of entity families.
Interface for a step in the serialization of entity families.
ePhase
Serialization phase.
@ AC_BeginReceive
Start of data reception.
@ AC_EndReceive
End of data reception.
Interface of an entity family.
virtual IItemFamilyPolicyMng * policyMng()=0
Interface of behaviors/policies associated with this family.
virtual IMesh * mesh() const =0
Associated mesh.
virtual IItemFamily * cellFamily()=0
Returns the cell family.
Arguments for the serialization callbacks of entity families.
Int32 rank() const
Rank of the source or destination.
Int32ConstArrayView localIds() const
Local indices of the entities. During serialization, these are the local indices of the entities sent...
ISerializer * serializer() const
Associated serializer.
Interface for the material and environment manager of a mesh.
Interface of a material variable on a mesh.
IItemFamilySerializeStep * createStep(IItemFamily *family) override
Creates a step for the family family.
void notifyAction(const NotifyActionArgs &args) override
Notifies the instance that we are entering a certain phase of the exchange.
ePhase phase() const override
Serialization phase where this instance is involved.
IItemFamily * family() const override
Associated family.
void serialize(const ItemFamilySerializeArgs &args) override
Serializes into/from buf.
void finalize() override
Performs end-of-exchange processing.
void initialize() override
Initializes the instance before the start of exchanges.
void registerFactory()
Registers the factory for exchanges.
Object allowing indirect modification of materials or media.
Implementation of a material manager.
void visitVariables(IFunctorWithArgumentT< IMeshMaterialVariable * > *functor) override
Applies the functor functor to all material variables.
IMesh * mesh() override
Associated mesh.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
TraceMessage info() const
Flow for an information message.
Always enables tracing in Arcane parts concerning materials.