Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshVariableScalarRefTpl1.cc
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/* MeshVariableScalarRefTpl1.cc (C) 2000-2025 */
9/* */
10/* Instantiation of template classes for mesh variables. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/MeshVariableScalarRef.inst.h"
15#include "arcane/core/MeshPartialVariableScalarRef.inst.h"
16#include "arcane/core/VariableFactoryRegisterer.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
28add(VarType& out, const VarType& v, const ItemGroup& group)
29{
30 ENUMERATE_ITEM (iitem, group) {
31 out[iitem] += v[iitem];
32 }
33}
34
36sub(VarType& out, const VarType& v, const ItemGroup& group)
37{
38 ENUMERATE_ITEM (iitem, group) {
39 out[iitem] -= v[iitem];
40 }
41}
42
44mult(VarType& out, const VarType& v, const ItemGroup& group)
45{
46 ENUMERATE_ITEM (iitem, group) {
47 out[iitem] *= v[iitem];
48 }
49}
50
52mult(VarType& out, Real v, const ItemGroup& group)
53{
54 ENUMERATE_ITEM (iitem, group) {
55 out[iitem] *= v;
56 }
57}
58
60power(VarType& out, Real v, const ItemGroup& group)
61{
62 ENUMERATE_ITEM (iitem, group) {
63 out[iitem] = math::pow(out[iitem], v);
64 }
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70ARCANE_INSTANTIATE_MESHVARIABLE_SCALAR(Real);
71ARCANE_INSTANTIATE_MESHVARIABLE_SCALAR(Real2);
72ARCANE_INSTANTIATE_MESHVARIABLE_SCALAR(Real2x2);
73ARCANE_INSTANTIATE_MESHVARIABLE_SCALAR(Real3);
74ARCANE_INSTANTIATE_MESHVARIABLE_SCALAR(Real3x3);
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // namespace Arcane
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
#define ENUMERATE_ITEM(name, group)
Generic enumerator for a node group.
Mesh entity group.
Definition ItemGroup.h:51
Class managing a 2-dimensional real vector.
Definition Real2.h:122
Class managing a 2x2 matrix of reals.
Definition Real2x2.h:55
Class managing a 3-dimensional real vector.
Definition Real3.h:132
Class managing a 3x3 real matrix.
Definition Real3x3.h:67
__host__ __device__ double pow(double x, double y)
Power function.
Definition Math.h:175
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
double Real
Type representing a real number.