70 m_default_mesh(m_sub_domain->defaultMesh()),
75 "InterfaceDistance2ForEnv",
78 info() <<
"Loading Hyoda's environments plugin";
79 info() <<
"Setting a maximum of " << HYODA_MAX_ENV <<
" environments";
89 hyoda()->meshIceT()->setColor(min,max,val,rgb);
90 glColor3d(rgb[0], rgb[1], rgb[2]);
92 glColor3d(rgb[0], rgb[1], rgb[2]);
93 glVertex2d(m_default_mesh->nodesCoordinates()[node].x,
94 m_default_mesh->nodesCoordinates()[node].y);
99 glColor3d(0.0, 0.0, 0.0);
101 glVertex2d(m_default_mesh->nodesCoordinates()[node].x,
102 m_default_mesh->nodesCoordinates()[node].y);
114 dist_min =
math::scaMul(m_default_mesh->nodesCoordinates()[cell.
node(0)],normal);
115 dist_max =
math::scaMul(m_default_mesh->nodesCoordinates()[cell.
node(0)],normal);
117 for (
Integer node_id = 0; node_id < cell_nb_node; ++node_id) {
118 const Node& node=cell.
node(node_id);
120 if (dist < dist_min) dist_min = dist;
121 if (dist > dist_max) dist_max = dist;
131 ARCANE_UNUSED(global_min);
132 ARCANE_UNUSED(global_max);
135 info()<<
"\n\r\33[7m[HyodaEnvs::draw] Focusing on variable "<<variable->
name()<<
"\33[m";
142 debug()<<
"\33[7m[HyodaEnvs::draw] Calcul des min et max locaux aux envCells\33[m";
143 Real local_min, local_max;
144 local_min=local_max=0.0;
148 for(
int iEnvOrder=0, mx=allEnvCell.
nbEnvironment(); iEnvOrder<mx; ++iEnvOrder){
149 Integer num_env = number_env[cell][iEnvOrder];
150 if (num_env==-1)
continue;
154 Real val=cell_variable[envCell];
165 debug()<<
"\33[7m[HyodaEnvs::draw] ENUMERATE_ALLENVCELL\33[m";
169 Real3 normal = m_interface_normal[cell];
173 if (normal.
abs()==0.)
continue;
174 info()<<
"\n\r\33[7m[HyodaEnvs::draw] #"<<cell.
uniqueId()<<
", normal="<<normal <<
"\33[m";
177 hyodaMix()->setCellOrigin(cell);
179 Real dist_min, dist_max;
182 computeDistMinMax(cell,normal,dist_min,dist_max);
189 Int32 nbNumberedMilieux=0;
190 for(
int iEnvOrder=0, mx=allEnvCell.
nbEnvironment(); iEnvOrder<mx; ++iEnvOrder){
191 Integer num_env = number_env[cell][iEnvOrder];
192 if (num_env==-1)
continue;
193 nbNumberedMilieux+=1;
197 Int32 nbOrderedMilieux=0;
199 Integer ord_env = order_env[iEnvCell];
200 if (ord_env==-1)
continue;
201 if (ord_env > HYODA_MAX_ENV)
203 <<
": while counting nbOrderedMilieux, ord_env="
204 << ord_env <<
" > " << HYODA_MAX_ENV <<
"\33[m";
205 if (ord_env > HYODA_MAX_ENV)
continue;
230 for(
int iEnvOrder=0, mx=allEnvCell.
nbEnvironment(); iEnvOrder<mx; ++iEnvOrder){
231 Integer num_env = number_env[cell][iEnvOrder];
232 if (num_env==-1)
continue;
233 Real its_distance=m_interface_distance_env[cell][num_env];
234 info() <<
"[HyodaEnvs::draw] num_env=" << num_env <<
", its distance=" << its_distance;
235 if (its_distance < dist_min)
warning()<<
"its_distance < dist_min";
236 if (its_distance > dist_max)
warning()<<
"its_distance > dist_max";
238 Int32 xPts=hyodaMix()->xCellPoints(cell, normal, its_distance, iMilieux);
240 if (its_distance < dist_min) xPts=0x0;
242 if (its_distance > dist_max) xPts=0xF;
244 if (nbNumberedMilieux==1) xPts=0xF;
245 info() <<
"\t\33[7m[HyodaEnvs::draw] xPts["<<iEnvOrder<<
"]="<<xPts<<
"\33[m";
248 m_x_codes[cell]|=xPts<<(iMilieux<<2);
265 for(
int iEnvOrder=0, mx=allEnvCell.
nbEnvironment(); iEnvOrder<mx; ++iEnvOrder){
267 Integer num_env = number_env[cell][iEnvOrder];
268 if (num_env==-1)
continue;
269 debug()<<
"\t[HyodaEnvs::draw] Looking for num_env="<<num_env;
278 debug() <<
"\t\t[HyodaEnvs::draw] \33[7m"
279 << iMilieux <<
"/" << (nbNumberedMilieux-1)
280 <<
" val=" << cell_variable[envCell] <<
"\33[m";
281 debug()<<
"\t\t[HyodaEnvs::draw] iMilieux="<<iMilieux;
283 hyodaMix()->xCellFill(cell, xCodes,
284 local_min, local_max,
285 cell_variable[envCell],
295 if (hit_env!=num_env){
297 <<
": Environement "<<num_env<<
" non trouvé dans les milieux!\33[m";
305 if (iMilieux!=nbNumberedMilieux){
307 <<
": tous les milieux n'ont pas été dessinés!\33[m";
312 Integer order = order_env[ienvcell];
313 if (order == -1 )
continue;
314 if (order > HYODA_MAX_ENV){
316 <<
": order_env > "<<HYODA_MAX_ENV<<
"\33[m";
319 if (order>=nbOrderedMilieux){
321 <<
": En redessinant via order_env, le milieu "<<order
322 <<
" est réclamé, alors qu'on en a "<<nbOrderedMilieux<<
"\33[m";
324 <<
": On tente de patcher l'offset\33[m";
328 if (order<iPatchOffset)
continue;
329 hyodaMix()->xCellFill(cell, xCodes,
330 local_min, local_max,
331 cell_variable[envCell],
337 if (iOrderedMilieux!=nbOrderedMilieux)
339 <<
": Même via les order_env, les milieux n'ont pas tous été dessinés\33[m";
349 IMesh* m_default_mesh;
Interface du gestionnaire d'un sous-domaine.