47 namespace LibUtilities
68 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
69 m_num_processes[0] =
m_hcomm->GetSize();
86 for(
int i = 0 ; i < m_num_points_per_proc[0] ; i++)
126 m_num_homogeneous_points[0] = HomoBasis0.
GetNumPoints();
127 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
128 m_num_homogeneous_points[1] = HomoBasis1.
GetNumPoints();
129 m_num_homogeneous_coeffs[1] = HomoBasis1.
GetNumModes();
131 m_num_processes[0] =
m_hcomm->GetRowComm()->GetSize();
132 m_num_processes[1] =
m_hcomm->GetColumnComm()->GetSize();
167 ASSERTL0(
false,
"Transposition is not set up for 3D.");
208 const Array<OneD,const NekDouble> &inarray,
209 Array<OneD, NekDouble> &outarray,
246 ASSERTL0(
false,
"Transposition not implemented yet.");
251 ASSERTL0(
false,
"Transposition not implemented yet.");
256 ASSERTL0(
false,
"Transposition not implemented yet.");
261 ASSERTL0(
false,
"Transposition type does not exist.");
271 const Array<OneD,const NekDouble> &inarray,
272 Array<OneD, NekDouble> &outarray,
283 int num_dofs = inarray.num_elements();
285 int num_pencil_per_proc =
290 m_OffsetMap = Array<OneD,int> (m_num_processes[0],0);
292 for(i = 0; i < m_num_processes[0]; i++)
296 m_OffsetMap[i] = i * num_pencil_per_proc *
297 m_num_points_per_proc[0];
300 Array< OneD, NekDouble> tmp_outarray(
310 packed_len = m_num_homogeneous_points[0];
314 while(index < num_points_per_plane)
317 num_pencil_per_proc < (num_points_per_plane - index)
318 ? num_pencil_per_proc
319 : (num_points_per_plane - index);
324 &(inarray[index + (i * num_points_per_plane)]), 1,
325 &(outarray[cnt]), 1);
327 cnt += num_pencil_per_proc;
336 for(i = 0; i < packed_len; ++i)
339 &(tmp_outarray[i * num_pencil_per_proc]), 1,
340 &(outarray[i]), packed_len);
349 int i, pts_per_plane;
350 int n = inarray.num_elements();
364 ASSERTL1(&inarray[0] != &outarray[0],
365 "Inarray and outarray cannot be the same");
367 for(i = 0; i < packed_len; ++i)
370 &(inarray[i * pts_per_plane]), 1,
371 &(outarray[i]), packed_len);
381 const Array<OneD,const NekDouble> &inarray,
382 Array<OneD, NekDouble> &outarray,
393 int num_dofs = outarray.num_elements();
395 int num_pencil_per_proc =
400 m_OffsetMap = Array<OneD,int> (m_num_processes[0],0);
402 for(i = 0; i < m_num_processes[0]; i++)
406 m_OffsetMap[i] = i * num_pencil_per_proc *
407 m_num_points_per_proc[0];
410 Array< OneD, NekDouble> tmp_inarray(
413 Array< OneD, NekDouble> tmp_outarray(
414 num_pencil_per_proc*m_num_homogeneous_points[0],
423 packed_len = m_num_homogeneous_points[0];
427 for(i = 0; i < packed_len; ++i)
429 Vmath::Vcopy(num_pencil_per_proc,&(inarray[i]),packed_len,
430 &(tmp_inarray[i*num_pencil_per_proc]),1);
436 while(index < num_points_per_plane)
439 num_pencil_per_proc < (num_points_per_plane - index)
440 ? num_pencil_per_proc
441 : (num_points_per_plane - index);
446 &(tmp_outarray[cnt]), 1,
447 &(outarray[index + (i * num_points_per_plane)]), 1);
449 cnt += num_pencil_per_proc;
462 int n = inarray.num_elements();
478 ASSERTL1(&inarray[0] != &outarray[0],
479 "Inarray and outarray cannot be the same");
481 for(i = 0; i < packed_len; ++i)
484 &(inarray[i]), packed_len,
485 &(outarray[i * pts_per_plane]), 1);
495 const Array<OneD,const NekDouble> &inarray,
496 Array<OneD, NekDouble> &outarray,
502 "Parallel transposition not implemented yet for "
503 "3D-Homo-2D approach.");
508 int n = inarray.num_elements();
525 ASSERTL1(&inarray[0] != &outarray[0],
526 "Inarray and outarray cannot be the same");
528 for(i = 0; i < packed_len; ++i)
531 &(inarray[i * pts_per_line]), 1,
532 &(outarray[i]), packed_len);
542 const Array<OneD,const NekDouble> &inarray,
543 Array<OneD, NekDouble> &outarray,
549 "Parallel transposition not implemented yet for "
550 "3D-Homo-2D approach.");
555 int n = inarray.num_elements();
572 ASSERTL1(&inarray[0] != &outarray[0],
573 "Inarray and outarray cannot be the same");
575 for(i = 0; i < packed_len; ++i)
578 &(inarray[i]), packed_len,
579 &(outarray[i * pts_per_line]), 1);
589 const Array<OneD,const NekDouble> &inarray,
590 Array<OneD, NekDouble> &outarray,
596 "Parallel transposition not implemented yet for "
597 "3D-Homo-2D approach.");
603 int s = inarray.num_elements();
605 int pts_per_line = s/n;
607 int packed_len = pts_per_line * m_num_homogeneous_points[1];
609 for(
int i = 0; i < m_num_homogeneous_points[0] ; ++i)
612 &(inarray[i]), m_num_homogeneous_points[0],
613 &(outarray[i * packed_len]), 1);
623 const Array<OneD,const NekDouble> &inarray,
624 Array<OneD, NekDouble> &outarray,
630 "Parallel transposition not implemented yet for "
631 "3D-Homo-2D approach.");
637 int s = inarray.num_elements();
639 int pts_per_line = s/n;
641 int packed_len = pts_per_line * m_num_homogeneous_points[1];
643 for(
int i = 0; i < packed_len ; ++i)
646 &(inarray[i]), packed_len,
647 &(outarray[i * m_num_homogeneous_points[0]]), 1);