Nektar++
Transposition.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Transposition.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Manager class for homogeneous data transposition
32//
33///////////////////////////////////////////////////////////////////////////////
34#ifndef NEKTAR_LIB_UTILITIES_HOMOGENEOUS1D_H
35#define NEKTAR_LIB_UTILITIES_HOMOGENEOUS1D_H
36
41
43{
44class BasisKey;
45} // namespace Nektar::LibUtilities
46
48{
50{
61};
62
64{
65public:
69
71 const LibUtilities::BasisKey &HomoBasis1,
73
75 const LibUtilities::BasisKey &HomoBasis1,
76 const LibUtilities::BasisKey &HomoBasis2,
78
80
81 LIB_UTILITIES_EXPORT unsigned int GetK(int i);
82
84
85 LIB_UTILITIES_EXPORT unsigned int GetPlaneID(int i);
86
87 LIB_UTILITIES_EXPORT unsigned int GetStripID(void);
88
90
92 const int npts, const Array<OneD, const NekDouble> &inarray,
93 Array<OneD, NekDouble> &outarray, bool UseNumMode = false,
95
97
99
100protected:
102
103private:
105 const int npts, const Array<OneD, const NekDouble> &inarray,
106 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
107
109 const int npts, const Array<OneD, const NekDouble> &inarray,
110 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
111
113 const int npts, const Array<OneD, const NekDouble> &inarray,
114 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
115
117 const int npts, const Array<OneD, const NekDouble> &inarray,
118 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
119
121 const int npts, const Array<OneD, const NekDouble> &inarray,
122 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
123
125 const int npts, const Array<OneD, const NekDouble> &inarray,
126 Array<OneD, NekDouble> &outarray, bool UseNumMode = false);
127
129
130 /// Number of homogeneous points on each processor per direction.
132
133 /// Total homogeneous points per direction.
135
136 /// Total number of homogeneous coefficients.
138
140
141 /// Rank of process
143
144 /// IDs of the planes on the processes.
146
147 /// IDs of the strips on the processes.
148 unsigned int m_strip_ID;
149
150 /// Fourier wave numbers associated with the planes.
152
153 /// MPI_Alltoallv map containing size of send/recv buffer.
155
156 /// MPI_Alltoallv offset map of send/recv buffer in global vector.
158};
159
160typedef std::shared_ptr<Transposition> TranspositionSharedPtr;
161} // namespace Nektar::LibUtilities
162#endif
#define LIB_UTILITIES_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void TransposeYZtoZY(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void SetSpecVanVisc(Array< OneD, NekDouble > visc)
NekDouble GetSpecVanVisc(const int k)
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.
Array< OneD, unsigned int > GetPlanesIDs(void)
void TransposeYZtoX(const int npts, 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.
void Transpose(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false, TranspositionDir dir=eNoTrans)
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm0, LibUtilities::CommSharedPtr hcomm1)
void TransposeXtoYZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_num_points_per_proc
Number of homogeneous points on each processor per direction.
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.
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 TransposeZtoXY(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeXYtoZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeZYtoYZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
std::shared_ptr< Transposition > TranspositionSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
double NekDouble