Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
code
pugs
Commits
b1d0fcb3
Commit
b1d0fcb3
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add construction and access to a cell to cell graph
The considered graph is built joining cells through their faces
parent
176f4182
No related branches found
No related tags found
1 merge request
!11
Feature/mpi
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+2
-2
2 additions, 2 deletions
CMakeLists.txt
src/mesh/Connectivity.hpp
+39
-0
39 additions, 0 deletions
src/mesh/Connectivity.hpp
src/mesh/Mesh.hpp
+9
-0
9 additions, 0 deletions
src/mesh/Mesh.hpp
with
50 additions
and
2 deletions
CMakeLists.txt
+
2
−
2
View file @
b1d0fcb3
...
...
@@ -264,5 +264,5 @@ target_link_libraries(
kokkos
${
PARMETIS_LIBRARIES
}
${
MPI_CXX_LINK_FLAGS
}
${
MPI_CXX_LIBRARIES
}
Pastis
Utils
Pastis
Mesh
)
Pastis
Mesh
Pastis
Utils
)
This diff is collapsed.
Click to expand it.
src/mesh/Connectivity.hpp
+
39
−
0
View file @
b1d0fcb3
...
...
@@ -25,6 +25,8 @@
#include
<CellType.hpp>
#include
<CSRGraph.hpp>
#include
<RefId.hpp>
#include
<ItemType.hpp>
#include
<RefNodeList.hpp>
...
...
@@ -32,6 +34,7 @@
#include
<tuple>
#include
<algorithm>
#include
<set>
template
<
size_t
Dimension
>
class
Connectivity
;
...
...
@@ -530,6 +533,42 @@ class Connectivity final
return
m_ref_node_list
[
i
];
}
PASTIS_INLINE
CSRGraph
cellToCellGraph
()
const
{
std
::
vector
<
std
::
set
<
int
>>
cell_cells
(
this
->
numberOfCells
());
const
auto
&
face_to_cell_matrix
=
this
->
faceToCellMatrix
();
for
(
FaceId
l
=
0
;
l
<
this
->
numberOfFaces
();
++
l
)
{
const
auto
&
face_to_cell
=
face_to_cell_matrix
[
l
];
if
(
face_to_cell
.
size
()
==
2
)
{
const
int
cell_0
=
face_to_cell
[
0
];
const
int
cell_1
=
face_to_cell
[
1
];
cell_cells
[
cell_0
].
insert
(
cell_1
);
cell_cells
[
cell_1
].
insert
(
cell_0
);
}
}
Array
<
int
>
entries
(
this
->
numberOfCells
()
+
1
);
entries
[
0
]
=
0
;
for
(
size_t
j
=
0
;
j
<
this
->
numberOfCells
();
++
j
)
{
entries
[
j
+
1
]
=
entries
[
j
]
+
cell_cells
[
j
].
size
();
}
Array
<
int
>
neighbors
(
entries
[
this
->
numberOfCells
()]);
{
size_t
k
=
0
;
for
(
size_t
j
=
0
;
j
<
this
->
numberOfCells
();
++
j
)
{
for
(
auto
cell_id
:
cell_cells
[
j
])
{
neighbors
[
k
]
=
cell_id
;
++
k
;
}
}
}
return
CSRGraph
(
entries
,
neighbors
);
}
PASTIS_INLINE
size_t
numberOfNodes
()
const
final
{
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Mesh.hpp
+
9
−
0
View file @
b1d0fcb3
...
...
@@ -4,11 +4,14 @@
#include
<ItemValue.hpp>
#include
<TinyVector.hpp>
#include
<CSRGraph.hpp>
#include
<memory>
struct
IMesh
{
virtual
const
size_t
meshDimension
()
const
=
0
;
virtual
CSRGraph
cellToCellGraph
()
const
=
0
;
~
IMesh
()
=
default
;
};
...
...
@@ -27,6 +30,12 @@ private:
NodeValue
<
Rd
>
m_mutable_xr
;
public:
PASTIS_INLINE
CSRGraph
cellToCellGraph
()
const
final
{
return
m_connectivity
->
cellToCellGraph
();
}
PASTIS_INLINE
const
size_t
meshDimension
()
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