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
05d9c658
Commit
05d9c658
authored
May 4, 2018
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
ajout nouveau maillage non uniforme
parent
ebf90dc7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+1
-1
1 addition, 1 deletion
src/main.cpp
src/mesh/Mesh.hpp
+30
-24
30 additions, 24 deletions
src/mesh/Mesh.hpp
with
31 additions
and
25 deletions
src/main.cpp
+
1
−
1
View file @
05d9c658
...
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
...
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
uj
=
unknowns
.
uj
();
const
Kokkos
::
View
<
const
Rd
*>
uj
=
unknowns
.
uj
();
double
pi
=
4.
*
std
::
atan
(
1.
);
double
pi
=
4.
*
std
::
atan
(
1.
);
std
::
ofstream
fout
(
"comparaison_u_k_non_cst_maill_non_unif_
64
0"
);
std
::
ofstream
fout
(
"comparaison_u_k_non_cst_maill_non_unif_
32
0"
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
//fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2) <<'\n'; //cas k constant
//fout << xj[j][0] << ' ' << uj[j][0] << ' ' << std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2) <<'\n'; //cas k constant
fout
<<
xj
[
j
][
0
]
<<
' '
<<
uj
[
j
][
0
]
<<
' '
<<
std
::
sin
(
pi
*
xj
[
j
][
0
])
*
std
::
exp
(
-
0.2
)
<<
'\n'
;
// cas k non constant
fout
<<
xj
[
j
][
0
]
<<
' '
<<
uj
[
j
][
0
]
<<
' '
<<
std
::
sin
(
pi
*
xj
[
j
][
0
])
*
std
::
exp
(
-
0.2
)
<<
'\n'
;
// cas k non constant
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Mesh.hpp
+
30
−
24
View file @
05d9c658
...
@@ -62,36 +62,42 @@ public:
...
@@ -62,36 +62,42 @@ public:
// pas non constant
// pas non constant
//Mesh(const Connectivity& connectivity)
// : m_connectivity(connectivity),
// m_xr("xr", connectivity.numberOfNodes())
//{
// const double delta_x = 1./connectivity.numberOfCells();
// Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
// if (r%2 == 0) {
// m_xr[r][0] = r*delta_x;
// }
// else {
// m_xr[r][0] = (r*2+1)*0.5*delta_x;
// }
// });
//}
// pas non constant avec fonction x^2
Mesh
(
const
Connectivity
&
connectivity
)
Mesh
(
const
Connectivity
&
connectivity
)
:
m_connectivity
(
connectivity
),
:
m_connectivity
(
connectivity
),
m_xr
(
"xr"
,
connectivity
.
numberOfNodes
())
m_xr
(
"xr"
,
connectivity
.
numberOfNodes
())
{
{
const
double
delta_x
=
1.
/
connectivity
.
numberOfCells
();
const
double
delta_x
=
1.
/
connectivity
.
numberOfCells
();
Kokkos
::
parallel_for
(
connectivity
.
numberOfNodes
(),
KOKKOS_LAMBDA
(
const
int
&
r
){
Kokkos
::
parallel_for
(
connectivity
.
numberOfNodes
(),
KOKKOS_LAMBDA
(
const
int
&
r
){
if
(
r
%
4
==
1
)
{
m_xr
[
r
][
0
]
=
(
r
*
2
+
1
)
*
0.5
*
delta_x
;
}
else
{
if
(
r
%
4
==
3
)
{
m_xr
[
r
][
0
]
=
((
r
*
3
-
1
)
/
3.
)
*
delta_x
;
}
else
{
m_xr
[
r
][
0
]
=
r
*
delta_x
;
m_xr
[
r
][
0
]
=
r
*
delta_x
;
});
}
Kokkos
::
parallel_for
(
connectivity
.
numberOfNodes
(),
KOKKOS_LAMBDA
(
const
int
&
r
){
}
m_xr
[
r
][
0
]
=
m_xr
[
r
][
0
]
*
m_xr
[
r
][
0
];
});
});
}
}
// pas non constant avec fonction x^2 (mauvais choix pas, hyper lent)
// Mesh(const Connectivity& connectivity)
// : m_connectivity(connectivity),
// m_xr("xr", connectivity.numberOfNodes())
//{
// const double delta_x = 1./connectivity.numberOfCells();
// Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
// m_xr[r][0] = r*delta_x;
// });
// Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
// m_xr[r][0] = m_xr[r][0]*m_xr[r][0];
// });
//}
~
Mesh
()
~
Mesh
()
{
{
;
;
...
...
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