47 namespace LibUtilities
69 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
70 m_num_processes[0] =
m_hcomm->GetSize();
85 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
86 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
93 (NumStrips > global_rank_id) ? global_rank_id:(global_rank_id - NumStrips);
98 for(
int i = 0 ; i < m_num_points_per_proc[0] ; i++)
138 m_num_homogeneous_points[0] = HomoBasis0.
GetNumPoints();
139 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
140 m_num_homogeneous_points[1] = HomoBasis1.
GetNumPoints();
141 m_num_homogeneous_coeffs[1] = HomoBasis1.
GetNumModes();
143 m_num_processes[0] =
m_hcomm->GetRowComm()->GetSize();
144 m_num_processes[1] =
m_hcomm->GetColumnComm()->GetSize();
179 ASSERTL0(
false,
"Transposition is not set up for 3D.");
262 ASSERTL0(
false,
"Transposition not implemented yet.");
267 ASSERTL0(
false,
"Transposition not implemented yet.");
272 ASSERTL0(
false,
"Transposition not implemented yet.");
277 ASSERTL0(
false,
"Transposition type does not exist.");
299 int num_dofs = inarray.num_elements();
301 int num_pencil_per_proc =
308 for(i = 0; i < m_num_processes[0]; i++)
312 m_OffsetMap[i] = i * num_pencil_per_proc *
313 m_num_points_per_proc[0];
326 packed_len = m_num_homogeneous_points[0];
330 while(index < num_points_per_plane)
333 num_pencil_per_proc < (num_points_per_plane - index)
334 ? num_pencil_per_proc
335 : (num_points_per_plane - index);
340 &(inarray[index + (i * num_points_per_plane)]), 1,
341 &(outarray[cnt]), 1);
343 cnt += num_pencil_per_proc;
352 for(i = 0; i < packed_len; ++i)
355 &(tmp_outarray[i * num_pencil_per_proc]), 1,
356 &(outarray[i]), packed_len);
365 int i, pts_per_plane;
366 int n = inarray.num_elements();
380 ASSERTL1(&inarray[0] != &outarray[0],
381 "Inarray and outarray cannot be the same");
383 for(i = 0; i < packed_len; ++i)
386 &(inarray[i * pts_per_plane]), 1,
387 &(outarray[i]), packed_len);
409 int num_dofs = outarray.num_elements();
411 int num_pencil_per_proc =
418 for(i = 0; i < m_num_processes[0]; i++)
422 m_OffsetMap[i] = i * num_pencil_per_proc *
423 m_num_points_per_proc[0];
430 num_pencil_per_proc*m_num_homogeneous_points[0],
439 packed_len = m_num_homogeneous_points[0];
443 for(i = 0; i < packed_len; ++i)
445 Vmath::Vcopy(num_pencil_per_proc,&(inarray[i]),packed_len,
446 &(tmp_inarray[i*num_pencil_per_proc]),1);
452 while(index < num_points_per_plane)
455 num_pencil_per_proc < (num_points_per_plane - index)
456 ? num_pencil_per_proc
457 : (num_points_per_plane - index);
462 &(tmp_outarray[cnt]), 1,
463 &(outarray[index + (i * num_points_per_plane)]), 1);
465 cnt += num_pencil_per_proc;
478 int n = inarray.num_elements();
494 ASSERTL1(&inarray[0] != &outarray[0],
495 "Inarray and outarray cannot be the same");
497 for(i = 0; i < packed_len; ++i)
500 &(inarray[i]), packed_len,
501 &(outarray[i * pts_per_plane]), 1);
518 "Parallel transposition not implemented yet for "
519 "3D-Homo-2D approach.");
524 int n = inarray.num_elements();
541 ASSERTL1(&inarray[0] != &outarray[0],
542 "Inarray and outarray cannot be the same");
544 for(i = 0; i < packed_len; ++i)
547 &(inarray[i * pts_per_line]), 1,
548 &(outarray[i]), packed_len);
565 "Parallel transposition not implemented yet for "
566 "3D-Homo-2D approach.");
571 int n = inarray.num_elements();
588 ASSERTL1(&inarray[0] != &outarray[0],
589 "Inarray and outarray cannot be the same");
591 for(i = 0; i < packed_len; ++i)
594 &(inarray[i]), packed_len,
595 &(outarray[i * pts_per_line]), 1);
612 "Parallel transposition not implemented yet for "
613 "3D-Homo-2D approach.");
619 int s = inarray.num_elements();
621 int pts_per_line = s/n;
623 int packed_len = pts_per_line * m_num_homogeneous_points[1];
625 for(
int i = 0; i < m_num_homogeneous_points[0] ; ++i)
628 &(inarray[i]), m_num_homogeneous_points[0],
629 &(outarray[i * packed_len]), 1);
646 "Parallel transposition not implemented yet for "
647 "3D-Homo-2D approach.");
653 int s = inarray.num_elements();
655 int pts_per_line = s/n;
657 int packed_len = pts_per_line * m_num_homogeneous_points[1];
659 for(
int i = 0; i < packed_len ; ++i)
662 &(inarray[i]), packed_len,
663 &(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)
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm0, LibUtilities::CommSharedPtr hcomm1)
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.
unsigned int GetStripID(void)
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
unsigned int m_strip_ID
IDs of the strips on the processes.
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.