14#include "arcane/utils/TraceAccessor.h"
15#include "arcane/utils/Array.h"
16#include "arcane/utils/IOException.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/Ref.h"
19#include "arcane/utils/NotSupportedException.h"
20#include "arcane/utils/Real3.h"
21#include "arcane/utils/OStringStream.h"
22#include "arcane/utils/FixedArray.h"
23#include "arcane/utils/PlatformUtils.h"
24#include "arcane/utils/CheckedConvert.h"
26#include "arcane/core/IMeshReader.h"
27#include "arcane/core/IPrimaryMesh.h"
28#include "arcane/core/IItemFamily.h"
29#include "arcane/core/ItemGroup.h"
30#include "arcane/core/VariableTypes.h"
31#include "arcane/core/IParallelMng.h"
33#include "arcane/core/IMeshModifier.h"
34#include "arcane/core/MeshKind.h"
37#include "arcane/std/internal/IosFile.h"
38#include "arcane/std/internal/IosGmsh.h"
101 Int64 entity_tag = -1;
118 bool isNull()
const {
return dimension == (-1); }
119 Int32 dimension = -1;
129 void add(Int32 dimension, Int64 tag,
String name)
135 for (
auto& x : m_physical_names[dimension])
174 Int32 m_entity_dim = -1;
175 Int32 m_entity_tag = -1;
176 Int32 m_entity_tag_master = -1;
178 Int32 m_nb_corresponding_node = 0;
221 for (
auto& x : entities_with_nodes_list[dimension - 1])
228 for (
auto& x : entities_nodes_list)
245 Real3 m_node_min_bounding_box;
246 Real3 m_node_max_bounding_box;
264 IMesh* m_mesh =
nullptr;
266 Int32 m_master_io_rank = A_NULL_RANK;
267 bool m_is_parallel =
false;
269 MeshInfo m_mesh_info;
282 void _readMeshFromFile();
285 void _allocateCells();
286 void _allocateGroups();
293 Int16 _switchMshType(Int64, Int32&)
const;
294 void _readPhysicalNames();
300 Int32 _getIntegerAndBroadcast();
301 Int64 _getInt64AndBroadcast();
311 void _goToNextLine();
326 inline std::pair<Int64, Int64>
349 s = f->getNextLine();
353 info() <<
"BroadcastNextLine: " << s;
354 m_parallel_mng->broadcastString(s, m_master_io_rank);
356 info() <<
"GetNextLine: " << s;
389_getIntegerAndBroadcast()
394 v[0] = f->getInteger();
396 m_parallel_mng->broadcast(v.view(), m_master_io_rank);
404Int64 MshParallelMeshReader::
405_getInt64AndBroadcast()
407 IosFile* f = m_ios_file.get();
408 FixedArray<Int64, 1> v;
412 m_parallel_mng->broadcast(v.view(), m_master_io_rank);
420void MshParallelMeshReader::
421_getInt64ArrayAndBroadcast(ArrayView<Int64> values)
423 IosFile* f = m_ios_file.get();
426 f->binaryRead(values);
429 for (
Int64& v : values)
434 m_parallel_mng->broadcast(values, m_master_io_rank);
440void MshParallelMeshReader::
441_getInt32ArrayAndBroadcast(ArrayView<Int32> values)
443 IosFile* f = m_ios_file.get();
446 f->binaryRead(values);
449 for (
Int32& v : values)
454 m_parallel_mng->broadcast(values, m_master_io_rank);
460void MshParallelMeshReader::
461_getDoubleArrayAndBroadcast(ArrayView<double> values)
463 IosFile* f = m_ios_file.get();
466 f->binaryRead(values);
469 for (
double& v : values)
474 m_parallel_mng->broadcast(values, m_master_io_rank);
480Real3 MshParallelMeshReader::
483 IosFile* f = m_ios_file.get();
487 f->binaryRead(SmallSpan<Real3>(&v, 1));
490 Real x = f->getReal();
491 Real y = f->getReal();
492 Real z = f->getReal();
501Int32 MshParallelMeshReader::
504 IosFile* f = m_ios_file.get();
508 f->binaryRead(SmallSpan<Int32>(&v, 1));
517Int64 MshParallelMeshReader::
520 IosFile* f = m_ios_file.get();
524 f->binaryRead(SmallSpan<Int64>(&v, 1));
533void MshParallelMeshReader::
536 if (m_ios_file.get())
537 m_ios_file->getNextLine();
543Int16 MshParallelMeshReader::
544_switchMshType(
Int64 mshElemType,
Int32& nNodes)
const
546 switch (mshElemType) {
552 info() <<
"Could not decode IT_NullType with nNodes=" << nNodes;
553 throw IOException(
"_switchMshType",
"Could not decode IT_NullType with nNodes");
570 return IT_Tetraedron4;
573 return IT_Hexaedron8;
576 return IT_Pentaedron6;
582 return IT_Heptaedron10;
585 return IT_Octaedron12;
591 return IT_Tetraedron10;
605 ARCANE_THROW(NotSupportedException,
"Unknown GMSH element type '{0}'", mshElemType);
618 Real min_value = -max_value;
626 m_mesh_info.m_node_min_bounding_box =
min_box;
627 m_mesh_info.m_node_max_bounding_box =
max_box;
649 for (Int64 i = 0; i <
nb_node; ++i) {
651 part = std::clamp(part, 0,
m_nb_part - 1);
657 for (Int64 i = 0; i <
nb_node; ++i) {
697 _getInt64ArrayAndBroadcast(
nodes_info.view());
710 info() <<
"[Nodes] nb_entity=" << nb_entity
715 <<
" nb_rank=" << m_parallel_mng->
commSize();
730void MshParallelMeshReader::
742 Int64
nb_node2 = _getInt64AndBroadcast();
781 ios_file->binaryRead(nodes_uids.view());
784 for (Integer i = 0; i < nb_to_read; ++i) {
786 nodes_uids[i] = ios_file->getInt64();
790 if (dest_rank != m_master_io_rank) {
791 pm->send(nodes_uids, dest_rank);
794 else if (my_rank == dest_rank) {
795 pm->
recv(nodes_uids, m_master_io_rank);
799 if (my_rank == dest_rank) {
808 info() <<
"Reading COORDS part i=" << i_part <<
" dest_rank=" << dest_rank <<
" nb_to_read=" << nb_to_read;
809 if (my_rank == dest_rank || my_rank == m_master_io_rank) {
810 nodes_coordinates.resize(nb_to_read);
817 ios_file->binaryRead(nodes_coordinates.view());
820 for (Integer i = 0; i < nb_to_read; ++i) {
821 nodes_coordinates[i] = _getReal3();
825 if (dest_rank != m_master_io_rank) {
826 pm->send(nodes_coordinates, dest_rank);
829 else if (my_rank == dest_rank) {
830 pm->
recv(nodes_coordinates, m_master_io_rank);
834 if (my_rank == dest_rank) {
868 info() <<
"Reading block part i_part=" <<
i_part
883 for (Int64 i = 0; i <
nb_uid; ++i) {
887 for (Int32
j = 0;
j < item_nb_node; ++
j) {
895 for (Int64 i = 0; i <
nb_uid; ++i) {
898 for (Int32
j = 0;
j < item_nb_node; ++
j)
899 connectivities[(i * item_nb_node) +
j] =
ios_file->getInt64();
908 pm->
recv(uids, m_master_io_rank);
909 pm->
recv(connectivities, m_master_io_rank);
988 _getInt32ArrayAndBroadcast(
block_info.view());
995 Integer item_nb_node = 0;
998 info() <<
"[Elements] index=" << block.index <<
" entity_dim=" <<
entity_dim
999 <<
" entity_tag=" << entity_tag
1001 <<
" item_type=" << item_type <<
" item_nb_node=" << item_nb_node;
1004 block.item_type = item_type;
1005 block.item_nb_node = item_nb_node;
1007 block.entity_tag = entity_tag;
1055 const Int32
block_dim = block.dimension;
1057 _computeOwnItems(block, m_mesh_info.cells_infos,
false);
1063 if (block.item_type == IT_Triangle3)
1064 block.item_type =
ItemTypeId(IT_Cell3D_Triangle3);
1065 else if (block.item_type == IT_Quad4)
1066 block.item_type =
ItemTypeId(IT_Cell3D_Quad4);
1068 ARCANE_FATAL(
"Not supported sub dimension cell type={0}", block.item_type);
1070 block.is_built_as_cells =
true;
1071 _computeOwnItems(block, m_mesh_info.cells_infos,
false);
1094 pm->broadcast(view, dest_rank);
1104 template <
typename DataType>
inline ArrayView<DataType>
1105 _broadcastArray(IParallelMng* pm, UniqueArray<DataType>& values,
1106 UniqueArray<DataType>& work_values,
Int32 dest_rank)
1111 if (dest_rank == my_rank)
1112 size = values.size();
1113 pm->broadcast(ArrayView<Int64>(1, &size), dest_rank);
1114 return _broadcastArrayWithSize(pm, values, work_values, dest_rank, size);
1122void MshParallelMeshReader::
1123_computeOwnItems(MeshV4ElementsBlock& block, ItemKindInfo& item_kind_info,
bool is_generate_uid)
1127 IParallelMng* pm = m_parallel_mng;
1130 const ItemTypeId item_type = block.item_type;
1131 const Int32 item_nb_node = block.item_nb_node;
1133 UniqueArray<Int64> connectivities;
1134 UniqueArray<Int64> uids;
1135 UniqueArray<Int32> nodes_rank;
1138 info() <<
"Compute own items block_index=" << block.index <<
" nb_part=" << nb_part;
1139 for (
Int32 i_part = 0; i_part < nb_part; ++i_part) {
1142 ArrayView<Int64> connectivities_view = _broadcastArray(pm, block.connectivities, connectivities, dest_rank);
1143 ArrayView<Int64> uids_view = _broadcastArray(pm, block.uids, uids, dest_rank);
1145 Int32 nb_item = uids_view.size();
1146 nodes_rank.resize(nb_item);
1147 nodes_rank.fill(-1);
1152 for (
Int32 i = 0; i < nb_item; ++i) {
1153 Int64 first_node_uid = connectivities_view[i * item_nb_node];
1158 Int32 rank = x->second;
1159 nodes_rank[i] = rank;
1161 pm->
reduce(Parallel::ReduceMax, nodes_rank);
1162 for (
Int32 i = 0; i < nb_item; ++i) {
1163 const Int32 rank = nodes_rank[i];
1164 if (rank != my_rank)
1169 ConstArrayView<Int64> v = connectivities_view.subView(i * item_nb_node, item_nb_node);
1170 Int64 uid = uids_view[i];
1171 if (is_generate_uid)
1173 uid = NULL_ITEM_UNIQUE_ID;
1174 item_kind_info.addItem(item_type, uid, v);
1211 Int32 nb_item = uids.size();
1218 for (Int32 i = 0; i < nb_item; ++i) {
1229void MshParallelMeshReader::
1232 IMesh* mesh = m_mesh;
1233 Integer nb_item = m_mesh_info.faces_infos.nb_item;
1234 info() <<
"Adding faces direct nb_face=" << nb_item;
1236 mesh->
modifier()->addFaces(nb_item, m_mesh_info.faces_infos.items_infos);
1242void MshParallelMeshReader::
1245 IMesh* mesh = m_mesh;
1246 Integer nb_elements = m_mesh_info.cells_infos.nb_item;
1247 info() <<
"nb_of_elements=cells_type.size()=" << nb_elements;
1248 Integer nb_cell_node = m_mesh_info.cells_infos.items_infos.
size();
1249 info() <<
"nb_cell_node=cells_connectivity.size()=" << nb_cell_node;
1252 info() <<
"Building cells, nb_cell=" << nb_elements <<
" nb_cell_node=" << nb_cell_node;
1253 IPrimaryMesh* pmesh = mesh->toPrimaryMesh();
1254 info() <<
"## Allocating ##";
1255 pmesh->allocateCells(nb_elements, m_mesh_info.cells_infos.items_infos,
false);
1256 info() <<
"## Ending ##";
1258 if (m_mesh->
meshKind().isNonManifold())
1260 pmesh->endAllocate();
1261 info() <<
"## Done ##";
1267void MshParallelMeshReader::
1270 IMesh* mesh = m_mesh;
1271 Int32 mesh_dim = mesh->dimension();
1272 Int32 face_dim = mesh_dim - 1;
1273 UniqueArray<MeshV4EntitiesWithNodes> entity_list;
1274 UniqueArray<MeshPhysicalName> physical_name_list;
1275 for (MeshV4ElementsBlock& block : m_mesh_info.blocks) {
1276 entity_list.clear();
1277 physical_name_list.clear();
1278 Int32 block_index = block.index;
1279 Int32 block_dim = block.dimension;
1282 Int64 block_entity_tag = block.entity_tag;
1283 if (block_entity_tag < 0) {
1284 info(5) <<
"[Groups] Skipping block index=" << block_index <<
" because it has no entity";
1287 if (block_dim == 0) {
1288 const MeshV4EntitiesNodes* entity = m_mesh_info.findNodeEntities(block_entity_tag);
1290 info(5) <<
"[Groups] Skipping block index=" << block_index
1291 <<
" because entity tag is invalid";
1294 Int64 entity_physical_tag = entity->physical_tag;
1295 MeshPhysicalName physical_name = m_mesh_info.physical_name_list.find(block_dim, entity_physical_tag);
1296 physical_name_list.add(physical_name);
1299 m_mesh_info.findEntities(block_dim, block_entity_tag, entity_list);
1300 for (
const MeshV4EntitiesWithNodes& x : entity_list) {
1301 Int64 entity_physical_tag = x.physical_tag;
1302 MeshPhysicalName physical_name = m_mesh_info.physical_name_list.find(block_dim, entity_physical_tag);
1303 physical_name_list.add(physical_name);
1306 for (
const MeshPhysicalName& physical_name : physical_name_list) {
1307 if (physical_name.isNull()) {
1308 info(5) <<
"[Groups] Skipping block index=" << block_index
1309 <<
" because entity physical tag is invalid";
1312 info(4) <<
"[Groups] Block index=" << block_index <<
" dim=" << block_dim
1313 <<
" name='" << physical_name.name <<
"' built_as_cells=" << block.is_built_as_cells;
1314 if (block_dim == mesh_dim || block.is_built_as_cells) {
1317 else if (block_dim == face_dim) {
1348void MshParallelMeshReader::
1352 IMesh* mesh = m_mesh;
1353 const Int32 nb_entity = connectivities.size() / item_nb_node;
1380 for (Integer z = 0; z < item_nb_node; ++z)
1384 for (Integer z = 0; z < item_nb_node; ++z)
1392 faces_nodes_unique_id_index = 0;
1393 for (Integer i_face = 0; i_face < nb_entity; ++i_face) {
1394 const Integer n = item_nb_node;
1395 Int32 face_first_node_lid = faces_first_node_local_id[i_face];
1396 if (face_first_node_lid != NULL_ITEM_LOCAL_ID) {
1397 Int64ConstArrayView face_nodes_id(item_nb_node, &faces_nodes_unique_id[faces_nodes_unique_id_index]);
1398 Node current_node(mesh_nodes[faces_first_node_local_id[i_face]]);
1399 Face face = MeshUtils::getFaceFromNodesUniqueId(current_node, face_nodes_id);
1404 if (!m_is_parallel) {
1406 ostr() <<
"(Nodes:";
1407 for (Integer z = 0; z < n; ++z)
1408 ostr() <<
' ' << face_nodes_id[z];
1409 ostr() <<
" - " << current_node.localId() <<
")";
1410 ARCANE_FATAL(
"INTERNAL: MeshMeshReader face index={0} with nodes '{1}' is not in node/face connectivity",
1411 i_face, ostr.str());
1415 faces_id.add(face.localId());
1418 faces_nodes_unique_id_index += n;
1420 info(4) <<
"Adding " << faces_id.size() <<
" faces from block index=" << block_index
1421 <<
" to group '" << face_group.
name() <<
"'";
1445void MshParallelMeshReader::
1449 const Int32 nb_entity = uids.size();
1461 if (m_is_parallel) {
1467 info() <<
"Adding " << items_lid.size() <<
" items from block index=" << block_index
1468 <<
" to group '" << group_name <<
"' for family=" << family->
name();
1482void MshParallelMeshReader::
1486 String quote_mark =
"\"";
1487 Int32 nb_name = _getIntegerAndBroadcast();
1488 info() <<
"nb_physical_name=" << nb_name;
1492 for (
Int32 i = 0; i < nb_name; ++i) {
1493 Int32 dim = _getIntegerAndBroadcast();
1494 Int32 tag = _getIntegerAndBroadcast();
1496 if (dim < 0 || dim > 3)
1497 ARCANE_FATAL(
"Invalid value for physical name dimension dim={0}", dim);
1501 if (s.startsWith(quote_mark))
1503 if (s.endsWith(quote_mark))
1504 s = s.substring(0, s.length() - 1);
1505 m_mesh_info.physical_name_list.add(dim, tag, s);
1506 info(4) <<
"[PhysicalName] index=" << i <<
" dim=" << dim <<
" tag=" << tag <<
" name='" << s <<
"'";
1510 if (s !=
"$EndPhysicalNames")
1511 ARCANE_FATAL(
"found '{0}' and expected '$EndPhysicalNames'", s);
1563 info() <<
"Reading entity index=" << i;
1565 Int32 tag = _getInt32();
1569 ARCANE_FATAL(
"NotImplemented numPhysicalTag>1 (n={0}, index={1} xyz={2})",
1572 Int32 physical_tag = -1;
1574 physical_tag = _getInt32();
1575 info(4) <<
"[Entities] point tag=" << tag <<
" pos=" <<
xyz <<
" phys_tag=" << physical_tag;
1580 m_parallel_mng->broadcast(
tag_info.view(), m_master_io_rank);
1588 _readOneEntity(
i_dim);
1599void MshParallelMeshReader::
1614 Int32 tag = _getInt32();
1623 Int32 physical_tag = _getInt32();
1625 info(4) <<
"[Entities] z=" << z <<
" physical_tag=" << physical_tag;
1628 Int64 num_bounding_group = _getInt64();
1629 for (
Int64 k = 0; k < num_bounding_group; ++k) {
1630 [[maybe_unused]]
Int32 group_tag = _getInt32();
1632 info(4) <<
"[Entities] dim=" << entity_dim <<
" tag=" << tag
1633 <<
" min_pos=" << min_pos <<
" max_pos=" << max_pos
1634 <<
" nb_phys_tag=" << nb_physical_tag;
1637 m_parallel_mng->broadcast(dim_and_tag_info.view(), m_master_io_rank);
1641 Int64 tag = dim_and_tag_info[1];
1642 Int64 nb_physical_tag = dim_and_tag_info[2];
1643 for (
Int32 z = 0; z < nb_physical_tag; ++z) {
1644 Int64 physical_tag = dim_and_tag_info[3 + z];
1645 info(4) <<
"[Entities] adding info dim=" << entity_dim <<
" tag=" << tag
1646 <<
" physical_tag=" << physical_tag;
1647 m_mesh_info.entities_with_nodes_list[dim - 1].add(MeshV4EntitiesWithNodes(dim, tag, physical_tag));
1677 Int64
nb_link = _getInt64AndBroadcast();
1699 _getDoubleArrayAndBroadcast(
one_info.m_affine_values);
1701 info() <<
"[Periodic] nb_corresponding_node=" <<
one_info.m_nb_corresponding_node;
1702 one_info.m_corresponding_nodes.resize(
one_info.m_nb_corresponding_node * 2);
1703 _getInt64ArrayAndBroadcast(
one_info.m_corresponding_nodes);
1710 if (s !=
"$EndPeriodic")
1711 ARCANE_FATAL(
"found '{0}' and expected '$EndPeriodic'", s);
1724 constexpr Int32 MAX_SIZE = 128;
1731 IosFile* f = m_ios_file.get();
1735 info() <<
"S=" << s;
1736 if (m_is_parallel) {
1737 m_parallel_mng->broadcastString(s, m_master_io_rank);
1753void MshParallelMeshReader::
1757 IMesh* mesh = m_mesh;
1758 info() <<
"Reading 'msh' file in parallel";
1760 const int MSH_BINARY_TYPE = 1;
1763 Real version =
ios_file->getReal();
1765 ARCANE_THROW(
IOException,
"Wrong msh file version '{0}'. Only version '4.1' is supported in parallel", version);
1771 pwarning() <<
"MSH reader for binary format is experimental";
1786 ios_file->getNextLine();
1789 if (!ios_file->lookForString(
"$EndMeshFormat"))
1799 if (next_line ==
"$PhysicalNames") {
1800 _readPhysicalNames();
1806 if (next_line ==
"$Entities") {
1811 if (next_line !=
"$Nodes")
1812 ARCANE_THROW(IOException,
"Unexpected string '{0}'. Valid values are '$Nodes'", next_line);
1818 if (ios_file && !ios_file->lookForString(
"$EndNodes"))
1822 if (ios_file && !ios_file->lookForString(
"$Elements"))
1828 if (ios_file && !ios_file->lookForString(
"$EndElements"))
1831 info() <<
"Computed mesh dimension = " << mesh_dimension;
1834 pmesh->setDimension(mesh_dimension);
1836 info() <<
"NextLine=" << next_line;
1842 if (next_line ==
"$Periodic") {
1860 info() <<
"Trying to read in parallel 'msh' file '" << filename;
1863 m_parallel_mng = pm;
1864 const Int32 nb_rank = pm->
commSize();
1889 bool is_readable = platform::isFileReadable(filename);
1893 error() <<
"Unable to read file '" << filename <<
"'";
1900 std::ifstream
ifile;
1909 _readMeshFromFile();
1913 info() <<
"The file does not begin with '$MeshFormat' returning RTError";
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
#define ARCANE_THROW(exception_class,...)
Macro pour envoyer une exception avec formattage.
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Fonctions utilitaires sur le maillage.
Informations sur le type flottant.
Interface d'une famille d'entités.
virtual ItemGroup findGroup(const String &name) const =0
Recherche un groupe.
virtual String name() const =0
Nom de la famille.
virtual void itemsUniqueIdToLocalId(Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal=true) const =0
Converti un tableau de numéros uniques en numéros locaux.
virtual IItemFamily * nodeFamily()=0
Retourne la famille des noeuds.
virtual IItemFamily * faceFamily()=0
Retourne la famille des faces.
eReturnType
Types des codes de retour d'une lecture ou écriture.
@ RTError
Erreur lors de l'opération.
@ RTOk
Opération effectuée avec succès.
virtual VariableNodeReal3 & nodesCoordinates()=0
Coordonnées des noeuds.
virtual IParallelMng * parallelMng()=0
Gestionnaire de parallèlisme.
virtual IMeshModifier * modifier()=0
Interface de modification associée.
virtual const MeshKind meshKind() const =0
Caractéristiques du maillage.
virtual IPrimaryMesh * toPrimaryMesh()=0
Retourne l'instance sous la forme d'un IPrimaryMesh.
Exception lorsqu'une erreur d'entrée/sortie est détectée.
Interface du gestionnaire de parallélisme pour un sous-domaine.
virtual Int32 commRank() const =0
Rang de cette instance dans le communicateur.
virtual void recv(ArrayView< char > values, Int32 rank)=0
virtual bool isMasterIO() const =0
true si l'instance est un gestionnaire maître des entrées/sorties.
virtual Int32 commSize() const =0
Nombre d'instance dans le communicateur.
virtual Integer masterIORank() const =0
Rang de l'instance gérant les entrées/sorties (pour laquelle isMasterIO() est vrai)
virtual bool isParallel() const =0
Retourne true si l'exécution est parallèle.
virtual char reduce(eReduceType rt, char v)=0
Effectue la réduction de type rt sur le réel v et retourne la valeur.
Routines des Lecture/Ecriture d'un fichier.
Groupe d'entités de maillage.
const String & name() const
Nom du groupe.
void addItems(Int32ConstArrayView items_local_id, bool check_if_present=true)
Ajoute des entités.
Type d'une entité (Item).
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Informations pour créer les entités d'un genre.
Informations sur le maillage créé
std::unordered_map< Int64, Int32 > nodes_rank_map
Tableau associatif (uniqueId(),rang) auquel le noeud appartiendra.
UniqueArray< Int64 > nodes_unique_id
UniqueId() des noeuds de ma partie.
UniqueArray< Real3 > nodes_coordinates
Coordonnées des noeuds de ma partie.
Informations sur la périodicité
Lecteur de fichiers de maillage au format msh.
bool _getIsEndOfFileAndBroadcast()
Retourne true si on est à la fin du fichier.
void _readPeriodic()
Lecture des informations périodiques.
void _addFaceGroup(MeshV4ElementsBlock &block, const String &group_name)
Ajoute des faces au groupe group_name.
Integer _readElementsFromFile()
Lecture des éléments (mailles,faces,...)
void _readAndCheck(const String &expected_value)
Tente de lire la valeur value.
UniqueArray< Int32 > m_parts_rank
Liste des rangs qui participent à la conservation des données.
void _readEntities()
Lecture des entités.
Int32 m_nb_part
Nombre de partitions pour la lecture des noeuds et blocs.
void _readOneElementBlock(MeshV4ElementsBlock &block)
Lit un bloc d'entité de type 'Element'.
void _readNodesFromFile()
Lecture des noeuds du maillage.
void _setNodesCoordinates()
Positionne les coordonnées des noeuds.
eReturnType readMeshFromMshFile(IMesh *mesh, const String &file_name) override
Lit le maillage contenu dans le fichier filename et le construit dans mesh.
bool m_is_binary
Vrai si le format est binaire.
void _addCellOrNodeGroup(MeshV4ElementsBlock &block, const String &group_name, IItemFamily *family)
Ajoute des faces au groupe group_name.
void _computeNodesPartition()
String _getNextLineAndBroadcast()
Lis la valeur de la prochaine ligne et la broadcast aux autres rangs.
Vue sur les informations des noeuds.
Classe gérant un vecteur de réel de dimension 3.
Integer size() const
Nombre d'éléments du vecteur.
Int64 largeSize() const
Nombre d'éléments du vecteur (en 64 bits)
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
void addRange(ConstReferenceType val, Int64 n)
Ajoute n élément de valeur val à la fin du tableau.
void add(ConstReferenceType val)
Ajoute l'élément val à la fin du tableau.
Interface du gestionnaire de traces.
Exception lorsqu'une opération n'est pas supportée.
Chaîne de caractères unicode.
static String collapseWhiteSpace(const String &rhs)
Effectue une normalisation des caractères espaces.
const char * localstr() const
Retourne la conversion de l'instance dans l'encodage UTF-8.
Classe d'accès aux traces.
TraceMessage pwarning() const
TraceMessage error() const
Flot pour un message d'erreur.
TraceMessage info() const
Flot pour un message d'information.
T max(const T &a, const T &b, const T &c)
Retourne le maximum de trois éléments.
ARCCORE_HOST_DEVICE Real2 min(Real2 a, Real2 b)
Retourne le minimum de deux Real2.
Int32 toInt32(Int64 v)
Converti un Int64 en un Int32.
constexpr ARCCORE_HOST_DEVICE bool isNearlyEqual(const _Type &a, const _Type &b)
Teste si deux valeurs sont à un peu près égales. Pour les types entiers, cette fonction est équivalen...
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
Infos du bloc '$PhysicalNames'.
Infos sur un nom physique.
Infos d'un bloc pour $Elements pour la version 4.
Int32 index
Index du bloc dans la liste.
bool is_built_as_cells
Indique si les entités du bloc sont des mailles.
Int32 dimension
Dimension de l'entité
ItemTypeId item_type
Type Arcane de l'entité
Int32 item_nb_node
Nombre de noeuds de l'entité.
Int64 nb_entity
Nombre d'entités du bloc.
UniqueArray< Int64 > connectivities
< Liste des uniqueId() du bloc
Infos pour les entités 0D.
Infos pour les entités 1D, 2D et 3D.