Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
e2af02f9
Commit
e2af02f9
authored
Oct 23, 2017
by
Douglas Serson
Browse files
Implement v_ExponentialFilter for Hex elements
parent
6ec5b72b
Changes
2
Hide whitespace changes
Inline
Side-by-side
library/StdRegions/StdHexExp.cpp
View file @
e2af02f9
...
@@ -2436,5 +2436,69 @@ namespace Nektar
...
@@ -2436,5 +2436,69 @@ namespace Nektar
// backward transform to physical space
// backward transform to physical space
OrthoExp
.
BwdTrans
(
orthocoeffs
,
array
);
OrthoExp
.
BwdTrans
(
orthocoeffs
,
array
);
}
}
void
StdHexExp
::
v_ExponentialFilter
(
Array
<
OneD
,
NekDouble
>
&
array
,
const
NekDouble
alpha
,
const
NekDouble
exponent
,
const
NekDouble
cutoff
)
{
// Generate an orthogonal expansion
int
qa
=
m_base
[
0
]
->
GetNumPoints
();
int
qb
=
m_base
[
1
]
->
GetNumPoints
();
int
qc
=
m_base
[
2
]
->
GetNumPoints
();
int
nmodesA
=
m_base
[
0
]
->
GetNumModes
();
int
nmodesB
=
m_base
[
1
]
->
GetNumModes
();
int
nmodesC
=
m_base
[
2
]
->
GetNumModes
();
int
P
=
nmodesA
-
1
;
int
Q
=
nmodesB
-
1
;
int
R
=
nmodesC
-
1
;
// Declare orthogonal basis.
LibUtilities
::
PointsKey
pa
(
qa
,
m_base
[
0
]
->
GetPointsType
());
LibUtilities
::
PointsKey
pb
(
qb
,
m_base
[
1
]
->
GetPointsType
());
LibUtilities
::
PointsKey
pc
(
qc
,
m_base
[
2
]
->
GetPointsType
());
LibUtilities
::
BasisKey
Ba
(
LibUtilities
::
eOrtho_A
,
nmodesA
,
pa
);
LibUtilities
::
BasisKey
Bb
(
LibUtilities
::
eOrtho_A
,
nmodesB
,
pb
);
LibUtilities
::
BasisKey
Bc
(
LibUtilities
::
eOrtho_A
,
nmodesC
,
pc
);
StdHexExp
OrthoExp
(
Ba
,
Bb
,
Bc
);
// Cutoff
int
Pcut
=
cutoff
*
P
;
int
Qcut
=
cutoff
*
Q
;
int
Rcut
=
cutoff
*
R
;
// Project onto orthogonal space.
Array
<
OneD
,
NekDouble
>
orthocoeffs
(
OrthoExp
.
GetNcoeffs
());
OrthoExp
.
FwdTrans
(
array
,
orthocoeffs
);
//
NekDouble
fac
,
fac1
,
fac2
,
fac3
;
int
index
=
0
;
for
(
int
i
=
0
;
i
<
nmodesA
;
++
i
)
{
for
(
int
j
=
0
;
j
<
nmodesB
;
++
j
)
{
for
(
int
k
=
0
;
k
<
nmodesC
;
++
k
,
++
index
)
{
//to filter out only the "high-modes"
if
(
i
>
Pcut
||
j
>
Qcut
||
k
>
Rcut
)
{
fac1
=
(
NekDouble
)
(
i
-
Pcut
)
/
(
(
NekDouble
)(
P
-
Pcut
)
);
fac2
=
(
NekDouble
)
(
j
-
Qcut
)
/
(
(
NekDouble
)(
Q
-
Qcut
)
);
fac3
=
(
NekDouble
)
(
k
-
Rcut
)
/
(
(
NekDouble
)(
R
-
Rcut
)
);
fac
=
max
(
max
(
fac1
,
fac2
),
fac3
);
fac
=
pow
(
fac
,
exponent
);
orthocoeffs
[
index
]
*=
exp
(
-
alpha
*
fac
);
}
}
}
}
// backward transform to physical space
OrthoExp
.
BwdTrans
(
orthocoeffs
,
array
);
}
}
}
}
}
library/StdRegions/StdHexExp.h
View file @
e2af02f9
...
@@ -285,6 +285,11 @@ namespace Nektar
...
@@ -285,6 +285,11 @@ namespace Nektar
STD_REGIONS_EXPORT
virtual
void
v_SVVLaplacianFilter
(
Array
<
OneD
,
NekDouble
>
&
array
,
const
StdMatrixKey
&
mkey
);
STD_REGIONS_EXPORT
virtual
void
v_SVVLaplacianFilter
(
Array
<
OneD
,
NekDouble
>
&
array
,
const
StdMatrixKey
&
mkey
);
STD_REGIONS_EXPORT
virtual
void
v_ExponentialFilter
(
Array
<
OneD
,
NekDouble
>
&
array
,
const
NekDouble
alpha
,
const
NekDouble
exponent
,
const
NekDouble
cutoff
);
};
};
typedef
std
::
shared_ptr
<
StdHexExp
>
StdHexExpSharedPtr
;
typedef
std
::
shared_ptr
<
StdHexExp
>
StdHexExpSharedPtr
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment