Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Cartesian2DMeshGenerator_axl.h
1/*---------------------------------------------------------------------------*/
2/*---------------------------------------------------------------------------*/
3// #WARNING#: This file has been generated automatically. Do not edit.
4// Axlstar version 1.0
5/*---------------------------------------------------------------------------*/
6/*---------------------------------------------------------------------------*/
7
8#ifndef ARCANE_CASEOPTION_AXLSTAR_CARTESIAN2DMESHGENERATOR_H
9#define ARCANE_CASEOPTION_AXLSTAR_CARTESIAN2DMESHGENERATOR_H
10
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/String.h"
15
16#include "arcane/CaseOptions.h"
17#include "arcane/CaseOptionsMulti.h"
18#include "arcane/CaseOptionBuildInfo.h"
19#include "arcane/XmlNodeList.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24ARCANE_BEGIN_NAMESPACE
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30class CaseOptionsCartesian2DMeshGenerator
31{
32public:
33
34 /*-------------------------------------------------------------------------*/
35 /*--------------------------- Complex Options -----------------------------*/
36 /*-------------------------------------------------------------------------*/
37 // Generation for option 'x'
38 // Generating multiple arity CaseOption for complex option value 'x'
39 class CaseOptionPartInfoXValue
41 {
42 public:
43
44 typedef CaseOptionPartInfoXValue ThatClass;
45
46 CaseOptionPartInfoXValue(Arcane::ICaseOptionsMulti* opt,Arcane::ICaseOptionList* icl, const Arcane::XmlNode& element)
47 : Arcane::CaseOptionComplexValue(opt,icl,element)
48 , n(Arcane::CaseOptionBuildInfo(_configList(),
49 /* name */ "n", _element(),
50 /* default */ Arcane::String(),
51 /* min-occurs */ 1,
52 /* max-occurs */ 1,
53 /* optional */ false))
54 , length(Arcane::CaseOptionBuildInfo(_configList(),
55 /* name */ "length", _element(),
56 /* default */ Arcane::String(),
57 /* min-occurs */ 1,
58 /* max-occurs */ 1,
59 /* optional */ false))
60 , progression(Arcane::CaseOptionBuildInfo(_configList(),
61 /* name */ "progression", _element(),
62 /* default */ "1.0",
63 /* min-occurs */ 1,
64 /* max-occurs */ 1,
65 /* optional */ false))
66
67 {
68
69
70 }
71 public:
72 // Interfaces for multi-arity class CaseOptionsPartInfoX
73
74 Arcane::Integer getN() { return n(); }
75 Arcane::ICaseFunction* getNFunction() { return n.function(); }
76 Arcane::IStandardFunction* getNStandardFunction() { return n.standardFunction(); }
77 Arcane::Real getLength() { return length(); }
78 Arcane::ICaseFunction* getLengthFunction() { return length.function(); }
79 Arcane::IStandardFunction* getLengthStandardFunction() { return length.standardFunction(); }
80 Arcane::Real getProgression() { return progression(); }
81 Arcane::ICaseFunction* getProgressionFunction() { return progression.function(); }
82 Arcane::IStandardFunction* getProgressionStandardFunction() { return progression.standardFunction(); }
83
84
85
86 // Interfaces for complex options
87
88
89 public:
90
91 const ThatClass* operator->() const { return this; }
92
93 public:
94
95 Arcane::CaseOptionInteger n;
96 Arcane::CaseOptionReal length;
97 Arcane::CaseOptionReal progression;
98 };
99
100 // Generation for sub-option 'x'
101 class CaseOptionPartInfoX
103 , private Arcane::ArrayView< CaseOptionPartInfoXValue * >
104 {
105 public:
106
108
109 typedef CaseOptionPartInfoXValue value_type;
110
111 public:
112
113 CaseOptionPartInfoX(Arcane::ICaseOptionList* icl,
114 const Arcane::String& s, const Arcane::XmlNode& element)
115 : Arcane::CaseOptionsMulti(icl,s,element,1,-1)
116 {
117 // Generating translations and default values.
118 }
119
120 BaseClass operator()() { return (*this); }
121
122 protected:
123 void multiAllocate(const Arcane::XmlNodeList& elist)
124 {
125 Arcane::Integer s = elist.size();
126 value_type** v = 0;
127 if (s!=0)
128 v = new value_type*[s];
129 _setArray(v,s);
130 v = _ptr();
131 for( Arcane::Integer i=0; i<s; ++i ){
132 v[i] = new value_type(this,configList(),elist[i]);
133 }
134 }
135
136 public:
137
138 ~CaseOptionPartInfoX()
139 {
140 Arcane::Integer s = count();
141 if (s==0) return;
142 value_type** v = _ptr();
143 for( Arcane::Integer i=0; i<s; ++i ){
144 delete v[i];
145 }
146 delete[] v;
147 }
148
149 public:
150
151 const value_type& operator[](Arcane::Integer i) const
152 { return *(BaseClass::operator[](i)); }
153 value_type& operator[](Arcane::Integer i)
154 { return *(BaseClass::operator[](i)); }
155 Arcane::Integer count() const
156 { return BaseClass::size(); }
157 Arcane::Integer size() const
158 { return BaseClass::size(); }
159
160 };
161
162 // Generation for option 'y'
163 // Generating multiple arity CaseOption for complex option value 'y'
164 class CaseOptionPartInfoYValue
166 {
167 public:
168
169 typedef CaseOptionPartInfoYValue ThatClass;
170
171 CaseOptionPartInfoYValue(Arcane::ICaseOptionsMulti* opt,Arcane::ICaseOptionList* icl, const Arcane::XmlNode& element)
172 : Arcane::CaseOptionComplexValue(opt,icl,element)
173 , n(Arcane::CaseOptionBuildInfo(_configList(),
174 /* name */ "n", _element(),
175 /* default */ Arcane::String(),
176 /* min-occurs */ 1,
177 /* max-occurs */ 1,
178 /* optional */ false))
179 , length(Arcane::CaseOptionBuildInfo(_configList(),
180 /* name */ "length", _element(),
181 /* default */ Arcane::String(),
182 /* min-occurs */ 1,
183 /* max-occurs */ 1,
184 /* optional */ false))
185 , progression(Arcane::CaseOptionBuildInfo(_configList(),
186 /* name */ "progression", _element(),
187 /* default */ "1.0",
188 /* min-occurs */ 1,
189 /* max-occurs */ 1,
190 /* optional */ false))
191
192 {
193
194
195 }
196 public:
197 // Interfaces for multi-arity class CaseOptionsPartInfoY
198
199 Arcane::Integer getN() { return n(); }
200 Arcane::ICaseFunction* getNFunction() { return n.function(); }
201 Arcane::IStandardFunction* getNStandardFunction() { return n.standardFunction(); }
202 Arcane::Real getLength() { return length(); }
203 Arcane::ICaseFunction* getLengthFunction() { return length.function(); }
204 Arcane::IStandardFunction* getLengthStandardFunction() { return length.standardFunction(); }
205 Arcane::Real getProgression() { return progression(); }
206 Arcane::ICaseFunction* getProgressionFunction() { return progression.function(); }
207 Arcane::IStandardFunction* getProgressionStandardFunction() { return progression.standardFunction(); }
208
209
210
211 // Interfaces for complex options
212
213
214 public:
215
216 const ThatClass* operator->() const { return this; }
217
218 public:
219
220 Arcane::CaseOptionInteger n;
221 Arcane::CaseOptionReal length;
222 Arcane::CaseOptionReal progression;
223 };
224
225 // Generation for sub-option 'y'
226 class CaseOptionPartInfoY
228 , private Arcane::ArrayView< CaseOptionPartInfoYValue * >
229 {
230 public:
231
233
234 typedef CaseOptionPartInfoYValue value_type;
235
236 public:
237
238 CaseOptionPartInfoY(Arcane::ICaseOptionList* icl,
239 const Arcane::String& s, const Arcane::XmlNode& element)
240 : Arcane::CaseOptionsMulti(icl,s,element,1,-1)
241 {
242 // Generating translations and default values.
243 }
244
245 BaseClass operator()() { return (*this); }
246
247 protected:
248 void multiAllocate(const Arcane::XmlNodeList& elist)
249 {
250 Arcane::Integer s = elist.size();
251 value_type** v = 0;
252 if (s!=0)
253 v = new value_type*[s];
254 _setArray(v,s);
255 v = _ptr();
256 for( Arcane::Integer i=0; i<s; ++i ){
257 v[i] = new value_type(this,configList(),elist[i]);
258 }
259 }
260
261 public:
262
263 ~CaseOptionPartInfoY()
264 {
265 Arcane::Integer s = count();
266 if (s==0) return;
267 value_type** v = _ptr();
268 for( Arcane::Integer i=0; i<s; ++i ){
269 delete v[i];
270 }
271 delete[] v;
272 }
273
274 public:
275
276 const value_type& operator[](Arcane::Integer i) const
277 { return *(BaseClass::operator[](i)); }
278 value_type& operator[](Arcane::Integer i)
279 { return *(BaseClass::operator[](i)); }
280 Arcane::Integer count() const
281 { return BaseClass::size(); }
282 Arcane::Integer size() const
283 { return BaseClass::size(); }
284
285 };
286
287
288 /*-------------------------------------------------------------------------*/
289 /*--------------------------- Non Complex Options -------------------------*/
290 /*-------------------------------------------------------------------------*/
291
292 CaseOptionsCartesian2DMeshGenerator(Arcane::ICaseOptions* co)
293 : m_case_options(co)
294 , origin(Arcane::CaseOptionBuildInfo(_configList(),
295 /* name */ "origin", _element(),
296 /* default */ Arcane::String(),
297 /* min-occurs */ 1,
298 /* max-occurs */ 1,
299 /* optional */ false))
300 , nbPartX(Arcane::CaseOptionBuildInfo(_configList(),
301 /* name */ "nb-part-x", _element(),
302 /* default */ "0",
303 /* min-occurs */ 1,
304 /* max-occurs */ 1,
305 /* optional */ false))
306 , nbPartY(Arcane::CaseOptionBuildInfo(_configList(),
307 /* name */ "nb-part-y", _element(),
308 /* default */ "0",
309 /* min-occurs */ 1,
310 /* max-occurs */ 1,
311 /* optional */ false))
312 , generateSodGroups(Arcane::CaseOptionBuildInfo(_configList(),
313 /* name */ "generate-sod-groups", _element(),
314 /* default */ "false",
315 /* min-occurs */ 1,
316 /* max-occurs */ 1,
317 /* optional */ false))
318 , faceNumberingVersion(Arcane::CaseOptionBuildInfo(_configList(),
319 /* name */ "face-numbering-version", _element(),
320 /* default */ "4",
321 /* min-occurs */ 1,
322 /* max-occurs */ 1,
323 /* optional */ false))
324 , x(_configList(),
325 /* name */ "x", _element())
326 , y(_configList(),
327 /* name */ "y", _element())
328 {
329
330 }
331
332public:
333 // Interfaces for main CaseOptions
334
335 Arcane::Real2 getOrigin() { return origin(); }
336 Arcane::ICaseFunction* getOriginFunction() { return origin.function(); }
337 Arcane::IStandardFunction* getOriginStandardFunction() { return origin.standardFunction(); }
338 Arcane::Integer getNbPartX() { return nbPartX(); }
339 Arcane::ICaseFunction* getNbPartXFunction() { return nbPartX.function(); }
340 Arcane::IStandardFunction* getNbPartXStandardFunction() { return nbPartX.standardFunction(); }
341 Arcane::Integer getNbPartY() { return nbPartY(); }
342 Arcane::ICaseFunction* getNbPartYFunction() { return nbPartY.function(); }
343 Arcane::IStandardFunction* getNbPartYStandardFunction() { return nbPartY.standardFunction(); }
344 bool getGenerateSodGroups() { return generateSodGroups(); }
345 Arcane::ICaseFunction* getGenerateSodGroupsFunction() { return generateSodGroups.function(); }
346 Arcane::IStandardFunction* getGenerateSodGroupsStandardFunction() { return generateSodGroups.standardFunction(); }
347 Arcane::Integer getFaceNumberingVersion() { return faceNumberingVersion(); }
348 Arcane::ICaseFunction* getFaceNumberingVersionFunction() { return faceNumberingVersion.function(); }
349 Arcane::IStandardFunction* getFaceNumberingVersionStandardFunction() { return faceNumberingVersion.standardFunction(); }
350
351
352
353 // Interfaces for complex options
354
355
356public:
357
358 Arcane::ICaseOptions* caseOptions() const
359 {
360 return m_case_options.get();
361 }
362
363 Arcane::ICaseOptionList* configList() const
364 {
365 return m_case_options->configList();
366 }
367
368 void setCaseModule(Arcane::IModule* m)
369 {
370 m_case_options->setCaseModule(m);
371 }
372
373 void setCaseServiceInfo(Arcane::IServiceInfo* si)
374 {
375 m_case_options->setCaseServiceInfo(si);
376 }
377
378 void addAlternativeNodeName(const Arcane::String& lang,
379 const Arcane::String& name)
380 {
381 m_case_options->addAlternativeNodeName(lang,name);
382 }
383
384private:
385
386 Arcane::ICaseOptionList* _configList() const { return configList(); }
387 Arcane::XmlNode _element() const { return Arcane::XmlNode(); }
388
389private:
390
391 static Arcane::ICaseOptions* _createCaseOption(Arcane::ICaseMng* cm,Arcane::ICaseOptions* co);
392
393 Arcane::ReferenceCounter<Arcane::ICaseOptions> m_case_options;
394
395public:
396
397
398 Arcane::CaseOptionReal2 origin;
399 Arcane::CaseOptionInteger nbPartX;
400 Arcane::CaseOptionInteger nbPartY;
401 Arcane::CaseOptionBool generateSodGroups;
402 Arcane::CaseOptionInteger faceNumberingVersion;
403 CaseOptionPartInfoX x;
404 CaseOptionPartInfoY y;
405};
406
407/*---------------------------------------------------------------------------*/
408/*---------------------------------------------------------------------------*/
409
410ARCANE_END_NAMESPACE
411
412/*---------------------------------------------------------------------------*/
413/*---------------------------------------------------------------------------*/
414
415#endif
416
417
418
419/*---------------------------------------------------------------------------*/
420/*---------------------------------------------------------------------------*/
421// #WARNING#: This file has been generated automatically. Do not edit.
422// Axlstar version 1.0
423/*---------------------------------------------------------------------------*/
424/*---------------------------------------------------------------------------*/
425
426#ifndef ARCANE_MODULE_AXLSTAR_CARTESIAN2DMESHGENERATOR_H
427#define ARCANE_MODULE_AXLSTAR_CARTESIAN2DMESHGENERATOR_H
428
429/*---------------------------------------------------------------------------*/
430/*---------------------------------------------------------------------------*/
431
432#include "arcane/VariableTypes.h"
433#include "arcane/ServiceInfo.h"
434#include "arcane/ISubDomain.h"
435#include "arcane/ServiceBuildInfo.h"
436#include "arcane/ServiceFactory.h"
437#include "arcane/ServiceRegisterer.h"
438#include "arcane/BasicService.h"
439
440#ifndef ARCANE_HAS_SPECIFIC_BASIC_SERVICE
441// Code pour les versions de Arcane avant la 3.8 qui ne possèdent pas les
442// classes de base spécifiques pour les services
443namespace Arcane
444{
445using BasicCaseOptionService = BasicService;
446using BasicSubDomainService = BasicService;
447using BasicMeshService = BasicService;
448}
449#endif
450
451/*---------------------------------------------------------------------------*/
452/*---------------------------------------------------------------------------*/
453
454namespace Arcane
455{
456
457/*---------------------------------------------------------------------------*/
458/*---------------------------------------------------------------------------*/
459
461
462/*---------------------------------------------------------------------------*/
463/*---------------------------------------------------------------------------*/
464
467 : public Arcane::BasicCaseOptionService
468 , public Arcane::IMeshBuilder
469{
470public:
471 // NOTE GG: attention code dupliqué avec 'ServiceT4CaseAndStrong'. Bien reporter les modifications
472 template <typename ServiceClassType> static void fillServiceInfo(Arcane::ServiceInfo* si)
473 {
474 si->setCaseOptionsFileName("Cartesian2DMeshGenerator_arcane_std");
475 si->setAxlVersion(0.0);
476 si->setDefaultTagName("cartesian2-d-mesh-generator");
477 si->setAxlContent(getAxlContent());
480);
481 }
482
483public:
484
487 : Arcane::BasicCaseOptionService(sbi)
488 , m_options(nullptr)
489 {
491 if (co) {
493 }
494
495 }
496
499 {
500 delete m_options;
501 }
502
503
504public:
505
508
509private:
510
513
514protected:
515
517private:
519 {
520 const Arcane::Byte* content = (const Arcane::Byte*)"";
521 Arcane::Span<const Arcane::Byte> bytes(content,0);
522 int file_version = 1;
523 return Arcane::FileContent(bytes,file_version,"");
524 }
525};
526
527/*---------------------------------------------------------------------------*/
528/*---------------------------------------------------------------------------*/
529
530#define ARCANE_REGISTER_SERVICE_CARTESIAN2DMESHGENERATOR(service_name,class_name) \
531 ARCANE_REGISTER_AXL_SERVICE(class_name,Arcane::ServiceProperty(#service_name,Arcane::ST_CaseOption,\
532 Arcane::SFP_None ))
533
534/*---------------------------------------------------------------------------*/
535/*---------------------------------------------------------------------------*/
536
537} // End namespace Arcane
538
539/*---------------------------------------------------------------------------*/
540/*---------------------------------------------------------------------------*/
541
542#endif
543
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro to declare an interface when registering a service.
static Arcane::FileContent getAxlContent()
Variables du service.
ArcaneCartesian2DMeshGeneratorObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
CaseOptionsCartesian2DMeshGenerator * m_options
Options du jeu de données du service.
CaseOptionsCartesian2DMeshGenerator * options() const
Options du jeu de données du service.
Modifiable view of an array of type T.
Base class of a service linked to a subdomain.
Information for building a dataset option.
Base class for a complex option value.
Base class for an array of complex data set options.
Description and content of a file.
Definition FileContent.h:33
Interface of a dataset function.
Interface for a data set options list.
Interface for a list of options that appears multiple times.
Interface for a list of data set options.
Interface of a mesh creation/reading service.
Interface managing a standard function.
Information about a service.
Definition ServiceInfo.h:51
Class managing a 2-dimensional real vector.
Definition Real2.h:122
static void registerToServiceInfo(ServiceInfo *si, const Interfaces &... args)
Registers the factories for the Interfaces interfaces in the service.
ICaseOptions * caseOptions() const
Access to the associated ICaseOptions.
Structure containing the information to create a service.
View of an array of elements of type T.
Definition Span.h:635
List of nodes of a DOM tree.
Definition XmlNodeList.h:36
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.
unsigned char Byte
Type of a byte.
Definition BaseTypes.h:43