Interface of an entity family. More...
#include <arcane/core/IItemFamily.h>
Public Member Functions | |
| virtual void | build ()=0 |
| virtual String | name () const =0 |
| Family name. | |
| virtual String | fullName () const =0 |
| Full family name (with the mesh's name). | |
| virtual eItemKind | itemKind () const =0 |
| Entity kind. | |
| virtual Integer | nbItem () const =0 |
| Number of entities. | |
| virtual Int32 | maxLocalId () const =0 |
| virtual ItemInternalArrayView | itemsInternal ()=0 |
| Internal array of entities. | |
| virtual ItemInfoListView | itemInfoListView ()=0 |
| View on the entity information list. | |
| virtual IItemFamily * | parentFamily () const =0 |
| IItemFamily parent. | |
| virtual void | setParentFamily (IItemFamily *parent)=0 |
| virtual Integer | parentFamilyDepth () const =0 |
| Gives the nesting depth of the current mesh. | |
| virtual void | addChildFamily (IItemFamily *family)=0 |
| virtual IItemFamilyCollection | childFamilies ()=0 |
| Child families of this family. | |
| virtual VariableItemInt32 & | itemsNewOwner ()=0 |
| Variable containing the number of the new subdomain owning the entity. | |
| virtual void | checkValid ()=0 |
| Check the validity of internal structures (internal). | |
| virtual void | checkValidConnectivity ()=0 |
| Verification of the validity of internal structures concerning connectivity. | |
| virtual void | checkUniqueIds (Int64ConstArrayView unique_ids)=0 |
| Checks that the unique_ids are truly unique for all subdomains. | |
| virtual ItemVectorView | view (Int32ConstArrayView local_ids)=0 |
| View on the entities. | |
| virtual ItemVectorView | view ()=0 |
| View on all entities in the family. | |
| virtual void | removeItems2 (mesh::ItemDataList &item_data_list)=0 |
| Removes entities. | |
| virtual void | removeNeedRemoveMarkedItems ()=0 |
| virtual ItemInternal * | findOneItem (Int64 unique_id)=0 |
| Unique ID entity unique_id. | |
| virtual void | endUpdate ()=0 |
| Notifies the end of modification of the entity list. | |
| virtual void | partialEndUpdate ()=0 |
| Partial update. | |
| virtual void | partialEndUpdateGroup (const ItemGroup &group)=0 |
| Updates a group. | |
| virtual void | partialEndUpdateVariable (IVariable *variable)=0 |
| Updates a variable. | |
| virtual void | notifyItemsOwnerChanged ()=0 |
| Notifies that the entities specific to the family's subdomain have been modified. | |
| virtual void | notifyItemsUniqueIdChanged ()=0 |
| Notifies that the unique IDs of the entities have been modified. | |
| virtual IItemConnectivityInfo * | localConnectivityInfos () const =0 |
| Information on local connectivity within the subdomain for this family. | |
| virtual IItemConnectivityInfo * | globalConnectivityInfos () const =0 |
| Information on global connectivity across all subdomains. | |
| virtual void | setHasUniqueIdMap (bool v)=0 |
| Indicates whether the family has a conversion table from uniqueId to localId. | |
| virtual bool | hasUniqueIdMap () const =0 |
| Indicates if the family has a uniqueId to localId conversion table. | |
| virtual void | itemsUniqueIdToLocalId (Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal=true) const =0 |
| Converts an array of unique numbers to local numbers. | |
| virtual void | itemsUniqueIdToLocalId (Int32ArrayView local_ids, ConstArrayView< ItemUniqueId > unique_ids, bool do_fatal=true) const =0 |
| Converts an array of unique numbers to local numbers. | |
| virtual void | setItemSortFunction (IItemInternalSortFunction *sort_function)=0 |
| Positions the entity sorting function. | |
| virtual IItemInternalSortFunction * | itemSortFunction () const =0 |
| Entity sorting function. | |
| virtual ISubDomain * | subDomain () const =0 |
| Associated sub-domain. | |
| virtual ITraceMng * | traceMng () const =0 |
| Associated trace manager. | |
| virtual IMesh * | mesh () const =0 |
| Associated mesh. | |
| virtual IParallelMng * | parallelMng () const =0 |
| Associated parallelism manager. | |
| virtual ItemGroup | allItems () const =0 |
| Group of all entities. | |
| virtual ItemGroupCollection | groups () const =0 |
| Collection of groups in this family. | |
operations on groups | |
| virtual ItemGroup | findGroup (const String &name) const =0 |
| Searches for a group. | |
| virtual ItemGroup | findGroup (const String &name, bool create_if_needed)=0 |
| Searches for a group. | |
| 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 ItemGroup | createGroup (const String &name)=0 |
| Creates an entity group named name. | |
| virtual void | destroyGroups ()=0 |
| Deletes all groups in this family. | |
| virtual ItemGroup | createGroup (const String &name, const ItemGroup &parent, bool do_override=false)=0 |
| virtual IVariable * | findVariable (const String &name, bool throw_exception=false)=0 |
| Searches for the variable name name associated with this family. | |
| virtual void | usedVariables (VariableCollection collection)=0 |
| Adds the list of variables used by this family to the collection. | |
| virtual void | prepareForDump ()=0 |
| Prepares data for dumping. | |
| virtual void | readFromDump ()=0 |
| Reads data from a dump. | |
| virtual void | copyItemsValues (Int32ConstArrayView source, Int32ConstArrayView destination)=0 |
| virtual void | copyItemsMeanValues (Int32ConstArrayView first_source, Int32ConstArrayView second_source, Int32ConstArrayView destination)=0 |
| virtual void | clearItems ()=0 |
| Deletes all entities in the family. | |
| virtual void | compactItems (bool do_sort)=0 |
| Compresses the entities. | |
| virtual void | computeSynchronizeInfos ()=0 |
| Constructs the structures necessary for synchronization. | |
| virtual void | getCommunicatingSubDomains (Int32Array &sub_domains) const =0 |
| List of communicating sub-domains for the entities. | |
variable synchronization operations | |
| virtual IVariableSynchronizer * | allItemsSynchronizer ()=0 |
| Synchronizer on all entities of the family. | |
| virtual void | synchronize (VariableCollection variables)=0 |
| Synchronizes the variables variables. | |
| virtual void | synchronize (VariableCollection variables, Int32ConstArrayView local_ids) |
| Synchronizes the variables variables on a list of entities. | |
| virtual void | reduceFromGhostItems (IVariable *v, IDataOperation *operation)=0 |
| Applies a reduction operation from ghost items. | |
| virtual void | reduceFromGhostItems (IVariable *v, Parallel::eReduceType operation)=0 |
| Applies a reduction operation from ghost items. | |
| virtual ItemPairGroup | findAdjencyItems (const ItemGroup &group, const ItemGroup &sub_group, eItemKind link_kind, Integer nb_layer)=0 |
| Searches for an adjacency list. | |
| virtual ItemPairGroup | findAdjacencyItems (const ItemGroup &group, const ItemGroup &sub_group, eItemKind link_kind, Integer nb_layer) |
| Searches for an adjacency list. | |
| virtual IParticleFamily * | toParticleFamily ()=0 |
| Returns the interface of the particle family for this family. | |
| virtual IDoFFamily * | toDoFFamily () |
| Returns the interface of the particle family for this family. | |
| virtual void | internalRemoveItems (Int32ConstArrayView local_ids, bool keep_ghost=false)=0 |
Register/Delete a connectivity manager. | |
Allows propagating family changes to "external" connectivities in which it is involved. These "external" connectivities are currently those using degrees of freedom.
| |
| virtual void | addSourceConnectivity (IItemConnectivity *connectivity)=0 |
| virtual void | addTargetConnectivity (IItemConnectivity *connectivity)=0 |
| virtual void | removeSourceConnectivity (IItemConnectivity *connectivity)=0 |
| virtual void | removeTargetConnectivity (IItemConnectivity *connectivity)=0 |
| virtual void | setConnectivityMng (IItemConnectivityMng *connectivity_mng)=0 |
| virtual void | addGhostItems (Int64ConstArrayView unique_ids, Int32ArrayView items, Int32ConstArrayView owners)=0 |
| Allocates ghost entities. | |
| virtual IItemFamilyPolicyMng * | policyMng ()=0 |
| Interface of behaviors/policies associated with this family. | |
| virtual Properties * | properties ()=0 |
| Properties associated with this family. | |
| virtual EventObservableView< const ItemFamilyItemListChangedEventArgs & > | itemListChangedEvent ()=0 |
| Event for entity addition and deletion. | |
| virtual void | experimentalChangeUniqueId (ItemLocalId local_id, ItemUniqueId unique_id)=0 |
| Changes the unique number of the entity. | |
| virtual void | resizeVariables (bool force_resize)=0 |
| Resizes the variables of this family. | |
| virtual IItemFamilyTopologyModifier * | _topologyModifier ()=0 |
| Topology modifier interface. | |
| virtual IItemFamilyInternal * | _internalApi ()=0 |
| Internal Arcane API. | |
Interface of an entity family.
An entity family manages all entities of the same kind (Item::kind()) and is attached to a mesh (IMesh).
For any mesh, there is exactly one family of nodes (Node), edges (Edge), faces (Face), and cells (Cell). These entities are called base mesh entities and the associated families are the base mesh families.
Depending on the implementation, there may also be families of particles (Particle), dual nodes (DualNode), or links (Link). Depending on the requested connectivity, a family may not have elements. For example, by default in 3D, edges (Edge) are not created.
Each entity in the family has a local identifier within the family, given by Item::localId(). When a family evolves, this identifier may be modified. The Item::localId() of entities in a family are not necessarily contiguous. The maxLocalId() method allows knowing the maximum of these values. Compaction ensures that the localId() are renumbered from 0 to (nbItem()-1). For base mesh entities, compaction is automatic if the mesh has the property "sort" set to true. For others, you must call compactItems().
By default, a family has a conversion table from uniqueId() to localId(). This table must exist to allow the following operations:
It is possible to enable or disable this conversion table via the setHasUniqueIdMap() method only if no entity has been created. This operation is not possible on node, edge, face, and cell families.
When a family is modified by adding or removing entities, the variables and groups relying on this family are no longer usable until endUpdate() is called. For optimization reasons, it is possible to perform updates of certain variables or groups via partialEndUpdateVariable() or partialEndUpdateGroup(). ATTENTION, an call to one of these 3 update methods invalidates the entity instances (Item). To retain a reference to an entity, you must either use a group (ItemGroup) or keep its unique number and use itemsUniqueIdToLocalId().
Definition at line 82 of file IItemFamily.h.
|
inlinevirtual |
Definition at line 89 of file IItemFamily.h.
|
pure virtual |
Allocates ghost entities.
After calling this operation, you must call endUpdate() to notify the instance that the modifications are finished. It is possible to chain several allocations before calling endUpdate().
The unique_ids are those of items present on another sub-domain, whose number is in the owners array (of the same size as the unique_ids array). items must have the same number of elements as unique_ids and will be filled back with the local numbers of the created entities.
|
pure virtual |
Checks that the unique_ids are truly unique for all subdomains.
This method DOES NOT check that the unique_ids are identical to those of entities already created. It only checks the set of unique_ids passed as arguments by all subdomains.
This operation is collective and must be called by all subdomains.
|
pure virtual |
Deletes all entities in the family.
References clearItems().
Referenced by clearItems().
|
pure virtual |
Constructs the structures necessary for synchronization.
This operation must be performed every time the entities of the mesh change ownership (for example, during a load balancing).
This operation is collective.
References computeSynchronizeInfos().
Referenced by computeSynchronizeInfos().
|
pure virtual |
Copies the mean values of entities numbered first_source and second_source into entities numbered destination
| first_source | list of localIds of the 1st source |
| second_source | list of localIds of the 2nd source |
| destination | list of destination localIds |
References copyItemsMeanValues().
Referenced by copyItemsMeanValues().
|
pure virtual |
Copies the values of entities numbered source into entities numbered destination
| source | list of source localIds |
| destination | list of destination localIds |
References copyItemsValues().
Referenced by copyItemsValues().
Creates an entity group named name.
The group must not already exist, otherwise an exception is raised.
| name | name of the group |
References createGroup(), and name().
|
pure virtual |
Creates an entity group named name containing the entities local_ids.
| name | name of the group |
| local_ids | list of localId() of the entities composing the group. |
| do_override | if true and a group of the same name already exists, its elements are replaced by those given in local_ids. If false, an exception is raised. |
References createGroup(), and name().
Referenced by createGroup(), createGroup(), Arcane::ItemGroupImpl::createSubGroup(), and destroyGroups().
|
pure virtual |
Notifies the end of modification of the entity list.
This method must be called after modifying the entity list (after adding or removing). It updates the groups and resizes the variables on this family.
References endUpdate().
Referenced by endUpdate().
|
pure virtual |
Changes the unique number of the entity.
|
virtual |
Searches for an adjacency list.
Searches for the list of entities of type sub_kind, linked by the entity type link_kind of group group, over a number of layers nb_layer.
If group and sub_group are of the same kind, an entity is always in its adjacency list, as the first element.
If the list does not exist, it is created.
Definition at line 337 of file InterfaceImpl.cc.
References findAdjencyItems().
Referenced by findAdjencyItems(), and Arcane::ItemPairGroup::ItemPairGroup().
Searches for a group.
| name | name of the group to search for |
References findGroup(), and name().
Referenced by ItemGroupBuilder< T >::buildGroup(), findGroup(), and findGroup().
|
pure virtual |
Searches for a group.
| name | name of the group to search for |
References findGroup(), and name().
|
pure virtual |
Unique ID entity unique_id.
If no entity with this unique_id is found, returns nullptr.
References findOneItem().
Referenced by findOneItem().
|
pure virtual |
Searches for the variable name name associated with this family.
If no variable with the name name exists, and if throw_exception is false, returns 0; otherwise, it throws an exception.
References findVariable(), and name().
Referenced by findVariable(), and Arcane::Hdf5VariableReaderHelper::open().
|
pure virtual |
Variable containing the number of the new subdomain owning the entity.
This variable is only used for mesh partitioning.
|
pure virtual |
Entity sorting function.
The instance of this class remains the owner of the returned object, which must not be destroyed or modified.
References itemSortFunction().
Referenced by itemSortFunction().
|
pure virtual |
Converts an array of unique numbers to local numbers.
This operation takes as input the unique_ids array containing the unique numbers of entities of type item_kind and returns in local_ids the corresponding local number for this subdomain.
The complexity of this operation depends on the implementation. The default implementation uses a hash table. The average complexity is therefore constant.
If do_fatal is true, a fatal error is generated if an entity is not found, otherwise the not found element has the value NULL_ITEM_ID.
References itemsUniqueIdToLocalId().
|
pure virtual |
Converts an array of unique numbers to local numbers.
This operation takes as input the unique_ids array containing the unique numbers of entities of type item_kind and returns in local_ids the corresponding local number for this subdomain.
The complexity of this operation depends on the implementation. The default implementation uses a hash table. The average complexity is therefore constant.
If do_fatal is true, a fatal error is generated if an entity is not found, otherwise the not found element has the value NULL_ITEM_ID.
References itemsUniqueIdToLocalId().
Referenced by Arcane::CartesianMeshCoarsening::createCoarseCells(), itemsUniqueIdToLocalId(), and itemsUniqueIdToLocalId().
|
pure virtual |
Size required to dimension variables on these entities.
This is the maximum of the Item::localId() of the entities in this family plus 1.
Referenced by Arcane::ActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::InnerActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::InnerFaceItemGroupComputeFunctor::executeFunctor(), Arcane::ItemItemGroupComputeFunctor< ItemType >::executeFunctor(), Arcane::OuterActiveFaceItemGroupComputeFunctor::executeFunctor(), Arcane::OuterFaceItemGroupComputeFunctor::executeFunctor(), and Arcane::OwnActiveFaceItemGroupComputeFunctor::executeFunctor().
|
pure virtual |
|
pure virtual |
Partial update.
Updates the internal structures after a family modification. This is an optimized version of endUpdate() when you want to perform multiple mesh modifications. This method DOES NOT update the groups or variables associated with this family. Only the allItems() group is available. It is possible to update a group via partialEndUpdateGroup() and a variable via partialEndUpdateVariable().
This method is reserved for experienced users. For others, it is better to use endUpdate().
References partialEndUpdate().
Referenced by partialEndUpdate().
|
pure virtual |
Updates a group.
Updates the group after a family modification. The update consists of removing entities from the group that were possibly destroyed during the modification.
References partialEndUpdateGroup().
Referenced by partialEndUpdateGroup().
|
pure virtual |
Updates a variable.
Updates the variable after a family modification. The update consists of resizing the variable after a possible addition of entities.
References partialEndUpdateVariable().
Referenced by partialEndUpdateVariable().
|
pure virtual |
Applies a reduction operation from ghost items.
This operation is the inverse of synchronization.
The sub-domain retrieves the values of variable v on the entities it shares with other sub-domains, and the reduction operation operation is applied to this variable.
References reduceFromGhostItems().
Referenced by reduceFromGhostItems(), and reduceFromGhostItems().
|
pure virtual |
Applies a reduction operation from ghost items.
This operation is the inverse of synchronization.
The sub-domain retrieves the values of variable v on the entities it shares with other sub-domains, and the reduction operation operation is applied to this variable.
References reduceFromGhostItems().
|
pure virtual |
Removes entities.
Uses the graph (Families, Connectivities) ItemFamilyNetwork
TODO: To be put in the internal API
|
pure virtual |
Resizes the variables of this family.
This method is internal to Arcane.
|
pure virtual |
Indicates whether the family has a conversion table from uniqueId to localId.
The conversion table allows using the methods itemsUniqueIdToLocalId() or findOneItem().
This method can only be called when there are no entities in the family.
The node, edge, face, and cell families of the mesh must have a conversion table.
References setHasUniqueIdMap().
Referenced by setHasUniqueIdMap().
|
pure virtual |
Positions the entity sorting function.
The default method is to sort entities by ascending uniqueId(). If sort_function is null, the default method will be used. Otherwise, sort_function replaces the previous function, which is destroyed (via delete). Sorting is performed via the call to compactItems().
References setItemSortFunction().
Referenced by setItemSortFunction().
|
pure virtual |
Synchronizes the variables variables.
The variables variables must all come from this family and must not be partial.
References synchronize().
Referenced by synchronize().
|
virtual |
Synchronizes the variables variables on a list of entities.
The variables variables must all come from this family and must not be partial.
Only the entities listed in local_ids will be synchronized. Note: an entity present in this list on one sub-domain must be present in this list for any other sub-domain that possesses this entity.
Definition at line 307 of file InterfaceImpl.cc.
References ARCANE_THROW.
|
inlinevirtual |
Returns the interface of the particle family for this family.
The IParticleFamily interface only exists if this family is a particle family (itemKind()==IK_Particle). For other family kinds, 0 is returned.
Definition at line 622 of file IItemFamily.h.
References toDoFFamily().
Referenced by toDoFFamily().
|
pure virtual |
Returns the interface of the particle family for this family.
The IParticleFamily interface only exists if this family is a particle family (itemKind()==IK_Particle). For other family kinds, 0 is returned.
References toParticleFamily().
Referenced by toParticleFamily().
|
pure virtual |
View on the entities.
Returns a view on the entities with local numbers local_ids.
Referenced by Arcane::CartesianMeshCoarsening::createCoarseCells(), Arcane::Materials::ItemMaterialVariableArray< DataType >::serialize(), and Arcane::Materials::ItemMaterialVariableScalar< DataType >::serialize().