Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ExpressionImpl.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/* ExpressionImpl.cc (C) 2000-2014 */
9/* */
10/* Implémentation d'une expression. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14
15#include "arcane/utils/Iostream.h"
16#include "arcane/utils/Array.h"
17#include "arcane/expr/ExpressionImpl.h"
18#include "arcane/expr/OperatorMng.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23ARCANE_BEGIN_NAMESPACE
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28ExpressionImpl::
29ExpressionImpl()
30: m_op_mng(OperatorMng::instance())
31, m_nb_reference(0)
32, m_do_trace(false)
33{
34}
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39void ExpressionImpl::
40addRef()
41{
42 ++m_nb_reference;
43}
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
48void ExpressionImpl::
49removeRef()
50{
51 --m_nb_reference;
52 if (m_nb_reference==0){
53 //cout << "** DELETE\n";
54 delete this;
55 }
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
64void ExpressionImpl::
66{
68 exprs[0] = this;
69 for( Integer i=0; i<add_exprs.size(); ++i )
70 exprs[i+1] = add_exprs[i];
71
72 Integer size = vectorSize();
74 // Le variant appartient ensuite à résult qui le détruira
77
79
80 Integer nb_expr = exprs.size();
82 for( Integer i=0; i<nb_expr; ++i ){
83 display_values[i].resize(size);
86 exprs[i]->apply(&expr_result);
87 }
88
89 cout.flags(std::ios::scientific);
90 std::streamsize ss = std::cout.precision();
91 cout.precision(10);
92
93 for( Integer i=0; i<size; ++i ){
94 if (test_values[i]){
95 cout << "valeur [" << i << "] ";
96 for( Integer j=0; j<nb_expr; ++j ){
97 cout << ' ' << display_values[j][i];
98 }
99 cout << '\n';
100 }
101 }
102 std::cout.precision (ss);
103}
104
105/*---------------------------------------------------------------------------*/
106/*---------------------------------------------------------------------------*/
107
108ARCANE_END_NAMESPACE
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
Type de base polymorphe pour les tableaux (dimension 1).
Type de base polymorphe d'une expression.
Interface pour les différentes implémentations d'une expression.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120