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
98f8a1e0
Commit
98f8a1e0
authored
Apr 25, 2018
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
probleme signal dans diffusion_dt
parent
9dfa6abb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+2
-1
2 additions, 1 deletion
src/main.cpp
src/scheme/FiniteVolumesDiffusion.hpp
+23
-20
23 additions, 20 deletions
src/scheme/FiniteVolumesDiffusion.hpp
with
25 additions
and
21 deletions
src/main.cpp
+
2
−
1
View file @
98f8a1e0
...
...
@@ -173,7 +173,8 @@ int main(int argc, char *argv[])
std
::
cout
<<
"* "
<<
rang
::
style
::
underline
<<
"Final time"
<<
rang
::
style
::
reset
<<
": "
<<
rang
::
fgB
::
green
<<
t
<<
rang
::
fg
::
reset
<<
" ("
<<
iteration
<<
" iterations)
\n
"
;
method_cost_map
[
"AcousticSolverWithMesh"
]
=
timer
.
seconds
();
//method_cost_map["AcousticSolverWithMesh"] = timer.seconds();
method_cost_map
[
"FiniteVolumesDiffusionWithMesh"
]
=
timer
.
seconds
();
{
// gnuplot output for density
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
...
...
This diff is collapsed.
Click to expand it.
src/scheme/FiniteVolumesDiffusion.hpp
+
23
−
20
View file @
98f8a1e0
...
...
@@ -18,20 +18,20 @@
// Creation classe FiniteVolumesDiffusion
template
<
typename
MeshData
>
// MeshData est le type generique des donnees (geometriques) attachees a un maillage
template
<
typename
MeshData
>
class
FiniteVolumesDiffusion
{
typedef
typename
MeshData
::
MeshType
MeshType
;
// type du maillage
typedef
FiniteVolumesEulerUnknowns
<
MeshData
>
UnknownsType
;
// type des inconnues
typedef
typename
MeshData
::
MeshType
MeshType
;
typedef
FiniteVolumesEulerUnknowns
<
MeshData
>
UnknownsType
;
MeshData
&
m_mesh_data
;
// reference vers les donnees attachees du maillage
const
MeshType
&
m_mesh
;
// reference vers le maillage
const
typename
MeshType
::
Connectivity
&
m_connectivity
;
// references vers la connectivite
MeshData
&
m_mesh_data
;
const
MeshType
&
m_mesh
;
const
typename
MeshType
::
Connectivity
&
m_connectivity
;
constexpr
static
size_t
dimension
=
MeshType
::
dimension
;
// dimension du maillage (connue a la compilation)
constexpr
static
size_t
dimension
=
MeshType
::
dimension
;
typedef
TinyVector
<
dimension
>
Rd
;
// type de petits vecteurs (de dimension MeshType::dimension)
typedef
TinyMatrix
<
dimension
>
Rdd
;
// type de petites matrices
typedef
TinyVector
<
dimension
>
Rd
;
typedef
TinyMatrix
<
dimension
>
Rdd
;
private:
...
...
@@ -73,7 +73,8 @@ private:
}
};
Kokkos
::
View
<
Rd
**>
// Fonction qui calcule F_jr
// Calcule un Fjr
Kokkos
::
View
<
Rd
**>
computeFjr
(
const
Kokkos
::
View
<
const
Rd
**>&
Cjr
,
const
Kokkos
::
View
<
const
Rd
*>&
uj
,
const
Kokkos
::
View
<
const
double
*>&
kj
)
{
...
...
@@ -84,14 +85,16 @@ private:
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
for
(
int
r
=
0
;
r
<
cell_nb_nodes
[
j
];
++
r
)
{
m_Fjr
(
j
,
r
)
=
((
kj
(
cell_nodes
(
j
,
r
))
+
kj
(
cell_nodes
(
j
,
r
)
-
1
))
/
(
2
*
Dj
(
j
)))
*
(
uj
(
j
,
r
),
Cjr
(
j
,
r
));
//tensorProduct(uj(j,r),Cjr(j,r)) ?
m_Fjr
(
j
,
r
)
=
((
kj
(
cell_nodes
(
j
,
r
))
+
kj
(
cell_nodes
(
j
-
1
,
r
)))
/
(
2
*
Dj
(
j
)))
*
((
uj
(
j
,
r
),
Cjr
(
j
,
r
))
+
(
uj
(
j
-
1
,
r
),
Cjr
(
j
-
1
,
r
)))
;
//tensorProduct(uj(j,r),Cjr(j,r)) ?
}
});
return
m_Fjr
;
}
Kokkos
::
View
<
double
**>
// Fonction qui calcule G_jr
// Calcule un Gjr
Kokkos
::
View
<
double
**>
computeGjr
(
const
Kokkos
::
View
<
const
Rd
*>&
uj
,
const
Kokkos
::
View
<
const
Rd
**>&
Fjr
)
{
const
Kokkos
::
View
<
const
unsigned
int
**>&
cell_nodes
=
m_connectivity
.
cellNodes
();
...
...
@@ -100,15 +103,15 @@ private:
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
for
(
int
r
=
0
;
r
<
cell_nb_nodes
[
j
];
++
r
)
{
m_Gjr
(
j
,
r
)
=
0.5
*
((
uj
(
cell_nodes
(
j
,
r
))
+
uj
(
cell_nodes
(
j
,
r
)
-
1
)),
Fjr
(
j
,
r
));
m_Gjr
(
j
,
r
)
=
0.5
*
((
uj
(
cell_nodes
(
j
,
r
))
+
uj
(
cell_nodes
(
j
-
1
,
r
))),
Fjr
(
j
,
r
));
}
});
return
m_Gjr
;
}
// Calcul la liste des inverse
s
d'une liste de matrices
(pour
// l'instant
seulement $R^{1\times 1}$
)
// Calcul
e
la liste des inverse d'une liste de matrices
//
(pour
l'instant
, juste 1x1
)
void
inverse
(
const
Kokkos
::
View
<
const
Rdd
*>&
A
,
Kokkos
::
View
<
Rdd
*>&
inv_A
)
const
{
Kokkos
::
parallel_for
(
A
.
size
(),
KOKKOS_LAMBDA
(
const
int
&
r
)
{
...
...
@@ -116,7 +119,7 @@ private:
});
}
// Calcul la liste des inverses d'une liste de reels
// Calcul
e
la liste des inverses d'une liste de reels
void
inverse
(
const
Kokkos
::
View
<
const
double
*>&
x
,
Kokkos
::
View
<
double
*>&
inv_x
)
const
{
Kokkos
::
parallel_for
(
x
.
size
(),
KOKKOS_LAMBDA
(
const
int
&
r
)
{
...
...
@@ -153,7 +156,7 @@ public:
}
// Calcule une evaluation du pas de temps verifiant le CFL parabolique
// Utilise la reduction definie dans la structure ReduceMin.
Ici, dx_j=V_j
// Utilise la reduction definie dans la structure ReduceMin.
KOKKOS_INLINE_FUNCTION
double
diffusion_dt
(
const
Kokkos
::
View
<
const
double
*>&
rhoj
,
const
Kokkos
::
View
<
const
double
*>&
kj
)
const
{
...
...
@@ -163,12 +166,12 @@ public:
const
Kokkos
::
View
<
const
double
*>&
Vj
=
m_mesh_data
.
Vj
();
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
dt_j
[
j
]
=
rhoj
(
j
)
*
Vj
(
j
)
*
(
2.
/
(
kj
(
j
+
1
)
+
2
*
kj
(
j
)
+
kj
(
j
-
1
)))
*
std
::
min
(
Dj
(
j
+
1
),
Dj
(
j
));
//dt_j[j]= rhoj(j)*Vj(j)*(2./(kj(j+1) + 2*kj(j) + kj(j-1)))
// * std::min(Dj(j),Dj(j-1));
// * std::min(xj(j+1)-xj(j), xj(j)-xj(j-1));
// * std::min((Dxj(j+1),Cjr(j,1)) + (xj(j),Cjr(j,0)),
//(xj(j),Cjr(j,1)) + (xj(j-1),Cjr(j,0)) );
dt_j
[
j
]
=
0.0001
;
// le signal vient d ici !
});
double
dt
=
std
::
numeric_limits
<
double
>::
max
();
...
...
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