Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chaofan Chen
ogs
Commits
ecdb52cd
Commit
ecdb52cd
authored
3 years ago
by
wenqing
Committed by
Dmitri Naumov
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshLib/NodePartitionedMesh.cpp
+26
-0
26 additions, 0 deletions
MeshLib/NodePartitionedMesh.cpp
MeshLib/NodePartitionedMesh.h
+2
-26
2 additions, 26 deletions
MeshLib/NodePartitionedMesh.h
with
28 additions
and
26 deletions
MeshLib/NodePartitionedMesh.cpp
+
26
−
0
View file @
ecdb52cd
...
@@ -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
),
...
...
This diff is collapsed.
Click to expand it.
MeshLib/NodePartitionedMesh.h
+
2
−
26
View file @
ecdb52cd
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment