OGS
ApplicationUtils::Partition Struct Reference

Detailed Description

A subdomain mesh.

Definition at line 30 of file NodeWiseMeshPartitioner.h.

#include <NodeWiseMeshPartitioner.h>

Public Member Functions

std::size_t numberOfMeshItems (MeshLib::MeshItemType const item_type) const
 
std::ostream & writeNodes (std::ostream &os, std::vector< std::size_t > const &global_node_ids) const
 
std::ostream & writeConfig (std::ostream &os) const
 

Public Attributes

std::vector< MeshLib::Node const * > nodes
 nodes.
 
std::size_t number_of_regular_base_nodes
 
std::size_t number_of_regular_nodes
 
std::size_t number_of_base_nodes
 
std::size_t number_of_mesh_base_nodes
 
std::size_t number_of_mesh_all_nodes
 
std::vector< const MeshLib::Element * > regular_elements
 Non ghost elements.
 
std::vector< const MeshLib::Element * > ghost_elements
 
std::vector< bool > duplicate_ghost_cell
 
std::size_t number_of_integration_points = 0
 

Member Function Documentation

◆ numberOfMeshItems()

std::size_t ApplicationUtils::Partition::numberOfMeshItems ( MeshLib::MeshItemType const item_type) const

Definition at line 36 of file NodeWiseMeshPartitioner.cpp.

38{
39 if (item_type == MeshLib::MeshItemType::Node)
40 {
41 return nodes.size();
42 }
43
44 if (item_type == MeshLib::MeshItemType::Cell)
45 {
46 return regular_elements.size() + ghost_elements.size();
47 }
48
50 {
52 }
53 OGS_FATAL("Mesh items other than nodes and cells are not supported.");
54}
#define OGS_FATAL(...)
Definition Error.h:26
std::vector< const MeshLib::Element * > regular_elements
Non ghost elements.
std::vector< const MeshLib::Element * > ghost_elements
std::vector< MeshLib::Node const * > nodes
nodes.

References MeshLib::Cell, ghost_elements, MeshLib::IntegrationPoint, MeshLib::Node, nodes, number_of_integration_points, OGS_FATAL, and regular_elements.

◆ writeConfig()

std::ostream & ApplicationUtils::Partition::writeConfig ( std::ostream & os) const

Definition at line 85 of file NodeWiseMeshPartitioner.cpp.

86{
87 long const data[] = {
88 static_cast<long>(nodes.size()),
89 static_cast<long>(number_of_base_nodes),
90 static_cast<long>(regular_elements.size()),
91 static_cast<long>(ghost_elements.size()),
92 static_cast<long>(number_of_regular_base_nodes),
93 static_cast<long>(number_of_regular_nodes),
94 static_cast<long>(number_of_mesh_base_nodes),
95 static_cast<long>(number_of_mesh_all_nodes),
96 static_cast<long>(
98 static_cast<long>(
100 };
101
102 return os.write(reinterpret_cast<const char*>(data), sizeof(data));
103}
NodeWiseMeshPartitioner::IntegerType getNumberOfIntegerVariablesOfElements(std::vector< const MeshLib::Element * > const &elements)

References ApplicationUtils::getNumberOfIntegerVariablesOfElements(), ghost_elements, nodes, number_of_base_nodes, number_of_mesh_all_nodes, number_of_mesh_base_nodes, number_of_regular_base_nodes, number_of_regular_nodes, and regular_elements.

◆ writeNodes()

std::ostream & ApplicationUtils::Partition::writeNodes ( std::ostream & os,
std::vector< std::size_t > const & global_node_ids ) const

Definition at line 56 of file NodeWiseMeshPartitioner.cpp.

58{
59 std::vector<MeshLib::IO::NodeData> nodes_buffer;
60 nodes_buffer.reserve(nodes.size());
61
62 for (const auto* node : nodes)
63 {
64 double const* coords = node->data();
65 nodes_buffer.emplace_back(global_node_ids[node->getID()], coords[0],
66 coords[1], coords[2]);
67 }
68 return os.write(reinterpret_cast<const char*>(nodes_buffer.data()),
69 sizeof(MeshLib::IO::NodeData) * nodes_buffer.size());
70}
constexpr ranges::views::view_closure coords
Definition Mesh.h:232
struct NodeData used for parallel reading and also partitioning
Definition NodeData.h:18

References nodes.

Member Data Documentation

◆ duplicate_ghost_cell

std::vector<bool> ApplicationUtils::Partition::duplicate_ghost_cell

Definition at line 41 of file NodeWiseMeshPartitioner.h.

◆ ghost_elements

std::vector<const MeshLib::Element*> ApplicationUtils::Partition::ghost_elements

◆ nodes

◆ number_of_base_nodes

std::size_t ApplicationUtils::Partition::number_of_base_nodes

Definition at line 35 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ number_of_integration_points

std::size_t ApplicationUtils::Partition::number_of_integration_points = 0

Definition at line 43 of file NodeWiseMeshPartitioner.h.

Referenced by numberOfMeshItems().

◆ number_of_mesh_all_nodes

std::size_t ApplicationUtils::Partition::number_of_mesh_all_nodes

Definition at line 37 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ number_of_mesh_base_nodes

std::size_t ApplicationUtils::Partition::number_of_mesh_base_nodes

Definition at line 36 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ number_of_regular_base_nodes

std::size_t ApplicationUtils::Partition::number_of_regular_base_nodes

◆ number_of_regular_nodes

std::size_t ApplicationUtils::Partition::number_of_regular_nodes

◆ regular_elements

std::vector<const MeshLib::Element*> ApplicationUtils::Partition::regular_elements

Non ghost elements.

Definition at line 39 of file NodeWiseMeshPartitioner.h.

Referenced by ApplicationUtils::computePartitionOffsets(), numberOfMeshItems(), and writeConfig().


The documentation for this struct was generated from the following files: