Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
AMRComputeFunction.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/* AMRComputeFunction.h (C) 2000-2017 */
9/* */
10/* Variable transport functor class. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_AMRCOMPUTEFUNCTION_H
13#define ARCANE_AMRCOMPUTEFUNCTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/AMRTransportFunctor.h"
18
19#include "arcane/core/Item.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 \brief Interface for the CellVariable transport functor class.
32 */
33class AMRComputeFunction
35{
36 public:
37
38 template <typename ClassType>
39 AMRComputeFunction(ClassType* instance, void (ClassType::*func)(Array<ItemInternal*>&, AMROperationType))
40 : m_functor(new AMRTransportFunctorT<ClassType>(instance, func))
41 {
42 }
43 template <typename ClassType>
44 AMRComputeFunction(ClassType* instance, void (ClassType::*func)(Array<Cell>&, AMROperationType))
45 : m_functor(new AMRTransportFunctorT<ClassType>(instance, func))
46 {
47 }
48 virtual ~AMRComputeFunction() { delete m_functor; } //!< Releases resources
49
50 public:
51
52 //! Executes the calculation function
53 virtual void executeFunctor(Array<ItemInternal*>& cells, AMROperationType op)
54 {
55 m_functor->executeFunctor(cells, op);
56 }
57 //! Executes the calculation function
58 virtual void executeFunctor(Array<Cell>& cells, AMROperationType op)
59 {
60 m_functor->executeFunctor(cells, op);
61 }
62
63 private:
64
65 IAMRTransportFunctor* m_functor;
66};
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71} // namespace Arcane
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76#endif
virtual void executeFunctor(Array< Cell > &cells, AMROperationType op)
Executes the calculation function.
virtual void executeFunctor(Array< ItemInternal * > &cells, AMROperationType op)
Executes the calculation function.
virtual ~AMRComputeFunction()
Releases resources.
Base class for 1D data vectors.
Interface of a functor with argument.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --