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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
7aa02175
Commit
7aa02175
authored
7 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Continue use of crs representation of connectivity
- cell->face is reversed - face->local face number in cell
parent
9055e3e1
No related branches found
No related tags found
1 merge request
!6
Feature/crs
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mesh/Connectivity2D.hpp
+8
-8
8 additions, 8 deletions
src/mesh/Connectivity2D.hpp
src/mesh/Connectivity3D.hpp
+32
-36
32 additions, 36 deletions
src/mesh/Connectivity3D.hpp
src/mesh/MeshData.hpp
+2
-4
2 additions, 4 deletions
src/mesh/MeshData.hpp
with
42 additions
and
48 deletions
src/mesh/Connectivity2D.hpp
+
8
−
8
View file @
7aa02175
...
...
@@ -215,10 +215,10 @@ class Connectivity2D
return
m_cell_nodes
;
}
const
Kokkos
::
View
<
const
unsigned
int
**>
cellFaces
()
const
{
return
m_cell_faces
;
}
//
const Kokkos::View<const unsigned int**> cellFaces() const
//
{
//
return m_cell_faces;
//
}
const
Kokkos
::
View
<
const
unsigned
short
*>
cellNbNodes
()
const
{
...
...
@@ -230,10 +230,10 @@ class Connectivity2D
return
m_inv_cell_nb_nodes
;
}
const
Kokkos
::
View
<
const
unsigned
short
*>
cellNbFaces
()
const
{
return
m_cell_nb_faces
;
}
//
const Kokkos::View<const unsigned short*> cellNbFaces() const
//
{
//
return m_cell_nb_faces;
//
}
const
Kokkos
::
View
<
const
unsigned
short
**>
faceCellLocalFace
()
const
{
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Connectivity3D.hpp
+
32
−
36
View file @
7aa02175
...
...
@@ -23,8 +23,12 @@ public:
static
constexpr
size_t
dimension
=
3
;
ConnectivityMatrix
m_cell_to_face_matrix
;
ConnectivityMatrixShort
m_cell_to_face_is_reversed_matrix
;
ConnectivityMatrix
m_face_to_cell_matrix
;
ConnectivityMatrixShort
m_face_to_cell_local_face_matrix
;
ConnectivityMatrix
m_face_to_node_matrix
;
ConnectivityMatrix
m_node_to_cell_matrix
;
ConnectivityMatrixShort
m_node_to_cell_local_node_matrix
;
...
...
@@ -39,11 +43,6 @@ private:
const
Kokkos
::
View
<
const
unsigned
int
**>
m_cell_nodes
;
Kokkos
::
View
<
double
*>
m_inv_cell_nb_nodes
;
Kokkos
::
View
<
const
unsigned
short
*>
m_cell_nb_faces
;
Kokkos
::
View
<
const
bool
**>
m_cell_faces_is_reversed
;
Kokkos
::
View
<
const
unsigned
short
**>
m_face_cell_local_face
;
Kokkos
::
View
<
const
unsigned
short
*>
m_node_nb_faces
;
Kokkos
::
View
<
const
unsigned
int
**>
m_node_faces
;
...
...
@@ -255,8 +254,6 @@ private:
std
::
cerr
<<
__FILE__
<<
':'
<<
__LINE__
<<
':'
<<
rang
::
fg
::
red
<<
" only works for hexa"
<<
rang
::
fg
::
reset
<<
'\n'
;
m_cell_nb_faces
=
cell_nb_faces
;
m_number_of_faces
=
face_cells_map
.
size
();
std
::
cerr
<<
__FILE__
<<
':'
<<
__LINE__
<<
':'
...
...
@@ -301,6 +298,24 @@ private:
=
Kokkos
::
create_staticcrsgraph
<
ConnectivityMatrix
>
(
"face_to_cell_matrix"
,
face_to_cell_vector
);
}
{
std
::
vector
<
std
::
vector
<
unsigned
short
>>
face_to_cell_local_face_vector
(
m_number_of_faces
);
size_t
l
=
0
;
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
const
auto
&
cells_info_vector
=
face_cells_vector
.
second
;
std
::
vector
<
unsigned
short
>&
cells_vector
=
face_to_cell_local_face_vector
[
l
];
cells_vector
.
resize
(
cells_info_vector
.
size
());
for
(
size_t
j
=
0
;
j
<
cells_info_vector
.
size
();
++
j
)
{
const
auto
&
[
cell_number
,
local_face_in_cell
,
reversed
]
=
cells_info_vector
[
j
];
cells_vector
[
j
]
=
local_face_in_cell
;
}
++
l
;
}
m_face_to_cell_local_face_matrix
=
Kokkos
::
create_staticcrsgraph
<
ConnectivityMatrixShort
>
(
"face_to_cell_local_face_matrix"
,
face_to_cell_local_face_vector
);
}
#warning check that the number of cell per faces is <=2
{
...
...
@@ -325,34 +340,25 @@ private:
<<
rang
::
fg
::
red
<<
" m_max_nb_face_per_cell forced to 6"
<<
rang
::
fg
::
reset
<<
'\n'
;
m_max_nb_face_per_cell
=
6
;
Kokkos
::
View
<
bool
**>
cell_faces_is_reversed
(
"cell_faces_is_reversed"
,
m_number_of_cells
,
m_max_nb_face_per_cell
);
{
std
::
vector
<
std
::
vector
<
unsigned
short
>>
cell_to_face_is_reversed_vector
(
m_number_of_cells
);
for
(
size_t
j
=
0
;
j
<
cell_to_face_is_reversed_vector
.
size
();
++
j
)
{
cell_to_face_is_reversed_vector
[
j
].
resize
(
cell_nb_faces
[
j
]);
}
int
l
=
0
;
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
const
auto
&
cells_vector
=
face_cells_vector
.
second
;
for
(
unsigned
short
lj
=
0
;
lj
<
cells_vector
.
size
();
++
lj
)
{
const
auto
&
[
cell_number
,
cell_local_face
,
reversed
]
=
cells_vector
[
lj
];
cell_face
s
_is_reversed
(
cell_number
,
cell_local_face
)
=
reversed
;
cell_
to_
face_is_reversed
_vector
[
cell_number
][
cell_local_face
]
=
reversed
;
}
++
l
;
}
}
m_cell_faces_is_reversed
=
cell_faces_is_reversed
;
Kokkos
::
View
<
unsigned
short
**>
face_cell_local_face
(
"face_cell_local_face"
,
m_number_of_faces
,
m_max_nb_node_per_cell
);
{
int
l
=
0
;
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
const
auto
&
cells_vector
=
face_cells_vector
.
second
;
for
(
unsigned
short
lj
=
0
;
lj
<
cells_vector
.
size
();
++
lj
)
{
unsigned
short
cell_local_face
=
std
::
get
<
1
>
(
cells_vector
[
lj
]);
face_cell_local_face
(
l
,
lj
)
=
cell_local_face
;
}
++
l
;
}
m_cell_to_face_is_reversed_matrix
=
Kokkos
::
create_staticcrsgraph
<
ConnectivityMatrixShort
>
(
"cell_to_face_is_reversed_matrix"
,
cell_to_face_is_reversed_vector
);
}
m_face_cell_local_face
=
face_cell_local_face
;
std
::
unordered_map
<
unsigned
int
,
std
::
vector
<
unsigned
int
>>
node_faces_map
;
for
(
size_t
l
=
0
;
l
<
m_face_to_node_matrix
.
numRows
();
++
l
)
{
...
...
@@ -448,11 +454,6 @@ private:
return
m_cell_nodes
;
}
const
Kokkos
::
View
<
const
bool
**>
cellFacesIsReversed
()
const
{
return
m_cell_faces_is_reversed
;
}
const
Kokkos
::
View
<
const
unsigned
short
*>
cellNbNodes
()
const
{
return
m_cell_nb_nodes
;
...
...
@@ -463,11 +464,6 @@ private:
return
m_inv_cell_nb_nodes
;
}
const
Kokkos
::
View
<
const
unsigned
short
**>
faceCellLocalFace
()
const
{
return
m_face_cell_local_face
;
}
unsigned
int
getFaceNumber
(
const
std
::
vector
<
unsigned
int
>&
face_nodes
)
const
{
const
Face
face
(
face_nodes
);
...
...
This diff is collapsed.
Click to expand it.
src/mesh/MeshData.hpp
+
2
−
4
View file @
7aa02175
...
...
@@ -140,9 +140,6 @@ private:
}
});
const
Kokkos
::
View
<
const
bool
**>
cell_faces_is_reversed
=
m_mesh
.
connectivity
().
cellFacesIsReversed
();
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
for
(
int
R
=
0
;
R
<
cell_nb_nodes
[
j
];
++
R
)
{
m_Cjr
(
j
,
R
)
=
zero
;
...
...
@@ -152,10 +149,11 @@ private:
node_id_to_local
[
cell_nodes
(
j
,
R
)]
=
R
;
}
const
auto
&
cell_faces
=
m_mesh
.
connectivity
().
m_cell_to_face_matrix
.
rowConst
(
j
);
const
auto
&
cell_faces_is_reversed
=
m_mesh
.
connectivity
().
m_cell_to_face_is_reversed_matrix
.
rowConst
(
j
);
for
(
size_t
L
=
0
;
L
<
cell_faces
.
length
;
++
L
)
{
const
size_t
l
=
cell_faces
(
L
);
const
auto
&
face_nodes
=
m_mesh
.
connectivity
().
m_face_to_node_matrix
.
rowConst
(
l
);
if
(
cell_faces_is_reversed
(
j
,
L
))
{
if
(
cell_faces_is_reversed
(
L
))
{
for
(
size_t
rl
=
0
;
rl
<
face_nodes
.
length
;
++
rl
)
{
m_Cjr
(
j
,
node_id_to_local
[
face_nodes
(
rl
)])
-=
Nlr
(
l
,
rl
);
}
...
...
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