Nektar++
Loading...
Searching...
No Matches
library
Collections
MatrixFreeBase.h
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////////
2
//
3
// File: MatrixFreeBase.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: base class definition for matrrix free type
32
//
33
///////////////////////////////////////////////////////////////////////////////
34
35
#ifndef NEKTAR_LIBRARY_COLLECTIONS_MATRIXFREEBASE_H
36
#define NEKTAR_LIBRARY_COLLECTIONS_MATRIXFREEBASE_H
37
38
#include <
StdRegions/StdExpansion.h
>
39
40
namespace
Nektar::Collections
41
{
42
43
class
MatrixFreeBase
44
{
45
public
:
46
// Default constructor
47
MatrixFreeBase
() =
default
;
48
49
MatrixFreeBase
(
const
unsigned
int
nIn,
const
unsigned
int
nOut,
50
const
unsigned
int
nCollSize)
51
:
m_nIn
(nIn * nCollSize),
m_nOut
(nOut * nCollSize)
52
{
53
// Padding if needed
54
using
vec_t
=
tinysimd::simd<NekDouble>
;
55
const
auto
nElmtNoPad = nCollSize;
56
m_nElmtPad
= nElmtNoPad;
57
58
if
(nElmtNoPad % vec_t::width != 0)
59
{
60
m_isPadded
=
true
;
61
m_nElmtPad
=
62
nElmtNoPad + vec_t::width - (nElmtNoPad % vec_t::width);
63
}
64
}
65
66
protected
:
67
/// flag for padding
68
bool
m_isPadded
{
false
};
69
/// size after padding
70
unsigned
int
m_nElmtPad
;
71
/// actural size of input array
72
unsigned
int
m_nIn
;
73
/// actural size of output array
74
unsigned
int
m_nOut
;
75
};
76
77
}
// namespace Nektar::Collections
78
#endif
// NEKTAR_LIBRARY_COLLECTIONS_MATRIXFREEBASE_H
StdExpansion.h
Nektar::Collections::MatrixFreeBase
Definition
MatrixFreeBase.h:44
Nektar::Collections::MatrixFreeBase::MatrixFreeBase
MatrixFreeBase(const unsigned int nIn, const unsigned int nOut, const unsigned int nCollSize)
Definition
MatrixFreeBase.h:49
Nektar::Collections::MatrixFreeBase::MatrixFreeBase
MatrixFreeBase()=default
Nektar::Collections::MatrixFreeBase::m_nIn
unsigned int m_nIn
actural size of input array
Definition
MatrixFreeBase.h:72
Nektar::Collections::MatrixFreeBase::m_isPadded
bool m_isPadded
flag for padding
Definition
MatrixFreeBase.h:68
Nektar::Collections::MatrixFreeBase::m_nElmtPad
unsigned int m_nElmtPad
size after padding
Definition
MatrixFreeBase.h:70
Nektar::Collections::MatrixFreeBase::m_nOut
unsigned int m_nOut
actural size of output array
Definition
MatrixFreeBase.h:74
Nektar::Collections
Definition
BwdTrans.cpp:44
Nektar::Collections::vec_t
simd< NekDouble > vec_t
Definition
CoalescedGeomData.h:47
tinysimd::simd
typename abi< ScalarType, width >::type simd
Definition
tinysimd.hpp:80
Generated on Sun Nov 9 2025 20:16:56 for Nektar++ by
1.9.8