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
bf8059e7
Commit
bf8059e7
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Bunch of connectivity fixes in 3d
parent
6435271f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh/Connectivity3D.hpp
+22
-18
22 additions, 18 deletions
src/mesh/Connectivity3D.hpp
with
22 additions
and
18 deletions
src/mesh/Connectivity3D.hpp
+
22
−
18
View file @
bf8059e7
...
@@ -48,13 +48,14 @@ private:
...
@@ -48,13 +48,14 @@ private:
Kokkos
::
View
<
unsigned
short
**>
m_face_node_local_face
;
Kokkos
::
View
<
unsigned
short
**>
m_face_node_local_face
;
size_t
m_max_nb_node_per_cell
;
size_t
m_max_nb_node_per_cell
;
size_t
m_max_nb_face_per_cell
;
struct
Face
struct
Face
{
{
KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION
std
::
vector
<
unsigned
int
>
_sort
(
const
std
::
vector
<
unsigned
int
>&
node_list
)
const
std
::
vector
<
unsigned
int
>
_sort
(
const
std
::
vector
<
unsigned
int
>&
node_list
)
const
{
{
auto
min_id
=
std
::
min_element
(
node_list
.
begin
(),
node_list
.
end
());
const
auto
min_id
=
std
::
min_element
(
node_list
.
begin
(),
node_list
.
end
());
const
size_t
shift
=
std
::
distance
(
min_id
,
node_list
.
begin
());
const
size_t
shift
=
std
::
distance
(
min_id
,
node_list
.
begin
());
std
::
vector
<
unsigned
int
>
rotated_node_list
(
node_list
.
size
());
std
::
vector
<
unsigned
int
>
rotated_node_list
(
node_list
.
size
());
...
@@ -110,13 +111,15 @@ private:
...
@@ -110,13 +111,15 @@ private:
void
_computeFaceCellConnectivities
()
void
_computeFaceCellConnectivities
()
{
{
// In 2D faces are simply define
Kokkos
::
View
<
unsigned
short
*>
cell_nb_faces
(
"cell_nb_faces"
,
m_number_of_cells
);
typedef
std
::
pair
<
unsigned
int
,
unsigned
short
>
CellFaceId
;
typedef
std
::
pair
<
unsigned
int
,
unsigned
short
>
CellFaceId
;
std
::
map
<
Face
,
std
::
vector
<
CellFaceId
>>
face_cells_map
;
std
::
map
<
Face
,
std
::
vector
<
CellFaceId
>>
face_cells_map
;
for
(
unsigned
int
j
=
0
;
j
<
m_number_of_cells
;
++
j
)
{
for
(
unsigned
int
j
=
0
;
j
<
m_number_of_cells
;
++
j
)
{
const
unsigned
short
cell_nb_nodes
=
m_cell_nb_nodes
[
j
];
const
unsigned
short
cell_nb_nodes
=
m_cell_nb_nodes
[
j
];
switch
(
cell_nb_nodes
)
{
switch
(
cell_nb_nodes
)
{
case
4
:
{
// tetrahedron
case
4
:
{
// tetrahedron
cell_nb_faces
[
j
]
=
4
;
std
::
cerr
<<
"tetrahedron cell type NIY!
\n
"
;
std
::
cerr
<<
"tetrahedron cell type NIY!
\n
"
;
std
::
exit
(
0
);
std
::
exit
(
0
);
break
;
break
;
...
@@ -147,11 +150,13 @@ private:
...
@@ -147,11 +150,13 @@ private:
m_cell_nodes
(
j
,
1
),
m_cell_nodes
(
j
,
1
),
m_cell_nodes
(
j
,
5
),
m_cell_nodes
(
j
,
5
),
m_cell_nodes
(
j
,
4
)})].
push_back
(
std
::
make_pair
(
j
,
4
));
m_cell_nodes
(
j
,
4
)})].
push_back
(
std
::
make_pair
(
j
,
4
));
// face
1
// face
5
face_cells_map
[
Face
({
m_cell_nodes
(
j
,
3
),
face_cells_map
[
Face
({
m_cell_nodes
(
j
,
3
),
m_cell_nodes
(
j
,
2
),
m_cell_nodes
(
j
,
2
),
m_cell_nodes
(
j
,
6
),
m_cell_nodes
(
j
,
6
),
m_cell_nodes
(
j
,
7
)})].
push_back
(
std
::
make_pair
(
j
,
5
));
m_cell_nodes
(
j
,
7
)})].
push_back
(
std
::
make_pair
(
j
,
5
));
cell_nb_faces
[
j
]
=
6
;
break
;
break
;
}
}
default
:
{
default
:
{
...
@@ -159,15 +164,11 @@ private:
...
@@ -159,15 +164,11 @@ private:
std
::
exit
(
0
);
std
::
exit
(
0
);
}
}
}
}
for
(
unsigned
short
r
=
0
;
r
<
cell_nb_nodes
;
++
r
)
{
unsigned
int
node0_id
=
m_cell_nodes
(
j
,
r
);
unsigned
int
node1_id
=
m_cell_nodes
(
j
,(
r
+
1
)
%
cell_nb_nodes
);
if
(
node1_id
<
node0_id
)
{
std
::
swap
(
node0_id
,
node1_id
);
}
// face_cells_map[Face(node0_id, node1_id)].push_back(std::make_pair(j, r));
}
}
}
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
();
m_number_of_faces
=
face_cells_map
.
size
();
Kokkos
::
View
<
unsigned
short
*>
face_nb_nodes
(
"face_nb_nodes"
,
m_number_of_faces
);
Kokkos
::
View
<
unsigned
short
*>
face_nb_nodes
(
"face_nb_nodes"
,
m_number_of_faces
);
...
@@ -177,9 +178,9 @@ private:
...
@@ -177,9 +178,9 @@ private:
m_face_nb_nodes
=
face_nb_nodes
;
m_face_nb_nodes
=
face_nb_nodes
;
std
::
cerr
<<
__FILE__
<<
':'
<<
__LINE__
<<
':'
std
::
cerr
<<
__FILE__
<<
':'
<<
__LINE__
<<
':'
<<
rang
::
fg
::
red
<<
"
m_
max_nb_node_per_face forced to
8
"
<<
rang
::
fg
::
reset
;
<<
rang
::
fg
::
red
<<
"
max_nb_node_per_face forced to
4
"
<<
rang
::
fg
::
reset
<<
'\n'
;
unsigned
int
m_
max_nb_node_per_face
=
8
;
const
size_t
max_nb_node_per_face
=
4
;
Kokkos
::
View
<
unsigned
int
**>
face_nodes
(
"face_nodes"
,
m_number_of_faces
,
m_
max_nb_node_per_face
);
Kokkos
::
View
<
unsigned
int
**>
face_nodes
(
"face_nodes"
,
m_number_of_faces
,
max_nb_node_per_face
);
{
{
int
l
=
0
;
int
l
=
0
;
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
...
@@ -203,6 +204,8 @@ private:
...
@@ -203,6 +204,8 @@ private:
}
}
m_face_nb_cells
=
face_nb_cells
;
m_face_nb_cells
=
face_nb_cells
;
#warning check that the number of cell per faces is <=2
Kokkos
::
View
<
unsigned
int
**>
face_cells
(
"face_cells"
,
face_cells_map
.
size
(),
2
);
Kokkos
::
View
<
unsigned
int
**>
face_cells
(
"face_cells"
,
face_cells_map
.
size
(),
2
);
{
{
int
l
=
0
;
int
l
=
0
;
...
@@ -217,9 +220,10 @@ private:
...
@@ -217,9 +220,10 @@ private:
}
}
m_face_cells
=
face_cells
;
m_face_cells
=
face_cells
;
// In 2d cell_nb_faces = cell_nb_node
std
::
cerr
<<
__FILE__
<<
':'
<<
__LINE__
<<
':'
m_cell_nb_faces
=
m_cell_nb_nodes
;
<<
rang
::
fg
::
red
<<
" m_max_nb_face_per_cell forced to 6"
<<
rang
::
fg
::
reset
<<
'\n'
;
Kokkos
::
View
<
unsigned
int
**>
cell_faces
(
"cell_faces"
,
m_number_of_faces
,
m_max_nb_node_per_cell
);
m_max_nb_face_per_cell
=
6
;
Kokkos
::
View
<
unsigned
int
**>
cell_faces
(
"cell_faces"
,
m_number_of_faces
,
m_max_nb_face_per_cell
);
{
{
int
l
=
0
;
int
l
=
0
;
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
for
(
const
auto
&
face_cells_vector
:
face_cells_map
)
{
...
...
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