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
382cef42
Commit
382cef42
authored
6 years ago
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
corrections formules derivees par stephane
parent
a1d1268c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+22
-20
22 additions, 20 deletions
src/main.cpp
with
22 additions
and
20 deletions
src/main.cpp
+
22
−
20
View file @
382cef42
...
@@ -164,6 +164,7 @@ int main(int argc, char *argv[])
...
@@ -164,6 +164,7 @@ int main(int argc, char *argv[])
// Ecriture des valeurs initiales dans un fichier
// Ecriture des valeurs initiales dans un fichier
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
xr
=
mesh
.
xr
();
// rho
// rho
std
::
ofstream
fout1
(
"inter1"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout1
(
"inter1"
,
std
::
ios
::
trunc
);
...
@@ -208,32 +209,33 @@ int main(int argc, char *argv[])
...
@@ -208,32 +209,33 @@ int main(int argc, char *argv[])
// derivee de u
// derivee de u
std
::
ofstream
fout6
(
"inter6"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout6
(
"inter6"
,
std
::
ios
::
trunc
);
fout6
.
precision
(
15
);
fout6
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfCells
()
-
1
;
++
j
)
{
// en 1D : mesh.numberOfNodes() = mesh.numberOfCells() - 1
fout6
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
uj
[
j
+
1
][
0
]
-
uj
[
j
][
0
])
/
(
xj
[
j
+
1
][
0
]
-
xj
[
j
][
0
])
<<
'\n'
;
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfNodes
()
-
2
;
++
j
)
{
fout6
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
uj
[
j
+
1
][
0
]
-
uj
[
j
][
0
])
/
(
xr
[
j
+
2
][
0
]
-
xr
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fout6
.
close
();
fout6
.
close
();
// derivee de p
// derivee de p
std
::
ofstream
fout7
(
"inter7"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout7
(
"inter7"
,
std
::
ios
::
trunc
);
fout7
.
precision
(
15
);
fout7
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
fout7
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])
<<
'\n'
;
fout7
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fout7
.
close
();
fout7
.
close
();
// derivee de rho
// derivee de rho
std
::
ofstream
fout8
(
"inter8"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout8
(
"inter8"
,
std
::
ios
::
trunc
);
fout8
.
precision
(
15
);
fout8
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
fout8
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])
<<
'\n'
;
fout8
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fout8
.
close
();
fout8
.
close
();
// terme baroclyne
// terme baroclyne
std
::
ofstream
fout9
(
"inter9"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout9
(
"inter9"
,
std
::
ios
::
trunc
);
fout9
.
precision
(
15
);
fout9
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
fout9
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(((
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
]))
*
((
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])))
/
(
rhoj
[
j
]
*
rhoj
[
j
])
<<
'\n'
;
fout9
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(((
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
]))
*
((
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])))
/
(
rhoj
[
j
]
*
rhoj
[
j
])
<<
'\n'
;
}
}
fout9
.
close
();
fout9
.
close
();
...
@@ -434,16 +436,16 @@ int main(int argc, char *argv[])
...
@@ -434,16 +436,16 @@ int main(int argc, char *argv[])
std
::
ifstream
fint6
(
"inter6"
);
std
::
ifstream
fint6
(
"inter6"
);
std
::
ofstream
fout6
(
"film_du"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout6
(
"film_du"
,
std
::
ios
::
trunc
);
fout6
.
precision
(
15
);
fout6
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
fint6
,
ligne
);
getline
(
fint6
,
ligne
);
fout6
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
uj
[
j
+
1
][
0
]
-
uj
[
j
][
0
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])
<<
'\n'
;
fout6
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
uj
[
j
+
1
][
0
]
-
uj
[
j
][
0
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fint6
.
close
();
fint6
.
close
();
fout6
.
close
();
fout6
.
close
();
std
::
ifstream
rint6
(
"film_du"
);
std
::
ifstream
rint6
(
"film_du"
);
std
::
ofstream
rout6
(
"inter6"
,
std
::
ios
::
trunc
);
std
::
ofstream
rout6
(
"inter6"
,
std
::
ios
::
trunc
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
rint6
,
ligne
);
getline
(
rint6
,
ligne
);
rout6
<<
ligne
<<
'\n'
;
rout6
<<
ligne
<<
'\n'
;
}
}
...
@@ -454,16 +456,16 @@ int main(int argc, char *argv[])
...
@@ -454,16 +456,16 @@ int main(int argc, char *argv[])
std
::
ifstream
fint7
(
"inter7"
);
std
::
ifstream
fint7
(
"inter7"
);
std
::
ofstream
fout7
(
"film_dp"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout7
(
"film_dp"
,
std
::
ios
::
trunc
);
fout7
.
precision
(
15
);
fout7
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
fint7
,
ligne
);
getline
(
fint7
,
ligne
);
fout7
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])
<<
'\n'
;
fout7
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fint7
.
close
();
fint7
.
close
();
fout7
.
close
();
fout7
.
close
();
std
::
ifstream
rint7
(
"film_dp"
);
std
::
ifstream
rint7
(
"film_dp"
);
std
::
ofstream
rout7
(
"inter7"
,
std
::
ios
::
trunc
);
std
::
ofstream
rout7
(
"inter7"
,
std
::
ios
::
trunc
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
rint7
,
ligne
);
getline
(
rint7
,
ligne
);
rout7
<<
ligne
<<
'\n'
;
rout7
<<
ligne
<<
'\n'
;
}
}
...
@@ -474,16 +476,16 @@ int main(int argc, char *argv[])
...
@@ -474,16 +476,16 @@ int main(int argc, char *argv[])
std
::
ifstream
fint8
(
"inter8"
);
std
::
ifstream
fint8
(
"inter8"
);
std
::
ofstream
fout8
(
"film_drho"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout8
(
"film_drho"
,
std
::
ios
::
trunc
);
fout8
.
precision
(
15
);
fout8
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
fint8
,
ligne
);
getline
(
fint8
,
ligne
);
fout8
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])
<<
'\n'
;
fout8
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])
<<
'\n'
;
}
}
fint8
.
close
();
fint8
.
close
();
fout8
.
close
();
fout8
.
close
();
std
::
ifstream
rint8
(
"film_drho"
);
std
::
ifstream
rint8
(
"film_drho"
);
std
::
ofstream
rout8
(
"inter8"
,
std
::
ios
::
trunc
);
std
::
ofstream
rout8
(
"inter8"
,
std
::
ios
::
trunc
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
rint8
,
ligne
);
getline
(
rint8
,
ligne
);
rout8
<<
ligne
<<
'\n'
;
rout8
<<
ligne
<<
'\n'
;
}
}
...
@@ -494,16 +496,16 @@ int main(int argc, char *argv[])
...
@@ -494,16 +496,16 @@ int main(int argc, char *argv[])
std
::
ifstream
fint9
(
"inter9"
);
std
::
ifstream
fint9
(
"inter9"
);
std
::
ofstream
fout9
(
"film_baro"
,
std
::
ios
::
trunc
);
std
::
ofstream
fout9
(
"film_baro"
,
std
::
ios
::
trunc
);
fout9
.
precision
(
15
);
fout9
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
fint9
,
ligne
);
getline
(
fint9
,
ligne
);
fout9
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(((
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
]))
*
((
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
j
[
j
+
1
][
0
]
-
x
j
[
j
][
0
])))
/
(
rhoj
[
j
]
*
rhoj
[
j
])
<<
'\n'
;
fout9
<<
ligne
<<
' '
<<
std
::
fixed
<<
xj
[
j
][
0
]
<<
' '
<<
std
::
fixed
<<
(((
rhoj
[
j
+
1
]
-
rhoj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
]))
*
((
pj
[
j
+
1
]
-
pj
[
j
])
/
(
x
r
[
j
+
2
][
0
]
-
x
r
[
j
+
1
][
0
])))
/
(
rhoj
[
j
]
*
rhoj
[
j
])
<<
'\n'
;
}
}
fint9
.
close
();
fint9
.
close
();
fout9
.
close
();
fout9
.
close
();
std
::
ifstream
rint9
(
"film_baro"
);
std
::
ifstream
rint9
(
"film_baro"
);
std
::
ofstream
rout9
(
"inter9"
,
std
::
ios
::
trunc
);
std
::
ofstream
rout9
(
"inter9"
,
std
::
ios
::
trunc
);
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Cell
s
()
-
1
;
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOf
Node
s
()
-
2
;
++
j
)
{
getline
(
rint9
,
ligne
);
getline
(
rint9
,
ligne
);
rout9
<<
ligne
<<
'\n'
;
rout9
<<
ligne
<<
'\n'
;
}
}
...
...
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