59 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
60 const Domaine& domaine = domaine_VEF.
domaine();
64 int sommet_global, face_opp;
67 DoubleTab vecteur_normal_elem0(
dimension);
68 DoubleTab vecteur_normal_elem1(
dimension);
69 DoubleTab vecteur_normal_opp_elem0(
dimension);
70 DoubleTab vecteur_normal_opp_elem1(
dimension);
72 IntList sommets_elem0, sommets_elem1;
73 IntList faces_opp_elem0, faces_opp_elem1;
81 int nb_faces = domaine_VEF.
nb_faces();
85 Cerr <<
"Error OpRot: only the 2D case is supported at the moment" << finl;
89 for (
int face = premiere_face_int; face < nb_faces; face++)
92 elem0 = face_voisins(face, 0);
93 elem1 = face_voisins(face, 1);
103 for (
int composante = 0; composante <
dimension; composante++)
106 rot(face, composante) += pow(-1., modulo) * (vorticite(elem0) * vecteur_normal_elem0(modulo) + vorticite(elem1) * vecteur_normal_elem1(modulo));
116 sommets_elem0.
vide();
118 sommets_elem1.
vide();
120 faces_opp_elem0.
vide();
122 faces_opp_elem1.
vide();
124 for (
int i = 0; i < domaine.nb_som_elem(); i++)
126 sommets_elem0.
add_if_not(domaine.sommet_elem(elem0, i));
128 sommets_elem1.
add_if_not(domaine.sommet_elem(elem1, i));
137 for (
int composante = 0; composante <
dimension; composante++)
144 double sommation_sommets = 0.;
146 for (
int i = 0; i < sommets_elem0.
size(); i++)
148 sommet_global = sommets_elem0[i];
151 if (sommet_global != domaine.nb_som() - 1)
152 sommation_sommets += vorticite(domaine.nb_elem() + sommet_global);
155 rot(face, composante) += -pow(-1., modulo) / (
dimension + 1) * vecteur_normal_elem0(modulo) * sommation_sommets;
158 sommation_sommets = 0.;
159 for (
int i = 0; i < sommets_elem1.
size(); i++)
161 sommet_global = sommets_elem1[i];
164 if (sommet_global != domaine.nb_som() - 1)
165 sommation_sommets += vorticite(domaine.nb_elem() + sommet_global);
168 rot(face, composante) += -pow(-1., modulo) / (
dimension + 1) * vecteur_normal_elem1(modulo) * sommation_sommets;
177 sommation_sommets = 0.;
178 for (
int i = 0; i < sommets_elem0.
size(); i++)
180 sommet_global = sommets_elem0[i];
183 if (sommet_global != domaine.nb_som() - 1)
185 face_opp = faces_opp_elem0[i];
188 sommation_sommets += vorticite(domaine.nb_elem() + sommet_global) * vecteur_normal_opp_elem0(modulo);
193 rot(face, composante) += pow(-1., modulo) / (
dimension * (
dimension + 1)) * sommation_sommets;
196 sommation_sommets = 0.;
197 for (
int i = 0; i < sommets_elem1.
size(); i++)
199 sommet_global = sommets_elem1[i];
202 if (sommet_global != domaine.nb_som() - 1)
204 face_opp = faces_opp_elem1[i];
207 sommation_sommets += vorticite(domaine.nb_elem() + sommet_global) * vecteur_normal_opp_elem1(modulo);
213 rot(face, composante) += pow(-1., modulo) / (
dimension * (
dimension + 1)) * sommation_sommets;
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_faces() const
Returns the total number of faces.
virtual double face_normales(int face, int comp) const
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
int oriente_normale(int f, int e) const
int premiere_face_int() const
A face is internal if and only if it separates two elements.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const