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
bb619a53
Commit
bb619a53
authored
7 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Starts using Boundary class
parent
4fc560e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main.cpp
+6
-5
6 additions, 5 deletions
src/main.cpp
src/mesh/Connectivity2D.hpp
+18
-0
18 additions, 0 deletions
src/mesh/Connectivity2D.hpp
src/mesh/GmshReader.cpp
+5
-0
5 additions, 0 deletions
src/mesh/GmshReader.cpp
with
29 additions
and
5 deletions
src/main.cpp
+
6
−
5
View file @
bb619a53
...
@@ -223,10 +223,11 @@ int main(int argc, char *argv[])
...
@@ -223,10 +223,11 @@ int main(int argc, char *argv[])
MeshDataType
mesh_data
(
mesh
);
MeshDataType
mesh_data
(
mesh
);
std
::
vector
<
BoundaryConditionHandler
>
bc_list
;
std
::
vector
<
BoundaryConditionHandler
>
bc_list
;
{
// quite dirty!
{
for
(
size_t
i_boundary
=
0
;
i_boundary
<
mesh
.
connectivity
().
numberOfNodeBoundaries
();
++
i_boundary
)
{
for
(
size_t
i_boundary
=
0
;
i_boundary
<
mesh
.
connectivity
().
numberOfBoundaries
();
++
i_boundary
)
{
ConnectivityType
::
NodesBoundary
nodes_boundary
=
mesh
.
connectivity
().
nodesBoundary
(
i_boundary
);
const
Boundary
&
boundary
=
mesh
.
connectivity
().
boundary
(
i_boundary
);
const
RefId
&
ref
=
nodes_boundary
.
first
;
const
RefId
&
ref
=
boundary
.
refId
();
TinyVector
<
2
>
normal
(
0
,
0
);
TinyVector
<
2
>
normal
(
0
,
0
);
if
((
ref
.
tagName
()
==
std
::
string
(
"XMIN"
))
or
(
ref
.
tagName
()
==
"XMAX"
))
{
if
((
ref
.
tagName
()
==
std
::
string
(
"XMIN"
))
or
(
ref
.
tagName
()
==
"XMAX"
))
{
normal
=
TinyVector
<
2
>
(
1
,
0
);
normal
=
TinyVector
<
2
>
(
1
,
0
);
...
@@ -237,7 +238,7 @@ int main(int argc, char *argv[])
...
@@ -237,7 +238,7 @@ int main(int argc, char *argv[])
break
;
break
;
}
}
const
Kokkos
::
View
<
const
unsigned
int
*>
nodes_ids
=
nodes_
boundary
.
second
;
const
Kokkos
::
View
<
const
unsigned
int
*>
nodes_ids
=
boundary
.
nodeList
()
;
std
::
vector
<
unsigned
int
>
node_boundary_vector
(
nodes_ids
.
extent
(
0
));
std
::
vector
<
unsigned
int
>
node_boundary_vector
(
nodes_ids
.
extent
(
0
));
for
(
size_t
r
=
0
;
r
<
nodes_ids
.
extent
(
0
);
++
r
)
{
for
(
size_t
r
=
0
;
r
<
nodes_ids
.
extent
(
0
);
++
r
)
{
node_boundary_vector
[
r
]
=
nodes_ids
[
r
];
node_boundary_vector
[
r
]
=
nodes_ids
[
r
];
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Connectivity2D.hpp
+
18
−
0
View file @
bb619a53
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include
<algorithm>
#include
<algorithm>
#include
<RefId.hpp>
#include
<RefId.hpp>
#include
<Boundary.hpp>
class
EntityListManager
class
EntityListManager
{
{
...
@@ -90,6 +91,8 @@ public:
...
@@ -90,6 +91,8 @@ public:
typedef
std
::
vector
<
NodesBoundary
>
NodesBoundaryList
;
typedef
std
::
vector
<
NodesBoundary
>
NodesBoundaryList
;
EntityListManager
m_entity_list_manager
;
EntityListManager
m_entity_list_manager
;
std
::
vector
<
Boundary
>
m_boundary_list
;
private:
private:
const
size_t
m_number_of_cells
;
const
size_t
m_number_of_cells
;
size_t
m_number_of_faces
;
size_t
m_number_of_faces
;
...
@@ -252,6 +255,21 @@ private:
...
@@ -252,6 +255,21 @@ private:
}
}
public
:
public
:
void
addBoundary
(
const
Boundary
&
boundary
)
{
m_boundary_list
.
push_back
(
boundary
);
}
size_t
numberOfBoundaries
()
const
{
return
m_boundary_list
.
size
();
}
const
Boundary
&
boundary
(
const
size_t
&
i
)
const
{
return
m_boundary_list
[
i
];
}
const
size_t
&
numberOfNodes
()
const
const
size_t
&
numberOfNodes
()
const
{
{
return
m_number_of_nodes
;
return
m_number_of_nodes
;
...
...
This diff is collapsed.
Click to expand it.
src/mesh/GmshReader.cpp
+
5
−
0
View file @
bb619a53
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
#include
<Connectivity1D.hpp>
#include
<Connectivity1D.hpp>
#include
<Connectivity2D.hpp>
#include
<Connectivity2D.hpp>
#include
<Mesh.hpp>
#include
<Mesh.hpp>
#include
<Boundary.hpp>
#include
<map>
#include
<map>
#include
<regex>
#include
<regex>
...
@@ -836,6 +839,8 @@ GmshReader::__proceedData()
...
@@ -836,6 +839,8 @@ GmshReader::__proceedData()
}
}
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_face_list
.
first
);
const
PhysicalRefId
&
physical_ref_id
=
m_physical_ref_map
.
at
(
ref_face_list
.
first
);
connectivity
.
entityListManager
().
addFaceIdArray
(
physical_ref_id
.
refId
(),
face_list
);
connectivity
.
entityListManager
().
addFaceIdArray
(
physical_ref_id
.
refId
(),
face_list
);
Boundary
boundary
(
connectivity
,
physical_ref_id
.
refId
(),
face_list
);
connectivity
.
addBoundary
(
boundary
);
}
}
const
Kokkos
::
View
<
const
unsigned
int
**>
face_nodes
=
connectivity
.
faceNodes
();
const
Kokkos
::
View
<
const
unsigned
int
**>
face_nodes
=
connectivity
.
faceNodes
();
...
...
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