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
848e27c5
Commit
848e27c5
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Manage references of cells
Also dispatch all ref-item lists
parent
c6647937
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!11
Feature/mpi
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mesh/Connectivity.cpp
+3
-0
3 additions, 0 deletions
src/mesh/Connectivity.cpp
src/mesh/ConnectivityDispatcher.cpp
+4
-0
4 additions, 0 deletions
src/mesh/ConnectivityDispatcher.cpp
src/mesh/GmshReader.cpp
+54
-9
54 additions, 9 deletions
src/mesh/GmshReader.cpp
with
61 additions
and
9 deletions
src/mesh/Connectivity.cpp
+
3
−
0
View file @
848e27c5
...
...
@@ -134,7 +134,10 @@ _buildFrom(const ConnectivityDescriptor& descriptor)
m_face_is_owned
=
face_is_owned
;
}
m_ref_node_list_vector
=
descriptor
.
template
refItemListVector
<
ItemType
::
node
>();
m_ref_edge_list_vector
=
descriptor
.
template
refItemListVector
<
ItemType
::
edge
>();
m_ref_face_list_vector
=
descriptor
.
template
refItemListVector
<
ItemType
::
face
>();
m_ref_cell_list_vector
=
descriptor
.
template
refItemListVector
<
ItemType
::
cell
>();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mesh/ConnectivityDispatcher.cpp
+
4
−
0
View file @
848e27c5
...
...
@@ -639,8 +639,12 @@ ConnectivityDispatcher<Dimension>::ConnectivityDispatcher(const ConnectivityType
this
->
_buildItemToSubItemDescriptor
<
NodeOfCell
>
();
this
->
_buildItemReferenceList
<
ItemType
::
cell
>
();
this
->
_dispatchFaces
();
this
->
_buildItemReferenceList
<
ItemType
::
node
>
();
m_dispatched_connectivity
=
ConnectivityType
::
build
(
m_new_descriptor
);
}
...
...
This diff is collapsed.
Click to expand it.
src/mesh/GmshReader.cpp
+
54
−
9
View file @
848e27c5
...
...
@@ -1285,6 +1285,29 @@ GmshReader::__proceedData()
descriptor
.
cell_number_vector
[
jh
]
=
__hexahedra_number
[
j
];
}
std
::
map
<
unsigned
int
,
std
::
vector
<
unsigned
int
>>
ref_cells_map
;
for
(
unsigned
int
r
=
0
;
r
<
__tetrahedra_ref
.
size
();
++
r
)
{
const
unsigned
int
elem_number
=
__tetrahedra_ref
[
r
];
const
unsigned
int
&
ref
=
__tetrahedra_ref
[
r
];
ref_cells_map
[
ref
].
push_back
(
elem_number
);
}
for
(
unsigned
int
j
=
0
;
j
<
__hexahedra_ref
.
size
();
++
j
)
{
const
size_t
elem_number
=
nb_tetrahedra
+
j
;
const
unsigned
int
&
ref
=
__hexahedra_ref
[
j
];
ref_cells_map
[
ref
].
push_back
(
elem_number
);
}
for
(
const
auto
&
ref_cell_list
:
ref_cells_map
)
{
Array
<
CellId
>
cell_list
(
ref_cell_list
.
second
.
size
());
for
(
size_t
j
=
0
;
j
<
ref_cell_list
.
second
.
size
();
++
j
)
{
cell_list
[
j
]
=
ref_cell_list
.
second
[
j
];
}
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_cell_list
.
first
);
descriptor
.
addRefItemList
(
RefCellList
(
physical_ref_id
.
refId
(),
cell_list
));
}
__computeCellFaceAndFaceNodeConnectivities
<
3
>
(
descriptor
);
descriptor
.
cell_owner_vector
.
resize
(
nb_cells
);
...
...
@@ -1450,6 +1473,28 @@ GmshReader::__proceedData()
descriptor
.
cell_number_vector
[
jq
]
=
__quadrangles_number
[
j
];
}
std
::
map
<
unsigned
int
,
std
::
vector
<
unsigned
int
>>
ref_cells_map
;
for
(
unsigned
int
r
=
0
;
r
<
__triangles_ref
.
size
();
++
r
)
{
const
unsigned
int
elem_number
=
__triangles_ref
[
r
];
const
unsigned
int
&
ref
=
__triangles_ref
[
r
];
ref_cells_map
[
ref
].
push_back
(
elem_number
);
}
for
(
unsigned
int
j
=
0
;
j
<
__quadrangles_ref
.
size
();
++
j
)
{
const
size_t
elem_number
=
nb_triangles
+
j
;
const
unsigned
int
&
ref
=
__quadrangles_ref
[
j
];
ref_cells_map
[
ref
].
push_back
(
elem_number
);
}
for
(
const
auto
&
ref_cell_list
:
ref_cells_map
)
{
Array
<
CellId
>
cell_list
(
ref_cell_list
.
second
.
size
());
for
(
size_t
j
=
0
;
j
<
ref_cell_list
.
second
.
size
();
++
j
)
{
cell_list
[
j
]
=
ref_cell_list
.
second
[
j
];
}
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_cell_list
.
first
);
descriptor
.
addRefItemList
(
RefCellList
(
physical_ref_id
.
refId
(),
cell_list
));
}
this
->
__computeCellFaceAndFaceNodeConnectivities
<
2
>
(
descriptor
);
descriptor
.
cell_owner_vector
.
resize
(
nb_cells
);
...
...
@@ -1532,9 +1577,6 @@ GmshReader::__proceedData()
descriptor
.
addRefItemList
(
RefFaceList
{
physical_ref_id
.
refId
(),
face_list
});
}
std
::
shared_ptr
p_connectivity
=
Connectivity2D
::
build
(
descriptor
);
Connectivity2D
&
connectivity
=
*
p_connectivity
;
std
::
map
<
unsigned
int
,
std
::
vector
<
unsigned
int
>>
ref_points_map
;
for
(
unsigned
int
r
=
0
;
r
<
__points
.
size
();
++
r
)
{
const
unsigned
int
point_number
=
__points
[
r
];
...
...
@@ -1548,9 +1590,13 @@ GmshReader::__proceedData()
point_list
[
j
]
=
ref_point_list
.
second
[
j
];
}
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_point_list
.
first
);
connectivity
.
addRefItemList
(
RefNodeList
(
physical_ref_id
.
refId
(),
point_list
));
descriptor
.
addRefItemList
(
RefNodeList
(
physical_ref_id
.
refId
(),
point_list
));
}
std
::
shared_ptr
p_connectivity
=
Connectivity2D
::
build
(
descriptor
);
Connectivity2D
&
connectivity
=
*
p_connectivity
;
using
MeshType
=
Mesh
<
Connectivity2D
>
;
using
Rd
=
TinyVector
<
2
,
double
>
;
...
...
@@ -1590,10 +1636,6 @@ GmshReader::__proceedData()
descriptor
.
node_owner_vector
.
end
(),
parallel
::
rank
());
std
::
shared_ptr
p_connectivity
=
Connectivity1D
::
build
(
descriptor
);
Connectivity1D
&
connectivity
=
*
p_connectivity
;
std
::
map
<
unsigned
int
,
std
::
vector
<
unsigned
int
>>
ref_points_map
;
for
(
unsigned
int
r
=
0
;
r
<
__points
.
size
();
++
r
)
{
const
unsigned
int
point_number
=
__points
[
r
];
...
...
@@ -1607,9 +1649,12 @@ GmshReader::__proceedData()
point_list
[
j
]
=
ref_point_list
.
second
[
j
];
}
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_point_list
.
first
);
connectivity
.
addRefItemList
(
RefNodeList
(
physical_ref_id
.
refId
(),
point_list
));
descriptor
.
addRefItemList
(
RefNodeList
(
physical_ref_id
.
refId
(),
point_list
));
}
std
::
shared_ptr
p_connectivity
=
Connectivity1D
::
build
(
descriptor
);
Connectivity1D
&
connectivity
=
*
p_connectivity
;
using
MeshType
=
Mesh
<
Connectivity1D
>
;
using
Rd
=
TinyVector
<
1
,
double
>
;
...
...
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