86 std::size_t
size()
const {
return 14; }
101 std::string
const& mesh_name,
102 std::vector<MeshLib::Node*>
const& mesh_nodes,
103 std::vector<unsigned long>
const& glb_node_ids,
104 std::vector<MeshLib::Element*>
const& mesh_elems,
128 template <
typename DATA>
130 MPI_Datatype type, DATA& data)
const;
165 std::vector<std::optional<MeshLib::IO::PropertyVectorMetaData>>
const&
172 template <
typename T>
185 is.seekg(global_offset +
188 if (!is.read(
reinterpret_cast<char*
>(pv->
data()),
189 pv->
size() *
sizeof(T)))
191 "Error in NodePartitionedMeshReader::readProperties: "
192 "Could not read part {:d} of the PropertyVector.",
198 template <
typename T>
207 std::size_t
const property_vector_size =
209 pv->
resize(property_vector_size);
213 is.seekg(global_offset + property_vector_size *
sizeof(T) *
mpi_.rank);
216 if (!is.read(
reinterpret_cast<char*
>(pv->
data()),
217 pv->
size() *
sizeof(T)))
220 "Error in NodePartitionedMeshReader::readProperties: "
221 "Could not read part {:d} of the PropertyVector.",
233 void setNodes(
const std::vector<NodeData>& node_data,
234 std::vector<MeshLib::Node*>& mesh_node,
235 std::vector<unsigned long>& glb_node_ids)
const;
245 void setElements(
const std::vector<MeshLib::Node*>& mesh_nodes,
246 const std::vector<unsigned long>& elem_data,
247 std::vector<MeshLib::Element*>& mesh_elems,
248 const bool ghost =
false)
const;
void createPropertyVectorPart(std::istream &is, MeshLib::IO::PropertyVectorMetaData const &pvmd, MeshLib::IO::PropertyVectorPartitionMetaData const &pvpmd, MeshLib::MeshItemType t, unsigned long global_offset, MeshLib::Properties &p) const
void setElements(const std::vector< MeshLib::Node * > &mesh_nodes, const std::vector< unsigned long > &elem_data, std::vector< MeshLib::Element * > &mesh_elems, const bool ghost=false) const
Set mesh elements from a temporary array containing node data read from file.
bool readDataFromFile(std::string const &filename, MPI_Offset offset, MPI_Datatype type, DATA &data) const
MeshLib::NodePartitionedMesh * readMesh(const std::string &file_name_base)
Create a NodePartitionedMesh object, read binary mesh data in the manner of parallel,...
MeshLib::NodePartitionedMesh * read(const std::string &file_name_base)
Create a NodePartitionedMesh object, read data to it, and return a pointer to it. Data files are in b...
void setNodes(const std::vector< NodeData > &node_data, std::vector< MeshLib::Node * > &mesh_node, std::vector< unsigned long > &glb_node_ids) const
Set mesh nodes from a temporary array containing node data read from file.
NodePartitionedMeshReader(MPI_Comm comm)
void createSpecificPropertyVectorPart(std::istream &is, MeshLib::IO::PropertyVectorMetaData const &pvmd, MeshLib::MeshItemType t, unsigned long global_offset, MeshLib::Properties &p) const
MPI_Datatype _mpi_node_type
MPI data type for struct NodeData.
void registerNodeDataMpiType()
Define MPI data type for NodeData struct.
~NodePartitionedMeshReader()
struct MeshLib::IO::NodePartitionedMeshReader::PartitionedMeshInfo _mesh_info
MeshLib::Properties readProperties(const std::string &file_name_base) const
MeshLib::NodePartitionedMesh * newMesh(std::string const &mesh_name, std::vector< MeshLib::Node * > const &mesh_nodes, std::vector< unsigned long > const &glb_node_ids, std::vector< MeshLib::Element * > const &mesh_elems, MeshLib::Properties const &properties) const
Create a new mesh of NodePartitionedMesh after reading and processing the data.
BaseLib::MPI::Mpi mpi_
Pointer to MPI communicator, the rank and the size.
void readDomainSpecificPartOfPropertyVectors(std::vector< std::optional< MeshLib::IO::PropertyVectorMetaData > > const &vec_pvmd, MeshLib::IO::PropertyVectorPartitionMetaData const &pvpmd, MeshLib::MeshItemType t, std::istream &is, MeshLib::Properties &p) const
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties....
PropertyVector< T > * createNewPropertyVector(std::string_view name, MeshItemType mesh_item_type, std::size_t n_components=1)
constexpr void resize(std::size_t const size)
constexpr std::size_t size() const
constexpr const PROP_VAL_TYPE * data() const
A collection of integers that configure the partitioned mesh data.
unsigned long number_of_regular_base_nodes
unsigned long number_of_regular_nodes
unsigned long number_of_ghost_elements
unsigned long number_of_base_nodes
unsigned long number_of_global_base_nodes
unsigned long extra_flag
13: Reserved for extra flag.
unsigned long number_of_regular_elements
unsigned long number_of_nodes
0: Number of all nodes of a partition,
unsigned long number_of_global_nodes
7: Number of all nodes of global mesh,