20#include <vtkUnstructuredGrid.h>
21#include <vtkUnstructuredGridReader.h>
23#include <vtkCellIterator.h>
24#include <vtkIdTypeArray.h>
25#include <vtkCellData.h>
26#include <vtkPointData.h>
27#include <vtkDataSetAttributes.h>
28#include <vtkArrayDispatch.h>
29#include <vtkDataArrayAccessor.h>
30#include <vtkPolyDataReader.h>
31#include <vtkPolyData.h>
34#include <arccore/base/String.h>
35#include <arccore/base/FatalErrorException.h>
36#include <vtkXMLUnstructuredGridReader.h>
37#include <vtkXMLPolyDataReader.h>
40#include "arcane/core/AbstractService.h"
41#include "arcane/core/ICaseMeshReader.h"
43#include "arcane/core/IMeshBuilder.h"
44#include "arcane/core/MeshBuildInfo.h"
45#include "arcane/core/IPrimaryMesh.h"
47#include "arcane/core/IMeshInitialAllocator.h"
49#include "arcane/utils/ITraceMng.h"
50#include "arcane/utils/UniqueArray.h"
51#include "arcane/utils/Real3.h"
52#include "arcane/mesh/CellFamily.h"
53#include "arcane/core/MeshVariableScalarRef.h"
54#include "arcane/core/MeshVariableArrayRef.h"
56#include "arcane/core/ItemAllocationInfo.h"
57#include "arcane/core/VariableBuildInfo.h"
59#include "arcane/std/VtkPolyhedralMeshIO_axl.h"
67namespace VtkPolyhedralTools
78 bool print_mesh_info =
false;
79 bool print_debug_info =
false;
100 static String supportedVtkExtensions()
noexcept {
return "vtk,vtu";};
147 bool readHasFailed()
const noexcept {
return m_read_status.failure; }
184 void _printMeshInfos()
const;
187 template <
typename Connectivity2DArray>
189 void _readPlainTextVtkGrid(
const String& filename);
190 void _readXlmVtkGrid(
const String& filename);
191 void _checkVtkGrid()
const;
201 VtkReader reader{ filename, m_print_info_level };
202 if (reader.readHasFailed())
203 return reader.readStatus();
208 _readVariablesAndGroups(mesh, reader);
209 return reader.readStatus();
214 UniqueArray<VariableRef*> m_read_variables;
215 VtkPolyhedralTools::PrintInfoLevel m_print_info_level;
217 void _readVariablesAndGroups(IPrimaryMesh* mesh, VtkReader& reader);
218 void _createGroup(vtkDataArray* group_items,
const String& group_name, IPrimaryMesh* mesh, IItemFamily* item_family,
Int32ConstSpan vtkToArcaneLid)
const;
219 void _createVariable(vtkDataArray* item_values,
const String& variable_name, IMesh* mesh, IItemFamily* item_family,
Int32ConstSpan arcane_to_vtk_lids);
221 static void _fillItemAllocationInfo(ItemAllocationInfo& item_allocation_info, VtkReader& vtk_reader);
222 void _computeFaceVtkArcaneLidConversion(
Int32Span face_vtk_to_arcane_lids,
Int32Span arcane_to_vtk_lids, VtkPolyhedralMeshIOService::VtkReader& reader, IPrimaryMesh* mesh)
const;
245 build_info.addFactoryName(
"ArcanePolyhedralMeshFactory");
248 mk.setMeshStructure(eMeshStructure::Polyhedral);
255 m_trace_mng->
info() <<
"---Create Polyhedral mesh: " << pm->name() <<
"---";
256 m_trace_mng->
info() <<
"--Read mesh file " << m_read_info.fileName();
280 if (VtkPolyhedralMeshIOService::VtkReader::supportedVtkExtensions().contains(
read_info.format()))
282 return makeRef(builder);
290 ServiceProperty(
"VtkPolyhedralCaseMeshReader",
ST_CaseOption),
296void VtkPolyhedralMeshIOService::
297_fillItemAllocationInfo(ItemAllocationInfo& item_allocation_info, VtkReader& vtk_reader)
299 auto nb_item_family = 4;
300 auto nb_connected_family = 3;
301 item_allocation_info.family_infos.resize(nb_item_family);
302 for (
auto& family_info : item_allocation_info.family_infos) {
303 family_info.connected_family_info.resize(nb_connected_family);
306 auto& cell_family_info = item_allocation_info.family_infos[0];
307 cell_family_info.name =
"Cell";
308 cell_family_info.item_kind =
IK_Cell;
309 cell_family_info.item_uids = vtk_reader.cellUids();
310 auto& node_family_info = item_allocation_info.family_infos[1];
311 node_family_info.name =
"Node";
312 node_family_info.item_kind =
IK_Node;
313 node_family_info.item_uids = vtk_reader.nodeUids();
314 auto& face_family_info = item_allocation_info.family_infos[2];
315 face_family_info.name =
"Face";
316 face_family_info.item_kind =
IK_Face;
317 face_family_info.item_uids = vtk_reader.faceUids();
318 auto& edge_family_info = item_allocation_info.family_infos[3];
319 edge_family_info.name =
"Edge";
320 edge_family_info.item_kind =
IK_Edge;
321 edge_family_info.item_uids = vtk_reader.edgeUids();
323 auto cell_connected_family_index = 0;
324 auto& cell_connected_node_family_info = cell_family_info.connected_family_info[cell_connected_family_index++];
325 cell_connected_node_family_info.name = node_family_info.name;
326 cell_connected_node_family_info.item_kind = node_family_info.item_kind;
327 cell_connected_node_family_info.connectivity_name =
"CellToNodes";
328 cell_connected_node_family_info.nb_connected_items_per_item = vtk_reader.cellNbNodes();
329 cell_connected_node_family_info.connected_items_uids = vtk_reader.cellNodes();
331 auto& cell_connected_face_family_info = cell_family_info.connected_family_info[cell_connected_family_index++];
332 cell_connected_face_family_info.name = face_family_info.name;
333 cell_connected_face_family_info.item_kind = face_family_info.item_kind;
334 cell_connected_face_family_info.connectivity_name =
"CellToFaces";
335 cell_connected_face_family_info.nb_connected_items_per_item = vtk_reader.cellNbFaces();
336 cell_connected_face_family_info.connected_items_uids = vtk_reader.cellFaces();
338 auto& cell_connected_edge_family_info = cell_family_info.connected_family_info[cell_connected_family_index++];
339 cell_connected_edge_family_info.name = edge_family_info.name;
340 cell_connected_edge_family_info.item_kind = edge_family_info.item_kind;
341 cell_connected_edge_family_info.connectivity_name =
"CellToEdges";
342 cell_connected_edge_family_info.nb_connected_items_per_item = vtk_reader.cellNbEdges();
343 cell_connected_edge_family_info.connected_items_uids = vtk_reader.cellEdges();
345 auto face_connected_family_index = 0;
346 auto& face_connected_cell_family_info = face_family_info.connected_family_info[face_connected_family_index++];
347 face_connected_cell_family_info.name = cell_family_info.name;
348 face_connected_cell_family_info.item_kind = cell_family_info.item_kind;
349 face_connected_cell_family_info.connectivity_name =
"FaceToCells";
350 face_connected_cell_family_info.nb_connected_items_per_item = vtk_reader.faceNbCells();
351 face_connected_cell_family_info.connected_items_uids = vtk_reader.faceCells();
353 auto& face_connected_node_family_info = face_family_info.connected_family_info[face_connected_family_index++];
354 face_connected_node_family_info.name = node_family_info.name;
355 face_connected_node_family_info.item_kind = node_family_info.item_kind;
356 face_connected_node_family_info.connectivity_name =
"FaceToNodes";
357 face_connected_node_family_info.nb_connected_items_per_item = vtk_reader.faceNbNodes();
358 face_connected_node_family_info.connected_items_uids = vtk_reader.faceNodes();
360 auto& face_connected_edge_family_info = face_family_info.connected_family_info[face_connected_family_index];
361 face_connected_edge_family_info.name = edge_family_info.name;
362 face_connected_edge_family_info.item_kind = edge_family_info.item_kind;
363 face_connected_edge_family_info.connectivity_name =
"FaceToEdges";
364 face_connected_edge_family_info.nb_connected_items_per_item = vtk_reader.faceNbEdges();
365 face_connected_edge_family_info.connected_items_uids = vtk_reader.faceEdges();
367 auto edge_connected_family_index = 0;
368 auto& edge_connected_cell_family_info = edge_family_info.connected_family_info[edge_connected_family_index++];
369 edge_connected_cell_family_info.name = cell_family_info.name;
370 edge_connected_cell_family_info.item_kind = cell_family_info.item_kind;
371 edge_connected_cell_family_info.connectivity_name =
"EdgeToCells";
372 edge_connected_cell_family_info.nb_connected_items_per_item = vtk_reader.edgeNbCells();
373 edge_connected_cell_family_info.connected_items_uids = vtk_reader.edgeCells();
375 auto& edge_connected_face_family_info = edge_family_info.connected_family_info[edge_connected_family_index++];
376 edge_connected_face_family_info.name = face_family_info.name;
377 edge_connected_face_family_info.item_kind = face_family_info.item_kind;
378 edge_connected_face_family_info.connectivity_name =
"EdgeToFaces";
379 edge_connected_face_family_info.nb_connected_items_per_item = vtk_reader.edgeNbFaces();
380 edge_connected_face_family_info.connected_items_uids = vtk_reader.edgeFaces();
382 auto& edge_connected_node_family_info = edge_family_info.connected_family_info[edge_connected_family_index++];
383 edge_connected_node_family_info.name = node_family_info.name;
384 edge_connected_node_family_info.item_kind = node_family_info.item_kind;
385 edge_connected_node_family_info.connectivity_name =
"EdgeToNodes";
386 edge_connected_node_family_info.nb_connected_items_per_item = vtk_reader.edgeNbNodes();
387 edge_connected_node_family_info.connected_items_uids = vtk_reader.edgeNodes();
389 auto node_connected_family_index = 0;
390 auto& node_connected_cell_family_info = node_family_info.connected_family_info[node_connected_family_index++];
391 node_connected_cell_family_info.name = cell_family_info.name;
392 node_connected_cell_family_info.item_kind = cell_family_info.item_kind;
393 node_connected_cell_family_info.connectivity_name =
"NodeToCells";
394 node_connected_cell_family_info.nb_connected_items_per_item = vtk_reader.nodeNbCells();
395 node_connected_cell_family_info.connected_items_uids = vtk_reader.nodeCells();
397 auto& node_connected_face_family_info = node_family_info.connected_family_info[node_connected_family_index++];
398 node_connected_face_family_info.name = face_family_info.name;
399 node_connected_face_family_info.item_kind = face_family_info.item_kind;
400 node_connected_face_family_info.connectivity_name =
"NodeToFaces";
401 node_connected_face_family_info.nb_connected_items_per_item = vtk_reader.nodeNbFaces();
402 node_connected_face_family_info.connected_items_uids = vtk_reader.nodeFaces();
404 auto& node_connected_edge_family_info = node_family_info.connected_family_info[node_connected_family_index++];
405 node_connected_edge_family_info.name = edge_family_info.name;
406 node_connected_edge_family_info.item_kind = edge_family_info.item_kind;
407 node_connected_edge_family_info.connectivity_name =
"NodeToEdges";
408 node_connected_edge_family_info.nb_connected_items_per_item = vtk_reader.nodeNbEdges();
409 node_connected_edge_family_info.connected_items_uids = vtk_reader.nodeEdges();
411 node_family_info.item_coordinates_variable_name =
"NodeCoord";
412 node_family_info.item_coordinates = vtk_reader.nodeCoords();
418void VtkPolyhedralMeshIOService::
419_readVariablesAndGroups(IPrimaryMesh* mesh, VtkReader& reader)
422 if (
auto* cell_data = reader.cellData(); cell_data) {
425 std::iota(vtk_to_arcane_lids.begin(), vtk_to_arcane_lids.end(), 0);
427 for (
auto array_index = 0; array_index < cell_data->GetNumberOfArrays(); ++array_index) {
428 auto* cell_array = cell_data->GetArray(array_index);
431 if (String name = cell_array->GetName(); name.substring(0, 6) ==
"GROUP_")
432 _createGroup(cell_array, name.substring(6), mesh, mesh->cellFamily(), vtk_to_arcane_lids.constSpan());
434 _createVariable(cell_array, name, mesh, mesh->cellFamily(), arcane_to_vtk_lids);
435 if (m_print_info_level.print_debug_info) {
437 for (
auto tuple_index = 0; tuple_index < cell_array->GetNumberOfTuples(); ++tuple_index) {
438 for (
auto component_index = 0; component_index < cell_array->GetNumberOfComponents(); ++component_index) {
439 debug(
Trace::High) << cell_array->GetName() <<
"[" << tuple_index <<
"][" << component_index <<
"] = " << cell_array->GetComponent(tuple_index, component_index);
446 if (
auto* point_data = reader.pointData(); point_data) {
449 std::iota(vtk_to_arcane_lids.begin(), vtk_to_arcane_lids.end(), 0);
451 for (
auto array_index = 0; array_index < point_data->GetNumberOfArrays(); ++array_index) {
452 auto* point_array = point_data->GetArray(array_index);
453 if (String name = point_array->GetName(); name.substring(0, 6) ==
"GROUP_")
454 _createGroup(point_array, name.substring(6), mesh, mesh->nodeFamily(), vtk_to_arcane_lids.constSpan());
456 _createVariable(point_array, name, mesh, mesh->nodeFamily(), arcane_to_vtk_lids);
457 if (m_print_info_level.print_debug_info) {
459 for (
auto tuple_index = 0; tuple_index < point_array->GetNumberOfTuples(); ++tuple_index) {
460 for (
auto component_index = 0; component_index < point_array->GetNumberOfComponents(); ++component_index) {
461 debug(
Trace::High) << point_array->GetName() <<
"[" << tuple_index <<
"][" << component_index <<
"] = " << point_array->GetComponent(tuple_index, component_index);
468 if (
auto* face_data = reader.faceData(); face_data) {
472 _computeFaceVtkArcaneLidConversion(vtk_to_Arcane_lids, arcane_to_vtk_lids, reader, mesh);
473 for (
auto array_index = 0; array_index < face_data->GetNumberOfArrays(); ++array_index) {
474 auto* face_array = face_data->GetArray(array_index);
475 if (String name = face_array->GetName(); name.substring(0, 6) ==
"GROUP_")
476 _createGroup(face_array, name.substring(6), mesh, mesh->faceFamily(), vtk_to_Arcane_lids);
478 _createVariable(face_array, name, mesh, mesh->faceFamily(), arcane_to_vtk_lids);
479 if (m_print_info_level.print_debug_info) {
481 for (
auto tuple_index = 0; tuple_index < face_array->GetNumberOfTuples(); ++tuple_index) {
482 for (
auto component_index = 0; component_index < face_array->GetNumberOfComponents(); ++component_index) {
483 debug(
Trace::High) << face_array->GetName() <<
"[" << tuple_index <<
"][" << component_index <<
"] = " << face_array->GetComponent(tuple_index, component_index);
494void VtkPolyhedralMeshIOService::
495_createGroup(vtkDataArray* group_items,
const String& group_name, IPrimaryMesh* mesh, IItemFamily* item_family,
Int32ConstSpan vtkToArcaneLid)
const
500 if (group_items->GetNumberOfComponents() != 1)
501 fatal() << String::format(
"Cannot create item group {0}. Group information in data property must be a scalar", group_name);
502 debug() <<
"Create group " << group_name;
504 arcane_lids.
reserve((
int)group_items->GetNumberOfValues());
505 using GroupDispatcher = vtkArrayDispatch::DispatchByValueType<vtkArrayDispatch::Integrals>;
506 auto group_creator = [&arcane_lids, &vtkToArcaneLid](
auto* array) {
507 vtkIdType numTuples = array->GetNumberOfTuples();
508 vtkDataArrayAccessor<std::remove_pointer_t<
decltype(array)>> array_accessor{ array };
510 for (vtkIdType tupleIdx = 0; tupleIdx < numTuples; ++tupleIdx) {
511 auto value = array_accessor.Get(tupleIdx, 0);
513 arcane_lids.push_back(vtkToArcaneLid[local_id]);
517 if (!GroupDispatcher::Execute(group_items, group_creator))
518 ARCANE_FATAL(
"Cannot create item group {0}. Group information in data property must be an integral type", group_name);
519 debug() <<
" local ids for item group " << group_name <<
" " << arcane_lids;
520 item_family->createGroup(group_name, arcane_lids);
526template <
typename vtkType>
547void VtkPolyhedralMeshIOService::
554 ARCANE_FATAL(
"Cannot create variable {0}, {1} values are given for {2} items in {3} family",
559 using ValueType =
typename std::remove_pointer_t<
decltype(values)>::ValueType;
560 auto* var =
new ItemVariableScalarRefT<to_arcane_type_t<ValueType>>{ vbi, item_family->itemKind() };
561 m_read_variables.add(var);
562 vtkDataArrayAccessor<std::remove_pointer_t<
decltype(values)>> values_accessor{ values };
564 (*var)[item] = (to_arcane_type_t<ValueType>)values_accessor.Get(arcane_to_vtk_lids[item.localId()], 0);
567 auto array_variable_creator = [mesh, variable_name, item_family, arcane_to_vtk_lids,
this](
auto* values) {
568 VariableBuildInfo vbi{ mesh, variable_name };
569 using ValueType =
typename std::remove_pointer_t<
decltype(values)>::ValueType;
570 auto* var =
new ItemVariableArrayRefT<to_arcane_type_t<ValueType>>{ vbi, item_family->itemKind() };
571 m_read_variables.add(var);
572 vtkDataArrayAccessor<std::remove_pointer_t<
decltype(values)>> values_accessor{ values };
573 var->resize(values->GetNumberOfComponents());
576 for (
auto& var_value : (*var)[item]) {
577 var_value = (to_arcane_type_t<ValueType>)values_accessor.Get(arcane_to_vtk_lids[item.localId()], index++);
582 using ValueTypes = vtkTypeList_Create_6(
double,
float,
int,
long,
long long,
short);
583 using ArrayDispatcher = vtkArrayDispatch::DispatchByValueType<ValueTypes>;
585 bool is_variable_created =
false;
586 if (item_values->GetNumberOfComponents() == 1) {
587 is_variable_created = ArrayDispatcher::Execute(item_values, variable_creator);
591 is_variable_created = ArrayDispatcher::Execute(item_values, array_variable_creator);
593 if (!is_variable_created)
594 ARCANE_FATAL(
"Cannot create variable {0}, it's data type is not supported. Only real and integral types are supported", variable_name);
600void VtkPolyhedralMeshIOService::
601_computeFaceVtkArcaneLidConversion(
Int32Span face_vtk_to_arcane_lids,
Int32Span arcane_to_vtk_lids, VtkPolyhedralMeshIOService::VtkReader& reader, IPrimaryMesh* mesh)
const
603 auto face_nodes_unique_ids = reader.faceNodes();
604 auto face_nb_nodes = reader.faceNbNodes();
605 auto current_face_index = 0;
606 auto current_face_index_in_face_nodes = 0;
608 mesh->nodeFamily()->itemsUniqueIdToLocalId(face_nodes_local_ids, face_nodes_unique_ids);
609 for (
auto current_face_nb_node : face_nb_nodes) {
610 auto current_face_nodes = face_nodes_local_ids.subConstView(current_face_index_in_face_nodes, current_face_nb_node);
611 current_face_index_in_face_nodes += current_face_nb_node;
612 Node face_first_node{ mesh->nodeFamily()->view()[current_face_nodes[0]] };
613 face_vtk_to_arcane_lids[current_face_index] = mesh_utils::getFaceFromNodesLocal(face_first_node, current_face_nodes).localId();
614 ++current_face_index;
617 for (
auto arcane_lid : face_vtk_to_arcane_lids) {
618 arcane_to_vtk_lids[arcane_lid] = vtk_lid;
626VtkPolyhedralMeshIOService::VtkReader::
627VtkReader(
const String& filename, VtkPolyhedralTools::PrintInfoLevel print_info_level)
628: m_filename{ filename }
629, m_print_info_level{ print_info_level }
631 if (filename.empty()) {
632 m_read_status.failure =
true;
633 m_read_status.failure_message =
"filename for polyhedral vtk mesh is empty.";
636 if (filename.endsWith(
"vtk"))
637 _readPlainTextVtkGrid(filename);
638 else if (filename.endsWith(
"vtu"))
639 _readXlmVtkGrid(filename);
641 m_read_status.failure =
true;
642 m_read_status.failure_message = String::format(
"Unsupported vtk extension for file {0}. Supported vtk extension for Polyhedral meshes are {1}",
643 filename,VtkReader::supportedVtkExtensions());
647 m_read_status.failure =
true;
648 m_read_status.failure_message = String::format(
"Cannot read vtk polyhedral file {0}. Vtk grid was not created.", filename);
651 if (m_vtk_grid->GetNumberOfCells() == 0) {
652 m_read_status.failure =
true;
653 m_read_status.failure_message = String::format(
"Cannot read vtk polyhedral file {0}. No cells were found.", filename);
656 if (!m_vtk_grid->GetFaces()) {
657 m_read_status.failure =
true;
658 m_read_status.failure_message = String::format(
"The given mesh vtk file {0} is not a polyhedral mesh, cannot read it", filename);
662 m_cell_data = m_vtk_grid->GetCellData();
663 m_point_data = m_vtk_grid->GetPointData();
666 String faces_filename = m_filename +
"faces.vtk";
667 std::ifstream ifile(faces_filename.localstr());
669 _readPlainTextVtkFaceGrid(faces_filename);
672 faces_filename = m_filename +
"faces.vtu";
673 ifile = std::ifstream{ faces_filename.localstr() };
675 _readXmlVtkFaceGrid(faces_filename);
680 faces_filename.split(faces_filename_and_extension,
'.');
683 m_read_status.info_message = String::format(
"Information no face mesh given {0}{1} (.vtk or .vtu) to define face variables or groups on faces.",
684 faces_filename_and_extension[0],
685 faces_filename_and_extension[1]);
688 if (m_vtk_face_grid) {
689 if (m_vtk_face_grid->GetNumberOfCells() == 0) {
690 m_read_status.failure =
true;
691 m_read_status.failure_message = m_read_status.failure_message + String::format(
" Error in reading face information for groups in mesh file {0} ", faces_filename);
694 m_face_data = m_vtk_face_grid->GetCellData();
698 m_read_status.failure =
true;
699 m_read_status.failure_message = m_read_status.failure_message + String::format(
"Face data could not be built from file {0}{1} (.vtk or .vtu).",
700 faces_filename_and_extension[0],
701 faces_filename_and_extension[1]);
705 if (m_print_info_level.print_mesh_info)
715 if (m_cell_uids.
empty()) {
717 m_cell_uids.
reserve(m_vtk_grid->GetNumberOfCells());
718 m_cell_nb_nodes.
reserve(m_vtk_grid->GetNumberOfCells());
719 m_cell_node_uids.
reserve(10 * m_vtk_grid->GetNumberOfCells());
720 auto* cell_iter = m_vtk_grid->NewCellIterator();
721 cell_iter->InitTraversal();
722 while (!cell_iter->IsDoneWithTraversal()) {
723 m_cell_uids.
push_back(cell_iter->GetCellId());
725 ArrayView<vtkIdType> cell_nodes{
Integer(cell_iter->GetNumberOfPoints()), cell_iter->GetPointIds()->GetPointer(0) };
726 std::for_each(cell_nodes.begin(), cell_nodes.end(), [
this](
auto uid) { this->m_cell_node_uids.push_back(uid); });
727 cell_iter->GoToNextCell();
739 if (m_node_uids.empty()) {
741 auto nb_nodes = m_vtk_grid->GetNumberOfPoints();
742 m_node_uids.resize(nb_nodes);
743 m_node_nb_cells.resize(nb_nodes);
744 m_node_cell_uids.reserve(8 * nb_nodes);
745 m_node_uid_to_index.resize(nb_nodes);
746 for (
int node_index = 0; node_index < nb_nodes; ++node_index) {
747 Int64 node_uid = node_index;
748 m_node_uids[node_index] = node_uid;
749 auto cell_nodes = vtkIdList::New();
750 m_vtk_grid->GetPointCells(node_index, cell_nodes);
751 Int64Span cell_nodes_view((
Int64*)cell_nodes->GetPointer(0), cell_nodes->GetNumberOfIds());
752 m_node_cell_uids.addRange(cell_nodes_view);
753 m_node_nb_cells[node_index] = (
Int32)cell_nodes->GetNumberOfIds();
756 m_node_uid_to_index[node_uid] = node_index;
771 if (!m_face_uids.empty())
774 auto* cell_iter = m_vtk_grid->NewCellIterator();
775 cell_iter->InitTraversal();
776 vtkIdType nb_face_estimation = 0;
777 while (!cell_iter->IsDoneWithTraversal()) {
778 vtkIdType cell_nb_faces = 0;
779 vtkIdType* points{
nullptr };
780 m_vtk_grid->GetFaceStream(cell_iter->GetCellId(), cell_nb_faces, points);
781 nb_face_estimation += cell_nb_faces;
782 cell_iter->GoToNextCell();
784 m_face_uids.reserve(nb_face_estimation);
785 auto const* faces = m_vtk_grid->GetFaces();
790 ARCANE_FATAL(
"Mesh {0} is not polyhedral: faces are not defined", m_filename);
793 auto face_info_size = faces->GetNumberOfValues();
794 m_face_node_uids.reserve(face_info_size);
795 m_face_nb_nodes.reserve(nb_face_estimation);
796 m_face_cell_uids.reserve(2 * nb_face_estimation);
797 m_face_nb_cells.reserve(nb_face_estimation);
798 m_cell_face_uids.reserve(8 * m_cell_uids.size());
799 m_cell_nb_faces.resize(m_cell_uids.size(), 0);
800 m_cell_face_indexes.resize(m_cell_uids.size(), -1);
801 m_face_uid_indexes.resize(2 * nb_face_estimation, -1);
803 current_face_nodes.
reserve(10);
804 sorted_current_face_nodes.reserve(10);
805 UniqueArray<UniqueArray<Int64>> node_faces(m_node_uids.size());
806 UniqueArray<Int32> face_offsets;
807 face_offsets.reserve(nb_face_estimation);
808 face_offsets.push_back(0);
809 FaceUidToIndexMap face_uid_to_index;
810 face_uid_to_index.reserve(nb_face_estimation);
812 auto cell_face_index = 0;
813 auto global_face_index = 0;
814 auto face_uid_index = 0;
815 for (
int face_info_index = 0; face_info_index < face_info_size; cell_index++) {
816 auto current_cell_nb_faces =
Int32(faces->GetValue(face_info_index++));
817 m_cell_face_indexes[m_cell_uids[cell_index]] = cell_face_index;
818 for (
auto face_index = 0; face_index < current_cell_nb_faces; ++face_index, ++global_face_index) {
819 auto current_face_nb_nodes =
Int32(faces->GetValue(face_info_index++));
820 m_cell_nb_faces[m_cell_uids[cell_index]] += 1;
821 for (
int node_index = 0; node_index < current_face_nb_nodes; ++node_index) {
822 current_face_nodes.push_back(faces->GetValue(face_info_index++));
824 sorted_current_face_nodes.resize(current_face_nodes.size());
825 auto is_front_cell = mesh_utils::reorderNodesOfFace(current_face_nodes, sorted_current_face_nodes);
826 auto [is_face_found, existing_face_index] = _findFace(sorted_current_face_nodes, node_faces,
827 m_node_uid_to_index, m_face_nb_nodes,
828 face_uid_to_index, face_offsets, m_face_node_uids);
829 if (!is_face_found) {
830 for (
auto node_uid : current_face_nodes) {
831 node_faces[m_node_uid_to_index[node_uid]].push_back(face_uid);
833 m_cell_face_uids.push_back(face_uid);
834 m_face_uids.push_back(face_uid);
835 m_face_nb_nodes.push_back(current_face_nb_nodes);
836 m_face_node_uids.addRange(sorted_current_face_nodes);
837 m_face_nb_cells.push_back(1);
838 m_face_uid_indexes[global_face_index] = face_uid_index;
839 face_uid_to_index.push_back(face_uid_index);
840 auto previous_offset = face_offsets.back();
841 face_offsets.push_back(previous_offset + sorted_current_face_nodes.size());
845 m_face_cell_uids.push_back(NULL_ITEM_UNIQUE_ID);
846 m_face_cell_uids.push_back(m_cell_uids[cell_index]);
849 m_face_cell_uids.push_back(m_cell_uids[cell_index]);
850 m_face_cell_uids.push_back(NULL_ITEM_UNIQUE_ID);
854 m_cell_face_uids.push_back(m_face_uids[existing_face_index]);
855 m_face_nb_cells[existing_face_index] += 1;
856 m_face_uid_indexes[global_face_index] = existing_face_index;
859 if (m_face_cell_uids[2 * existing_face_index + 1] != NULL_ITEM_UNIQUE_ID) {
860 ARCANE_FATAL(
"Problem in face orientation, face uid {0}, nodes {1}, same orientation in cell {2} and {3}. Change mesh file.",
861 m_face_uids[existing_face_index],
863 m_face_cell_uids[2 * existing_face_index + 1],
864 m_cell_uids[cell_index]);
866 m_face_cell_uids[2 * existing_face_index + 1] = m_cell_uids[cell_index];
869 if (m_face_cell_uids[2 * existing_face_index] != NULL_ITEM_UNIQUE_ID) {
870 ARCANE_FATAL(
"Problem in face orientation, face uid {0}, nodes {1}, same orientation in cell {2} and {3}. Change mesh file.",
871 m_face_uids[existing_face_index],
873 m_face_cell_uids[2 * existing_face_index],
874 m_cell_uids[cell_index]);
876 m_face_cell_uids[2 * existing_face_index] = m_cell_uids[cell_index];
879 current_face_nodes.clear();
880 sorted_current_face_nodes.clear();
882 cell_face_index += m_cell_nb_faces[m_cell_uids[cell_index]];
885 m_node_nb_faces.resize(m_node_uids.size(), 0);
886 _flattenConnectivity(node_faces.constSpan(), m_node_nb_faces, m_node_face_uids);
888 if (m_print_info_level.print_debug_info) {
889 std::cout <<
"================FACE NODES ==============" << std::endl;
890 std::copy(m_face_node_uids.begin(), m_face_node_uids.end(), std::ostream_iterator<Int64>(std::cout,
" "));
891 std::cout << std::endl;
892 std::copy(m_face_nb_nodes.begin(), m_face_nb_nodes.end(), std::ostream_iterator<Int64>(std::cout,
" "));
893 std::cout << std::endl;
894 std::copy(m_cell_face_indexes.begin(), m_cell_face_indexes.end(), std::ostream_iterator<Int64>(std::cout,
" "));
895 std::cout << std::endl;
907 if (!m_edge_uids.empty())
913 m_edge_uids.reserve(2 * m_vtk_grid->GetNumberOfPoints());
914 auto const* faces = m_vtk_grid->GetFaces();
919 ARCANE_FATAL(
"Mesh {0} is not polyhedral: faces are not defined", m_filename);
922 auto nb_edge_estimation = 2 * m_edge_uids.capacity();
923 m_edge_node_uids.reserve(nb_edge_estimation);
924 auto face_info_size = faces->GetNumberOfValues();
926 auto global_face_index = 0;
927 auto new_edge_index = 0;
928 UniqueArray<std::set<Int64>> edge_cells;
929 UniqueArray<Int64UniqueArray> edge_faces;
930 edge_cells.reserve(m_edge_uids.capacity());
931 edge_faces.reserve(m_edge_uids.capacity());
932 m_cell_nb_edges.resize(m_cell_uids.size(), 0);
933 m_cell_edge_uids.reserve(20 * m_cell_uids.size());
934 UniqueArray<std::set<Int64>> face_edges;
935 face_edges.resize(m_face_uids.size());
936 UniqueArray<std::set<Int64>> cell_edges;
937 cell_edges.resize(m_cell_uids.size());
938 UniqueArray<Int64UniqueArray> node_edges;
939 node_edges.resize(m_node_uids.size());
940 EdgeUidToIndexMap edge_uid_to_index;
941 edge_uid_to_index.reserve(nb_edge_estimation);
943 edge_offsets.
reserve(nb_edge_estimation);
944 edge_offsets.push_back(0);
945 m_edge_nb_nodes.reserve(nb_edge_estimation);
946 for (
int face_info_index = 0; face_info_index < face_info_size; ++cell_index) {
947 auto current_cell_nb_faces =
Int32(faces->GetValue(face_info_index++));
948 for (
auto face_index = 0; face_index < current_cell_nb_faces; ++face_index, ++global_face_index) {
949 auto current_face_nb_nodes =
Int32(faces->GetValue(face_info_index++));
950 auto first_face_node_uid =
Int32(faces->GetValue(face_info_index));
951 UniqueArray<Int64> current_edge(2), sorted_edge(2);
952 for (
int node_index = 0; node_index < current_face_nb_nodes - 1; ++node_index) {
953 current_edge = UniqueArray<Int64>{ faces->GetValue(face_info_index++), faces->GetValue(face_info_index) };
954 mesh_utils::reorderNodesOfFace(current_edge, sorted_edge);
955 auto [is_edge_found, existing_edge_index] = _findFace(sorted_edge, node_edges,
958 edge_uid_to_index, edge_offsets, m_edge_node_uids);
959 if (!is_edge_found) {
960 m_cell_nb_edges[cell_index] += 1;
961 face_edges[m_face_uid_indexes[global_face_index]].insert(edge_uid);
962 cell_edges[cell_index].insert(edge_uid);
963 for (
auto node : current_edge) {
964 node_edges[node].push_back(edge_uid);
966 edge_cells.push_back(std::set{ m_cell_uids[cell_index] });
967 edge_faces.push_back(
Int64UniqueArray{ m_cell_face_uids[m_cell_face_indexes[cell_index] + face_index] });
968 m_edge_uids.push_back(edge_uid++);
969 m_edge_node_uids.addRange(sorted_edge);
970 edge_uid_to_index.push_back(new_edge_index);
971 auto current_offset = edge_offsets.back();
972 edge_offsets.push_back(current_offset + 2);
973 m_edge_nb_nodes.push_back(2);
977 edge_cells[existing_edge_index].insert(m_cell_uids[cell_index]);
978 edge_faces[existing_edge_index].push_back(m_cell_face_uids[m_cell_face_indexes[cell_index] + face_index]);
979 face_edges[m_face_uid_indexes[global_face_index]].insert(m_edge_uids[existing_edge_index]);
980 cell_edges[cell_index].insert(m_edge_uids[existing_edge_index]);
983 current_edge = UniqueArray<Int64>{ faces->GetValue(face_info_index++), first_face_node_uid };
984 mesh_utils::reorderNodesOfFace(current_edge, sorted_edge);
985 auto [is_edge_found, existing_edge_index] = _findFace(sorted_edge, node_edges,
988 edge_uid_to_index, edge_offsets, m_edge_node_uids);
989 if (!is_edge_found) {
990 m_cell_nb_edges[cell_index] += 1;
991 edge_cells.push_back(std::set{ m_cell_uids[cell_index] });
992 edge_faces.push_back(
Int64UniqueArray{ m_cell_face_uids[m_cell_face_indexes[cell_index] + face_index] });
993 face_edges[m_face_uid_indexes[global_face_index]].insert(edge_uid);
994 cell_edges[cell_index].insert(edge_uid);
995 for (
auto node : current_edge) {
996 node_edges[node].push_back(edge_uid);
998 m_edge_uids.push_back(edge_uid++);
999 m_edge_node_uids.addRange(sorted_edge);
1000 edge_uid_to_index.push_back(new_edge_index);
1001 auto current_offset = edge_offsets.back();
1002 edge_offsets.push_back(current_offset + 2);
1003 m_edge_nb_nodes.push_back(2);
1007 edge_cells[existing_edge_index].insert(m_cell_uids[cell_index]);
1008 edge_faces[existing_edge_index].push_back(m_cell_face_uids[m_cell_face_indexes[cell_index] + face_index]);
1009 face_edges[m_face_uid_indexes[global_face_index]].insert(m_edge_uids[existing_edge_index]);
1010 cell_edges[cell_index].insert(m_edge_uids[existing_edge_index]);
1015 m_edge_nb_cells.resize(m_edge_uids.size(), 0);
1016 _flattenConnectivity(edge_cells.constSpan(), m_edge_nb_cells, m_edge_cell_uids);
1019 m_edge_nb_faces.resize(m_edge_uids.size(), 0);
1020 _flattenConnectivity(edge_faces.constSpan(), m_edge_nb_faces, m_edge_face_uids);
1023 m_face_nb_edges.resize(m_face_uids.size(), 0);
1024 _flattenConnectivity(face_edges.constSpan(), m_face_nb_edges, m_face_edge_uids);
1027 m_cell_nb_edges.resize(m_cell_uids.size(), 0);
1028 _flattenConnectivity(cell_edges, m_cell_nb_edges, m_cell_edge_uids);
1031 m_node_nb_edges.resize(m_node_uids.size(), 0);
1032 _flattenConnectivity(node_edges, m_node_nb_edges, m_node_edge_uids);
1034 if (m_print_info_level.print_debug_info) {
1035 std::cout <<
"================EDGE NODES ==============" << std::endl;
1036 std::copy(m_edge_node_uids.begin(), m_edge_node_uids.end(), std::ostream_iterator<Int64>(std::cout,
" "));
1037 std::cout << std::endl;
1038 std::cout <<
"================FACE EDGES ==============" << std::endl;
1039 std::copy(m_face_nb_edges.begin(), m_face_nb_edges.end(), std::ostream_iterator<Int32>(std::cout,
" "));
1040 std::cout << std::endl;
1041 std::copy(m_face_edge_uids.begin(), m_face_edge_uids.end(), std::ostream_iterator<Int64>(std::cout,
" "));
1042 std::cout << std::endl;
1043 std::cout <<
"================CELL EDGES ==============" << std::endl;
1044 std::copy(m_cell_nb_edges.begin(), m_cell_nb_edges.end(), std::ostream_iterator<Int32>(std::cout,
" "));
1045 std::cout << std::endl;
1046 std::copy(m_cell_edge_uids.begin(), m_cell_edge_uids.end(), std::ostream_iterator<Int64>(std::cout,
" "));
1047 std::cout << std::endl;
1055std::pair<bool, Int32> VtkPolyhedralMeshIOService::VtkReader::
1057 const UniqueArray<Int64UniqueArray>& node_face_uids,
1058 const NodeUidToIndexMap& node_uid_to_index,
1060 const FaceUidToIndexMap& face_uid_to_index,
1061 const UniqueArray<Int32>& face_offsets,
1064 auto first_node_uid = sorted_face_nodes[0];
1065 auto first_node_index = node_uid_to_index[first_node_uid];
1067 for (
auto face_uid : node_face_uids[first_node_index]) {
1068 auto face_index = face_uid_to_index[face_uid];
1069 auto face_offset = face_offsets[face_index];
1070 auto face_nb_node = face_nb_nodes[face_index];
1071 if (face_nb_node == sorted_face_nodes.size()) {
1072 bool is_same_face =
true;
1073 for (
auto index = 0; index < face_nb_node; ++index) {
1074 if (sorted_face_nodes[index] != face_node_uids[face_offset + index]) {
1075 is_same_face =
false;
1079 return {
true, face_index };
1082 return {
false, -1 };
1088Integer VtkPolyhedralMeshIOService::VtkReader::
1091 if (m_node_uids.empty())
1093 return m_node_uids.size();
1102 if (m_cell_node_uids.empty())
1104 return m_cell_node_uids;
1113 if (m_cell_nb_nodes.empty())
1115 return m_cell_nb_nodes;
1124 if (m_face_node_uids.empty())
1126 return m_face_node_uids;
1135 if (m_face_nb_nodes.empty())
1137 return m_face_nb_nodes;
1146 if (m_edge_node_uids.empty())
1148 return m_edge_nb_nodes;
1157 if (m_edge_node_uids.empty())
1159 return m_edge_node_uids;
1168 if (m_face_cell_uids.empty())
1171 if (m_print_info_level.print_debug_info) {
1172 std::cout <<
"=================FACE CELLS================="
1174 std::copy(m_face_cell_uids.begin(), m_face_cell_uids.end(), std::ostream_iterator<Int64>(std::cout,
" "));
1176 std::cout <<
"=================END FACE CELLS================="
1179 return m_face_cell_uids;
1188 if (m_face_nb_cells.empty())
1190 return m_face_nb_cells;
1199 if (m_edge_nb_cells.empty())
1201 return m_edge_nb_cells;
1210 if (m_edge_cell_uids.empty())
1212 return m_edge_cell_uids;
1221 if (m_cell_nb_faces.empty())
1223 return m_cell_nb_faces;
1232 if (m_cell_face_uids.empty())
1234 return m_cell_face_uids;
1243 if (m_edge_nb_faces.empty())
1245 return m_edge_nb_faces;
1254 if (m_edge_face_uids.empty())
1256 return m_edge_face_uids;
1265 if (m_cell_nb_edges.empty())
1267 return m_cell_nb_edges;
1276 if (m_cell_edge_uids.empty())
1278 return m_cell_edge_uids;
1287 if (m_face_nb_edges.empty())
1289 return m_face_nb_edges;
1298 if (m_face_edge_uids.empty())
1300 return m_face_edge_uids;
1306template <
typename Connectivity2DArray>
1307void VtkPolyhedralMeshIOService::VtkReader::
1308_flattenConnectivity(Connectivity2DArray connected_item_2darray,
1309 Int32Span nb_connected_item_per_source_item,
1313 std::transform(connected_item_2darray.begin(), connected_item_2darray.end(), nb_connected_item_per_source_item.begin(), [](
auto const& connected_items) {
1314 return connected_items.size();
1317 connected_item_array.reserve(std::accumulate(nb_connected_item_per_source_item.begin(), nb_connected_item_per_source_item.end(), 0));
1318 std::for_each(connected_item_2darray.begin(), connected_item_2darray.end(), [&connected_item_array](
auto const& connected_items) {
1319 for (auto const& connected_item : connected_items) {
1320 connected_item_array.push_back(connected_item);
1331 if (m_node_nb_cells.
empty())
1333 return m_node_nb_cells;
1342 if (m_node_cell_uids.empty())
1344 return m_node_cell_uids;
1353 if (m_node_nb_faces.empty())
1355 return m_node_nb_faces;
1364 if (m_node_face_uids.empty())
1366 return m_node_face_uids;
1375 if (m_node_nb_edges.empty())
1377 return m_node_nb_edges;
1386 if (m_node_edge_uids.empty())
1388 return m_node_edge_uids;
1397 if (m_node_coordinates.empty()) {
1399 auto point_coords = m_vtk_grid->GetPoints()->GetData();
1400 if (m_print_info_level.print_debug_info) {
1401 std::cout <<
"======= Point COORDS ====" << std::endl;
1402 std::ostringstream oss;
1403 point_coords->PrintSelf(oss, vtkIndent{ 2 });
1404 std::cout << oss.str() << std::endl;
1406 auto nb_nodes = m_vtk_grid->GetNumberOfPoints();
1407 for (
int i = 0; i < nb_nodes; ++i) {
1408 if (m_print_info_level.print_debug_info) {
1409 std::cout <<
"==========current point coordinates : ( ";
1410 std::cout << *(point_coords->GetTuple(i)) <<
" , ";
1411 std::cout << *(point_coords->GetTuple(i) + 1) <<
" , ";
1412 std::cout << *(point_coords->GetTuple(i) + 2) <<
" ) ===" << std::endl;
1414 m_node_coordinates.add({ *(point_coords->GetTuple(i)),
1415 *(point_coords->GetTuple(i) + 1),
1416 *(point_coords->GetTuple(i) + 2) });
1419 return m_node_coordinates;
1425vtkCellData* VtkPolyhedralMeshIOService::VtkReader::
1434vtkPointData* VtkPolyhedralMeshIOService::VtkReader::
1437 return m_point_data;
1443void VtkPolyhedralMeshIOService::VtkReader::
1444_printMeshInfos()
const
1447 std::cout <<
"-- VTK GRID READ "
1448 <<
" NB CELLS " << m_vtk_grid->GetNumberOfCells() << std::endl;
1450 auto* cell_iter = m_vtk_grid->vtkDataSet::NewCellIterator();
1451 cell_iter->InitTraversal();
1452 vtkIdType* cell_faces{
nullptr };
1453 vtkIdType nb_faces = 0;
1454 while (!cell_iter->IsDoneWithTraversal()) {
1455 std::cout <<
"---- visiting cell id " << cell_iter->GetCellId() << std::endl;
1456 std::cout <<
"---- cell number of faces " << cell_iter->GetNumberOfFaces() << std::endl;
1457 std::cout <<
"---- cell number of points " << cell_iter->GetNumberOfPoints() << std::endl;
1458 m_vtk_grid->GetFaceStream(cell_iter->GetCellId(), nb_faces, cell_faces);
1459 for (
auto iface = 0; iface < nb_faces; ++iface) {
1460 auto face_nb_nodes = *cell_faces++;
1461 std::cout <<
"---- has face with " << face_nb_nodes <<
" nodes. Node ids : ";
1462 for (
int inode = 0; inode < face_nb_nodes; ++inode) {
1463 std::cout << *cell_faces++ <<
" ";
1465 std::cout << std::endl;
1467 cell_iter->GoToNextCell();
1474vtkCellData* VtkPolyhedralMeshIOService::VtkReader::faceData()
1484void VtkPolyhedralMeshIOService::VtkReader::
1485_readPlainTextVtkGrid(
const String& filename)
1487 m_vtk_grid_reader->SetFileName(filename.localstr());
1488 m_vtk_grid_reader->ReadAllScalarsOn();
1489 m_vtk_grid_reader->Update();
1490 m_vtk_grid = m_vtk_grid_reader->GetOutput();
1496void VtkPolyhedralMeshIOService::VtkReader::
1497_readXlmVtkGrid(
const String& filename)
1499 m_vtk_xml_grid_reader->SetFileName(filename.localstr());
1500 m_vtk_xml_grid_reader->Update();
1501 m_vtk_grid = m_vtk_xml_grid_reader->GetOutput();
1507void VtkPolyhedralMeshIOService::VtkReader::
1508_readPlainTextVtkFaceGrid(
const String& faces_filename)
1510 m_vtk_face_grid_reader->SetFileName(faces_filename.localstr());
1511 m_vtk_face_grid_reader->ReadAllScalarsOn();
1512 m_vtk_face_grid_reader->Update();
1513 m_vtk_face_grid = m_vtk_face_grid_reader->GetOutput();
1519void VtkPolyhedralMeshIOService::VtkReader::
1520_readXmlVtkFaceGrid(
const String& faces_filename)
1522 m_vtk_xml_face_grid_reader->SetFileName(faces_filename.localstr());
1523 m_vtk_xml_face_grid_reader->Update();
1524 m_vtk_face_grid = m_vtk_xml_face_grid_reader->GetOutput();
1530void VtkPolyhedralMeshIOService::VtkReader::
1531_checkVtkGrid()
const
1534 ARCANE_FATAL(
"Polyhedral vtk grid not loaded. Cannot continue.");
Fichier de configuration d'Arcane.
#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_FATAL(...)
Macro envoyant une exception FatalErrorException.
Déclarations des types généraux de Arcane.
Fonctions utilitaires sur le maillage.
Ce fichier contient les différentes fabriques de services et macro pour enregistrer les services.
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro pour déclarer une interface lors de l'enregistrement d'un service.
Gestion des références à une classe C++.
Generation de la classe de base du Service.
CaseOptionsVtkPolyhedralMeshIO * options() const
Options du jeu de données du service.
Informations nécessaires pour la lecture d'un fichier de maillage.
Interface d'une famille d'entités.
Interface d'un service de création/lecture du maillage.
virtual IMeshInitialAllocator * initialAllocator()
Allocateur initial spécifique.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Paramètres nécessaires à la construction d'un maillage.
Caractéristiques d'un maillage.
Structure contenant les informations pour créer un service.
Paramètres nécessaires à la construction d'une variable.
void fillMeshBuildInfo(MeshBuildInfo &build_info) override
Remplit build_info avec les informations nécessaires pour créer le maillage.
void allocateMeshItems(IPrimaryMesh *pm) override
Alloue les entités du maillage géré par ce service.
Ref< IMeshBuilder > createBuilder(const CaseMeshReaderReadInfo &read_info) const override
Retourne un builder pour créer et lire le maillage dont les informations sont spécifiées dans read_in...
bool empty() const
Capacité (nombre d'éléments alloués) du vecteur.
Vue modifiable d'un tableau d'un type T.
void reserve(Int64 new_capacity)
Réserve le mémoire pour new_capacity éléments.
void push_back(ConstReferenceType val)
Ajoute l'élément val à la fin du tableau.
Vue constante d'un tableau de type T.
Interface du gestionnaire de traces.
virtual TraceMessage info()=0
Flot pour un message d'information.
Vue d'un tableau d'éléments de type T.
Chaîne de caractères unicode.
Classe d'accès aux traces.
ITraceMng * traceMng() const
Gestionnaire de trace.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flot pour un message de debug.
TraceMessage fatal() const
Flot pour un message d'erreur fatale.
Vecteur 1D de données avec sémantique par valeur (style STL).
#define ARCANE_REGISTER_SERVICE(aclass, a_service_property,...)
Macro pour enregistrer un service.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Span< Int32 > Int32Span
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
Span< Int64 > Int64Span
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
UniqueArray< Int64 > Int64UniqueArray
Tableau dynamique à une dimension d'entiers 64 bits.
ArrayView< Real3 > Real3ArrayView
Equivalent C d'un tableau à une dimension de Real3.
ConstArrayView< Int32 > Int32ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 32 bits.
@ ST_CaseOption
Le service s'utilise au niveau du jeu de données.
SharedArray< Int32 > Int32SharedArray
Tableau dynamique à une dimension d'entiers 32 bits.
UniqueArray< Int32 > Int32UniqueArray
Tableau dynamique à une dimension d'entiers 32 bits.
@ IK_Node
Entité de maillage de genre noeud.
@ IK_Cell
Entité de maillage de genre maille.
@ IK_Face
Entité de maillage de genre face.
@ IK_Edge
Entité de maillage de genre arête.
UniqueArray< String > StringUniqueArray
Tableau dynamique à une dimension de chaînes de caractères.
Span< const Int32 > Int32ConstSpan
Vue en lecture seule d'un tableau à une dimension d'entiers 32 bits.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
Int32 Integer
Type représentant un entier.