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
228ec9dd
Commit
228ec9dd
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Use m_item_to_item_matrix instead of m_face_to_cell_matrix
parent
14ea5b10
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!6
Feature/crs
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mesh/Connectivity.cpp
+7
-4
7 additions, 4 deletions
src/mesh/Connectivity.cpp
src/mesh/Connectivity.hpp
+22
-6
22 additions, 6 deletions
src/mesh/Connectivity.hpp
src/mesh/MeshNodeBoundary.hpp
+2
-1
2 additions, 1 deletion
src/mesh/MeshNodeBoundary.hpp
with
31 additions
and
11 deletions
src/mesh/Connectivity.cpp
+
7
−
4
View file @
228ec9dd
...
...
@@ -153,13 +153,14 @@ void Connectivity<3>::_computeFaceCellConnectivities()
const
auto
&
cell_to_face_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
cell
)][
itemId
(
TypeOfItem
::
face
)];
auto
&
face_to_cell_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
m_connectivity_computer
.
computeInverseConnectivityMatrix
(
cell_to_face_matrix
,
m_
face_to_cell_matrix
);
face_to_cell_matrix
);
m_face_to_cell_local_face
=
CellValuePerFace
<
unsigned
short
>
(
*
this
);
m_connectivity_computer
.
computeLocalChildItemNumberInItem
(
cell_to_face_matrix
,
m_
face_to_cell_matrix
,
face_to_cell_matrix
,
m_face_to_cell_local_face
);
const
auto
&
face_to_node_matrix
...
...
@@ -246,6 +247,8 @@ void Connectivity<2>::_computeFaceCellConnectivities()
}
++
l
;
}
m_face_to_cell_matrix
=
face_to_cell_vector
;
auto
&
face_to_cell_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
face_to_cell_matrix
=
face_to_cell_vector
;
}
}
This diff is collapsed.
Click to expand it.
src/mesh/Connectivity.hpp
+
22
−
6
View file @
228ec9dd
...
...
@@ -243,6 +243,12 @@ class Connectivity final
return
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
cell
)][
itemId
(
TypeOfItem
::
face
)];
}
KOKKOS_INLINE_FUNCTION
ConnectivityMatrix
faceToCellMatrix
()
const
{
return
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
}
KOKKOS_INLINE_FUNCTION
ConnectivityMatrix
faceToNodeMatrix
()
const
{
...
...
@@ -259,7 +265,6 @@ class Connectivity final
FaceValuePerCell
<
bool
>
m_cell_face_is_reversed
;
ConnectivityMatrix
m_face_to_cell_matrix
;
CellValuePerFace
<
unsigned
short
>
m_face_to_cell_local_face
;
CellValuePerNode
<
unsigned
short
>
m_node_to_cell_local_node
;
...
...
@@ -333,7 +338,9 @@ private:
KOKKOS_INLINE_FUNCTION
size_t
numberOfFaces
()
const
{
return
m_face_to_cell_matrix
.
numRows
();
const
auto
&
face_to_node_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
node
)];
return
face_to_node_matrix
.
numRows
();
}
KOKKOS_INLINE_FUNCTION
...
...
@@ -440,8 +447,12 @@ inline const ConnectivityMatrix&
Connectivity
<
3
>::
itemToItemMatrix
<
TypeOfItem
::
face
,
TypeOfItem
::
cell
>
()
const
{
return
m_face_to_cell_matrix
;
const
auto
&
face_to_cell_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
return
face_to_cell_matrix
;
}
template
<
>
template
<
>
inline
const
ConnectivityMatrix
&
...
...
@@ -497,7 +508,10 @@ inline const ConnectivityMatrix&
Connectivity
<
2
>::
itemToItemMatrix
<
TypeOfItem
::
face
,
TypeOfItem
::
cell
>
()
const
{
return
m_face_to_cell_matrix
;
const
auto
&
face_to_cell_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
return
face_to_cell_matrix
;
}
template
<
>
...
...
@@ -554,8 +568,10 @@ inline const ConnectivityMatrix&
Connectivity
<
1
>::
itemToItemMatrix
<
TypeOfItem
::
face
,
TypeOfItem
::
cell
>
()
const
{
#warning in 1d, faces and node are the same
return
m_face_to_cell_matrix
;
const
auto
&
face_to_cell_matrix
=
m_item_to_item_matrix
[
itemId
(
TypeOfItem
::
face
)][
itemId
(
TypeOfItem
::
cell
)];
return
face_to_cell_matrix
;
}
template
<
>
...
...
This diff is collapsed.
Click to expand it.
src/mesh/MeshNodeBoundary.hpp
+
2
−
1
View file @
228ec9dd
...
...
@@ -29,9 +29,10 @@ class MeshNodeBoundary
const
RefFaceList
&
ref_face_list
)
{
static_assert
(
dimension
==
MeshType
::
dimension
);
const
auto
&
face_to_cell_matrix
=
mesh
.
connectivity
().
faceToCellMatrix
();
const
Kokkos
::
View
<
const
unsigned
int
*>&
face_list
=
ref_face_list
.
faceList
();
Kokkos
::
parallel_for
(
face_list
.
extent
(
0
),
KOKKOS_LAMBDA
(
const
int
&
l
){
const
auto
&
face_cells
=
mesh
.
connectivity
().
m_
face_to_cell_matrix
.
rowConst
(
face_list
[
l
]);
const
auto
&
face_cells
=
face_to_cell_matrix
.
rowConst
(
face_list
[
l
]);
if
(
face_cells
.
length
>
1
)
{
std
::
cerr
<<
"internal faces cannot be used to define mesh boundaries
\n
"
;
std
::
exit
(
1
);
...
...
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