Skip to content
Snippets Groups Projects
Commit da53aee4 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[MeL|NumLib] better readability: active -> regular

The term 'active' is already used in the context
of domain deactivation
parent 79032039
No related branches found
No related tags found
No related merge requests found
......@@ -408,44 +408,45 @@ MeshLib::NodePartitionedMesh* NodePartitionedMeshReader::newMesh(
std::vector<MeshLib::Element*> const& mesh_elems,
MeshLib::Properties const& properties) const
{
std::vector<std::size_t> gathered_n_active_base_nodes(_mpi_comm_size);
std::vector<std::size_t> gathered_n_regular_base_nodes(_mpi_comm_size);
MPI_Allgather(&_mesh_info.active_base_nodes,
MPI_Allgather(&_mesh_info.regular_base_nodes,
1,
MPI_UNSIGNED_LONG,
gathered_n_active_base_nodes.data(),
gathered_n_regular_base_nodes.data(),
1,
MPI_UNSIGNED_LONG,
_mpi_comm);
std::vector<std::size_t> n_active_base_nodes_at_rank;
n_active_base_nodes_at_rank.push_back(0);
std::partial_sum(begin(gathered_n_active_base_nodes),
end(gathered_n_active_base_nodes),
back_inserter(n_active_base_nodes_at_rank));
std::vector<std::size_t> gathered_n_active_high_order_nodes(_mpi_comm_size);
std::size_t const n_active_high_order_nodes =
_mesh_info.active_nodes - _mesh_info.active_base_nodes;
MPI_Allgather(&n_active_high_order_nodes,
std::vector<std::size_t> n_regular_base_nodes_at_rank;
n_regular_base_nodes_at_rank.push_back(0);
std::partial_sum(begin(gathered_n_regular_base_nodes),
end(gathered_n_regular_base_nodes),
back_inserter(n_regular_base_nodes_at_rank));
std::vector<std::size_t> gathered_n_regular_high_order_nodes(
_mpi_comm_size);
std::size_t const n_regular_high_order_nodes =
_mesh_info.regular_nodes - _mesh_info.regular_base_nodes;
MPI_Allgather(&n_regular_high_order_nodes,
1,
MPI_UNSIGNED_LONG,
gathered_n_active_high_order_nodes.data(),
gathered_n_regular_high_order_nodes.data(),
1,
MPI_UNSIGNED_LONG,
_mpi_comm);
std::vector<std::size_t> n_active_high_order_nodes_at_rank;
n_active_high_order_nodes_at_rank.push_back(0);
std::partial_sum(begin(gathered_n_active_high_order_nodes),
end(gathered_n_active_high_order_nodes),
back_inserter(n_active_high_order_nodes_at_rank));
std::vector<std::size_t> n_regular_high_order_nodes_at_rank;
n_regular_high_order_nodes_at_rank.push_back(0);
std::partial_sum(begin(gathered_n_regular_high_order_nodes),
end(gathered_n_regular_high_order_nodes),
back_inserter(n_regular_high_order_nodes_at_rank));
return new MeshLib::NodePartitionedMesh(
mesh_name, mesh_nodes, glb_node_ids, mesh_elems, properties,
_mesh_info.global_base_nodes, _mesh_info.global_nodes,
_mesh_info.active_nodes, std::move(n_active_base_nodes_at_rank),
std::move(n_active_high_order_nodes_at_rank));
_mesh_info.regular_nodes, std::move(n_regular_base_nodes_at_rank),
std::move(n_regular_high_order_nodes_at_rank));
}
void NodePartitionedMeshReader::setNodes(
......
......@@ -78,10 +78,10 @@ private:
/// of a partition,
unsigned long ghost_elements; ///< 3: Number of ghost element of
/// a partition,
unsigned long active_base_nodes; ///< 4: Number of active nodes for
/// linear element of a partition,
unsigned long active_nodes; ///< 5: Number of all active nodes a
/// partition,
unsigned long regular_base_nodes; ///< 4: Number of regular nodes for
/// linear element of a partition,
unsigned long regular_nodes; ///< 5: Number of all regular nodes a
/// partition,
unsigned long global_base_nodes; ///< 6: unused, previously number of
/// nodes for linear element of global
/// mesh,
......
......@@ -15,14 +15,14 @@ namespace MeshLib
{
std::vector<int> getEndNodeIDRanks(
std::size_t const n_global_nodes,
std::vector<std::size_t> const& n_active_base_nodes_at_rank,
std::vector<std::size_t> const& n_active_high_order_nodes_at_rank)
std::vector<std::size_t> const& n_regular_base_nodes_at_rank,
std::vector<std::size_t> const& n_regular_high_order_nodes_at_rank)
{
std::vector<int> data;
std::transform(n_active_base_nodes_at_rank.begin() + 1,
n_active_base_nodes_at_rank.end(),
n_active_high_order_nodes_at_rank.begin() + 1,
std::transform(n_regular_base_nodes_at_rank.begin() + 1,
n_regular_base_nodes_at_rank.end(),
n_regular_high_order_nodes_at_rank.begin() + 1,
std::back_inserter(data), std::plus<int>());
data.push_back(n_global_nodes);
......@@ -38,27 +38,27 @@ NodePartitionedMesh::NodePartitionedMesh(
Properties const& properties,
const std::size_t n_global_base_nodes,
const std::size_t n_global_nodes,
const std::size_t n_active_nodes,
std::vector<std::size_t>&& n_active_base_nodes_at_rank,
std::vector<std::size_t>&& n_active_high_order_nodes_at_rank)
const std::size_t n_regular_nodes,
std::vector<std::size_t>&& n_regular_base_nodes_at_rank,
std::vector<std::size_t>&& n_regular_high_order_nodes_at_rank)
: Mesh(name, nodes, elements, properties),
_global_node_ids(glb_node_ids),
_n_global_base_nodes(n_global_base_nodes),
_n_global_nodes(n_global_nodes),
_n_active_nodes(n_active_nodes),
_n_active_base_nodes_at_rank(std::move(n_active_base_nodes_at_rank)),
_n_active_high_order_nodes_at_rank(
std::move(n_active_high_order_nodes_at_rank)),
_n_regular_nodes(n_regular_nodes),
_n_regular_base_nodes_at_rank(std::move(n_regular_base_nodes_at_rank)),
_n_regular_high_order_nodes_at_rank(
std::move(n_regular_high_order_nodes_at_rank)),
_end_node_id_at_rank(
getEndNodeIDRanks(n_global_nodes, _n_active_base_nodes_at_rank,
_n_active_high_order_nodes_at_rank)),
getEndNodeIDRanks(n_global_nodes, _n_regular_base_nodes_at_rank,
_n_regular_high_order_nodes_at_rank)),
_is_single_thread(false)
{
}
bool NodePartitionedMesh::isGhostNode(const std::size_t node_id) const
{
return node_id >= _n_active_nodes;
return node_id >= _n_regular_nodes;
}
std::size_t NodePartitionedMesh::getMaximumNConnectedNodesToNode() const
......
......@@ -36,7 +36,7 @@ public:
_global_node_ids(mesh.getNumberOfNodes()),
_n_global_base_nodes(mesh.computeNumberOfBaseNodes()),
_n_global_nodes(mesh.getNumberOfNodes()),
_n_active_nodes(mesh.getNumberOfNodes()),
_n_regular_nodes(mesh.getNumberOfNodes()),
_is_single_thread(true)
{
for (std::size_t i = 0; i < _nodes.size(); i++)
......@@ -58,10 +58,10 @@ public:
\param properties Mesh property.
\param n_global_base_nodes Number of the base nodes of the global mesh.
\param n_global_nodes Number of all nodes of the global mesh.
\param n_active_nodes Number of all active nodes.
\param n_active_base_nodes_at_rank Numbers of the active base nodes of
\param n_regular_nodes Number of all regular nodes.
\param n_regular_base_nodes_at_rank Numbers of the regular base nodes of
all previous ranks.
\param n_active_high_order_nodes_at_rank Numbers of the active high
\param n_regular_high_order_nodes_at_rank Numbers of the regular high
order nodes of all previous
ranks.
*/
......@@ -73,9 +73,9 @@ public:
Properties const& properties,
const std::size_t n_global_base_nodes,
const std::size_t n_global_nodes,
const std::size_t n_active_nodes,
std::vector<std::size_t>&& n_active_base_nodes_at_rank,
std::vector<std::size_t>&& n_active_high_order_nodes_at_rank);
const std::size_t n_regular_nodes,
std::vector<std::size_t>&& n_regular_base_nodes_at_rank,
std::vector<std::size_t>&& n_regular_high_order_nodes_at_rank);
/// Get the number of nodes of the global mesh for linear elements.
std::size_t getNumberOfGlobalBaseNodes() const
......@@ -91,20 +91,20 @@ public:
return _global_node_ids[node_id];
}
/// Get the number of all active nodes of the partition.
std::size_t getNumberOfActiveNodes() const { return _n_active_nodes; }
/// Get the number of all regular nodes of the partition.
std::size_t getNumberOfRegularNodes() const { return _n_regular_nodes; }
/// Check whether a node with ID of node_id is a ghost node
bool isGhostNode(const std::size_t node_id) const;
std::size_t getNumberOfActiveBaseNodesAtRank(int const partition_id) const
std::size_t getNumberOfRegularBaseNodesAtRank(int const partition_id) const
{
return _n_active_base_nodes_at_rank[partition_id];
return _n_regular_base_nodes_at_rank[partition_id];
}
std::size_t getNumberOfActiveHighOrderNodesAtRank(
std::size_t getNumberOfRegularHighOrderNodesAtRank(
int const partition_id) const
{
return _n_active_high_order_nodes_at_rank[partition_id];
return _n_regular_high_order_nodes_at_rank[partition_id];
}
// TODO I guess that is a simplified version of computeSparsityPattern()
......@@ -115,7 +115,7 @@ public:
int getNumberOfPartitions() const
{
return _n_active_base_nodes_at_rank.size();
return _n_regular_base_nodes_at_rank.size();
}
bool isForSingleThread() const { return _is_single_thread; }
......@@ -130,15 +130,15 @@ private:
/// Number of all nodes of the global mesh.
std::size_t _n_global_nodes;
/// Number of the all active nodes.
std::size_t _n_active_nodes;
/// Number of the all regular nodes.
std::size_t _n_regular_nodes;
/// Gathered numbers of the active nodes for linear interpolations of all
/// Gathered numbers of the regular nodes for linear interpolations of all
/// partitions.
std::vector<std::size_t> _n_active_base_nodes_at_rank;
std::vector<std::size_t> _n_regular_base_nodes_at_rank;
/// Gathered numbers of the all active high order nodes of all partitions.
std::vector<std::size_t> _n_active_high_order_nodes_at_rank;
/// Gathered numbers of the all regular high order nodes of all partitions.
std::vector<std::size_t> _n_regular_high_order_nodes_at_rank;
/// Gathered the end node id of each rank.
std::vector<int> _end_node_id_at_rank;
......
......@@ -339,10 +339,10 @@ GlobalIndexType getGlobalIndexWithTaylorHoodElement(
int const partition_id = partitioned_mesh.getPartitionID(global_node_id);
auto const n_total_active_base_nodes_before_this_rank =
partitioned_mesh.getNumberOfActiveBaseNodesAtRank(partition_id);
partitioned_mesh.getNumberOfRegularBaseNodesAtRank(partition_id);
auto const n_total_active_high_order_nodes_before_this_rank =
partitioned_mesh.getNumberOfActiveHighOrderNodesAtRank(partition_id);
partitioned_mesh.getNumberOfRegularHighOrderNodesAtRank(partition_id);
auto const node_id_offset =
n_total_active_base_nodes_before_this_rank +
......@@ -362,7 +362,7 @@ GlobalIndexType getGlobalIndexWithTaylorHoodElement(
}
int const n_active_base_nodes_of_this_partition =
partitioned_mesh.getNumberOfActiveBaseNodesAtRank(partition_id + 1) -
partitioned_mesh.getNumberOfRegularBaseNodesAtRank(partition_id + 1) -
n_total_active_base_nodes_before_this_rank;
/*
......@@ -370,13 +370,13 @@ GlobalIndexType getGlobalIndexWithTaylorHoodElement(
assuming that the base node has three components and the high order node
has two components:
Partition | 0 | 1 | ...
--------------------------------
Active nodes | Base | higher | Base | higher| ...
--------------------------------
c0 x x x x ...
c1 x x x x ...
c2 x x ...
Partition | 0 | 1 | ...
--------------------------------
Regular nodes | Base | higher | Base | higher| ...
--------------------------------
c0 x x x x ...
c1 x x x x ...
c2 x x ...
*/
return static_cast<GlobalIndexType>(
index_offset +
......
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