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
Dmitri Naumov
ogs
Commits
fb34ea74
Commit
fb34ea74
authored
10 years ago
by
wenqing
Committed by
Dmitri Naumov
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Add NodePartitionedMesh derived from Mesh.
parent
69e4f46d
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/CMakeLists.txt
+6
-0
6 additions, 0 deletions
MeshLib/CMakeLists.txt
MeshLib/NodePartitionedMesh.h
+148
-0
148 additions, 0 deletions
MeshLib/NodePartitionedMesh.h
with
154 additions
and
0 deletions
MeshLib/CMakeLists.txt
+
6
−
0
View file @
fb34ea74
# Source files
GET_SOURCE_FILES
(
SOURCES_MESHLIB
)
# It should be removed too for other MPI based DDC approach in future.
IF
(
NOT OGS_USE_PETSC
)
list
(
REMOVE_ITEM SOURCES_MESHLIB NodePartitionedMesh.h
)
ENDIF
(
NOT OGS_USE_PETSC
)
GET_SOURCE_FILES
(
SOURCES_ELEMENTS Elements
)
GET_SOURCE_FILES
(
SOURCES_EDITING MeshEditing
)
GET_SOURCE_FILES
(
SOURCES_GENERATORS MeshGenerators
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/NodePartitionedMesh.h
0 → 100644
+
148
−
0
View file @
fb34ea74
/*!
\file NodePartitionedMesh.h
\author Wenqing Wang
\date 2014.06
\brief Definition of mesh class for partitioned mesh (by node) for parallel computing within the
framework of domain decomposition (DDC).
\copyright
Copyright (c) 2012-2014, OpenGeoSys Community (http://www.opengeosys.org)
Distributed under a Modified BSD License.
See accompanying file LICENSE.txt or
http://www.opengeosys.org/project/license
*/
#ifndef NODE_PARTITIONED_MESH_H_
#define NODE_PARTITIONED_MESH_H_
#include
<vector>
#include
<string>
#include
"Mesh.h"
namespace
FileIO
{
class
readNodePartitionedMesh
;
};
namespace
MeshLib
{
class
Node
;
class
Element
;
/// A subdomain mesh.
class
NodePartitionedMesh
:
public
Mesh
{
public:
/*!
\brief Constructor
\param name Name assigned to the mesh.
\param nodes Vector for nodes, which storage looks like:
||--active base nodes--|--ghost base nodes--|
--active extra nodes--|--ghost extra nodes--||
(extra nodes: nodes for high order interpolations)
\param glb_node_ids Global IDs of nodes of a partition.
\param elements Vector for elements. Ghost elements are stored
after regular (non-ghost) elements.
\param n_nghost_elem Number of non-ghost elements, or the start ID of
the entry of ghost element in the element vector.
\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_base_nodes Number of the base nodes.
\param n_active_base_nodes Number of the active base nodes.
\param n_active_nodes Number of all active nodes.
*/
NodePartitionedMesh
(
const
std
::
string
&
name
,
const
std
::
vector
<
Node
*>
&
nodes
,
const
std
::
vector
<
unsigned
>
&
glb_node_ids
,
const
std
::
vector
<
Element
*>
&
elements
,
const
std
::
size_t
n_nghost_elem
,
const
unsigned
n_global_base_nodes
,
const
unsigned
n_global_nodes
,
const
unsigned
n_base_nodes
,
const
unsigned
n_active_base_nodes
,
const
unsigned
n_active_nodes
)
:
Mesh
(
name
,
nodes
,
elements
,
n_base_nodes
),
_global_node_ids
(
glb_node_ids
),
_n_nghost_elem
(
n_nghost_elem
),
_n_global_base_nodes
(
n_global_base_nodes
),
_n_global_nodes
(
n_global_nodes
),
_n_active_base_nodes
(
n_active_base_nodes
),
_n_active_nodes
(
n_active_nodes
)
{
}
~
NodePartitionedMesh
()
{
}
/// Get the number of nodes of the global mesh for linear elements.
unsigned
getNGlobalBaseNodes
()
const
{
return
_n_global_base_nodes
;
}
/// Get the number of all nodes of the global mesh.
unsigned
getNGlobalNodes
()
const
{
return
_n_global_nodes
;
}
/// Get the number of the active nodes of the partition for linear elements.
unsigned
getNActiveBaseNodes
()
const
{
return
_n_active_base_nodes
;
}
/// Get the number of all active nodes of the partition.
unsigned
getNActiveNodes
()
const
{
return
_n_active_nodes
;
}
/// Check whether a node with ID of node_id is a ghost node
bool
isGhostNode
(
const
unsigned
node_id
)
{
if
(
node_id
<
_n_active_base_nodes
)
return
true
;
else
if
(
node_id
>=
_n_base_nodes
&&
node_id
<
getLargestActiveNodeID
()
)
return
true
;
else
return
false
;
}
/// Get the largest ID of active nodes for higher order elements in a partition.
unsigned
getLargestActiveNodeID
()
const
{
return
_n_base_nodes
+
_n_active_nodes
-
_n_active_base_nodes
;
}
/// Get the number of non-ghost elements, or the start entry ID of ghost elements in element vector.
size_t
getNNonGhostElements
()
const
{
return
_n_nghost_elem
;
}
private
:
/// Global IDs of nodes of a partition
std
::
vector
<
unsigned
>
_global_node_ids
;
/// Number of non-ghost elements, or the ID of the start entry of ghost elements in _elements vector.
std
::
size_t
_n_nghost_elem
;
/// Number of the nodes of the global mesh linear interpolations.
unsigned
_n_global_base_nodes
;
/// Number of all nodes of the global mesh.
unsigned
_n_global_nodes
;
/// Number of the active nodes for linear interpolations
unsigned
_n_active_base_nodes
;
/// Number of the all active nodes.
unsigned
_n_active_nodes
;
};
}
// namespace MeshLib
#endif // NODE_PARTITIONED_MESH_H_
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