Skip to content
Snippets Groups Projects
Commit ee9eeaac authored by Fanny CHOPOT's avatar Fanny CHOPOT
Browse files

correction fonction updateVolumeCenter()

parent 4f8921a0
No related branches found
No related tags found
No related merge requests found
......@@ -72,12 +72,11 @@ private:
});
}
// Ajout fonction pour calculer h_i+1/2
KOKKOS_INLINE_FUNCTION
void _updateVolumeCenter()
{
const Kokkos::View<const unsigned int**>& cell_nodes
= m_mesh.connectivity().cellNodes();
const Kokkos::View<const unsigned int**>& face_cells
= m_mesh.connectivity().faceCells();
const Kokkos::View<const unsigned short*> face_nb_cells
= m_mesh.connectivity().faceNbCells();
......@@ -88,14 +87,16 @@ private:
const Kokkos::View<const unsigned short*> cell_nb_faces
= m_mesh.connectivity().cellNbFaces();
Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j){
const Kokkos::View<const Rd*> xr = m_mesh.xr();
Kokkos::parallel_for(m_mesh.numberOfFaces(), KOKKOS_LAMBDA(const int& l){
double sum_cjr_xj = 0;
for (int l=0; l<cell_nb_faces(j); ++l) {
for (int R=0; R<face_nb_cells[l]; R++) {
sum_cjr_xj += (m_xj[cell_nodes(j,R)], m_Cjr(j,face_cell_local_face(l,R)));
}
for (int local_cell_number=0; local_cell_number<face_nb_cells(l); ++local_cell_number) {
int j = face_cells(l,local_cell_number);
int local_face_number_in_cell = face_cell_local_face(l,local_cell_number);
sum_cjr_xj -= (m_xj[j]-xr(l), m_Cjr(j, local_face_number_in_cell));
}
m_Vl[j] = inv_dimension * sum_cjr_xj;
m_Vl[l] = sum_cjr_xj;
});
}
......@@ -151,7 +152,7 @@ public:
m_Cjr("Cjr", mesh.numberOfCells(), mesh.connectivity().maxNbNodePerCell()),
m_xj("xj", mesh.numberOfCells()),
m_Vj("Vj", mesh.numberOfCells()),
m_Vl("Vl", mesh.numberOfCells())
m_Vl("Vl", mesh.numberOfFaces())
{
if (dimension==1) {
// in 1d Cjr are computed once for all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment