Arcane  v3.14.11.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
IGeometryMng.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#ifndef ARCGEOSIM_GEOMETRY_IGEOMETRYSERVICE_H
8#define ARCGEOSIM_GEOMETRY_IGEOMETRYSERVICE_H
9/* Author : havep at Wed Nov 14 13:41:31 2007
10 * Generated by createNew
11 */
12
13#include <arcane/ItemGroup.h>
14#include <arcane/ArcaneTypes.h>
15#include <arcane/MeshVariable.h>
16#include <arcane/VariableTypedef.h>
17#include <arcane/utils/String.h>
18
19using namespace Arcane;
20
21namespace Arcane
22{
23namespace Numerics
24{
25
26//! Interface for local geometry computations
27class IGeometry;
28
29//! Geometric properties
30/*! Some of them are contextual.
31 * For example, the PMeasure of a 3D cell is its PVolume.
32 *
33 * Technical notes: A external container given by the user cannot
34 * be used for anything except the given property.
35 * An internal ItemGroupMap cannot be allocated for a group different
36 * of the group wished by the used.
37 */
38struct ARCANE_GEOMETRY_EXPORT IGeometryProperty
39{
40 enum eProperty
41 {
42 PNone = 0,
43 PMeasure = (1 << 0),
44 PLength = (1 << 1),
45 PArea = (1 << 2),
46 PVolume = (1 << 3),
47 PCenter = (1 << 4),
48 PNormal = (1 << 5),
49 PVolumeSurfaceRatio = (1 << 6),
50 PEnd = (1 << 7) //! Marqueur de dernier type
51 };
52
53 enum eStorage
54 {
55 PNoStorage = 0,
56 PVariable = (1 << 0)
57 };
58
59 static bool isScalar(const eProperty p)
60 {
61 return (p & (PMeasure|PLength|PArea|PVolume|PVolumeSurfaceRatio)) != 0;
62 }
63
64 static bool isVectorial(const eProperty p)
65 {
66 return (p & (PCenter|PNormal)) != 0;
67 }
68
70 {
71 public:
72 Enumerator() : m_state(1) { }
73 eProperty operator*() const { return (eProperty)m_state; }
74 void operator++() { m_state <<= 1; }
75 bool end() const { return m_state == PEnd; }
76 private:
77 Integer m_state;
78 };
79
80 static String name(const eProperty p) {
81 switch (p) {
82 case PNone:
83 return "None";
84 case PMeasure:
85 return "Measure";
86 case PLength:
87 return "Length";
88 case PArea:
89 return "Area";
90 case PVolume:
91 return "Volume";
92 case PCenter:
93 return "Center";
94 case PNormal:
95 return "Normal";
96 case PVolumeSurfaceRatio:
97 return "VolumeSurfaceRatio";
98 case PEnd:
99 default:
100 ARCANE_FATAL("Undefined property");
101 }
102 }
103
104 static String name(const eStorage p) {
105 switch (p) {
106 case PNoStorage:
107 return "NoStorage";
108 case PVariable:
109 return "Variable";
110 default:
111 ARCANE_FATAL("Undefined storage");
112 }
113 }
114};
115/*!
116 * \brief Gestionnaire des calculs géométriques.
117 */
118class ARCANE_GEOMETRY_EXPORT IGeometryMng
119{
120 public:
123
124 public:
125 /** Constructeur de la classe */
127
128 /** Destructeur de la classe */
129 virtual ~IGeometryMng() {};
130
131public:
132 //! Initialisation
133 virtual void init() = 0;
134
135 //@{ @name Geometric property management for ItemGroup
136
137 //! Set geometric properties on a ItemGroup
138 virtual void addItemGroupProperty(ItemGroup group, Integer property, Integer storage = IGeometryProperty::PVariable) = 0;
139
140 //! Set geometric properties on a ItemGroup with an external container (real field)
141 virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, RealVariable var) = 0;
142
143 //! Set geometric properties on a ItemGroup with an external container (real3 field)
144 virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, Real3Variable var) = 0;
145
146 //! Get set of properties of an ItemGroup
148
149 //! Check if a property is activated on an ItemGroup
150 virtual bool hasItemGroupProperty(ItemGroup group, Integer property) = 0;
151
152 //! Check if a storage is available on an ItemGroup
153 virtual Integer getItemGroupPropertyStorage(ItemGroup group, IGeometryProperty::eProperty property) = 0;
154
155 //@}
156
157 //@{ @name Access to geometric values
158
159 //! Get geometric property values for a Real field
160 virtual const RealVariable & getRealVariableProperty(ItemGroup group, IGeometryProperty::eProperty property) = 0;
161
162 //! Get geometric property values for a Real3 field
163 virtual const Real3Variable & getReal3VariableProperty(ItemGroup group, IGeometryProperty::eProperty property) = 0;
164
165 //@}
166
167 //@{ @name property management by group and properties
168
169 //! Update property values for an ItemGroup
170 virtual void update(ItemGroup group, Integer property) = 0;
171
172 //! Reset property for an ItemGroup
173 virtual void reset(ItemGroup group, Integer property) = 0;
174
175 //@}
176
177 //@{ @name property management by group
178
179 //! Update property values for an ItemGroup
180 virtual void update(ItemGroup group) = 0;
181
182 //! Reset property for an ItemGroup
183 virtual void reset(ItemGroup group) = 0;
184
185 //@}
186
187 //@{ @name global property management
188
189 //! Update property values for all ItemGroups
190 virtual void update() = 0;
191
192 //! Reset property for all ItemGroups
193 virtual void reset() = 0;
194
195 //@}
196
197 //! Get underlying geometry
198 virtual IGeometry * geometry() = 0;
199};
200
201} // End namespace Arcane
202
203} // End namespace Numerics
204
205#endif /* ARCGEOSIM_GEOMETRY_IGEOMETRYSERVICE_H */
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Gestionnaire des calculs géométriques.
virtual const RealVariable & getRealVariableProperty(ItemGroup group, IGeometryProperty::eProperty property)=0
Get geometric property values for a Real field.
virtual void reset(ItemGroup group)=0
Reset property for an ItemGroup.
virtual Integer getItemGroupPropertyStorage(ItemGroup group, IGeometryProperty::eProperty property)=0
Check if a storage is available on an ItemGroup.
virtual bool hasItemGroupProperty(ItemGroup group, Integer property)=0
Check if a property is activated on an ItemGroup.
virtual void update()=0
Update property values for all ItemGroups.
virtual void update(ItemGroup group, Integer property)=0
Update property values for an ItemGroup.
virtual void reset(ItemGroup group, Integer property)=0
Reset property for an ItemGroup.
virtual void update(ItemGroup group)=0
Update property values for an ItemGroup.
virtual Integer getItemGroupProperty(ItemGroup group)=0
Get set of properties of an ItemGroup.
virtual void reset()=0
Reset property for all ItemGroups.
virtual void init()=0
Initialisation.
virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, RealVariable var)=0
Set geometric properties on a ItemGroup with an external container (real field)
virtual IGeometry * geometry()=0
Get underlying geometry.
virtual void addItemGroupProperty(ItemGroup group, Integer property, Integer storage=IGeometryProperty::PVariable)=0
Set geometric properties on a ItemGroup.
virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, Real3Variable var)=0
Set geometric properties on a ItemGroup with an external container (real3 field)
virtual const Real3Variable & getReal3VariableProperty(ItemGroup group, IGeometryProperty::eProperty property)=0
Get geometric property values for a Real3 field.
Interface de calculs géométriques.
Definition IGeometry.h:25
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Real2 operator*(Real sca, const Real2Proxy &vec)
Multiplication par un scalaire.
Definition Real2Proxy.h:241
Int32 Integer
Type représentant un entier.