35 #include <boost/core/ignore_unused.hpp>
47 namespace LibUtilities
80 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
81 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
m_hcomm->GetSize();
88 : (global_rank_id - NumStrips);
152 boost::ignore_unused(HomoBasis0, HomoBasis1, HomoBasis2);
164 ASSERTL0(
false,
"Transposition is not set up for 3D.");
244 ASSERTL0(
false,
"Transposition not implemented yet.");
249 ASSERTL0(
false,
"Transposition not implemented yet.");
254 ASSERTL0(
false,
"Transposition not implemented yet.");
259 ASSERTL0(
false,
"Transposition type does not exist.");
279 int num_dofs = inarray.size();
281 int num_pencil_per_proc =
307 while (index < num_points_per_plane)
309 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
310 ? num_pencil_per_proc
311 : (num_points_per_plane - index);
316 &(inarray[index + (i * num_points_per_plane)]), 1,
317 &(outarray[cnt]), 1);
319 cnt += num_pencil_per_proc;
328 for (i = 0; i < packed_len; ++i)
331 &(tmp_outarray[i * num_pencil_per_proc]), 1,
332 &(outarray[i]), packed_len);
341 int i, pts_per_plane;
342 int n = inarray.size();
356 ASSERTL1(&inarray[0] != &outarray[0],
357 "Inarray and outarray cannot be the same");
359 for (i = 0; i < packed_len; ++i)
361 Vmath::Vcopy(pts_per_plane, &(inarray[i * pts_per_plane]), 1,
362 &(outarray[i]), packed_len);
382 int num_dofs = outarray.size();
384 int num_pencil_per_proc =
412 for (i = 0; i < packed_len; ++i)
414 Vmath::Vcopy(num_pencil_per_proc, &(inarray[i]), packed_len,
415 &(tmp_inarray[i * num_pencil_per_proc]), 1);
421 while (index < num_points_per_plane)
423 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
424 ? num_pencil_per_proc
425 : (num_points_per_plane - index);
430 &(outarray[index + (i * num_points_per_plane)]),
433 cnt += num_pencil_per_proc;
445 int i, pts_per_plane;
446 int n = inarray.size();
462 ASSERTL1(&inarray[0] != &outarray[0],
463 "Inarray and outarray cannot be the same");
465 for (i = 0; i < packed_len; ++i)
468 &(outarray[i * pts_per_plane]), 1);
482 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
483 "3D-Homo-2D approach.");
488 int n = inarray.size();
505 ASSERTL1(&inarray[0] != &outarray[0],
506 "Inarray and outarray cannot be the same");
508 for (i = 0; i < packed_len; ++i)
510 Vmath::Vcopy(pts_per_line, &(inarray[i * pts_per_line]), 1,
511 &(outarray[i]), packed_len);
525 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
526 "3D-Homo-2D approach.");
531 int n = inarray.size();
548 ASSERTL1(&inarray[0] != &outarray[0],
549 "Inarray and outarray cannot be the same");
551 for (i = 0; i < packed_len; ++i)
554 &(outarray[i * pts_per_line]), 1);
566 boost::ignore_unused(UseNumMode);
570 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
571 "3D-Homo-2D approach.");
576 int s = inarray.size();
578 int pts_per_line = s / n;
585 &(outarray[i * packed_len]), 1);
597 boost::ignore_unused(UseNumMode);
601 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
602 "3D-Homo-2D approach.");
607 int s = inarray.size();
609 int pts_per_line = s / n;
613 for (
int i = 0; i < packed_len; ++i)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
int GetNumPoints() const
Return points order at which basis is defined.
BasisType GetBasisType() const
Return type of expansion basis.
int GetNumModes() const
Returns the order of the basis.
void TransposeXYtoZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeYZtoZY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
unsigned int GetStripID(void)
void TransposeZtoXY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
int m_rank_id
Rank of process.
Array< OneD, unsigned int > GetKs(void)
unsigned int m_strip_ID
IDs of the strips on the processes.
Array< OneD, int > m_num_homogeneous_coeffs
Total number of homogeneous coefficients.
void Transpose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false, TranspositionDir dir=eNoTrans)
Array< OneD, unsigned int > GetPlanesIDs(void)
void TransposeXtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_OffsetMap
MPI_Alltoallv offset map of send/recv buffer in global vector.
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm0, LibUtilities::CommSharedPtr hcomm1)
unsigned int GetPlaneID(int i)
Array< OneD, int > m_num_processes
Array< OneD, int > m_num_points_per_proc
Number of homogeneous points on each processor per direction.
void TransposeYZtoX(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, int > m_num_homogeneous_points
Total homogeneous points per direction.
int m_num_homogeneous_directions
Array< OneD, unsigned int > m_K
Fourier wave numbers associated with the planes.
Array< OneD, unsigned int > m_planes_IDs
IDs of the planes on the processes.
void TransposeZYtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eFourierSingleMode
Fourier ModifiedExpansion with just the first mode .
@ eFourierHalfModeIm
Fourier Modified expansions with just the imaginary part of the first mode
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode
@ eFourier
Fourier Expansion .
The above copyright notice and this permission notice shall be included.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)