Skip to content
Snippets Groups Projects
Commit ecdb52cd authored by wenqing's avatar wenqing Committed by Dmitri Naumov
Browse files

[NodePartitionedMesh] Moved the definitions of two members to cpp file

parent 46a44375
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,32 @@ NodePartitionedMesh::NodePartitionedMesh( ...@@ -55,6 +55,32 @@ NodePartitionedMesh::NodePartitionedMesh(
{ {
} }
bool NodePartitionedMesh::isGhostNode(const std::size_t node_id) const
{
if (node_id < _n_active_base_nodes)
{
return false;
}
if (!isBaseNode(*_nodes[node_id], getElementsConnectedToNode(node_id)) &&
node_id < getLargestActiveNodeID())
{
return false;
}
return true;
}
std::size_t NodePartitionedMesh::getMaximumNConnectedNodesToNode() const
{
auto const& nodes_connections =
MeshLib::calculateNodesConnectedByElements(*this);
auto const max_connections = std::max_element(
nodes_connections.cbegin(), nodes_connections.cend(),
[](auto const& connections_node_a, auto const& connections_node_b)
{ return (connections_node_a.size() < connections_node_b.size()); });
// Return the number of connected nodes +1 for the node itself.
return static_cast<std::size_t>(max_connections->size() + 1);
}
int NodePartitionedMesh::getPartitionID(const int global_node_id) const int NodePartitionedMesh::getPartitionID(const int global_node_id) const
{ {
return std::upper_bound(std::cbegin(_end_node_id_ranks), return std::upper_bound(std::cbegin(_end_node_id_ranks),
......
...@@ -101,20 +101,7 @@ public: ...@@ -101,20 +101,7 @@ public:
/// Get the number of all active nodes of the partition. /// Get the number of all active nodes of the partition.
std::size_t getNumberOfActiveNodes() const { return _n_active_nodes; } std::size_t getNumberOfActiveNodes() const { return _n_active_nodes; }
/// Check whether a node with ID of node_id is a ghost node /// Check whether a node with ID of node_id is a ghost node
bool isGhostNode(const std::size_t node_id) const bool isGhostNode(const std::size_t node_id) const;
{
if (node_id < _n_active_base_nodes)
{
return false;
}
if (!isBaseNode(*_nodes[node_id],
getElementsConnectedToNode(node_id)) &&
node_id < getLargestActiveNodeID())
{
return false;
}
return true;
}
/// Get the largest ID of active nodes for higher order elements in a /// Get the largest ID of active nodes for higher order elements in a
/// partition. /// partition.
...@@ -125,18 +112,7 @@ public: ...@@ -125,18 +112,7 @@ public:
// TODO I guess that is a simplified version of computeSparsityPattern() // TODO I guess that is a simplified version of computeSparsityPattern()
/// Get the maximum number of connected nodes to node. /// Get the maximum number of connected nodes to node.
std::size_t getMaximumNConnectedNodesToNode() const std::size_t getMaximumNConnectedNodesToNode() const;
{
auto const& nodes_connections =
MeshLib::calculateNodesConnectedByElements(*this);
auto const max_connections = std::max_element(
nodes_connections.cbegin(), nodes_connections.cend(),
[](auto const& connections_node_a, auto const& connections_node_b) {
return (connections_node_a.size() < connections_node_b.size());
});
// Return the number of connected nodes +1 for the node itself.
return max_connections->size() + 1;
}
int getPartitionID(const int global_node_id) const; int getPartitionID(const int global_node_id) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment