diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp index d16baf46488b747bcca5de310d66bb27aaedcbc0..211f7fc5e7a65c1a17fa4e201fc89a40a567f266 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp @@ -163,7 +163,7 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::readMesh( //---------------------------------------------------------------------------------- // Read Nodes - std::vector<NodeData> nodes(_mesh_info.nodes); + std::vector<NodeData> nodes(_mesh_info.number_of_nodes); if (!readDataFromFile(fname_header + "nod" + fname_num_p_ext, static_cast<MPI_Offset>(_mesh_info.offset[2]), @@ -176,21 +176,22 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::readMesh( //---------------------------------------------------------------------------------- // Read non-ghost elements - std::vector<unsigned long> elem_data(_mesh_info.regular_elements + + std::vector<unsigned long> elem_data(_mesh_info.number_of_regular_elements + _mesh_info.offset[0]); if (!readDataFromFile(fname_header + "ele" + fname_num_p_ext, static_cast<MPI_Offset>(_mesh_info.offset[3]), MPI_LONG, elem_data)) return nullptr; - std::vector<MeshLib::Element*> mesh_elems(_mesh_info.regular_elements + - _mesh_info.ghost_elements); + std::vector<MeshLib::Element*> mesh_elems( + _mesh_info.number_of_regular_elements + + _mesh_info.number_of_ghost_elements); setElements(mesh_nodes, elem_data, mesh_elems); //---------------------------------------------------------------------------------- // Read ghost element - std::vector<unsigned long> ghost_elem_data(_mesh_info.ghost_elements + - _mesh_info.offset[1]); + std::vector<unsigned long> ghost_elem_data( + _mesh_info.number_of_ghost_elements + _mesh_info.offset[1]); if (!readDataFromFile(fname_header + "ele_g" + fname_num_p_ext, static_cast<MPI_Offset>(_mesh_info.offset[4]), @@ -410,7 +411,7 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::newMesh( { std::vector<std::size_t> gathered_n_regular_base_nodes(_mpi_comm_size); - MPI_Allgather(&_mesh_info.regular_base_nodes, + MPI_Allgather(&_mesh_info.number_of_regular_base_nodes, 1, MPI_UNSIGNED_LONG, gathered_n_regular_base_nodes.data(), @@ -427,7 +428,8 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::newMesh( std::vector<std::size_t> gathered_n_regular_high_order_nodes( _mpi_comm_size); std::size_t const n_regular_high_order_nodes = - _mesh_info.regular_nodes - _mesh_info.regular_base_nodes; + _mesh_info.number_of_regular_nodes - + _mesh_info.number_of_regular_base_nodes; MPI_Allgather(&n_regular_high_order_nodes, 1, MPI_UNSIGNED_LONG, @@ -444,8 +446,9 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::newMesh( return new MeshLib::NodePartitionedMesh( mesh_name, mesh_nodes, glb_node_ids, mesh_elems, properties, - _mesh_info.global_base_nodes, _mesh_info.global_nodes, - _mesh_info.regular_nodes, std::move(n_regular_base_nodes_at_rank), + _mesh_info.number_of_global_base_nodes, + _mesh_info.number_of_global_nodes, _mesh_info.number_of_regular_nodes, + std::move(n_regular_base_nodes_at_rank), std::move(n_regular_high_order_nodes_at_rank)); } @@ -454,8 +457,8 @@ void NodePartitionedMeshReader::setNodes( std::vector<MeshLib::Node*>& mesh_node, std::vector<unsigned long>& glb_node_ids) const { - mesh_node.resize(_mesh_info.nodes); - glb_node_ids.resize(_mesh_info.nodes); + mesh_node.resize(_mesh_info.number_of_nodes); + glb_node_ids.resize(_mesh_info.number_of_nodes); for (std::size_t i = 0; i < mesh_node.size(); i++) { @@ -471,10 +474,10 @@ void NodePartitionedMeshReader::setElements( std::vector<MeshLib::Element*>& mesh_elems, const bool ghost) const { // Number of elements, either ghost or regular - unsigned long const ne = - ghost ? _mesh_info.ghost_elements : _mesh_info.regular_elements; + unsigned long const ne = ghost ? _mesh_info.number_of_ghost_elements + : _mesh_info.number_of_regular_elements; unsigned long const id_offset_ghost = - ghost ? _mesh_info.regular_elements : 0; + ghost ? _mesh_info.number_of_regular_elements : 0; for (unsigned long i = 0; i < ne; i++) { diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h index ae8287e74cecdfff43224f0218a97885187bd536..8e8f673ab40f16dee1d3c833aaaac062d33b9e64 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.h @@ -71,27 +71,34 @@ private: /// A collection of integers that configure the partitioned mesh data. struct PartitionedMeshInfo { - unsigned long nodes; ///< 0: Number of all nodes of a partition, - unsigned long base_nodes; ///< 1: Number of nodes for linear - /// elements of a partition, - unsigned long regular_elements; ///< 2: Number of non-ghost elements - /// of a partition, - unsigned long ghost_elements; ///< 3: Number of ghost element of - /// a partition, - unsigned long regular_base_nodes; ///< 4: Number of regular nodes for + unsigned long + number_of_nodes; ///< 0: Number of all nodes of a partition, + unsigned long number_of_base_nodes; ///< 1: Number of nodes for linear + /// elements of a partition, + unsigned long + number_of_regular_elements; ///< 2: Number of non-ghost elements + /// of a partition, + unsigned long + number_of_ghost_elements; ///< 3: Number of ghost element of + /// a partition, + unsigned long + number_of_regular_base_nodes; ///< 4: Number of regular nodes for /// linear element of a partition, - unsigned long regular_nodes; ///< 5: Number of all regular nodes a - /// partition, - unsigned long global_base_nodes; ///< 6: unused, previously number of + unsigned long + number_of_regular_nodes; ///< 5: Number of all regular nodes a + /// partition, + unsigned long + number_of_global_base_nodes; ///< 6: unused, previously number of /// nodes for linear element of global /// mesh, - unsigned long global_nodes; ///< 7: Number of all nodes of global mesh, + unsigned long + number_of_global_nodes; ///< 7: Number of all nodes of global mesh, unsigned long offset[5]; ///< 8~12: Offsets of positions of partitions /// in the data arrays. unsigned long extra_flag; ///< 13: Reserved for extra flag. std::size_t size() const { return 14; } - unsigned long* data() { return &nodes; } + unsigned long* data() { return &number_of_nodes; } } _mesh_info; /*!