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 * > nodes
 nodes. More...
 
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. More...
 
std::vector< const MeshLib::Element * > ghost_elements
 
std::vector< bool > duplicate_ghost_cell
 

Member Function Documentation

◆ numberOfMeshItems()

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

Definition at line 45 of file NodeWiseMeshPartitioner.cpp.

47{
48 if (item_type == MeshLib::MeshItemType::Node)
49 {
50 return nodes.size();
51 }
52
53 if (item_type == MeshLib::MeshItemType::Cell)
54 {
55 return regular_elements.size() + ghost_elements.size();
56 }
57 OGS_FATAL("Mesh items other than nodes and cells are not supported.");
58}
#define OGS_FATAL(...)
Definition: Error.h:26
std::vector< MeshLib::Node * > nodes
nodes.
std::vector< const MeshLib::Element * > regular_elements
Non ghost elements.
std::vector< const MeshLib::Element * > ghost_elements

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

◆ writeConfig()

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

Definition at line 89 of file NodeWiseMeshPartitioner.cpp.

90{
91 long const data[] = {
92 static_cast<long>(nodes.size()),
93 static_cast<long>(number_of_base_nodes),
94 static_cast<long>(regular_elements.size()),
95 static_cast<long>(ghost_elements.size()),
96 static_cast<long>(number_of_regular_base_nodes),
97 static_cast<long>(number_of_regular_nodes),
98 static_cast<long>(number_of_mesh_base_nodes),
99 static_cast<long>(number_of_mesh_all_nodes),
100 static_cast<long>(
102 static_cast<long>(
104 };
105
106 return os.write(reinterpret_cast<const char*>(data), sizeof(data));
107}
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 60 of file NodeWiseMeshPartitioner.cpp.

62{
63 std::vector<NodeStruct> nodes_buffer;
64 nodes_buffer.reserve(nodes.size());
65
66 for (const auto* node : nodes)
67 {
68 double const* coords = node->data();
69 nodes_buffer.emplace_back(global_node_ids[node->getID()], coords[0],
70 coords[1], coords[2]);
71 }
72 return os.write(reinterpret_cast<const char*>(nodes_buffer.data()),
73 sizeof(NodeStruct) * nodes_buffer.size());
74}

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

std::vector<MeshLib::Node*> ApplicationUtils::Partition::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_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

Definition at line 33 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ number_of_regular_nodes

std::size_t ApplicationUtils::Partition::number_of_regular_nodes

Definition at line 34 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ 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: