Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
DataOperation.cc
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/* DataOperation.cc (C) 2000-2021 */
9/* */
10/* Opération sur une donnée. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/impl/DataOperation.h"
15
16#include "arcane/utils/FatalErrorException.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
28{
29public:
30 template<typename DataType>
31 DataType operator()(const DataType& input1,const DataType& input2)
32 {
33 return (DataType)(input1 + input2);
34 }
35};
36
38{
39public:
40 template<typename DataType>
41 DataType operator()(const DataType& input1,const DataType& input2)
42 {
43 return input1 - input2;
44 }
45};
46
48{
49public:
50 template<typename DataType>
51 DataType operator()(const DataType& input1,const DataType& input2)
52 {
53 return math::max(input1,input2);
54 }
55};
56
58{
59public:
60 template<typename DataType>
61 DataType operator()(const DataType& input1,const DataType& input2)
62 {
63 return math::min(input1,input2);
64 }
65};
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70extern "C++" ARCANE_IMPL_EXPORT IDataOperation*
71arcaneCreateDataOperation(Parallel::eReduceType rt)
72{
73 switch(rt){
74 case Parallel::ReduceSum:
76 break;
77 case Parallel::ReduceMax:
79 break;
80 case Parallel::ReduceMin:
82 break;
83 }
84 ARCANE_FATAL("Operation not found");
85}
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // End namespace Arcane
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Interface d'une opération sur une donnée.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
T max(const T &a, const T &b, const T &c)
Retourne le maximum de trois éléments.
Definition MathUtils.h:392
ARCCORE_HOST_DEVICE Real2 min(Real2 a, Real2 b)
Retourne le minimum de deux Real2.
Definition MathUtils.h:336
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eReduceType
Types des réductions supportées.