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
35#include <boost/core/ignore_unused.hpp>
36
39
40namespace Nektar
41{
42namespace LibUtilities
43{
47
49{
50 // Allocate the storage for points
52 size_t npts = m_pointsKey.GetNumPoints();
53
54 if (npts == 1)
55 {
56 m_points[0][0] = 0.25;
57 }
58 else
59 {
60 ASSERTL0(npts == 2,
61 "Fourier points for single mode analysis should be 2");
62
63 m_points[0][0] = 0.0;
64 m_points[0][1] = 0.5;
65 }
66}
67
69{
70 // Allocate the storage for points
72
73 size_t npts = m_pointsKey.GetNumPoints();
74 for (size_t i = 0; i < npts; ++i)
75 {
76 m_weights[i] = 1.0;
77 }
78}
79
81{
82
84}
85
86std::shared_ptr<Points<NekDouble>> FourierSingleModePoints::Create(
87 const PointsKey &key)
88{
89 std::shared_ptr<Points<NekDouble>> returnval(
91
92 returnval->Initialize();
93
94 return returnval;
95}
96
97std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::CreateMatrix(
98 const PointsKey &pkey)
99{
100 boost::ignore_unused(pkey);
101
102 ASSERTL0(false,
103 "CreateMatrix not available for Fourier Single Mode Points");
104
105 return nullptr;
106}
107
108const std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::v_GetI(
109 const PointsKey &pkey)
110{
111 boost::ignore_unused(pkey);
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(
120{
121 boost::ignore_unused(x);
122
123 ASSERTL0(false, "Interp not available for Fourier Single Mode Points");
124
125 return nullptr;
126}
127
128const std::shared_ptr<NekMatrix<NekDouble>> FourierSingleModePoints::v_GetI(
129 size_t numpoints, const Array<OneD, const NekDouble> &x)
130{
131 boost::ignore_unused(numpoints, x);
132
133 ASSERTL0(false, "Interp not available for Fourier Single Mode Points");
134
135 return nullptr;
136}
137
139 size_t npts, const Array<OneD, const NekDouble> &xpoints,
141{
142 boost::ignore_unused(npts, xpoints, interp);
143
144 ASSERTL0(
145 false,
146 "CalculateInterpMatrix not available for Fourier Single Mode Points");
147}
148
149} // end of namespace LibUtilities
150} // end of namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
void CalculateInterpMatrix(size_t npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
virtual const MatrixSharedPtrType v_GetI(const PointsKey &pkey) override final
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:169
Stores a set of points of datatype DataT, defined by a PointKey.
Definition: Points.h:240
Array< OneD, DataType > m_points[3]
Storage for the point locations, allowing for up to a 3D points storage.
Definition: Points.h:361
PointsKey m_pointsKey
Points type for this points distributions.
Definition: Points.h:358
Array< OneD, DataType > m_weights
Quadrature weights for the weights.
Definition: Points.h:363
Defines a specification for a set of points.
Definition: Points.h:55
size_t GetNumPoints() const
Definition: Points.h:90
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:77
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2