OGS
ApplicationUtils::Partition Struct Reference

Detailed Description

A subdomain mesh.

Definition at line 19 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 25 of file NodeWiseMeshPartitioner.cpp.

27{
28 switch (item_type)
29 {
31 return nodes.size();
33 return regular_elements.size() + ghost_elements.size();
36 default:
37 OGS_FATAL("Unsupported MeshItemType {:s}.",
38 MeshLib::toString(item_type));
39 }
40}
#define OGS_FATAL(...)
Definition Error.h:19
static constexpr char const * toString(const MeshItemType t)
Returns a char array for a specific MeshItemType.
Definition MeshEnums.h:25
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().

Referenced by ApplicationUtils::partitionProperties().

◆ writeConfig()

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

Definition at line 71 of file NodeWiseMeshPartitioner.cpp.

72{
73 long const data[] = {
74 static_cast<long>(nodes.size()),
75 static_cast<long>(number_of_base_nodes),
76 static_cast<long>(regular_elements.size()),
77 static_cast<long>(ghost_elements.size()),
78 static_cast<long>(number_of_regular_base_nodes),
79 static_cast<long>(number_of_regular_nodes),
80 static_cast<long>(number_of_mesh_base_nodes),
81 static_cast<long>(number_of_mesh_all_nodes),
82 static_cast<long>(
84 static_cast<long>(
86 };
87
88 return os.write(reinterpret_cast<const char*>(data), sizeof(data));
89}
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 42 of file NodeWiseMeshPartitioner.cpp.

44{
45 std::vector<MeshLib::IO::NodeData> nodes_buffer;
46 nodes_buffer.reserve(nodes.size());
47
48 for (const auto* node : nodes)
49 {
50 double const* coords = node->data();
51 nodes_buffer.emplace_back(global_node_ids[node->getID()], coords[0],
52 coords[1], coords[2]);
53 }
54 return os.write(reinterpret_cast<const char*>(nodes_buffer.data()),
55 sizeof(MeshLib::IO::NodeData) * nodes_buffer.size());
56}
constexpr ranges::views::view_closure coords
Definition Mesh.h:223

References nodes.

Member Data Documentation

◆ duplicate_ghost_cell

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

Definition at line 30 of file NodeWiseMeshPartitioner.h.

◆ ghost_elements

◆ nodes

◆ number_of_base_nodes

std::size_t ApplicationUtils::Partition::number_of_base_nodes

Definition at line 24 of file NodeWiseMeshPartitioner.h.

Referenced by writeConfig().

◆ number_of_integration_points

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

Definition at line 32 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 26 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 25 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

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