Nektar++
FourierSingleModePoints.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: FourierSingleModePoints.cpp
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: 1D Non Evenly-Spaced Fourier Points for stability analysis
32//
33///////////////////////////////////////////////////////////////////////////////
34
37
39{
43
45{
46 // Allocate the storage for points
48 size_t npts = m_pointsKey.GetNumPoints();
49
50 if (npts == 1)
51 {
52 m_points[0][0] = 0.25;
53 }
54 else
55 {
56 ASSERTL0(npts == 2,
57 "Fourier points for single mode analysis should be 2");
58
59 m_points[0][0] = 0.0;
60 m_points[0][1] = 0.5;
61 }
62}
63
65{
66 // Allocate the storage for points
68
69 size_t npts = m_pointsKey.GetNumPoints();
70 for (size_t i = 0; i < npts; ++i)
71 {
72 m_weights[i] = 1.0;
73 }
74}
75
77{
78
80}
81
82std::shared_ptr<Points<NekDouble>> FourierSingleModePoints::Create(
83 const PointsKey &key)
84{
85 std::shared_ptr<Points<NekDouble>> returnval(
87
88 returnval->Initialize();
89
90 return returnval;
91}
92
93std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::CreateMatrix(
94 [[maybe_unused]] const PointsKey &pkey)
95{
96 ASSERTL0(false,
97 "CreateMatrix not available for Fourier Single Mode Points");
98
99 return nullptr;
100}
101
102const std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::v_GetI(
103 [[maybe_unused]] const PointsKey &pkey)
104{
105 ASSERTL0(false, "Interp not available for Fourier Single Mode Points");
106
107 return nullptr;
108}
109
110const std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::v_GetI(
111 [[maybe_unused]] const Array<OneD, const NekDouble> &x)
112{
113 ASSERTL0(false, "Interp not available for Fourier Single Mode Points");
114
115 return nullptr;
116}
117
118const std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::v_GetI(
119 [[maybe_unused]] size_t numpoints,
120 [[maybe_unused]] const Array<OneD, const NekDouble> &x)
121{
122 ASSERTL0(false, "Interp not available for Fourier Single Mode Points");
123
124 return nullptr;
125}
126
128 [[maybe_unused]] size_t npts,
129 [[maybe_unused]] const Array<OneD, const NekDouble> &xpoints,
130 [[maybe_unused]] Array<OneD, NekDouble> &interp)
131{
132 ASSERTL0(
133 false,
134 "CalculateInterpMatrix not available for Fourier Single Mode Points");
135}
136
137} // namespace Nektar::LibUtilities
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void CalculateInterpMatrix(size_t npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
const MatrixSharedPtrType v_GetI(const PointsKey &pkey) final
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
bool RegisterCreator(const KeyType &key, const CreateFuncType &createFunc)
Register the given function and associate it with the key. The return value is just to facilitate cal...
Definition: NekManager.hpp:168
Stores a set of points of datatype DataT, defined by a PointKey.
Definition: Points.h:235
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
Definition: Points.h:356
PointsKey m_pointsKey
Points type for this points distributions.
Definition: Points.h:353
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
Definition: Points.h:358
Defines a specification for a set of points.
Definition: Points.h:50
size_t GetNumPoints() const
Definition: Points.h:85
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
PointsManagerT & PointsManager(void)
@ eFourierSingleModeSpaced
1D Non Evenly-spaced points for Single Mode analysis
Definition: PointsType.h:75