14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/ScopedPtr.h"
16#include "arcane/utils/ITraceMng.h"
17#include "arcane/utils/OStringStream.h"
18#include "arcane/utils/CheckedConvert.h"
20#include "arcane/core/IMeshUniqueIdMng.h"
21#include "arcane/core/IParallelExchanger.h"
22#include "arcane/core/IParallelMng.h"
23#include "arcane/core/ISerializeMessage.h"
24#include "arcane/core/ISerializer.h"
25#include "arcane/core/ParallelMngUtils.h"
27#include "arcane/mesh/DynamicMesh.h"
28#include "arcane/mesh/OneMeshItemAdder.h"
29#include "arcane/mesh/GhostLayerBuilder.h"
30#include "arcane/mesh/FaceUniqueIdBuilder.h"
31#include "arcane/mesh/ItemTools.h"
32#include "arcane/mesh/ItemsOwnerBuilder.h"
34#include <unordered_set>
50arcaneComputeCartesianFaceUniqueId(
DynamicMesh* mesh);
58, m_mesh(mesh_builder->
mesh())
59, m_mesh_builder(mesh_builder)
66void FaceUniqueIdBuilder::
67computeFacesUniqueIds()
73 info() <<
"Using version=" << face_version <<
" to compute faces unique ids"
74 <<
" mesh=" << m_mesh->
name() <<
" is_parallel=" << is_parallel;
76 if (face_version > 5 || face_version < 0)
77 ARCANE_FATAL(
"Invalid value '{0}' for compute face unique ids versions: v>=0 && v<=6", face_version);
79 if (face_version == 5)
80 _computeFaceUniqueIdVersion5(m_mesh);
81 else if (face_version == 4)
82 arcaneComputeCartesianFaceUniqueId(m_mesh);
83 else if (face_version == 3)
84 _computeFaceUniqueIdVersion3(m_mesh);
85 else if (face_version == 0) {
86 info() <<
"No face renumbering";
91 if (face_version == 2) {
93 info() <<
"Use new mesh init in FaceUniqueIdBuilder";
107 Real diff = (
Real)(end_time - begin_time);
108 info() <<
"TIME to compute face unique ids=" << diff;
113 ItemInternalMap& faces_map = m_mesh->facesMap();
117 if (face_version != 0)
118 m_mesh->faceFamily()->notifyItemsUniqueIdChanged();
120 bool is_verbose = m_mesh_builder->isVerbose();
122 info() <<
"NEW FACES_MAP after re-indexing";
123 faces_map.eachItem([&](Item face) {
124 info() <<
"Face uid=" << face.uniqueId() <<
" lid=" << face.localId();
129 if (face_version == 0 || face_version == 5) {
130 ItemsOwnerBuilder owner_builder(m_mesh);
131 owner_builder.computeFacesOwner();
143 info() <<
"Check no duplicate face uniqueId";
145 std::unordered_set<Int64> checked_faces_map;
148 auto p = checked_faces_map.find(uid);
149 if (p != checked_faces_map.end()) {
150 pwarning() <<
"Duplicate Face UniqueId=" << uid;
153 checked_faces_map.insert(uid);
172 , m_nb_back_face(nb_back_face)
173 , m_nb_true_boundary_face(nb_true_boundary_face)
178 : m_unique_id(NULL_ITEM_ID)
180 , m_nb_true_boundary_face(0)
186 bool operator<(
const T_CellFaceInfo& ci)
const
188 return m_unique_id < ci.m_unique_id;
194 Int64 m_nb_back_face;
195 Int64 m_nb_true_boundary_face;
222 Integer nb_local_face = m_mesh_builder->oneMeshItemAdder()->nbFace();
223 Integer nb_local_cell = m_mesh_builder->oneMeshItemAdder()->nbCell();
224 bool is_verbose = m_mesh_builder->isVerbose();
227 faces_opposite_cell_uid.
fill(NULL_ITEM_ID);
235 faces_new_uid.
fill(NULL_ITEM_ID);
237 Integer nb_recv_sub_domain_boundary_face = 0;
272 Integer nb_sub_domain_boundary_face = faces_local_id.
size();
274 debug() <<
"NB BOUNDARY FACE=" << nb_sub_domain_boundary_face
275 <<
" NB_FACE=" << nb_local_face
276 <<
" GLOBAL_NB_BOUNDARY_FACE=" << global_nb_boundary_face;
289 Int64 step_size = 1500000;
290 Integer nb_phase = CheckedConvert::toInteger((global_nb_boundary_face / step_size) + 1);
292 for (
Integer i_phase = 0; i_phase < nb_phase; ++i_phase) {
293 Integer nb_face_to_send = nb_sub_domain_boundary_face / nb_phase;
294 Integer first_face_to_send = nb_face_to_send * i_phase;
295 Integer last_face_to_send = first_face_to_send + nb_face_to_send;
296 if (i_phase + 1 == nb_phase)
297 last_face_to_send = nb_sub_domain_boundary_face;
298 Integer real_nb_face_to_send = last_face_to_send - first_face_to_send;
300 faces_infos2.
clear();
301 for (
Integer i_face = first_face_to_send; i_face < first_face_to_send + real_nb_face_to_send; ++i_face) {
302 Face face(faces[faces_local_id[i_face]]);
307 faces_infos2.
add(node.uniqueId().asInt64());
315 Integer face_index_in_cell = 0;
317 for (
Face current_face_in_cell : cell.
faces()) {
318 if (current_face_in_cell == face)
320 if (current_face_in_cell.backCell() == cell)
321 ++face_index_in_cell;
325 face_index_in_cell = NULL_ITEM_ID;
326 faces_infos2.
add(face_index_in_cell);
328 faces_infos2.
add(IT_NullType);
332 info() <<
"Number of face bytes received: " << recv_faces_infos.
size()
333 <<
" phase=" << i_phase <<
"/" << nb_phase
334 <<
" first_face=" << first_face_to_send
335 <<
" last_face=" << last_face_to_send
336 <<
" nb=" << real_nb_face_to_send;
338 Integer recv_faces_infos_index = 0;
340 for (
Integer i_sub_domain = 0; i_sub_domain < nb_rank; ++i_sub_domain) {
343 if (i_sub_domain == my_rank) {
344 recv_faces_infos_index += faces_infos2.
size();
349 Integer face_type = CheckedConvert::toInteger(recv_faces_infos[recv_faces_infos_index]);
350 ++recv_faces_infos_index;
351 if (face_type == IT_NullType) {
359 recv_faces_infos_index += face_nb_node;
360 Int64 cell_uid = recv_faces_infos[recv_faces_infos_index];
361 ++recv_faces_infos_index;
362 Integer cell_owner = CheckedConvert::toInteger(recv_faces_infos[recv_faces_infos_index]);
363 ++recv_faces_infos_index;
364 Integer cell_face_index = CheckedConvert::toInteger(recv_faces_infos[recv_faces_infos_index]);
365 ++recv_faces_infos_index;
374 ++nb_recv_sub_domain_boundary_face;
375 faces_opposite_cell_uid[face.
localId()] = cell_uid;
376 faces_opposite_cell_index[face.
localId()] = cell_face_index;
377 faces_opposite_cell_owner[face.
localId()] = cell_owner;
378 cells_first_face_uid.
add(cell_uid, -1);
382 info() <<
"Number of faces on the subdomain interface: "
383 << nb_sub_domain_boundary_face <<
' ' << nb_recv_sub_domain_boundary_face;
387 Int64 max_cell_uid = 0;
388 Int32 max_cell_local_id = 0;
392 if (cell_uid > max_cell_uid)
393 max_cell_uid = cell_uid;
394 if (cell_local_id > max_cell_local_id)
395 max_cell_local_id = cell_local_id;
398 debug() <<
"GLOBAL MAX CELL UID=" << global_max_cell_uid;
401 my_cells_faces_info.
reserve(nb_local_cell);
403 my_cells_nb_back_face.
fill(0);
409 Integer nb_true_boundary_face = 0;
410 for (
Face face : cell.faces()) {
411 Int64 opposite_cell_uid = faces_opposite_cell_uid[face.localId()];
412 if (face.backCell() == cell)
414 else if (face.nbCell() == 1 && opposite_cell_uid == NULL_ITEM_ID) {
415 ++nb_true_boundary_face;
418 my_cells_nb_back_face[cell_local_id] = nb_back_face;
419 my_cells_faces_info.
add(
T_CellFaceInfo(cell_uid, nb_back_face, nb_true_boundary_face));
421 std::sort(std::begin(my_cells_faces_info), std::end(my_cells_faces_info));
425 Integer first_cell_index_to_send = 0;
426 Int64 current_face_uid = 0;
428 for (
Integer i_phase = 0; i_phase < nb_phase; ++i_phase) {
429 Integer nb_uid_to_send = CheckedConvert::toInteger(global_max_cell_uid / nb_phase);
430 Integer first_uid_to_send = nb_uid_to_send * i_phase;
431 Int64 last_uid_to_send = first_uid_to_send + nb_uid_to_send;
432 if (i_phase + 1 == nb_phase)
433 last_uid_to_send = global_max_cell_uid;
437 for (
Integer zz = first_cell_index_to_send, zs = my_cells_faces_info.
size(); zz < zs; ++zz) {
438 if (my_cells_faces_info[zz].m_unique_id <= last_uid_to_send)
443 debug() <<
"FIRST TO SEND=" << first_cell_index_to_send
444 <<
" NB=" << nb_cell_to_send
445 <<
" first_uid=" << first_uid_to_send
446 <<
" last_uid=" << last_uid_to_send;
448 T_CellFaceInfo* begin_cell_array = my_cells_faces_info.
data() + first_cell_index_to_send;
449 Int64* begin_array =
reinterpret_cast<Int64*
>(begin_cell_array);
450 Integer begin_size = nb_cell_to_send * 3;
456 first_cell_index_to_send += nb_cell_to_send;
458 info() <<
"Infos faces (received) nb_int64=" << recv_cells_faces_infos.
size();
459 Integer recv_nb_cell = recv_cells_faces_infos.
size() / 3;
465 for (
Integer i = 0; i < recv_nb_cell; ++i) {
466 Int64 cell_uid = recv_cells_faces_infos[i * 3];
467 global_cells_faces_info[i].m_unique_id = cell_uid;
468 global_cells_faces_info[i].m_nb_back_face = recv_cells_faces_infos[(i * 3) + 1];
469 global_cells_faces_info[i].m_nb_true_boundary_face = recv_cells_faces_infos[(i * 3) + 2];
471 info() <<
"Sorting the faces nb=" << global_cells_faces_info.
size();
472 std::sort(std::begin(global_cells_faces_info), std::end(global_cells_faces_info));
474 for (
Integer i = 0; i < recv_nb_cell; ++i) {
475 Int64 cell_uid = global_cells_faces_info[i].m_unique_id;
476 if (cells_map.
hasKey(cell_uid) || cells_first_face_uid.
hasKey(cell_uid))
477 cells_first_face_uid.
add(cell_uid, current_face_uid);
478 current_face_uid += global_cells_faces_info[i].m_nb_back_face + global_cells_faces_info[i].m_nb_true_boundary_face;
487 Integer num_true_boundary_face = 0;
488 for (
Face face : cell.faces()) {
489 Int64 opposite_cell_uid = faces_opposite_cell_uid[face.localId()];
490 Int64 face_new_uid = NULL_ITEM_UNIQUE_ID;
491 if (face.backCell() == cell) {
492 if (!cells_first_face_uid.
hasKey(cell_uid))
493 fatal() <<
"NO KEY 0 for cell_uid=" << cell_uid;
494 face_new_uid = cells_first_face_uid[cell_uid] + num_local_face;
495 face.mutableItemBase().setOwner(my_rank, my_rank);
498 else if (face.nbCell() == 1) {
499 if (opposite_cell_uid == NULL_ITEM_UNIQUE_ID) {
501 if (!cells_first_face_uid.
hasKey(cell_uid))
502 fatal() <<
"NO KEY 1 for cell_uid=" << cell_uid;
503 face_new_uid = cells_first_face_uid[cell_uid] + my_cells_nb_back_face[cell_local_id] + num_true_boundary_face;
504 ++num_true_boundary_face;
505 face.mutableItemBase().setOwner(my_rank, my_rank);
508 if (!cells_first_face_uid.
hasKey(opposite_cell_uid))
509 fatal() <<
"NO KEY 1 for cell_uid=" << cell_uid <<
" opoosite=" << opposite_cell_uid;
510 face_new_uid = cells_first_face_uid[opposite_cell_uid] + faces_opposite_cell_index[face.localId()];
511 face.mutableItemBase().setOwner(faces_opposite_cell_owner[face.localId()], my_rank);
514 if (face_new_uid != NULL_ITEM_UNIQUE_ID) {
515 faces_new_uid[face.localId()] = face_new_uid;
516 face.mutableItemBase().setUniqueId(face_new_uid);
524 for (
Integer i = 0, is = nb_local_face; i < is; ++i) {
525 if (faces_new_uid[i] == NULL_ITEM_UNIQUE_ID) {
528 error() <<
"The face lid=" << i <<
" has not been re-indexed.";
532 ARCANE_FATAL(
"Some ({0}) faces have not been reindexed", nb_error);
541 Int64 opposite_cell_uid = faces_opposite_cell_uid[face.localId()];
543 bool true_boundary =
false;
544 bool internal_other =
false;
545 if (face.backCell() == cell) {
547 else if (face.nbCell() == 1) {
548 if (opposite_cell_uid == NULL_ITEM_ID)
549 true_boundary =
true;
554 internal_other =
true;
555 opposite_cell_uid = face.backCell().uniqueId().asInt64();
557 ostr() <<
"NEW UNIQUE ID FOR FACE"
558 <<
" lid=" << face.localId()
559 <<
" cell=" << cell_uid
560 <<
" face=" << face.uniqueId()
561 <<
" nbcell=" << face.nbCell()
562 <<
" cellindex=" << face_index <<
" (";
563 for (
Node node : face.nodes())
564 ostr() <<
' ' << node.uniqueId();
567 ostr() <<
" internal-other";
569 ostr() <<
" true-boundary";
570 if (opposite_cell_uid != NULL_ITEM_ID) {
571 ostr() <<
" opposite " << opposite_cell_uid;
574 ostr() <<
" (shared)";
579 info() << ostr.str();
580 String file_name(
"faces_uid.");
581 file_name = file_name + my_rank;
582 std::ofstream ofile(file_name.
localstr());
596 for (BoundaryInfosMapEnumerator i_map(boundary_infos_to_send); ++i_map;) {
597 Int32 sd = i_map.data()->key();
603 info() <<
"NB_SEND=" << nb_sender <<
" NB_RECV=" << nb_receiver;
604 Integer total = nb_sender + nb_receiver;
606 info() <<
"GLOBAL_NB_MESSAGE=" << global_total;
615 s->
setMode(ISerializer::ModeReserve);
625 debug() <<
"END EXCHANGE";
628template <
typename DataType>
638 MyInfo(
const DataType& d,
Integer n)
652 : m_last_index(5000, true)
657 void add(
Int64 node_uid,
const DataType& data)
659 Integer current_index = m_values.size();
662 HashTableMapT<Int64, Int32>::Data* d = m_last_index.lookupAdd(node_uid, -1, is_add);
664 m_values.add(
MyInfo(data, d->value()));
665 d->value() = current_index;
670 UniqueArray<MyInfo> m_values;
671 HashTableMapT<Int64, Int32> m_last_index;
690 Integer nb_local_face = m_mesh_builder->oneMeshItemAdder()->nbFace();
695 faces_opposite_cell_uid.
fill(NULL_ITEM_ID);
702 faces_new_uid.
fill(NULL_ITEM_ID);
727 Int64 my_max_node_uid = NULL_ITEM_UNIQUE_ID;
730 if (node_uid > my_max_node_uid)
731 my_max_node_uid = node_uid;
734 debug() <<
"NODE_UID_INFO: MY_MAX_UID=" << my_max_node_uid
735 <<
" GLOBAL=" << global_max_node_uid;
738 BoundaryInfosMap boundary_infos_to_send(nb_rank,
true);
740 info() <<
"NB_CORE modulo=" << uid_to_subdomain_converter.modulo();
748 if (face_nb_cell == 1) {
750 is_boundary_nodes[node.
localId()] =
true;
759 Int32 dest_rank = -1;
760 if (!is_boundary_nodes[first_node.
localId()]) {
761 v = nodes_info.
lookupAdd(first_node_uid)->value();
764 dest_rank = uid_to_subdomain_converter.uidToRank(first_node_uid);
765 v = boundary_infos_to_send.
lookupAdd(dest_rank)->value();
767 v.
add(first_node_uid);
773 if (back_cell.
null())
774 v.
add(NULL_ITEM_UNIQUE_ID);
777 if (front_cell.
null())
778 v.
add(NULL_ITEM_UNIQUE_ID);
790 Integer nb_receiver = exchanger->nbReceiver();
791 debug() <<
"NB RECEIVER=" << nb_receiver;
793 for (
Integer i = 0; i < nb_receiver; ++i) {
800 received_infos.
resize(nb_info);
805 while (z < nb_info) {
806 Int64 node_uid = received_infos[z + 0];
807 Int32 face_type = (
Int32)received_infos[z + 3];
822 while (z < nb_info) {
830 my_max_face_node =
math::max(node_nb_face, my_max_face_node);
833 debug() <<
"GLOBAL MAX FACE NODE=" << global_max_face_node;
836 boundary_infos_to_send = BoundaryInfosMap(nb_rank,
true);
844 while (z < nb_info) {
845 Int64 node_uid = a[z + 0];
847 Int64 face_uid = a[z + 2];
853 Integer face_index = node_nb_face;
854 Int32 face_new_owner = sender_rank;
855 for (
Integer y = 0; y < node_nb_face; ++y) {
856 if (memcmp(&a[indexes[y] + 6], &a[z + 6],
sizeof(
Int64) * face_nb_node) == 0) {
858 face_new_owner = (
Int32)a[indexes[y] + 1];
861 Int64 face_new_uid = (node_uid * global_max_face_node) + face_index;
866 v.
add(face_new_owner);
872 my_max_face_node =
math::max(node_nb_face, my_max_face_node);
879 Integer nb_receiver = exchanger->nbReceiver();
880 debug() <<
"NB RECEIVER=" << nb_receiver;
882 for (
Integer i = 0; i < nb_receiver; ++i) {
887 received_infos.
resize(nb_info);
889 if ((nb_info % 3) != 0)
890 ARCANE_FATAL(
"info size can not be divided by 3 v={0}", nb_info);
892 Int64 nb_item = nb_info / 3;
893 for (
Int64 z = 0; z < nb_item; ++z) {
894 Int64 old_uid = received_infos[(z * 3)];
895 Int64 new_uid = received_infos[(z * 3) + 1];
896 Int32 new_owner = (
Int32)received_infos[(z * 3) + 2];
897 impl::MutableItemBase face(faces_map.
tryFind(old_uid));
900 face.setUniqueId(new_uid);
908 debug() <<
"END OF TEST NEW FACE COMPUTE";
922 bool is_verbose = m_mesh_builder->isVerbose();
931 if (cell_uid > max_uid)
934 info() <<
"Max uid=" << max_uid;
935 Integer nb_computed = max_uid + 1;
943 Integer nb_true_boundary_face = 0;
944 for (
Face face : cell.faces()) {
945 if (face.backCell() == cell)
947 else if (face.nbCell() == 1) {
948 ++nb_true_boundary_face;
951 cell_nb_num_back_face[cell_uid] = nb_num_back_face;
952 cell_true_boundary_face[cell_uid] = nb_true_boundary_face;
956 for (
Integer i = 0; i < nb_computed; ++i) {
957 cell_first_face_uid[i] = current_face_uid;
958 current_face_uid += cell_nb_num_back_face[i] + cell_true_boundary_face[i];
964 info() <<
"Recv: Cell FaceInfo celluid=" << i
965 <<
" firstfaceuid=" << cell_first_face_uid[i]
966 <<
" nbback=" << cell_nb_num_back_face[i]
967 <<
" nbbound=" << cell_true_boundary_face[i];
974 Integer nb_true_boundary_face = 0;
975 for (
Face face : cell.faces()) {
976 Int64 face_new_uid = NULL_ITEM_UNIQUE_ID;
977 if (face.backCell() == cell) {
978 face_new_uid = cell_first_face_uid[cell_uid] + nb_num_back_face;
981 else if (face.nbCell() == 1) {
982 face_new_uid = cell_first_face_uid[cell_uid] + cell_nb_num_back_face[cell_uid] + nb_true_boundary_face;
983 ++nb_true_boundary_face;
985 if (face_new_uid != NULL_ITEM_UNIQUE_ID) {
986 face.mutableItemBase().setUniqueId(face_new_uid);
996 Int64 opposite_cell_uid = NULL_ITEM_UNIQUE_ID;
997 bool true_boundary =
false;
998 bool internal_other =
false;
999 if (face.backCell() == cell) {
1001 else if (face.nbCell() == 1) {
1002 true_boundary =
true;
1005 internal_other =
true;
1006 opposite_cell_uid = face.backCell().uniqueId().asInt64();
1008 ostr() <<
"NEW LOCAL ID FOR CELLFACE cell_uid=" << cell.
uniqueId() <<
' '
1009 << face_index <<
" uid=" << face.uniqueId() <<
" (";
1010 for (
Node node : face.nodes())
1011 ostr() <<
' ' << node.uniqueId();
1014 ostr() <<
" internal-other";
1016 ostr() <<
" true-boundary";
1017 if (opposite_cell_uid != NULL_ITEM_ID)
1018 ostr() <<
" opposite " << opposite_cell_uid;
1023 info() << ostr.str();
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Integer size() const
Number of elements in the vector.
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.
const T * data() const
Access to the root of the array without any protection.
void reserve(Int64 new_capacity)
Reserves memory for new_capacity elements.
FaceConnectedListViewType faces() const
List of faces of the cell.
Constant view of an array of type T.
constexpr Integer size() const noexcept
Number of elements in the array.
Class to convert a FaceLocalId to a face.
Cell frontCell() const
Cell in front of the face (null cell if none).
Cell cell(Int32 i) const
i-th cell of the face
Int32 nbCell() const
Number of cells of the face (1 or 2).
bool isSubDomainBoundary() const
Indicates if the face is on the subdomain boundary (i.e nbCell()==1).
Cell backCell() const
Cell behind the face (null cell if none).
Hash table for associative arrays.
Data * lookupAdd(KeyTypeConstRef id, const ValueType &value, bool &is_add)
Searches for or adds the value corresponding to key id.
bool add(KeyTypeConstRef id, const ValueType &value)
Adds the value value corresponding to key id.
bool hasKey(KeyTypeConstRef id)
true if a value with key id is present
Interface of an entity family.
virtual Int32 maxLocalId() const =0
virtual Integer faceBuilderVersion() const =0
Face numbering version.
Information exchange between processors.
virtual void addSender(Int32 rank)=0
Adds a processor to send to.
virtual Integer nbSender() const =0
Number of processors to which we send.
virtual Integer nbReceiver() const =0
Number of processors from which we will receive messages.
virtual bool initializeCommunicationsMessages()=0
Calculates communications.
virtual ISerializeMessage * messageToSend(Integer i)=0
Message intended for the i-th processor.
virtual void processExchange()=0
Performs the exchange using the default options of ParallelExchangerOptions.
Interface of the parallelism manager for a subdomain.
virtual Int32 commRank() const =0
Rank of this instance in the communicator.
virtual void allGatherVariable(ConstArrayView< char > send_buf, Array< char > &recv_buf)=0
Performs an all-gather operation across all processors.
virtual Int32 commSize() const =0
Number of instances in the communicator.
virtual bool isParallel() const =0
Returns true if the execution is parallel.
virtual char reduce(eReduceType rt, char v)=0
Performs a reduction of type rt on the real v and returns the value.
virtual void barrier()=0
Performs a barrier.
void reserveInt64(Int64 n)
Reserve for n Int64.
@ ModePut
The serializer expects reserve().
@ ModeGet
The serializer expects get().
virtual Int64 getInt64()=0
Retrieve a size.
virtual void allocateBuffer()=0
Allocates the serializer memory.
virtual void putSpan(Span< const Real > values)
Add the array values.
virtual void getSpan(Span< Real > values)
Retrieve the array values.
virtual void reserveSpan(eBasicDataType dt, Int64 n)=0
Reserves memory for n values of dt.
virtual void setMode(eMode new_mode)=0
Sets the current mode.
virtual void putInt64(Int64 value)=0
Add the integer value.
virtual void flush()=0
Flushes all streams.
Int32 flags() const
Flags of the entity.
bool null() const
True if the entity is the null entity.
@ II_Shared
The entity is shared by another subdomain.
@ II_HasBackCell
The entity has a back cell.
@ II_SubDomainBoundary
The entity is at the boundary of two subdomains.
Info on a mesh entity type.
Integer nbLocalNode() const
Number of nodes of the entity.
Mesh entity type manager.
ItemTypeInfo * typeFromId(Integer id) const
Type corresponding to the number id.
Unique identifier of an entity.
Node node(Int32 i) const
i-th node of the entity
NodeConnectedListViewType nodes() const
List of nodes of the entity.
Int32 nbNode() const
Number of nodes of the entity.
Base class for a mesh element.
impl::MutableItemBase mutableItemBase() const
Mutable internal part of the entity.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Int32 owner() const
Owner subdomain number of the entity.
ItemUniqueId uniqueId() const
Unique identifier across all domains.
constexpr bool null() const
true if the entity is null (i.e. not connected to the mesh)
impl::ItemBase itemBase() const
Internal part of the entity.
Int16 type() const
Entity type.
Interface for a serialization message between IMessagePassingMng.
virtual MessageRank destination() const =0
Destination rank (if isSend() is true) or sender.
virtual ISerializer * serializer()=0
Serializer.
Int32 value() const
Rank value.
void setOwner(Integer suid, Int32 current_sub_domain)
Sets the sub-domain number of the entity owner.
void addFlags(Int32 added_flags)
Adds the flags added_flags to those of the entity.
Output stream linked to a String.
InstanceType * get() const
Associated instance or nullptr if none.
Reference to an instance.
1D vector of data with reference semantics.
Unicode character string.
const char * localstr() const
Returns the conversion of the instance into UTF-8 encoding.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flow for a debug message.
TraceMessage fatal() const
Flow for a fatal error message.
TraceMessage info() const
Flow for an information message.
TraceMessage error() const
Flow for an error message.
ITraceMng * traceMng() const
Trace manager.
TraceMessage pwarning() const
1D data vector with value semantics (STL style).
Construction of a mesh incrementally.
Implementation of a mesh.
IParallelMng * parallelMng() override
Parallelism manager.
String name() const override
Mesh name.
IMeshUniqueIdMng * meshUniqueIdMng() const override
Unique ID numbering manager.
void _computeFacesUniqueIdsParallelV2()
Calculates the unique IDs for each face in parallel V2.
void _computeFacesUniqueIdsSequential()
Calculates the unique IDs for each face sequentially.
FaceUniqueIdBuilder(DynamicMeshIncrementalBuilder *mesh_builder)
Constructs an instance for the mesh.
void _exchangeData(IParallelExchanger *exchanger, BoundaryInfosMap &boundary_infos_to_send)
void _checkNoDuplicate()
Checks that there are no duplicate uniqueIds.
void _computeFacesUniqueIdsParallelV1()
Calculates the unique numbers for each face in parallel.
Associative array of ItemInternal.
void eachItem(const Lambda &lambda)
Template function to iterate over the instance's entities.
bool hasKey(Int64 key)
true if a value with the key id is present
impl::ItemBase tryFind(Int64 key) const
Returns the entity associated with key if found, or the null entity otherwise.
Helper class for parallel determination of face unique_ids.
T max(const T &a, const T &b, const T &c)
Returns the maximum of three elements.
@ ReduceSum
Sum of values.
@ ReduceMax
Maximum of values.
Ref< IParallelExchanger > createExchangerRef(IParallelMng *pm)
Returns an interface to transfer messages between ranks.
Array< Int64 > Int64Array
Dynamic one-dimensional array of 64-bit integers.
bool arcaneIsCheck()
True if running in check mode.
UniqueArray< Int64 > Int64UniqueArray
Dynamic 1D array of 64-bit integers.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
@ Int64
64-bit integer data type
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
double Real
Type representing a real number.
UniqueArray< Integer > IntegerUniqueArray
Dynamic 1D array of integers.
std::int32_t Int32
Signed integer type of 32 bits.