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.");
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.");
283 int num_dofs = inarray.num_elements();
285 int num_pencil_per_proc =
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];
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);
393 int num_dofs = outarray.num_elements();
395 int num_pencil_per_proc =
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];
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);
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);
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);
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);
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);
void TransposeZYtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
#define ASSERTL0(condition, msg)
Array< OneD, unsigned int > GetPlanesIDs(void)
int m_rank_id
Rank of process.
void TransposeXYtoZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
BasisType GetBasisType() const
Return type of expansion basis.
void TransposeYZtoX(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeZtoXY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_num_homogeneous_points
Total homogeneous points per direction.
Array< OneD, int > m_OffsetMap
MPI_Alltoallv offset map of send/recv buffer in global vector.
void TransposeXtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_SizeMap
MPI_Alltoallv map containing size of send/recv buffer.
Array< OneD, unsigned int > m_planes_IDs
IDs of the planes on the processes.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void TransposeYZtoZY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Fourier Modified expansions with just the real part of the first mode .
unsigned int GetPlaneID(int i)
int GetNumPoints() const
Return points order at which basis is defined.
int m_num_homogeneous_directions
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm)
Fourier Modified expansions with just the imaginary part of the first mode .
Array< OneD, int > m_num_processes
Array< OneD, unsigned int > m_K
Fourier wave numbers associated with the planes.
Array< OneD, int > m_num_homogeneous_coeffs
Total number of homogeneous coefficients.
Fourier ModifiedExpansion with just the first mode .
void Transpose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false, TranspositionDir dir=eNoTrans)
Array< OneD, unsigned int > GetKs(void)
int GetNumModes() const
Returns the order of the basis.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Describes the specification for a Basis.
Array< OneD, int > m_num_points_per_proc
Number of homogeneous points on each processor per direction.