Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MatItemEnumerator.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* MatItemEnumerator.cc (C) 2000-2024 */
9/* */
10/* Enumérateurs sur les mailles materiaux. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arcane/core/materials/ComponentItemVectorView.h"
17#include "arcane/core/materials/IMeshMaterialMng.h"
18#include "arcane/core/materials/IMeshBlock.h"
19#include "arcane/core/materials/MatItemVector.h"
20#include "arcane/core/materials/EnvItemVector.h"
21#include "arcane/core/materials/internal/IMeshComponentInternal.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::Materials
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35ComponentCellEnumerator::
36ComponentCellEnumerator(const ComponentItemVectorView& v)
37: m_index(0)
38, m_size(v._matvarIndexes().size())
39, m_constituent_list_view(v._constituentItemListView())
40, m_matvar_indexes(v._matvarIndexes())
41, m_component(v.component())
42{
43#ifdef ARCANE_CHECK
44 if (m_index<m_size)
45 _check();
46#endif
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52MatCellEnumerator MatCellEnumerator::
53create(IMeshMaterial* mat)
54{
55 return MatCellEnumerator(mat->view());
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61MatCellEnumerator MatCellEnumerator::
62create(const MatCellVector& miv)
63{
64 return create(miv.view());
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70MatCellEnumerator MatCellEnumerator::
71create(MatCellVectorView v)
72{
73 return MatCellEnumerator(v);
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82EnvCellEnumerator EnvCellEnumerator::
83create(IMeshEnvironment* env)
84{
85 return EnvCellEnumerator(env->view());
86}
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91EnvCellEnumerator EnvCellEnumerator::
92create(const EnvCellVector& miv)
93{
94 return create(miv.view());
95}
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100EnvCellEnumerator EnvCellEnumerator::
101create(EnvCellVectorView v)
102{
103 return EnvCellEnumerator(v);
104}
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112EnvCellEnumerator CellGenericEnumerator::
113create(IMeshEnvironment* env)
114{
115 return EnvCellEnumerator::create(env);
116}
117
118/*---------------------------------------------------------------------------*/
119/*---------------------------------------------------------------------------*/
120
121EnvCellEnumerator CellGenericEnumerator::
122create(const EnvCellVector& ecv)
123{
124 return EnvCellEnumerator::create(ecv);
125}
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130EnvCellEnumerator CellGenericEnumerator::
131create(EnvItemVectorView v)
132{
133 return EnvCellEnumerator::create(v);
134}
135
136/*---------------------------------------------------------------------------*/
137/*---------------------------------------------------------------------------*/
138
139MatCellEnumerator CellGenericEnumerator::
140create(IMeshMaterial* mat)
141{
142 return MatCellEnumerator::create(mat);
143}
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148MatCellEnumerator CellGenericEnumerator::
149create(const MatCellVector& miv)
150{
151 return MatCellEnumerator::create(miv);
152}
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157MatCellEnumerator CellGenericEnumerator::
158create(MatItemVectorView v)
159{
160 return MatCellEnumerator::create(v);
161}
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
165
166CellEnumerator CellGenericEnumerator::
167create(CellVectorView v)
168{
169 return CellEnumerator(v);
170}
171
172/*---------------------------------------------------------------------------*/
173/*---------------------------------------------------------------------------*/
174
175CellEnumerator CellGenericEnumerator::
176create(const CellGroup& v)
177{
178 return create(v.view());
179}
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
187ComponentCellEnumerator ComponentCellEnumerator::
188create(IMeshComponent* component)
189{
190 return ComponentCellEnumerator(component->view());
191}
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
196ComponentCellEnumerator ComponentCellEnumerator::
197create(const ComponentItemVector& v)
198{
199 return create(v.view());
200}
201
202/*---------------------------------------------------------------------------*/
203/*---------------------------------------------------------------------------*/
204
205ComponentCellEnumerator ComponentCellEnumerator::
206create(ComponentItemVectorView v)
207{
208 return ComponentCellEnumerator(v);
209}
210
211/*---------------------------------------------------------------------------*/
212/*---------------------------------------------------------------------------*/
213
214/*---------------------------------------------------------------------------*/
215/*---------------------------------------------------------------------------*/
216
217ComponentEnumerator::
218ComponentEnumerator(ConstArrayView<IMeshComponent*> components)
219: m_components(components)
220, m_index(0)
221, m_size(m_components.size())
222{
223}
224
225/*---------------------------------------------------------------------------*/
226/*---------------------------------------------------------------------------*/
227
228/*---------------------------------------------------------------------------*/
229/*---------------------------------------------------------------------------*/
230
231MatEnumerator::
232MatEnumerator(IMeshMaterialMng* mm)
233: m_mats(mm->materials())
234, m_index(0)
235, m_size(m_mats.size())
236{
237}
238
239/*---------------------------------------------------------------------------*/
240/*---------------------------------------------------------------------------*/
241
242MatEnumerator::
243MatEnumerator(IMeshEnvironment* env)
244: m_mats(env->materials())
245, m_index(0)
246, m_size(m_mats.size())
247{
248}
249
250/*---------------------------------------------------------------------------*/
251/*---------------------------------------------------------------------------*/
252
253MatEnumerator::
254MatEnumerator(ConstArrayView<IMeshMaterial*> mats)
255: m_mats(mats)
256, m_index(0)
257, m_size(m_mats.size())
258{
259}
260
261/*---------------------------------------------------------------------------*/
262/*---------------------------------------------------------------------------*/
263
264/*---------------------------------------------------------------------------*/
265/*---------------------------------------------------------------------------*/
266
267EnvEnumerator::
268EnvEnumerator(IMeshMaterialMng* mm)
269: m_envs(mm->environments())
270, m_index(0)
271, m_size(m_envs.size())
272{
273}
274
275/*---------------------------------------------------------------------------*/
276/*---------------------------------------------------------------------------*/
277
278EnvEnumerator::
279EnvEnumerator(IMeshBlock* mb)
280: m_envs(mb->environments())
281, m_index(0)
282, m_size(m_envs.size())
283{
284}
285
286/*---------------------------------------------------------------------------*/
287/*---------------------------------------------------------------------------*/
288
289EnvEnumerator::
290EnvEnumerator(ConstArrayView<IMeshEnvironment*> envs)
291: m_envs(envs)
292, m_index(0)
293, m_size(m_envs.size())
294{
295}
296
297/*---------------------------------------------------------------------------*/
298/*---------------------------------------------------------------------------*/
299
300/*---------------------------------------------------------------------------*/
301/*---------------------------------------------------------------------------*/
302
303AllEnvCellEnumerator AllEnvCellEnumerator::
304create(AllEnvCellVectorView items)
305{
306 return AllEnvCellEnumerator(items);
307}
308
309/*---------------------------------------------------------------------------*/
310/*---------------------------------------------------------------------------*/
311
312AllEnvCellEnumerator AllEnvCellEnumerator::
313create(IMeshMaterialMng* mng,const CellVectorView& view)
314{
315 return create(mng->view(view));
316}
317
318/*---------------------------------------------------------------------------*/
319/*---------------------------------------------------------------------------*/
320
321AllEnvCellEnumerator AllEnvCellEnumerator::
322create(IMeshMaterialMng* mng,const CellGroup& group)
323{
324 return create(mng->view(group));
325}
326
327/*---------------------------------------------------------------------------*/
328/*---------------------------------------------------------------------------*/
329
330AllEnvCellEnumerator AllEnvCellEnumerator::
331create(IMeshBlock* block)
332{
333 return create(block->view());
334}
335
336/*---------------------------------------------------------------------------*/
337/*---------------------------------------------------------------------------*/
338
339/*---------------------------------------------------------------------------*/
340/*---------------------------------------------------------------------------*/
341
342ComponentPartCellEnumerator ComponentPartCellEnumerator::
343create(ComponentPartItemVectorView v)
344{
345 return ComponentPartCellEnumerator(v,0);
346}
347
348/*---------------------------------------------------------------------------*/
349/*---------------------------------------------------------------------------*/
350
351ComponentPartCellEnumerator ComponentPartCellEnumerator::
352create(IMeshComponent* component,eMatPart part)
353{
354 return create(component->partItems(part));
355}
356
357/*---------------------------------------------------------------------------*/
358/*---------------------------------------------------------------------------*/
359
360ComponentPartCellEnumerator::
361ComponentPartCellEnumerator(const ComponentPartItemVectorView& v,Integer base_index)
362: m_index(0)
363, m_size(v.itemIndexes().size())
364, m_var_idx(v.componentPartIndex())
365, m_base_index(base_index)
366, m_value_indexes(v.valueIndexes())
367, m_item_indexes(v.itemIndexes())
368, m_constituent_list_view(v.constituentItemListView())
369, m_component(v.component())
370{
371}
372
373/*---------------------------------------------------------------------------*/
374/*---------------------------------------------------------------------------*/
375
376MatPartCellEnumerator::
377MatPartCellEnumerator(const MatPartItemVectorView& v)
378: ComponentPartCellEnumerator(v,0)
379{
380}
381
382/*---------------------------------------------------------------------------*/
383/*---------------------------------------------------------------------------*/
384
385MatPartCellEnumerator MatPartCellEnumerator::
386create(IMeshMaterial* mat,eMatPart part)
387{
388 MatPartItemVectorView v(mat->partMatItems(part));
389 return MatPartCellEnumerator(v);
390}
391
392/*---------------------------------------------------------------------------*/
393/*---------------------------------------------------------------------------*/
394
395MatPartCellEnumerator MatPartCellEnumerator::
396create(MatPartItemVectorView v)
397{
398 return MatPartCellEnumerator(v);
399}
400
401/*---------------------------------------------------------------------------*/
402/*---------------------------------------------------------------------------*/
403
404EnvPartCellEnumerator::
405EnvPartCellEnumerator(const EnvPartItemVectorView& v)
406: ComponentPartCellEnumerator(v,0)
407{
408}
409
410/*---------------------------------------------------------------------------*/
411/*---------------------------------------------------------------------------*/
412
413EnvPartCellEnumerator EnvPartCellEnumerator::
414create(IMeshEnvironment* env,eMatPart part)
415{
416 EnvPartItemVectorView v(env->partEnvItems(part));
417 return EnvPartCellEnumerator(v);
418}
419
420/*---------------------------------------------------------------------------*/
421/*---------------------------------------------------------------------------*/
422
423EnvPartCellEnumerator EnvPartCellEnumerator::
424create(EnvPartItemVectorView v)
425{
426 return EnvPartCellEnumerator(v);
427}
428
429/*---------------------------------------------------------------------------*/
430/*---------------------------------------------------------------------------*/
431
432} // End namespace Arcane::Materials
433
434/*---------------------------------------------------------------------------*/
435/*---------------------------------------------------------------------------*/
ItemEnumeratorT< Cell > CellEnumerator
Enumérateurs sur des mailles.
Definition ItemTypes.h:271
Active toujours les traces dans les parties Arcane concernant les matériaux.