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
3e5dc0f6
Commit
3e5dc0f6
authored
Apr 23, 2018
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
Suppression des parties de mouvement du maillage
parent
b99b33a7
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/scheme/FiniteVolumesDiffusion.hpp
+9
-107
9 additions, 107 deletions
src/scheme/FiniteVolumesDiffusion.hpp
with
9 additions
and
107 deletions
src/scheme/FiniteVolumesDiffusion.hpp
+
9
−
107
View file @
3e5dc0f6
...
@@ -36,7 +36,7 @@ class FiniteVolumesDiffusion
...
@@ -36,7 +36,7 @@ class FiniteVolumesDiffusion
private:
private:
// Sert a calculer les reductions (en gros calculer le min sur des
// Sert a calculer les reductions (en gros calculer le min sur des
// vecteurs en parallele)
Ne pas regarder plus comment ca marche.
// vecteurs en parallele)
struct
ReduceMin
struct
ReduceMin
{
{
private:
private:
...
@@ -73,91 +73,7 @@ private:
...
@@ -73,91 +73,7 @@ private:
}
}
};
};
// KOKKOS_INLINE_FUNCTION // Fonction qui calcule (rho c)_j
Kokkos
::
View
<
Rd
**>
// Fonction qui calcule F_jr // A MODIFIER // Ajout de k
//const Kokkos::View<const double*>
//computeRhoCj(const Kokkos::View<const double*>& rhoj,
// const Kokkos::View<const double*>& cj)
//{
// Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) {
// m_rhocj[j] = rhoj[j]*cj[j];
// });
// return m_rhocj;
//}
// KOKKOS_INLINE_FUNCTION // Fonction qui calcule A_jr
//const Kokkos::View<const Rdd**>
//computeAjr(const Kokkos::View<const double*>& rhocj,
// const Kokkos::View<const Rd**>& Cjr) {
//const Kokkos::View<const unsigned short*> cell_nb_nodes
// = m_connectivity.cellNbNodes();
//Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) {
// for (int r=0; r<cell_nb_nodes[j]; ++r) {
// m_Ajr(j,r) = tensorProduct(rhocj(j)*Cjr(j,r), Cjr(j,r));
// }
// });
//return m_Ajr;
//}
// KOKKOS_INLINE_FUNCTION // Fonction qui calcule A_r (la matrice locale au sommet r)
//const Kokkos::View<const Rdd*>
//computeAr(const Kokkos::View<const Rdd**>& Ajr) {
//const Kokkos::View<const unsigned int**> node_cells = m_connectivity.nodeCells();
//const Kokkos::View<const unsigned short**> node_cell_local_node = m_connectivity.nodeCellLocalNode();
//const Kokkos::View<const unsigned short*> node_nb_cells = m_connectivity.nodeNbCells();
//Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
// Rdd sum = zero;
// for (int j=0; j<node_nb_cells(r); ++j) {
// const int J = node_cells(r,j);
// const int R = node_cell_local_node(r,j);
// sum += Ajr(J,R);
// }
// m_Ar(r) = sum;
// });
//return m_Ar;
//}
//KOKKOS_INLINE_FUNCTION // Fonction qui calcule la somme b_r (le second membre au sommet r)
//const Kokkos::View<const Rd*>
//computeBr(const Kokkos::View<const Rdd**>& Ajr,
// const Kokkos::View<const Rd**>& Cjr,
// const Kokkos::View<const Rd*>& uj,
// const Kokkos::View<const double*>& pj) {
//const Kokkos::View<const unsigned int**>& node_cells = m_connectivity.nodeCells();
//const Kokkos::View<const unsigned short**>& node_cell_local_node = m_connectivity.nodeCellLocalNode();
//const Kokkos::View<const unsigned short*>& node_nb_cells = m_connectivity.nodeNbCells();
//Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
// Rd& br = m_br(r);
// br = zero;
// for (int j=0; j<node_nb_cells(r); ++j) {
// const int J = node_cells(r,j);
// const int R = node_cell_local_node(r,j);
// br += Ajr(J,R)*uj(J) + pj(J)*Cjr(J,R);
// }
// });
//return m_br;
//}
//Kokkos::View<Rd*> // calcule u_r (vitesse au sommet r, pour se deplacer)
//computeUr(const Kokkos::View<const Rdd*>& Ar,
// const Kokkos::View<const Rd*>& br) {
//inverse(Ar, m_inv_Ar);
//const Kokkos::View<const Rdd*> invAr = m_inv_Ar;
//Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r) {
// m_ur[r]=invAr(r)*br(r);
//});
//m_ur[0]=zero;
//m_ur[m_mesh.numberOfNodes()-1]=zero;
//return m_ur;
//}
Kokkos
::
View
<
Rd
**>
// Fonction qui calcule F_jr // A MODIFIER
computeFjr
(
const
Kokkos
::
View
<
const
Rdd
**>&
Ajr
,
computeFjr
(
const
Kokkos
::
View
<
const
Rdd
**>&
Ajr
,
const
Kokkos
::
View
<
const
Rd
*>&
ur
,
const
Kokkos
::
View
<
const
Rd
*>&
ur
,
const
Kokkos
::
View
<
const
Rd
**>&
Cjr
,
const
Kokkos
::
View
<
const
Rd
**>&
Cjr
,
...
@@ -176,7 +92,7 @@ private:
...
@@ -176,7 +92,7 @@ private:
return
m_Fjr
;
return
m_Fjr
;
}
}
Kokkos
::
View
<
Rd
**>
// Fonction qui calcule G_jr // A MODIFIER
Kokkos
::
View
<
Rd
**>
// Fonction qui calcule G_jr // A MODIFIER
// Ajout de k
computeGjr
(
const
Kokkos
::
View
<
const
Rdd
**>&
Ajr
,
computeGjr
(
const
Kokkos
::
View
<
const
Rdd
**>&
Ajr
,
const
Kokkos
::
View
<
const
Rd
*>&
ur
,
const
Kokkos
::
View
<
const
Rd
*>&
ur
,
const
Kokkos
::
View
<
const
Rd
**>&
Cjr
,
const
Kokkos
::
View
<
const
Rd
**>&
Cjr
,
...
@@ -195,22 +111,6 @@ private:
...
@@ -195,22 +111,6 @@ private:
return
m_Gjr
;
return
m_Gjr
;
}
}
// Calcul la liste des inverses d'une liste de matrices (pour
// l'instant seulement $R^{1\times 1}$)
//void inverse(const Kokkos::View<const Rdd*>& A,
// Kokkos::View<Rdd*>& inv_A) const {
//Kokkos::parallel_for(A.size(), KOKKOS_LAMBDA(const int& r) {
// inv_A(r) = Rdd{1./(A(r)(0,0))};
// });
//}
// Calcul 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) {
// inv_x(r) = 1./x(r);
// });
// }
// Enchaine les operations pour calculer les flux (Fjr et ur) pour // A MODIFIER
// Enchaine les operations pour calculer les flux (Fjr et ur) pour // A MODIFIER
// pouvoir derouler le schema
// pouvoir derouler le schema
...
@@ -268,12 +168,14 @@ public:
...
@@ -268,12 +168,14 @@ public:
KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION
double
acoustic_dt
(
const
Kokkos
::
View
<
const
double
*>&
Vj
,
double
acoustic_dt
(
const
Kokkos
::
View
<
const
double
*>&
Vj
,
const
Kokkos
::
View
<
const
double
*>&
cj
)
const
{
const
Kokkos
::
View
<
const
double
*>&
cj
)
const
{
Kokkos
::
View
<
double
*>
dt_j
(
"dt_j"
,
m_mesh
.
numberOfCells
());
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
m_Vj_over_cj
[
j
]
=
Vj
[
j
]
/
cj
[
j
];
m_Vj_over_cj
[
j
]
=
Vj
[
j
]
/
cj
[
j
];
// La tu mets la formule pour chaque maille
});
});
double
dt
=
std
::
numeric_limits
<
double
>::
max
();
double
dt
=
std
::
numeric_limits
<
double
>::
max
();
Kokkos
::
parallel_reduce
(
m_mesh
.
numberOfCells
(),
ReduceMin
(
m_Vj_over_c
j
),
dt
);
Kokkos
::
parallel_reduce
(
m_mesh
.
numberOfCells
(),
ReduceMin
(
dt_
j
),
dt
);
return
dt
;
return
dt
;
}
}
...
...
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