89 for (
int k = 0; k < ksz; k++)
90 for (
int j = 0; j < jsz; j++)
96 else if (shear_BC_helpler_.monofluide_variable_==2 && offset >0.)
98 for (
int i = 0; i < isz; i++)
99 for (
int k = 0; k < ksz; k++)
100 for (
int j = 0; j < jsz; j++)
101 dest[
IJK_Field_local_template<_TYPE_,_TYPE_ARRAY_>::linear_index(i + ir , j + jr , k + kr)]=(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmin_(i + ir , j + jr , k+2-nb_ghost)*(_TYPE_)shear_BC_helpler_.Phi_ppty_l_+((_TYPE_)1.-(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmin_(i + ir , j + jr , k+2-nb_ghost))*(_TYPE_)shear_BC_helpler_.Phi_ppty_v_;
107 for (
int i = 0; i < isz; i++)
109 shear_BC_helpler_.prepare_interpolation_for_shear_periodicity((
int) round((
double) i + (
double) is + offset), ((
double) i + (
double) is + offset), isz);
110 for (
int k = 0; k < ksz; k++)
111 for (
int j = 0; j < jsz; j++)
118 const int data_size = isz * jsz * ksz;
119 const int data_size_other_buf = 1;
120 const int type_size =
sizeof(_TYPE_);
121 const int double_size =
sizeof(double);
122 const int int_size =
sizeof(int);
123 _TYPE_ *send_buffer = 0;
124 _TYPE_ *recv_buffer = 0;
125 double *send_buffer_offset = 0;
126 double *recv_buffer_offset = 0;
127 int *send_buffer_nb_ghost = 0;
128 int *recv_buffer_nb_ghost = 0;
132 send_buffer =
new _TYPE_[data_size];
133 _TYPE_ *buf = send_buffer;
134 send_buffer_offset =
new double[data_size_other_buf];
135 double *buf_offset = send_buffer_offset;
136 send_buffer_nb_ghost =
new int[data_size_other_buf];
137 int *buf_nb_ghost = send_buffer_nb_ghost;
139 *buf_nb_ghost=nb_ghost;
143 for (
int i = 0; i < isz; i++)
144 for (
int k = 0; k < ksz; k++)
145 for (
int j = 0; j < jsz; j++, buf++)
149 else if (shear_BC_helpler_.monofluide_variable_==1 && offset <0.)
151 for (
int i = 0; i < isz; i++)
153 shear_BC_helpler_.prepare_interpolation_for_shear_periodicity((
int) round((
double) i + (
double) is + offset), ((
double) i + (
double) is + offset), isz);
154 for (
int k = 0; k < ksz; k++)
155 for (
int j = 0; j < jsz; j++, buf++)
157 _TYPE_ interpIsigkappazmin= 0.;
158 _TYPE_ interpIsigkappazmax= 0.;
159 interpolation_for_shear_periodicity_I_sig_kappa(j + js, k+2, k+2, interpIsigkappazmin, interpIsigkappazmax);
160 *buf = interpolation_for_shear_periodicity_IJK_Field(j + js, k + ks) + interpIsigkappazmin;
165 else if (shear_BC_helpler_.monofluide_variable_==1 && offset >0.)
167 for (
int i = 0; i < isz; i++)
169 shear_BC_helpler_.prepare_interpolation_for_shear_periodicity((
int) round((
double) i + (
double) is + offset), ((
double) i + (
double) is + offset), isz);
170 for (
int k = 0; k < ksz; k++)
171 for (
int j = 0; j < jsz; j++, buf++)
173 _TYPE_ interpIsigkappazmin= 0.;
174 _TYPE_ interpIsigkappazmax= 0.;
175 interpolation_for_shear_periodicity_I_sig_kappa(j + js, k+2-nb_ghost, k+2-nb_ghost, interpIsigkappazmin, interpIsigkappazmax);
176 *buf = interpolation_for_shear_periodicity_IJK_Field(j + js, k + ks) + interpIsigkappazmax;
181 else if (shear_BC_helpler_.monofluide_variable_==2)
183 for (
int i = 0; i < isz; i++)
184 for (
int k = 0; k < ksz; k++)
185 for (
int j = 0; j < jsz; j++, buf++)
191 for (
int i = 0; i < isz; i++)
193 shear_BC_helpler_.prepare_interpolation_for_shear_periodicity((
int) round((
double) i + (
double) is + offset), ((
double) i + (
double) is + offset), isz);
194 for (
int k = 0; k < ksz; k++)
195 for (
int j = 0; j < jsz; j++, buf++)
196 *buf= interpolation_for_shear_periodicity_IJK_Field(j + js, k + ks) + (_TYPE_) jump_i;
203 recv_buffer =
new _TYPE_[data_size];
204 recv_buffer_offset =
new double[data_size_other_buf];
205 recv_buffer_nb_ghost =
new int[data_size_other_buf];
207 ::envoyer_recevoir(send_buffer, data_size * type_size, pe_send_, recv_buffer, data_size * type_size, pe_recv_);
208 ::envoyer_recevoir(send_buffer_offset, data_size_other_buf * double_size, pe_send_, recv_buffer_offset, data_size_other_buf * double_size, pe_recv_);
209 ::envoyer_recevoir(send_buffer_nb_ghost, data_size_other_buf * int_size, pe_send_, recv_buffer_nb_ghost, data_size_other_buf * int_size, pe_recv_);
213 _TYPE_ *buf = recv_buffer;
214 double *buf_offset = recv_buffer_offset;
215 int *buf_nb_ghost= recv_buffer_nb_ghost;
218 if (*buf_offset == 0.)
220 for (
int i = 0; i < isz; i++)
221 for (
int k = 0; k < ksz; k++)
222 for (
int j = 0; j < jsz; j++, buf++)
226 else if (shear_BC_helpler_.monofluide_variable_==1 && *buf_offset <0.)
228 for (
int i = 0; i < isz; i++)
229 for (
int k = 0; k < ksz; k++)
230 for (
int j = 0; j < jsz; j++, buf++)
236 else if (shear_BC_helpler_.monofluide_variable_==1 && *buf_offset >0.)
238 for (
int i = 0; i < isz; i++)
239 for (
int k = 0; k < ksz; k++)
240 for (
int j = 0; j < jsz; j++, buf++)
247 else if (shear_BC_helpler_.monofluide_variable_==2 && *buf_offset <0.)
249 for (
int i = 0; i < isz; i++)
250 for (
int k = 0; k < ksz; k++)
251 for (
int j = 0; j < jsz; j++, buf++)
252 dest[
IJK_Field_local_template<_TYPE_,_TYPE_ARRAY_>::linear_index(ir + i, jr + j, kr + k)]=(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmax_(ir + i , jr + j , k+2)*(_TYPE_)shear_BC_helpler_.Phi_ppty_l_+((_TYPE_)1.-(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmax_(ir + i , jr + j , k+2))*(_TYPE_)shear_BC_helpler_.Phi_ppty_v_;
256 else if (shear_BC_helpler_.monofluide_variable_==2 && *buf_offset >0.)
258 for (
int i = 0; i < isz; i++)
259 for (
int k = 0; k < ksz; k++)
260 for (
int j = 0; j < jsz; j++, buf++)
261 dest[
IJK_Field_local_template<_TYPE_,_TYPE_ARRAY_>::linear_index(ir + i, jr + j, kr + k)]=(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmin_(ir + i , jr + j , k+2-*buf_nb_ghost)*(_TYPE_)shear_BC_helpler_.Phi_ppty_l_+((_TYPE_)1.-(_TYPE_) shear_BC_helpler_.indicatrice_ghost_zmin_(ir + i , jr + j , k+2-*buf_nb_ghost))*(_TYPE_)shear_BC_helpler_.Phi_ppty_v_;
267 for (
int i = 0; i < isz; i++)
268 for (
int k = 0; k < ksz; k++)
269 for (
int j = 0; j < jsz; j++, buf++)
275 delete[] send_buffer;
276 delete[] recv_buffer;
277 delete[] send_buffer_offset;
278 delete[] recv_buffer_offset;
279 delete[] send_buffer_nb_ghost;
280 delete[] recv_buffer_nb_ghost;
289 statistics().begin_count(STD_COUNTERS::virtual_swap);
307 double offset_i = 0.0;
314 offset_i = Shear_x_time/DX;
316 exchange_data(pe_imin_, 0, 0, 0, pe_imax_, nii, 0, 0, le_ghost, njj, nkk);
317 exchange_data(pe_imax_, nii - le_ghost, 0, 0, pe_imin_, -le_ghost, 0, 0, le_ghost, njj, nkk);
318 exchange_data(pe_jmin_, 0, 0, 0, pe_jmax_, 0, njj, 0, nii, le_ghost, nkk);
319 exchange_data(pe_jmax_, 0, njj - le_ghost, 0, pe_jmin_, 0, -le_ghost, 0, nii, le_ghost, nkk);
322 exchange_data(pe_kmin_, 0, 0, 0, pe_kmax_, 0, 0, nkk, nii , njj , le_ghost);
324 exchange_data(pe_kmin_, 0, 0, 0, pe_kmax_, 0, 0, nkk, nii, njj, le_ghost, -offset_i,
shear_BC_helpler_.DU_, le_ghost);
327 exchange_data(pe_kmax_, 0, 0, nkk - le_ghost, pe_kmin_, 0, 0, -le_ghost, nii, njj, le_ghost);
329 exchange_data(pe_kmax_, 0, 0, nkk - le_ghost, pe_kmin_, 0, 0, -le_ghost, nii, njj, le_ghost, offset_i, -
shear_BC_helpler_.DU_, le_ghost);
332 exchange_data(pe_imin_, 0, -le_ghost, 0 , pe_imax_, nii, -le_ghost, 0, le_ghost, le_ghost, nkk);
333 exchange_data(pe_imin_, 0, njj , 0 , pe_imax_, nii, njj , 0, le_ghost, le_ghost, nkk);
334 exchange_data(pe_imax_, nii-le_ghost, -le_ghost, 0 , pe_imin_, -le_ghost, -le_ghost, 0, le_ghost, le_ghost, nkk);
335 exchange_data(pe_imax_, nii-le_ghost, njj , 0 , pe_imin_, -le_ghost, njj , 0, le_ghost, le_ghost, nkk);
337 exchange_data(pe_jmin_, 0, 0, -le_ghost, pe_jmax_, 0 , njj, -le_ghost, nii, le_ghost, le_ghost);
338 exchange_data(pe_jmin_, 0, 0, nkk , pe_jmax_, 0 , njj, nkk , nii, le_ghost, le_ghost);
339 exchange_data(pe_jmax_, 0, njj-le_ghost, - le_ghost, pe_jmin_, 0, -le_ghost, -le_ghost, nii, le_ghost, le_ghost);
340 exchange_data(pe_jmax_, 0, njj-le_ghost, nkk , pe_jmin_, 0, -le_ghost, nkk , nii, le_ghost, le_ghost);
342 exchange_data(pe_kmin_, -le_ghost, 0 , 0, pe_kmax_, -le_ghost, 0, nkk, le_ghost, njj, le_ghost);
343 exchange_data(pe_kmin_, nii , 0 , 0, pe_kmax_, nii , 0, nkk, le_ghost, njj, le_ghost);
344 exchange_data(pe_kmax_, -le_ghost, 0 , nkk-le_ghost, pe_kmin_, -le_ghost, 0, -le_ghost, le_ghost, njj, le_ghost);
345 exchange_data(pe_kmax_, nii , 0 , nkk-le_ghost, pe_kmin_, nii , 0, -le_ghost, le_ghost, njj, le_ghost);
348 exchange_data(pe_imin_, 0, -le_ghost, -le_ghost , pe_imax_, nii, -le_ghost, -le_ghost, le_ghost, le_ghost, le_ghost);
349 exchange_data(pe_imin_, 0, njj , -le_ghost , pe_imax_, nii, njj , -le_ghost, le_ghost, le_ghost, le_ghost);
350 exchange_data(pe_imin_, 0, -le_ghost, nkk , pe_imax_, nii, -le_ghost, nkk , le_ghost, le_ghost, le_ghost);
351 exchange_data(pe_imin_, 0, njj , nkk , pe_imax_, nii, njj , nkk , le_ghost, le_ghost, le_ghost);
352 exchange_data(pe_imax_, nii-le_ghost, -le_ghost, -le_ghost, pe_imin_, -le_ghost, -le_ghost, -le_ghost , le_ghost, le_ghost, le_ghost);
353 exchange_data(pe_imax_, nii-le_ghost, njj , -le_ghost, pe_imin_, -le_ghost, njj , -le_ghost , le_ghost, le_ghost, le_ghost);
354 exchange_data(pe_imax_, nii-le_ghost, -le_ghost, nkk , pe_imin_, -le_ghost, -le_ghost, nkk , le_ghost, le_ghost, le_ghost);
355 exchange_data(pe_imax_, nii-le_ghost, njj , nkk , pe_imin_, -le_ghost, njj , nkk , le_ghost, le_ghost, le_ghost);
357 statistics().end_count(STD_COUNTERS::virtual_swap);
464 double offset = Shear_x_time/dxi;
473 double coeff_matrice = dxi * dxj / dxk;
486 for (
int j = 0 ; j <
nj; j++)
488 for (
int i = 0 ; i <
ni; i++)
490 shear_BC_helpler_.prepare_interpolation_for_shear_periodicity((
int) round((
double) i + offset), ((
double) i + offset),
ni);
503 rho =2./((1./rho_minus_1)+(1./rho_0));
507 rho =(rho_minus_1+rho_0)/2.;
509 _TYPE_ interpIsigkappazmin = 0.;
510 _TYPE_ interpIsigkappazmax = 0.;
512 _TYPE_ erreur = interpIsigkappazmax-(_TYPE_)
shear_BC_helpler_.I_sig_kappa_zmin_(i , j , 1);
513 resu(i,j,0)+=(coeff_matrice/rho)*erreur;
527 rho =2./((1./rho_nk_plus_1)+(1./rho_nk));
531 rho =(rho_nk_plus_1+rho_nk)/2.;
533 _TYPE_ interpIsigkappazmin= 0.;
534 _TYPE_ interpIsigkappazmax= 0.;
536 _TYPE_ erreur = interpIsigkappazmin-(_TYPE_)
shear_BC_helpler_.I_sig_kappa_zmax_(i , j , 2);
537 resu(i,j,
nk-1)+=(coeff_matrice/rho)*erreur;