Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IGeometryMng.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#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/utils/String.h"
14
15#include "arcane/core/ItemGroup.h"
17#include "arcane/core/MeshVariable.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23using namespace Arcane;
24
25namespace Arcane::Numerics
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
32class IGeometry;
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
38
46struct ARCANE_GEOMETRY_EXPORT IGeometryProperty
47{
48 enum eProperty
49 {
50 PNone = 0,
51 PMeasure = (1 << 0),
52 PLength = (1 << 1),
53 PArea = (1 << 2),
54 PVolume = (1 << 3),
55 PCenter = (1 << 4),
56 PNormal = (1 << 5),
57 PVolumeSurfaceRatio = (1 << 6),
58 PEnd = (1 << 7)
59 };
60
61 enum eStorage
62 {
63 PNoStorage = 0,
64 PVariable = (1 << 0)
65 };
66
67 static bool isScalar(const eProperty p)
68 {
69 return (p & (PMeasure | PLength | PArea | PVolume | PVolumeSurfaceRatio)) != 0;
70 }
71
72 static bool isVectorial(const eProperty p)
73 {
74 return (p & (PCenter | PNormal)) != 0;
75 }
76
77 class Enumerator
78 {
79 public:
80
81 Enumerator()
82 : m_state(1)
83 {}
84 eProperty operator*() const { return (eProperty)m_state; }
85 void operator++() { m_state <<= 1; }
86 bool end() const { return m_state == PEnd; }
87
88 private:
89
90 Integer m_state;
91 };
92
93 static String name(const eProperty p)
94 {
95 switch (p) {
96 case PNone:
97 return "None";
98 case PMeasure:
99 return "Measure";
100 case PLength:
101 return "Length";
102 case PArea:
103 return "Area";
104 case PVolume:
105 return "Volume";
106 case PCenter:
107 return "Center";
108 case PNormal:
109 return "Normal";
110 case PVolumeSurfaceRatio:
111 return "VolumeSurfaceRatio";
112 case PEnd:
113 default:
114 ARCANE_FATAL("Undefined property");
115 }
116 }
117
118 static String name(const eStorage p)
119 {
120 switch (p) {
121 case PNoStorage:
122 return "NoStorage";
123 case PVariable:
124 return "Variable";
125 default:
126 ARCANE_FATAL("Undefined storage");
127 }
128 }
129};
130
133class ARCANE_GEOMETRY_EXPORT IGeometryMng
134{
135 public:
136
137 typedef VariableItemReal RealVariable;
138 typedef VariableItemReal3 Real3Variable;
139
140 public:
141
144
146 virtual ~IGeometryMng() {};
147
148 public:
149
151 virtual void init() = 0;
152
154
156 virtual void addItemGroupProperty(ItemGroup group, Integer property, Integer storage = IGeometryProperty::PVariable) = 0;
157
159 virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, RealVariable var) = 0;
160
162 virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, Real3Variable var) = 0;
163
166
168 virtual bool hasItemGroupProperty(ItemGroup group, Integer property) = 0;
169
171 virtual Integer getItemGroupPropertyStorage(ItemGroup group, IGeometryProperty::eProperty property) = 0;
172
174
176
178 virtual const RealVariable& getRealVariableProperty(ItemGroup group, IGeometryProperty::eProperty property) = 0;
179
181 virtual const Real3Variable& getReal3VariableProperty(ItemGroup group, IGeometryProperty::eProperty property) = 0;
182
184
186
188 virtual void update(ItemGroup group, Integer property) = 0;
189
191 virtual void reset(ItemGroup group, Integer property) = 0;
192
194
196
198 virtual void update(ItemGroup group) = 0;
199
201 virtual void reset(ItemGroup group) = 0;
202
204
206
208 virtual void update() = 0;
209
211 virtual void reset() = 0;
212
214
216 virtual IGeometry* geometry() = 0;
217};
218
219/*---------------------------------------------------------------------------*/
220/*---------------------------------------------------------------------------*/
221
222} // namespace Arcane::Numerics
223
224/*---------------------------------------------------------------------------*/
225/*---------------------------------------------------------------------------*/
226
227#endif
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Declarations of Arcane's general types.
Mesh entity group.
Definition ItemGroup.h:51
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
Initialization.
virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, RealVariable var)=0
Set geometric properties on an 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 an ItemGroup.
virtual void addItemGroupProperty(ItemGroup group, IGeometryProperty::eProperty property, Real3Variable var)=0
Set geometric properties on an 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.
Geometric calculation interface.
Definition IGeometry.h:30
ItemVariableScalarRefT< Real > VariableItemReal
Real type quantity.
ItemVariableScalarRefT< Real3 > VariableItemReal3
3D coordinate type quantity
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.