14#include "arcane/core/ItemGroupImpl.h"
16#include "arcane/utils/String.h"
17#include "arcane/utils/ITraceMng.h"
18#include "arcane/utils/ArgumentException.h"
20#include "arcane/core/ItemGroupObserver.h"
21#include "arcane/core/IItemFamily.h"
22#include "arcane/core/ItemGroup.h"
23#include "arcane/core/IMesh.h"
24#include "arcane/core/MeshPartInfo.h"
25#include "arcane/core/MeshKind.h"
26#include "arcane/core/ItemPrinter.h"
27#include "arcane/core/IItemOperationByBasicType.h"
28#include "arcane/core/ItemGroupComputeFunctor.h"
29#include "arcane/core/IVariableSynchronizer.h"
30#include "arcane/core/ParallelMngUtils.h"
31#include "arcane/core/internal/ItemGroupInternal.h"
46class ItemGroupImplNull
81class ItemGroupImplItemGroupComputeFunctor
82:
public ItemGroupComputeFunctor
90 ItemGroupImplItemGroupComputeFunctor(
ItemGroupImpl* parent, FuncPtr funcPtr)
91 : ItemGroupComputeFunctor()
100 (m_parent->*m_function)();
112ItemGroupImpl* ItemGroupImpl::
130 m_p->m_sub_parts_by_type.setImpl(
this);
140 m_p->m_sub_parts_by_type.setImpl(
this);
150 m_p->m_sub_parts_by_type.setImpl(
this);
177 return m_p->fullName();
186 return m_p->itemsLocalId().size();
195 return m_p->itemsLocalId().empty();
204 return m_p->itemsLocalId();
213 if (
m_p->m_transaction_mode)
215 m_p->m_transaction_mode =
true;
224 if (!
m_p->m_transaction_mode)
226 m_p->m_transaction_mode =
false;
227 if (
m_p->m_need_recompute) {
228 m_p->m_need_recompute =
false;
229 m_p->m_need_invalidate_on_recompute =
false;
230 m_p->notifyInvalidateObservers();
242 <<
" with self_invalidate=" << self_invalidate;
244 if (
m_p->m_compute_functor && !
m_p->m_transaction_mode)
245 ARCANE_FATAL(
"Direct access for computed group in only available during a transaction");
248 return m_p->mutableItemsLocalId();
257 return m_p->m_parent;
275 return m_p->m_item_family;
293 return m_p->m_is_own;
302 const bool is_own =
m_p->m_is_own;
306 if (
m_p->m_own_group)
340 m_p->m_own_group = ii;
344 m_p->m_own_group = ii;
360 m_p->m_ghost_group = ii;
372 return checkSharedNull();
392 m_p->m_node_group = ii;
408 m_p->m_edge_group = ii;
424 m_p->m_face_group = ii;
440 m_p->m_cell_group = ii;
452 return checkSharedNull();
457 m_p->m_inner_face_group = ii;
469 return checkSharedNull();
474 m_p->m_outer_face_group = ii;
489 return checkSharedNull();
495 m_p->m_active_cell_group = ii;
507 return checkSharedNull();
513 m_p->m_own_active_cell_group = ii;
525 return checkSharedNull();
529 m_p->m_mesh->cellFamily(),
531 m_p->m_level_cell_group[level] = ii;
543 return checkSharedNull();
548 m_p->m_mesh->cellFamily(),
550 m_p->m_own_level_cell_group[level] = ii;
562 return checkSharedNull();
567 m_p->m_active_face_group = ii;
579 return checkSharedNull();
584 m_p->m_own_active_face_group = ii;
595 return checkSharedNull();
600 m_p->m_inner_active_face_group = ii;
612 return checkSharedNull();
617 m_p->m_outer_active_face_group = ii;
628 auto finder =
m_p->m_sub_groups.find(sub_name);
629 if (finder !=
m_p->m_sub_groups.end()) {
630 ARCANE_FATAL(
"Cannot create already existing sub-group ({0}) in group ({1})",
633 ItemGroup ig = family->
createGroup(sub_name, ItemGroup(
this));
636 functor->setGroup(ii);
639 m_p->m_sub_groups[sub_name] = ii;
651 auto finder =
m_p->m_sub_groups.find(sub_name);
652 if (finder !=
m_p->m_sub_groups.end()) {
653 return finder->second.get();
657 return checkSharedNull();
668 if (
m_p->m_compute_functor) {
670 <<
name() <<
" : skip computed group";
683 m_p->notifyInvalidateObservers();
688 for (
Integer i = 0, is = items_lid.
size(); i < is; ++i) {
690 items_lid[i] = old_to_new_ids[old_id];
693 m_p->updateTimestamp();
700 if (
m_p->m_observer_need_info) {
701 m_p->notifyCompactObservers(&old_to_new_ids);
706 std::sort(std::begin(items_lid), std::end(items_lid));
707 m_p->notifyCompactObservers(
nullptr);
720 msg->
debug(
Trace::High) <<
"ItemGroupImpl::invalidate(force=" << force_recompute <<
")"
721 <<
" name=" <<
name();
725 m_p->updateTimestamp();
726 m_p->setNeedRecompute();
729 m_p->notifyInvalidateObservers();
747 return m_p->itemInfoListView();
756 return m_p->m_is_local_to_sub_domain;
765 m_p->m_is_local_to_sub_domain = v;
775 (
"Operation on invalid group"));
776 if (
m_p->m_compute_functor && !
m_p->m_transaction_mode)
784 if (nb_item_to_add == 0)
793 Integer nb_items_id = current_size;
794 m_p->m_items_index_in_all_group.resize(
m_p->maxLocalId());
795 for (
Integer i = 0, is = nb_item_to_add; i < is; ++i) {
796 Int32 local_id = items_local_id[i];
797 items_lid.
add(local_id);
798 m_p->m_items_index_in_all_group[local_id] = nb_items_id + i;
800 nb_added = nb_item_to_add;
802 else if (check_if_present) {
805 presence_checks.
fill(
false);
806 for (
Integer i = 0, is = items_lid.
size(); i < is; ++i) {
807 presence_checks[items_lid[i]] =
true;
810 for (
Integer i = 0; i < nb_item_to_add; ++i) {
811 const Integer lid = items_local_id[i];
812 if (!presence_checks[lid]) {
816 presence_checks[lid] =
true;
822 nb_added = nb_item_to_add;
829 trace->
info(5) <<
"ItemGroupImpl::addItems() group <" <<
name() <<
"> "
830 <<
" checkpresent=" << check_if_present
831 <<
" nb_current=" << current_size
832 <<
" want_to_add=" << nb_item_to_add
833 <<
" effective_added=" << nb_added;
838 m_p->updateTimestamp();
840 m_p->notifyExtendObservers(&observation_info);
850 m_p->_removeItems(items_local_id);
859 bool check_if_present)
862 (
"Operation on invalid group"));
863 if (
m_p->m_compute_functor && !
m_p->m_transaction_mode)
878 const Integer new_size =
m_p->m_item_family->nbItem();
879 items_lid.
resize(new_size);
880 m_p->m_items_index_in_all_group.resize(
m_p->maxLocalId());
881 if (new_size == internal_size) {
883 for (
Integer i = 0; i < internal_size; ++i) {
884 Int32 local_id = internals[i]->localId();
885 items_lid[i] = local_id;
886 m_p->m_items_index_in_all_group[local_id] = i;
891 for (
Integer i = 0; i < internal_size; ++i) {
895 items_lid[index] = local_id;
896 m_p->m_items_index_in_all_group[local_id] = index;
900 if (index != new_size)
901 ARCANE_FATAL(
"Inconsistent number of elements in the generation of the group '{0}' expected={1} present={2}",
902 name(), new_size, index);
907 m_p->updateTimestamp();
911 addItems(added_items_lids, check_if_present);
915 trace->
info(5) <<
"ItemGroupImpl::removeAddItems() group <" <<
name() <<
"> "
916 <<
" old_size=" <<
m_p->m_item_family->nbItem()
917 <<
" new_size=" <<
size()
918 <<
" nb_removed=" << removed_items_lids.
size()
919 <<
" nb_added=" << added_items_lids.
size();
930 if (
m_p->m_compute_functor && !
m_p->m_transaction_mode)
935 buf_view.
copy(items_local_id);
936 m_p->updateTimestamp();
937 m_p->m_need_recompute =
false;
941 <<
" size=" <<
size();
947 m_p->notifyInvalidateObservers();
949 m_p->notifyExtendObservers(&items_local_id);
967 std::sort(std::begin(local_ids), std::end(local_ids), *
this);
971 return m_items[lid1].uniqueId() < m_items[lid2].uniqueId();
991 sorter.sort(sorted_lid);
1001 m_p->m_is_all_items =
true;
1010 return m_p->m_is_all_items;
1016class ItemCheckSuppressedFunctor
1027 bool operator()(
Integer item_lid)
1029 return m_items[item_lid]->isSuppressed();
1046 if (
m_p->m_compute_functor) {
1047 trace->
debug(
Trace::High) <<
"ItemGroupImpl::removeSuppressedItems on " <<
name() <<
" : skip computed group";
1056 for (
Integer i = 0; i < current_size; ++i) {
1057 if (items_lid[i] >= nb_item) {
1058 trace->
fatal() <<
"ItemGroupImpl::removeSuppressedItems(): bad range "
1059 <<
" name=" <<
name()
1060 <<
" i=" << i <<
" lid=" << items_lid[i]
1061 <<
" max=" << nb_item;
1071 if (
m_p->m_observer_need_info) {
1072 removed_ids.
reserve(current_size);
1074 for (
Integer i = 0; i < current_size; ++i) {
1075 if (!items[items_lid[i]]->isSuppressed()) {
1076 items_lid[index] = items_lid[i];
1081 removed_lids.
add(items_lid[i]);
1085 if (new_size != current_size) {
1086 items_lid.
resize(new_size);
1092 auto ibegin = std::begin(items_lid);
1093 auto new_end = std::remove_if(ibegin, std::end(items_lid), f);
1094 new_size = (
Integer)(new_end - ibegin);
1095 items_lid.
resize(new_size);
1100 <<
"> NEW SIZE=" << new_size <<
" OLD=" << current_size;
1105 if (current_size != new_size) {
1106 m_p->updateTimestamp();
1107 m_p->notifyReduceObservers(observation_info);
1108 delete observation_info;
1109 delete observation_info2;
1126_checkNeedUpdate(
bool do_padding)
1136 bool has_recompute =
false;
1150 m_p->notifyInvalidateObservers();
1152 has_recompute =
true;
1155 _checkUpdateSimdPadding();
1156 return has_recompute;
1163_checkNeedUpdateNoPadding()
1165 return _checkNeedUpdate(
false);
1172_checkNeedUpdateWithPadding()
1174 return _checkNeedUpdate(
true);
1183 return _checkNeedUpdate(
false);
1190_checkUpdateSimdPadding()
1202 if (!items_lid.
empty())
1204 m_p->updateTimestamp();
1206 m_p->m_need_recompute =
false;
1207 for (
const auto& i :
m_p->m_sub_groups)
1209 m_p->notifyInvalidateObservers();
1219 return ItemGroup(
m_p->m_parent);
1229 ARCANE_ASSERT((!
m_p->m_need_recompute), (
"Operation on invalid group"));
1230 m_p->m_sub_parts_by_type.applyOperation(operation);
1233void ItemGroupSubPartsByType::
1236 bool is_verbose = m_is_debug_apply_operation;
1240 tm->
info() <<
"applyOperation name=" << m_group_internal->name() <<
" nb_item=" << m_group_internal->nbItem();
1241 if (isUseV2ForApplyOperation()) {
1243 _initChildrenByTypeV2();
1245 Int64 t = m_group_internal->timestamp();
1249 _computeChildrenByTypeV2();
1255 _initChildrenByTypeV1();
1257 IItemFamily* family = m_group_internal->m_item_family;
1263#define APPLY_OPERATION_ON_TYPE(ITEM_TYPE) \
1264 if (isUseV2ForApplyOperation()) { \
1265 Int16 type_id = IT_##ITEM_TYPE; \
1266 Int32ConstArrayView sub_ids = m_children_by_type_ids[type_id]; \
1267 if (has_only_one_type && type_id == m_unique_children_type) \
1268 sub_ids = m_group_internal->itemsLocalId(); \
1269 if (is_verbose && sub_ids.size() > 0) \
1270 tm->info() << "Type=" << (int)IT_##ITEM_TYPE << " nb=" << sub_ids.size(); \
1271 if (sub_ids.size() != 0) { \
1272 operation->apply##ITEM_TYPE(family->view(sub_ids)); \
1276 ItemGroup group(m_children_by_type[IT_##ITEM_TYPE]); \
1277 if (!group.empty()) \
1278 operation->apply##ITEM_TYPE(group.view()); \
1281 APPLY_OPERATION_ON_TYPE(Vertex);
1282 APPLY_OPERATION_ON_TYPE(Line2);
1283 APPLY_OPERATION_ON_TYPE(Triangle3);
1284 APPLY_OPERATION_ON_TYPE(Quad4);
1285 APPLY_OPERATION_ON_TYPE(Pentagon5);
1286 APPLY_OPERATION_ON_TYPE(Hexagon6);
1287 APPLY_OPERATION_ON_TYPE(Tetraedron4);
1288 APPLY_OPERATION_ON_TYPE(Pyramid5);
1289 APPLY_OPERATION_ON_TYPE(Pentaedron6);
1290 APPLY_OPERATION_ON_TYPE(Hexaedron8);
1291 APPLY_OPERATION_ON_TYPE(Heptaedron10);
1292 APPLY_OPERATION_ON_TYPE(Octaedron12);
1293 APPLY_OPERATION_ON_TYPE(HemiHexa7);
1294 APPLY_OPERATION_ON_TYPE(HemiHexa6);
1295 APPLY_OPERATION_ON_TYPE(HemiHexa5);
1296 APPLY_OPERATION_ON_TYPE(HemiHexa7);
1297 APPLY_OPERATION_ON_TYPE(AntiWedgeLeft6);
1298 APPLY_OPERATION_ON_TYPE(AntiWedgeRight6);
1299 APPLY_OPERATION_ON_TYPE(DiTetra5);
1300 APPLY_OPERATION_ON_TYPE(DualNode);
1301 APPLY_OPERATION_ON_TYPE(DualEdge);
1302 APPLY_OPERATION_ON_TYPE(DualFace);
1303 APPLY_OPERATION_ON_TYPE(DualCell);
1304 APPLY_OPERATION_ON_TYPE(Link);
1306#undef APPLY_OPERATION_ON_TYPE
1315 return !(
m_p->m_compute_functor != 0 ||
1316 m_p->m_is_local_to_sub_domain ||
1326 return m_p->timestamp();
1335 auto finder =
m_p->m_observers.find(ref);
1336 auto end =
m_p->m_observers.end();
1337 if (finder != end) {
1338 delete finder->second;
1339 finder->second = obs;
1343 m_p->m_observers[ref] = obs;
1356 auto finder =
m_p->m_observers.find(ref);
1357 auto end =
m_p->m_observers.end();
1364 m_p->m_observers.erase(finder);
1366 bool new_observer_need_info =
false;
1367 auto i =
m_p->m_observers.begin();
1368 for (; i != end; ++i) {
1370 new_observer_need_info |= obs->
needInfo();
1376 if (
m_p->m_group_index_table.isUsed() &&
m_p->m_group_index_table.isUnique()) {
1377 m_p->m_group_index_table.reset();
1378 m_p->m_synchronizer.reset();
1388 return m_p->m_observer_need_info;
1397 delete m_p->m_compute_functor;
1398 m_p->m_compute_functor = functor;
1407 return (
m_p->m_compute_functor);
1416 m_p->m_sub_parts_by_type._computeChildrenByTypeV1();
1422void ItemGroupSubPartsByType::
1423_computeChildrenByTypeV1()
1426 ITraceMng* trace = that_group.mesh()->traceMng();
1427 trace->
debug(
Trace::High) <<
"ItemGroupImpl::_computeChildrenByType for " << m_group_internal->name();
1432 for (
Integer i = 0; i < nb_basic_item_type; ++i) {
1439 Integer item_type = item.type();
1440 if (item_type < nb_basic_item_type)
1441 items_by_type[item_type].add(iitem.itemLocalId());
1444 for (
Integer i = 0; i < nb_basic_item_type; ++i) {
1446 impl->setItems(items_by_type[i]);
1447 impl->endTransaction();
1460 ARCANE_UNUSED(info);
1463 m_p->notifyInvalidateObservers();
1472 ARCANE_UNUSED(info);
1475 m_p->notifyInvalidateObservers();
1484 ARCANE_UNUSED(info);
1487 m_p->notifyInvalidateObservers();
1496 m_p->setNeedRecompute();
1497 m_p->notifyInvalidateObservers();
1506 if (
m_p->m_observer_need_info == flag)
1508 m_p->m_observer_need_info = flag;
1512 parent->detachObserver(
this);
1513 if (
m_p->m_observer_need_info) {
1530 if (self_invalidate) {
1531 m_p->setNeedRecompute();
1532 m_p->m_need_invalidate_on_recompute =
true;
1535 for (
const auto& i :
m_p->m_sub_groups)
1536 i.second->_forceInvalidate(
true);
1547 std::vector<const void*> ptrs;
1548 for (
const auto& i :
m_p->m_observers)
1549 ptrs.push_back(i.first);
1550 for (
const void* i : ptrs)
1555 if (
m_p->m_is_all_items)
1556 m_p->resetSubGroups();
1569 if (!
m_p->m_group_index_table.isUsed()) {
1572 trace->
debug(
Trace::High) <<
"** CREATION OF LOCAL ID TO INDEX TABLE OF GROUP : " <<
m_p->m_name;
1573 m_p->m_group_index_table->update();
1575 return m_p->m_group_index_table;
1584 if (!
m_p->m_synchronizer.get()) {
1586 ItemGroup this_group(
this);
1590 m_p->m_synchronizer->compute();
1592 return m_p->m_synchronizer.get();
1601 return m_p->m_synchronizer.get();
1623 ItemUniqueId last_uid = items[items_lid[0]]->uniqueId();
1624 for (
Integer i = 1; i < nb_item; ++i) {
1641 if (
this == shared_null) {
1642 shared_null =
nullptr;
1655 shared_null->addRef();
1668 shared_null->removeRef();
1677 return m_p->isContiguous();
1686 m_p->checkIsContiguous();
1708 m_p->mutableItemsLocalId().clear();
1711 if (
m_p->variableItemsLocalid())
1712 m_p->variableItemsLocalid()->variable()->shrinkMemory();
1714 m_p->mutableItemsLocalId().shrink();
1716 m_p->applySimdPadding();
1725 return &
m_p->m_internal_api;
1732void ItemGroupSubPartsByType::
1733_initChildrenByTypeV1()
1739 for (
Integer i = 0; i < nb_basic_item_type; ++i) {
#define ARCANE_THROW(exception_class,...)
Macro for throwing an exception with formatting.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Integer capacity() const
Capacity (number of allocated elements) of the vector.
Integer size() const
Number of elements in the vector.
bool empty() const
Capacity (number of allocated elements) of the vector.
Exception when an argument is invalid.
void copy(const U ©_array)
Copies the array copy_array into the instance.
constexpr Integer size() const noexcept
Returns the size of the array.
const T * unguardedBasePointer() const
void fill(ConstReferenceType value)
Fills the array with the value value.
void resize(Int64 s)
Changes the number of elements in the array to s.
void clear()
Removes the elements from the array.
void add(ConstReferenceType val)
Adds element val to the end of the array.
void reserve(Int64 new_capacity)
Reserves memory for new_capacity elements.
ArrayView< T > subView(Int64 abegin, Integer asize)
Sub-view starting from element abegin and containing asize elements.
constexpr Integer size() const noexcept
Number of elements in the array.
Base class of a hash table between group items and their positions in the table.
virtual void executeFunctor()=0
Executes the associated method.
Interface of an entity family.
virtual ItemGroup createGroup(const String &name, Int32ConstArrayView local_ids, bool do_override=false)=0
Creates an entity group named name containing the entities local_ids.
virtual IMesh * mesh() const =0
Associated mesh.
virtual bool needInfo() const =0
Indicates whether the observer will need transition information.
Interface of an operator on entities sorted by type.
virtual ITraceMng * traceMng()=0
Associated message manager.
virtual ItemTypeMng * itemTypeMng() const =0
Associated entity type manager.
virtual const MeshPartInfo & meshPartInfo() const =0
Mesh part information.
Interface of the parallelism manager for a subdomain.
virtual TraceMessage fatal()=0
Stream for a fatal error message.
virtual TraceMessage info()=0
Stream for an information message.
virtual TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium)=0
Stream for a debug message.
Interface of a variable synchronization service.
bool isSuppressed() const
True if the entity is suppressed.
Int32 localId() const
Local number (in the subdomain) of the entity.
Functor for calculating elements of a group.
Internal API of ItemGroupImpl in Arcane.
void executeFunctor() override
Executes the associated method.
const String & name() const
Returns the group name.
Brief: Implementation of a mesh entity group.
void removeItems(Int32ConstArrayView items_local_id, bool check_if_present)
Removes the entities items_local_id from the group.
bool checkNeedUpdate()
Updates the group if necessary.
ItemGroupImpl * activeCellGroup()
AMR.
void removeAddItems(Int32ConstArrayView removed_local_id, Int32ConstArrayView added_local_id, bool check_if_present)
Removes and adds the entities removed_local_id and added_local_id from the group.
ItemGroupImplInternal * _internalApi() const
Internal Arcane API.
void setItems(Int32ConstArrayView items_local_id)
Positions the group entities at items_local_id.
void setOwn(bool v)
Sets whether the group property is local or not.
Int64 timestamp() const
Returns the group's timestamp. This time is incremented after every modification.
ItemInternalList itemsInternal() const
List of entities that the group relies on.
void endTransaction()
Ends a transaction.
void invalidate(bool force_recompute)
Invalidates the group.
ItemGroupImpl * nodeGroup()
Group of nodes of the elements of this group.
void addItems(Int32ConstArrayView items_local_id, bool check_if_present)
Adds entities with local IDs items_local_id.
bool isAllItems() const
Indicates if the group is the group of all entities.
void _executeExtend(const Int32ConstArrayView *info)
Sub-group invalidation.
ItemGroupImpl * parent() const
Parent group (0 if none).
Int32Array & unguardedItemsLocalId(const bool self_invalidate=true)
List of local IDs of the entities in this group.
ItemGroupImpl * cellGroup()
Group of cells of the elements of this group.
ItemGroupImpl * innerFaceGroup()
Brief: Group of internal faces of the elements of this group.
eItemKind itemKind() const
Type of the group. It is the type of its elements.
ItemGroupImpl * createSubGroup(const String &suffix, IItemFamily *family, ItemGroupComputeFunctor *functor)
Creates a calculated subgroup.
void checkLocalIdsAreContiguous() const
Checks if the group entities have contiguous localIds().
virtual ~ItemGroupImpl()
Releases resources.
ItemGroupImpl * edgeGroup()
Group of edges of the elements of this group.
bool null() const
Returns true if the group is null.
void clear()
Removes the entities from the group.
ItemGroupImpl * faceGroup()
Group of faces of the elements of this group.
void destroy()
Destroys the group. After this call, the group becomes a null group.
void setLocalToSubDomain(bool v)
Sets the boolean indicating if the group is local to the subdomain.
void setIsAllItems()
Indicates to this group that it is the group of all entities in the family.
void _executeReduce(const Int32ConstArrayView *info)
Sub-group invalidation.
void removeSuppressedItems()
Removes entities from the group whose isSuppressed() flag is true.
const String & fullName() const
Full group name (with mesh + family).
ItemGroupImpl * ownGroup()
Group of entities owned by the entities of this group.
void _updateNeedInfoFlag(const bool flag)
Forced update of the restructuring information flag.
IMesh * mesh() const
Mesh to which the group belongs (0 for the null group).
bool checkIsSorted() const
Checks and returns whether the group is sorted by increasing uniqueId().
void checkValid()
Checks that the group is valid.
IVariableSynchronizer * synchronizer()
Group synchronizer.
Integer size() const
Number of entities in the group.
Int32ConstArrayView itemsLocalId() const
List of local IDs of the entities in this group.
bool needSynchronization() const
Indicates if the group structurally needs parallel synchronization.
ItemGroupImpl * ownActiveCellGroup()
Brief: Group of own active cells of this group.
SharedPtrT< GroupIndexTable > localIdToIndex()
Table of local IDs to a position for all entities in the group.
ItemInfoListView itemInfoListView() const
List of entities that the group relies on.
void attachObserver(const void *ref, IItemGroupObserver *obs)
Attaches an observer.
ItemGroupImpl * outerActiveFaceGroup()
Brief: Group of active external faces of the elements of this group.
void detachObserver(const void *ref)
Detaches an observer.
IItemFamily * itemFamily() const
Family to which the group belongs (or 0 if none).
void _executeInvalidate()
Sub-group invalidation.
virtual void deleteMe()
Notification from SharedReference indicating that the instance must be destroyed.
void _executeCompact(const Int32ConstArrayView *info)
Sub-group invalidation.
bool isLocalToSubDomain() const
AMR OFF.
ItemGroupImpl * ghostGroup()
Items in the group not owned by the subdomain.
ItemGroupImpl * ownLevelCellGroup(const Integer &level)
Brief: Group of own active cells of this group.
Int64 capacity() const
Number of allocated elements.
bool isContiguousLocalIds() const
Indicates if the group entities have contiguous localIds().
static void _buildSharedNull()
Internal.
ItemGroupImpl * innerActiveFaceGroup()
Brief: Group of active internal faces of the elements of this group.
void applyOperation(IItemOperationByBasicType *operation)
Applies the operation operation to the group entities.
void beginTransaction()
Starts a transaction.
ItemGroupImpl * levelCellGroup(const Integer &level)
Brief: Group of active cells of this group.
bool hasComputeFunctor() const
Indicates if the group is calculated.
bool hasSynchronizer()
Indicates if this group has a synchronizer.
bool hasInfoObserver() const
Indicates if the content of this group is observed.
void setComputeFunctor(IFunctor *functor)
Defines a group calculation function.
ItemGroupImpl * ownActiveFaceGroup()
Brief: Group of active external faces of the elements of this group.
bool isOwn() const
Returns whether the group contains only elements specific to the subdomain.
ItemGroupImpl()
Constructs a null group.
ItemGroup parentGroup()
Parent group.
bool empty() const
True if the group is empty.
void _forceInvalidate(const bool self_invalidate)
Recursive forced invalidation.
ItemGroupInternal * m_p
Group implementation.
static void _destroySharedNull()
Internal.
ItemGroupImpl * activeFaceGroup()
Brief: Group of domain-specific active faces.
const String & name() const
Group name.
void _computeChildrenByType()
Method for calculating sub-groups by type.
ItemGroupImpl * outerFaceGroup()
Brief: Group of external faces of the elements of this group.
void shrinkMemory()
Limits the maximum memory used by the group.
ItemGroupImpl * findSubGroup(const String &suffix)
Accesses a calculated subgroup.
void changeIds(Int32ConstArrayView old_to_new_ids)
Changes the indices of the group entities.
Implementation of the ItemGroupImpl class.
ItemGroupImpl * m_interface_group
Items on the boundary of two subdomains.
bool m_need_invalidate_on_recompute
True if invalidate observers must be activated upon recalculation.
bool m_need_recompute
True if the group needs to be recalculated.
void checkUpdateSimdPadding()
Fills the last elements of the group to have a complete SIMD vector.
IItemFamily * m_item_family
Associated family.
IFunctor * m_compute_functor
Group computation function.
CheckNeedUpdateMutex m_check_need_update_mutex
Mutex to protect updates.
ItemGroupImpl * m_group_impl
To be deleted when version V1 is removed.
UniqueArray< UniqueArray< Int32 > > m_children_by_type_ids
List of localIds by entity type.
Int64 m_children_by_type_ids_computed_timestamp
Timestamp indicating when the list of child ids was calculated.
UniqueArray< ItemGroupImpl * > m_children_by_type
List of children of this group by entity type.
ItemTypeId m_unique_children_type
Indicates the type of the entities in the group.
ItemGroupImpl * internal() const
Returns the group implementation.
View of a list to obtain information about entities.
Internal structure of a mesh entity.
Mesh entity type manager.
static Integer nbBasicItemType()
number of available types
String typeName(Integer id) const
Name of the type corresponding to the number id.
Unique identifier of an entity.
Exception when an operation is not supported.
View of an array of elements of type T.
Unicode character string.
1D data vector with value semantics (STL style).
ItemGroupT< Cell > CellGroup
Group of cells.
ItemGroupT< Face > FaceGroup
Group of faces.
ItemGroupT< Edge > EdgeGroup
Group of edges.
ItemGroupT< Node > NodeGroup
Group of nodes.
Int32 checkResizeArrayWithCapacity(Array< DataType > &array, Int64 new_size, bool force_resize)
Resizes an array by adding a memory reserve.
void copy(MutableMemoryView destination, eMemoryResource destination_mem, ConstMemoryView source, eMemoryResource source_mem, const RunQueue *queue=nullptr)
Copies source to destination using the queue queue.
Ref< IVariableSynchronizer > createSynchronizerRef(IParallelMng *pm, IItemFamily *family)
Returns an interface to synchronize variables on the group of the family family.
@ Medium
Medium level (default).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
bool arcaneIsCheck()
True if running in check mode.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
ConstArrayView< ItemInternal * > ItemInternalList
Type of the internal list of entities.
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
eItemKind
Mesh entity type.
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Face
Face mesh entity.
@ IK_Edge
Edge mesh entity.
IItemGroupObserver * newItemGroupObserverT(T *object, typename IItemGroupObserver::FuncTraits< T >::FuncPtr funcptr)
Utility for simplified creation of ItemGroupObserverT.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
std::int32_t Int32
Signed integer type of 32 bits.