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

modification formule k dans Fl

parent 961c8050
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
// pas constant // pas constant
/*
Mesh(const Connectivity& connectivity) Mesh(const Connectivity& connectivity)
: m_connectivity(connectivity), : m_connectivity(connectivity),
m_xr("xr", connectivity.numberOfNodes()) m_xr("xr", connectivity.numberOfNodes())
...@@ -60,10 +60,10 @@ public: ...@@ -60,10 +60,10 @@ public:
m_xr[r][0] = r*delta_x; m_xr[r][0] = r*delta_x;
}); });
} }
*/
// pas non constant // pas non constant
/*
Mesh(const Connectivity& connectivity) Mesh(const Connectivity& connectivity)
: m_connectivity(connectivity), : m_connectivity(connectivity),
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
} }
}); });
} }
*/
~Mesh() ~Mesh()
{ {
......
...@@ -103,8 +103,10 @@ private: ...@@ -103,8 +103,10 @@ private:
int cell_here = face_cells(l,j); int cell_here = face_cells(l,j);
int local_face_number_in_cell = face_cell_local_face(l,j); int local_face_number_in_cell = face_cell_local_face(l,j);
sum -= tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)); sum -= tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell));
sum2 += kj(cell_here)*Vj(cell_here); // sum2 += kj(cell_here)*Vj(cell_here);
sum3 += Vj(cell_here); //sum3 += Vj(cell_here);
sum2 += (1./Vj(cell_here))*kj(cell_here);
sum3 += 1./Vj(cell_here);
} }
m_Fl(l) = ((sum2/sum3)/Vl(l))*sum; m_Fl(l) = ((sum2/sum3)/Vl(l))*sum;
...@@ -352,8 +354,8 @@ public: ...@@ -352,8 +354,8 @@ public:
double erreur = 0.; double erreur = 0.;
double exacte = 0.; double exacte = 0.;
for (size_t j=0; j<m_mesh.numberOfCells(); ++j) { for (size_t j=0; j<m_mesh.numberOfCells(); ++j) {
//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(-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 //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])*Vj(j); erreur += (exacte - uj[j][0])*(exacte - uj[j][0])*Vj(j);
} }
erreur = std::sqrt(erreur); erreur = std::sqrt(erreur);
...@@ -370,13 +372,13 @@ public: ...@@ -370,13 +372,13 @@ public:
const Kokkos::View<const Rd*> xj = m_mesh_data.xj(); const Kokkos::View<const Rd*> xj = m_mesh_data.xj();
double pi = 4.*std::atan(1.); double pi = 4.*std::atan(1.);
//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(-2.*pi*pi*0.2); // k constant
double exacte = std::sin(pi*xj[0][0])*std::exp(-0.2); // k non constant //double exacte = std::sin(pi*xj[0][0])*std::exp(-0.2); // k non constant
double erreur = std::abs(exacte - uj[0][0]); double erreur = std::abs(exacte - uj[0][0]);
for (size_t j=1; j<m_mesh.numberOfCells(); ++j) { for (size_t j=1; j<m_mesh.numberOfCells(); ++j) {
//exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); 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); //exacte = std::sin(pi*xj[j][0])*std::exp(-0.2);
if (std::abs(exacte - uj[j][0]) > erreur) { if (std::abs(exacte - uj[j][0]) > erreur) {
erreur = std::abs(exacte - uj[j][0]); erreur = std::abs(exacte - uj[j][0]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment