Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
core/materials/MeshMaterialVariableComputeFunction.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* MeshMaterialVariableComputeFunction.h (C) 2000-2022 */
9/* */
10/* Classe fonctor de recalcul d'une variable matériau. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHMATERIALVARIABLECOMPUTEFUNCTION_H
13#define ARCANE_MATERIALS_MESHMATERIALVARIABLECOMPUTEFUNCTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/FunctorWithArgument.h"
18#include "arcane/utils/TraceInfo.h"
19
20#include "arcane/core/materials/IMeshMaterialVariableComputeFunction.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::Materials
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30/*!
31 \brief Interface de la classe fonctor de recalcul d'une variable.
32 */
35{
36 public:
37
38 template<typename ClassType>
39 MeshMaterialVariableComputeFunction(ClassType* instance,void (ClassType::*func)(IMeshMaterial* mat))
40 : m_functor(new FunctorWithArgumentT<ClassType,IMeshMaterial*>(instance,func))
41 {
42 }
43 template<typename ClassType>
44 MeshMaterialVariableComputeFunction(ClassType* instance,void (ClassType::*func)(IMeshMaterial* mat),const TraceInfo& tinfo)
45 : m_functor(new FunctorWithArgumentT<ClassType,IMeshMaterial*>(instance,func)), m_trace_info(tinfo)
46 {
47 }
48
49 //! Libère les ressources
51 {
52 delete m_functor;
53 }
54
55 public:
56
57 //! Exécute la fonction de calcul
58 void execute(IMeshMaterial* mat) override
59 {
60 m_functor->executeFunctor(mat);
61 }
62
63 const TraceInfo& traceInfo() const override
64 {
65 return m_trace_info;
66 }
67
68 private:
69
71 TraceInfo m_trace_info;
72};
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77} // End namespace Arcane::Materials
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82#endif
83
Interface d'un matériau d'un maillage.
void execute(IMeshMaterial *mat) override
Exécute la fonction de calcul.
const TraceInfo & traceInfo() const override
Informations de trace de la définition de la fonction de calcul.
Interface d'un fonctor avec argument mais sans valeur de retour.
Active toujours les traces dans les parties Arcane concernant les matériaux.