Nektar++
Loading...
Searching...
No Matches
NodalPrismExp.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NodalPrismExp.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: NodalPrismExp routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
36
38{
40 const LibUtilities::BasisKey &Bb,
41 const LibUtilities::BasisKey &Bc,
42 const LibUtilities::PointsType Ntype,
44 : StdExpansion(LibUtilities::StdNodalPrismData::getNumberOfCoefficients(
45 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
46 3, Ba, Bb, Bc),
47 StdExpansion3D(LibUtilities::StdNodalPrismData::getNumberOfCoefficients(
48 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
49 Ba, Bb, Bc),
50 StdPrismExp(Ba, Bb, Bc), StdNodalPrismExp(Ba, Bb, Bc, Ntype),
51 Expansion(geom), Expansion3D(geom), PrismExp(Ba, Bb, Bc, geom),
52 m_matrixManager(
53 std::bind(&Expansion3D::CreateMatrix, this, std::placeholders::_1)),
54 m_staticCondMatrixManager(std::bind(&Expansion::CreateStaticCondMatrix,
55 this, std::placeholders::_1))
56{
57}
58
60 : StdExpansion(T), StdExpansion3D(T), StdPrismExp(T), StdNodalPrismExp(T),
62 m_matrixManager(T.m_matrixManager),
63 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
64{
65}
66
68 Array<OneD, NekDouble> &outarray)
69{
71 NodalToModal(inarray, tmp);
72 StdPrismExp::v_BwdTrans(tmp, outarray);
73}
74
76 const Array<OneD, const NekDouble> &inarray,
77 Array<OneD, NekDouble> &outarray)
78{
79 PrismExp::v_IProductWRTBase(inarray, outarray);
80 NodalToModalTranspose(outarray, outarray);
81}
82
84 const int dir, const Array<OneD, const NekDouble> &inarray,
85 Array<OneD, NekDouble> &outarray)
86{
87 PrismExp::v_IProductWRTDerivBase(dir, inarray, outarray);
88 NodalToModalTranspose(outarray, outarray);
89}
90
98
100{
102 m_base[0]->GetPointsKey());
104 m_base[1]->GetPointsKey());
106 m_base[2]->GetPointsKey());
107
109 bkey0, bkey1, bkey2, m_nodalPointsKey.GetPointsType());
110}
111
113 const NekDouble *data, const std::vector<unsigned int> &nummodes,
114 const int mode_offset, NekDouble *coeffs,
115 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
116{
118 Expansion::ExtractDataToCoeffs(data, nummodes, mode_offset, &modes[0],
119 fromType);
120
122 ModalToNodal(modes, nodes);
123}
124
126 const StdRegions::StdMatrixKey &mkey)
127{
128 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
129 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
130 LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
134 ntype);
135
136 return tmp->GetStdMatrix(mkey);
137}
138
143
149
151{
152 m_matrixManager.DeleteObject(mkey);
153}
154
156 Array<OneD, NekDouble> &outarray,
157 const StdRegions::StdMatrixKey &mkey)
158{
159 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
160}
161
163 const Array<OneD, const NekDouble> &inarray,
165{
166 StdExpansion::LaplacianMatrixOp_MatFree_GenericImpl(inarray, outarray,
167 mkey);
168}
169
171 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
173{
174 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
175}
176
178 const int i, const Array<OneD, const NekDouble> &inarray,
180{
181 StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
182}
183
185 const Array<OneD, const NekDouble> &inarray,
187{
188 StdExpansion::HelmholtzMatrixOp_MatFree_GenericImpl(inarray, outarray,
189 mkey);
190}
191
192} // namespace Nektar::LocalRegions
Describes the specification for a Basis.
Definition Basis.h:45
PointsType GetPointsType() const
Definition Points.h:90
void ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_DropLocMatrix(const MatrixKey &mkey) override
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product of a given function f with the different modes of the expansion.
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
NodalPrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const LibUtilities::PointsType Ntype, SpatialDomains::Geometry3D *geom)
Constructor using BasisKey class for quadrature points and order definition.
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition PrismExp.cpp:103
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
3D geometry information
Definition Geometry3D.h:50
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
Calculates the inner product of a given function f with the different modes of the expansion.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::PointsKey m_nodalPointsKey
void NodalToModal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void NodalToModalTranspose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ModalToNodal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< StdNodalPrismExp > StdNodalPrismExpSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
STL namespace.