Nektar++
Loading...
Searching...
No Matches
NodalTetExp.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NodalTetExp.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: NodalTetExp routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
36
37using namespace std;
38
40{
42 const LibUtilities::BasisKey &Bb,
43 const LibUtilities::BasisKey &Bc,
44 const LibUtilities::PointsType Ntype,
46 : StdExpansion(LibUtilities::StdNodalTetData::getNumberOfCoefficients(
47 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
48 3, Ba, Bb, Bc),
49 StdExpansion3D(LibUtilities::StdNodalTetData::getNumberOfCoefficients(
50 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
51 Ba, Bb, Bc),
52 StdTetExp(Ba, Bb, Bc), StdNodalTetExp(Ba, Bb, Bc, Ntype), Expansion(geom),
53 Expansion3D(geom), TetExp(Ba, Bb, Bc, geom),
54 m_matrixManager(
55 std::bind(&Expansion3D::CreateMatrix, this, std::placeholders::_1)),
56 m_staticCondMatrixManager(std::bind(&Expansion::CreateStaticCondMatrix,
57 this, std::placeholders::_1))
58{
59}
60
62 : StdExpansion(T), StdExpansion3D(T), StdTetExp(T), StdNodalTetExp(T),
63 Expansion(T), Expansion3D(T), TetExp(T),
64 m_matrixManager(T.m_matrixManager),
65 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
66{
67}
68
70 Array<OneD, NekDouble> &outarray)
71{
73 NodalToModal(inarray, tmp);
74 StdTetExp::v_BwdTrans(tmp, outarray);
75}
76
78 Array<OneD, NekDouble> &outarray)
79{
80 TetExp::v_IProductWRTBase(inarray, outarray);
81 NodalToModalTranspose(outarray, outarray);
82}
83
85 const int dir, const Array<OneD, const NekDouble> &inarray,
86 Array<OneD, NekDouble> &outarray)
87{
88 TetExp::v_IProductWRTDerivBase(dir, inarray, outarray);
89 NodalToModalTranspose(outarray, outarray);
90}
91
99
101{
103 m_base[0]->GetPointsKey());
105 m_base[1]->GetPointsKey());
107 m_base[2]->GetPointsKey());
108
110 bkey0, bkey1, bkey2, m_nodalPointsKey.GetPointsType());
111}
112
114 const NekDouble *data, const std::vector<unsigned int> &nummodes,
115 const int mode_offset, NekDouble *coeffs,
116 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
117{
119 Expansion::ExtractDataToCoeffs(data, nummodes, mode_offset, &modes[0],
120 fromType);
121
123 ModalToNodal(modes, nodes);
124}
125
127 const StdRegions::StdMatrixKey &mkey)
128{
129 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
130 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
131 LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
135 ntype);
136
137 return tmp->GetStdMatrix(mkey);
138}
139
144
150
152{
153 m_matrixManager.DeleteObject(mkey);
154}
155
157 Array<OneD, NekDouble> &outarray,
158 const StdRegions::StdMatrixKey &mkey)
159{
160 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
161}
162
164 const Array<OneD, const NekDouble> &inarray,
166{
167 StdExpansion::LaplacianMatrixOp_MatFree_GenericImpl(inarray, outarray,
168 mkey);
169}
170
172 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
174{
175 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
176}
177
179 const int i, const Array<OneD, const NekDouble> &inarray,
181{
182 StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
183}
184
186 const Array<OneD, const NekDouble> &inarray,
188{
189 StdExpansion::HelmholtzMatrixOp_MatFree_GenericImpl(inarray, outarray,
190 mkey);
191}
192
193} // 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)
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &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.
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
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
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_DropLocMatrix(const MatrixKey &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
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
NodalTetExp(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.
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition TetExp.cpp:119
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
void NodalToModalTranspose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void NodalToModal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ModalToNodal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
LibUtilities::PointsKey m_nodalPointsKey
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< StdNodalTetExp > StdNodalTetExpSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
STL namespace.