14#include "arcane/utils/ITraceMng.h"
15#include "arcane/utils/FatalErrorException.h"
17#include "arcane/core/Item.h"
18#include "arcane/core/ItemGroupComputeFunctor.h"
19#include "arcane/core/ItemGroupImpl.h"
20#include "arcane/core/ItemGroup.h"
21#include "arcane/core/IMesh.h"
22#include "arcane/core/IItemFamily.h"
23#include "arcane/core/Properties.h"
38 ITraceMng* trace = m_group->mesh()->traceMng();
41 m_group->beginTransaction();
47 items_lid.
add(iitem.itemLocalId());
49 m_group->setItems(items_lid);
50 m_group->endTransaction();
52 trace->
debug() <<
"OwnItemGroupComputeFunctor::execute()"
53 <<
" this=" << m_group
54 <<
" parent_name=" << parent.
name()
55 <<
" name=" << m_group->name()
56 <<
" parent_count=" << parent.
size()
57 <<
" mysize=" << m_group->size();
66 ITraceMng* trace = m_group->mesh()->traceMng();
68 m_group->beginTransaction();
74 items_lid.
add(iitem.itemLocalId());
77 m_group->setItems(items_lid);
78 m_group->endTransaction();
80 trace->
debug() <<
"GhostItemGroupComputeFunctor::execute()"
81 <<
" this=" << m_group
82 <<
" parent_name=" << parent.
name()
83 <<
" name=" << m_group->name()
84 <<
" parent_count=" << parent.
size()
85 <<
" mysize=" << m_group->size();
94 ITraceMng* trace = m_group->mesh()->traceMng();
99 trace->
fatal() <<
"InterfaceGroupComputeFunctor::executeFunctor()"
100 <<
" Incoherent family expected=" <<
IK_Face <<
" current=" << family->
itemKind();
103 m_group->beginTransaction();
110 if (!bcell.
null() && !fcell.
null()) {
111 const bool isBackOwn = bcell.
isOwn();
112 const bool isFrontOwn = fcell.
isOwn();
113 if (isBackOwn != isFrontOwn) {
119 m_group->setItems(items_lid);
120 m_group->endTransaction();
122 trace->
debug() <<
"InterfaceItemGroupComputeFunctor::execute()"
123 <<
" this=" << m_group
124 <<
" parent_name=" << parent.
name()
125 <<
" name=" << m_group->name()
126 <<
" parent_count=" << parent.
size()
127 <<
" mysize=" << m_group->size();
137template <
typename ItemType>
void
141 IMesh* mesh = m_group->mesh();
142 ITraceMng* trace = m_group->mesh()->traceMng();
148 ARCANE_FATAL(
"Incoherent family wanted={0} current={1} v={2}",
149 ik, family->
itemKind(), m_group->itemKind());
152 m_group->beginTransaction();
156 ItemType* null_type = 0;
158 impl::ItemBase i = (*iitem).itemBase();
160 Int32 lid = iitem2.localId();
161 if (markers[lid] == 0) {
167 bool do_sort = mesh->properties()->getBoolWithDefault(
"sort-subitemitem-group",
false);
169 m_group->setItems(items_lid, do_sort);
170 m_group->endTransaction();
172 trace->
debug() <<
"ItemItemGroupComputeFunctor::execute()"
173 <<
" this=" << m_group
174 <<
" parent_name=" << parent.
name()
175 <<
" name=" << m_group->name()
176 <<
" parent_count=" << parent.
size()
177 <<
" mysize=" << m_group->size()
178 <<
" mysize2=" << items_lid.
size();
187 ITraceMng* trace = m_group->mesh()->traceMng();
191 m_group->beginTransaction();
196 const Face& face = *iface;
205 markers[icell.localId()] =
true;
217 m_group->setItems(items_lid);
218 m_group->endTransaction();
220 trace->
debug() <<
"InnerFaceItemGroupComputeFunctor::execute()"
221 <<
" this=" << m_group
222 <<
" parent_name=" << parent.
name()
223 <<
" name=" << m_group->name()
224 <<
" parent_count=" << parent.
size()
225 <<
" mysize=" << m_group->size();
234 ITraceMng* trace = m_group->mesh()->traceMng();
238 m_group->beginTransaction();
243 const Face& face = *iface;
252 markers[icell.localId()] =
true;
264 m_group->setItems(items_lid);
265 m_group->endTransaction();
267 trace->
debug() <<
"OuterFaceItemGroupComputeFunctor::execute()"
268 <<
" this=" << m_group
269 <<
" parent_name=" << parent.
name()
270 <<
" name=" << m_group->name()
271 <<
" parent_count=" << parent.
size()
272 <<
" mysize=" << m_group->size();
281 ITraceMng* trace = m_group->mesh()->traceMng();
286 trace->
fatal() <<
"AllActiveCellGroupComputeFunctor::executeFunctor()"
287 <<
" Incoherent family expected=" <<
IK_Cell <<
" current=" << family->
itemKind();
290 m_group->beginTransaction();
297 m_group->setItems(items_lid);
298 m_group->endTransaction();
300 trace->
debug() <<
"AllActiveCellGroupComputeFunctor::execute()"
301 <<
" this=" << m_group
302 <<
" parent_name=" << parent.
name()
303 <<
" name=" << m_group->name()
304 <<
" parent_count=" << parent.
size()
305 <<
" mysize=" << m_group->size();
314 ITraceMng* trace = m_group->mesh()->traceMng();
319 trace->
fatal() <<
"OwnActiveCellGroupComputeFunctor::executeFunctor()"
320 <<
" Incoherent family expected=" <<
IK_Cell <<
" current=" << family->
itemKind();
323 m_group->beginTransaction();
331 m_group->setItems(items_lid);
332 m_group->endTransaction();
334 trace->
debug() <<
"OwnActiveCellGroupComputeFunctor::execute()"
335 <<
" this=" << m_group
336 <<
" parent_name=" << parent.
name()
337 <<
" name=" << m_group->name()
338 <<
" parent_count=" << parent.
size()
339 <<
" mysize=" << m_group->size();
348 ITraceMng* trace = m_group->mesh()->traceMng();
353 trace->
fatal() <<
"LevelCellGroupComputeFunctor::executeFunctor()"
354 <<
" Incoherent family expected=" <<
IK_Cell <<
" current=" << family->
itemKind();
357 m_group->beginTransaction();
362 if (item.
level() == m_level)
365 m_group->setItems(items_lid);
366 m_group->endTransaction();
368 trace->
debug() <<
"LevelCellGroupComputeFunctor::execute()"
369 <<
" this=" << m_group
370 <<
" parent_name=" << parent.
name()
371 <<
" name=" << m_group->name()
372 <<
" parent_count=" << parent.
size()
373 <<
" mysize=" << m_group->size();
382 ITraceMng* trace = m_group->mesh()->traceMng();
386 m_group->beginTransaction();
389 trace->
fatal() <<
"LevelCellGroupComputeFunctor::executeFunctor()"
390 <<
" Incoherent family expected=" <<
IK_Cell <<
" current=" << family->
itemKind();
394 if (item.
isOwn() && (item.
level() == m_level))
397 m_group->setItems(items_lid);
398 m_group->endTransaction();
400 trace->
debug() <<
"OwnLevelItemGroupComputeFunctor::execute()"
401 <<
" this=" << m_group
402 <<
" parent_name=" << parent.
name()
403 <<
" name=" << m_group->name()
404 <<
" parent_count=" << parent.
size()
405 <<
" mysize=" << m_group->size();
414 ITraceMng* trace = m_group->mesh()->traceMng();
418 m_group->beginTransaction();
445 markers[icell.localId()] =
true;
448 const Face& face = *iface;
458 trace->
debug() <<
"NUMBER OF ALL FACES= " << counter
459 <<
"\n NUNMBER OF BOUNDARY FACES= " << counter_0
460 <<
"\n NUMBER OF ACTIVE BOUNDARY FACES= " << counter_1
461 <<
"\n NUMBER OF ACTIVE INTERIOR FACES= " << counter_2 <<
"\n";
462 m_group->setItems(items_lid);
463 m_group->endTransaction();
465 trace->
debug() <<
"ActiveFaceItemGroupComputeFunctor::execute()"
466 <<
" this=" << m_group
467 <<
" parent_name=" << parent.
name()
468 <<
" name=" << m_group->name()
469 <<
" parent_count=" << parent.
size()
470 <<
" mysize=" << m_group->size();
479 ITraceMng* trace = m_group->mesh()->traceMng();
483 m_group->beginTransaction();
488 const Face& face = *iface;
502 markers[icell.localId()] =
true;
505 const Face& face = *iface;
510 else if (face.
isOwn() &&
517 m_group->setItems(items_lid);
518 m_group->endTransaction();
520 trace->
debug() <<
"OwnActiveFaceItemGroupComputeFunctor::execute()"
521 <<
" this=" << m_group
522 <<
" parent_name=" << parent.
name()
523 <<
" name=" << m_group->name()
524 <<
" parent_count=" << parent.
size()
525 <<
" mysize=" << m_group->size();
534 ITraceMng* trace = m_group->mesh()->traceMng();
538 m_group->beginTransaction();
555 markers[icell.localId()] =
true;
570 m_group->setItems(items_lid);
571 m_group->endTransaction();
573 trace->
debug() <<
"InnerActiveFaceItemGroupComputeFunctor::execute()"
574 <<
" this=" << m_group
575 <<
" parent_name=" << parent.
name()
576 <<
" name=" << m_group->name()
577 <<
" parent_count=" << parent.
size()
578 <<
" mysize=" << m_group->size();
587 ITraceMng* trace = m_group->mesh()->traceMng();
591 m_group->beginTransaction();
596 const Face& face = *iface;
605 markers[icell.localId()] =
true;
617 m_group->setItems(items_lid);
618 m_group->endTransaction();
620 trace->
debug() <<
"OuterActiveFaceItemGroupComputeFunctor::execute()"
621 <<
" this=" << m_group
622 <<
" parent_name=" << parent.
name()
623 <<
" name=" << m_group->name()
624 <<
" parent_count=" << parent.
size()
625 <<
" mysize=" << m_group->size();
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Integer size() const
Number of elements in the vector.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void fill(ConstReferenceType value)
Fills the array with the value value.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Cell frontCell() const
Cell in front of the face (null cell if none).
bool isSubDomainBoundary() const
Indicates if the face is on the subdomain boundary (i.e nbCell()==1).
Cell boundaryCell() const
Cell associated with this boundary face (null cell if none).
Cell backCell() const
Cell behind the face (null cell if none).
void executeFunctor() override
Executes the associated method.
Interface of an entity family.
virtual ItemGroup allItems() const =0
Group of all entities.
virtual Int32 maxLocalId() const =0
virtual eItemKind itemKind() const =0
Entity kind.
virtual TraceMessage fatal()=0
Stream for a fatal error message.
virtual TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium)=0
Stream for a debug message.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
const String & name() const
Group name.
Integer size() const
Number of elements in the group.
IItemFamily * itemFamily() const
Entity family to which this group belongs (0 for the null group).
bool isAllItems() const
Indicates if the group is that of all entities.
void executeFunctor() override
Functor to calculate a group containing entities connected to the entities of the parent group.
static eItemKind kind()
Entity kind.
Base class for a mesh element.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
constexpr bool null() const
true if the entity is null (i.e. not connected to the mesh)
constexpr bool isOwn() const
true if the entity belongs to the subdomain
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Executes the associated method.
void executeFunctor() override
Calculation of the group's own entities.
void executeFunctor() override
Executes the associated method.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
UniqueArray< bool > BoolUniqueArray
Dynamic 1D array of booleans.
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
eItemKind
Mesh entity type.
@ IK_Cell
Cell mesh entity.
@ IK_Face
Face mesh entity.
std::int32_t Int32
Signed integer type of 32 bits.