Loading [MathJax]/extensions/tex2jax.js
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 switch (item_type)
40 {
42 return nodes.size();
44 return regular_elements.size() + ghost_elements.size();
47 default:
48 OGS_FATAL("Unsupported MeshItemType {:s}.",
49 MeshLib::toString(item_type));
50 }
51}
#define OGS_FATAL(...)
Definition Error.h:26
static constexpr char const * toString(const MeshItemType t)
Returns a char array for a specific MeshItemType.
Definition MeshEnums.h:36
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, regular_elements, and MeshLib::toString().

◆ writeConfig()

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

Definition at line 82 of file NodeWiseMeshPartitioner.cpp.

83{
84 long const data[] = {
85 static_cast<long>(nodes.size()),
86 static_cast<long>(number_of_base_nodes),
87 static_cast<long>(regular_elements.size()),
88 static_cast<long>(ghost_elements.size()),
89 static_cast<long>(number_of_regular_base_nodes),
90 static_cast<long>(number_of_regular_nodes),
91 static_cast<long>(number_of_mesh_base_nodes),
92 static_cast<long>(number_of_mesh_all_nodes),
93 static_cast<long>(
95 static_cast<long>(
97 };
98
99 return os.write(reinterpret_cast<const char*>(data), sizeof(data));
100}
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 53 of file NodeWiseMeshPartitioner.cpp.

55{
56 std::vector<MeshLib::IO::NodeData> nodes_buffer;
57 nodes_buffer.reserve(nodes.size());
58
59 for (const auto* node : nodes)
60 {
61 double const* coords = node->data();
62 nodes_buffer.emplace_back(global_node_ids[node->getID()], coords[0],
63 coords[1], coords[2]);
64 }
65 return os.write(reinterpret_cast<const char*>(nodes_buffer.data()),
66 sizeof(MeshLib::IO::NodeData) * nodes_buffer.size());
67}
constexpr ranges::views::view_closure coords
Definition Mesh.h:234
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: