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
ebf90dc7
Commit
ebf90dc7
authored
7 years ago
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
code plus propre
parent
14d7add0
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
+10
-10
10 additions, 10 deletions
src/main.cpp
src/mesh/Mesh.hpp
+9
-9
9 additions, 9 deletions
src/mesh/Mesh.hpp
src/scheme/FiniteVolumesDiffusion.hpp
+6
-9
6 additions, 9 deletions
src/scheme/FiniteVolumesDiffusion.hpp
with
25 additions
and
28 deletions
src/main.cpp
+
10
−
10
View file @
ebf90dc7
...
...
@@ -196,9 +196,9 @@ int main(int argc, char *argv[])
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
uj
=
unknowns
.
uj
();
double
pi
=
4.
*
std
::
atan
(
1.
);
std
::
ofstream
fout
(
"comparaison
u
"
);
std
::
ofstream
fout
(
"comparaison
_u_k_non_cst_maill_non_unif_640
"
);
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.
001
) <<'\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
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Mesh.hpp
+
9
−
9
View file @
ebf90dc7
This diff is collapsed.
Click to expand it.
src/scheme/FiniteVolumesDiffusion.hpp
+
6
−
9
View file @
ebf90dc7
...
...
@@ -99,12 +99,7 @@ private:
sum2
+=
kj
(
cell_here
);
}
// k = x
// m_Fl(l) = ((sum2*0.5)/Vl(l))*sum;
m_Fl
(
l
)
=
((
sum2
/
face_nb_cells
(
l
))
/
Vl
(
l
))
*
sum
;
// k = 2
//m_Fl(l)= (2./Vl(l))*sum;
});
...
...
@@ -309,13 +304,15 @@ public:
const
Kokkos
::
View
<
const
Rd
*>
xj
=
m_mesh_data
.
xj
();
const
Kokkos
::
View
<
const
double
*>
Vj
=
m_mesh_data
.
Vj
();
double
pi
=
4.
*
std
::
atan
(
1.
);
double
erreur
=
0.
;
double
exacte
=
0.
;
for
(
size_t
j
=
0
;
j
<
m_mesh
.
numberOfCells
();
++
j
)
{
//exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.
001
); // solution exacte cas test k constant
//exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.
2
); // solution exacte cas test k constant
exacte
=
std
::
sin
(
pi
*
xj
[
j
][
0
])
*
std
::
exp
(
-
0.2
);
// solution exacte cas test k non constant
erreur
+=
(
exacte
-
uj
[
j
][
0
])
*
(
exacte
-
uj
[
j
][
0
]);
erreur
+=
(
exacte
-
uj
[
j
][
0
])
*
(
exacte
-
uj
[
j
][
0
])
*
Vj
(
j
)
;
}
erreur
=
std
::
sqrt
(
erreur
);
return
erreur
;
...
...
@@ -331,12 +328,12 @@ public:
const
Kokkos
::
View
<
const
Rd
*>
xj
=
m_mesh_data
.
xj
();
double
pi
=
4.
*
std
::
atan
(
1.
);
//double exacte = std::sin(pi*xj[0][0])*std::exp(-2.*pi*pi*0.
001
); // k constant
//double exacte = std::sin(pi*xj[0][0])*std::exp(-2.*pi*pi*0.
2
); // k constant
double
exacte
=
std
::
sin
(
pi
*
xj
[
0
][
0
])
*
std
::
exp
(
-
0.2
);
// k non constant
double
erreur
=
std
::
abs
(
exacte
-
uj
[
0
][
0
]);
for
(
size_t
j
=
1
;
j
<
m_mesh
.
numberOfCells
();
++
j
)
{
//exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.
001
);
//exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.
2
);
exacte
=
std
::
sin
(
pi
*
xj
[
j
][
0
])
*
std
::
exp
(
-
0.2
);
if
(
std
::
abs
(
exacte
-
uj
[
j
][
0
])
>
erreur
)
{
...
...
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