Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
38c18f5b
Commit
38c18f5b
authored
Jul 19, 2016
by
Douglas Serson
Browse files
Move interpolator to FieldUtils
parent
9f589b22
Changes
10
Hide whitespace changes
Inline
Side-by-side
library/FieldUtils/CMakeLists.txt
View file @
38c18f5b
SET
(
FieldUtilsHeaders
Module.h
Field.hpp
Interpolator.h
InputModules/InputDat.h
InputModules/InputFld.h
InputModules/InputXml.h
...
...
@@ -46,6 +47,7 @@ SET(FieldUtilsHeaders
SET
(
FieldUtilsSources
Module.cpp
Interpolator.cpp
InputModules/InputDat.cpp
InputModules/InputFld.cpp
InputModules/InputXml.cpp
...
...
library/
Solver
Utils/Interpolator.cpp
→
library/
Field
Utils/Interpolator.cpp
View file @
38c18f5b
...
...
@@ -34,13 +34,13 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
using
namespace
std
;
namespace
Nektar
{
namespace
Solver
Utils
namespace
Field
Utils
{
/**
...
...
library/
Solver
Utils/Interpolator.h
→
library/
Field
Utils/Interpolator.h
View file @
38c18f5b
...
...
@@ -34,8 +34,8 @@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef
NEKTAR_SOLVER
UTILS_INTERPOLATOR_H
#define
NEKTAR_SOLVER
UTILS_INTERPOLATOR_H
#ifndef
FIELD
UTILS_INTERPOLATOR_H
#define
FIELD
UTILS_INTERPOLATOR_H
#include <vector>
...
...
@@ -54,12 +54,14 @@
#include <LibUtilities/BasicUtils/VmathArray.hpp>
#include <LibUtilities/BasicUtils/PtsField.h>
#include "FieldUtilsDeclspec.h"
namespace
bg
=
boost
::
geometry
;
namespace
bgi
=
boost
::
geometry
::
index
;
namespace
Nektar
{
namespace
Solver
Utils
namespace
Field
Utils
{
enum
InterpMethod
...
...
@@ -102,52 +104,52 @@ public:
m_coordId
(
coordId
){};
/// Compute interpolation weights without doing any interpolation
LIB
_UTIL
ITIE
S_EXPORT
void
CalcWeights
(
FIELD
_UTILS_EXPORT
void
CalcWeights
(
const
LibUtilities
::
PtsFieldSharedPtr
ptsInField
,
LibUtilities
::
PtsFieldSharedPtr
&
ptsOutField
);
/// Interpolate from a pts field to a pts field
LIB
_UTIL
ITIE
S_EXPORT
void
Interpolate
(
FIELD
_UTILS_EXPORT
void
Interpolate
(
const
LibUtilities
::
PtsFieldSharedPtr
ptsInField
,
LibUtilities
::
PtsFieldSharedPtr
&
ptsOutField
);
/// Interpolate from an expansion to an expansion
LIB
_UTIL
ITIE
S_EXPORT
void
Interpolate
(
FIELD
_UTILS_EXPORT
void
Interpolate
(
const
std
::
vector
<
MultiRegions
::
ExpListSharedPtr
>
expInField
,
std
::
vector
<
MultiRegions
::
ExpListSharedPtr
>
&
expOutField
);
/// Interpolate from an expansion to a pts field
LIB
_UTIL
ITIE
S_EXPORT
void
Interpolate
(
FIELD
_UTILS_EXPORT
void
Interpolate
(
const
std
::
vector
<
MultiRegions
::
ExpListSharedPtr
>
expInField
,
LibUtilities
::
PtsFieldSharedPtr
&
ptsOutField
);
/// Interpolate from a pts field to an expansion
LIB
_UTIL
ITIE
S_EXPORT
void
Interpolate
(
FIELD
_UTILS_EXPORT
void
Interpolate
(
const
LibUtilities
::
PtsFieldSharedPtr
ptsInField
,
std
::
vector
<
MultiRegions
::
ExpListSharedPtr
>
&
expOutField
);
/// returns the dimension of the Interpolator.
/// Should be higher than the dimensions of the interpolated fields
LIB
_UTIL
ITIE
S_EXPORT
int
GetDim
()
const
;
FIELD
_UTILS_EXPORT
int
GetDim
()
const
;
/// Returns the filter width
LIB
_UTIL
ITIE
S_EXPORT
NekDouble
GetFiltWidth
()
const
;
FIELD
_UTILS_EXPORT
NekDouble
GetFiltWidth
()
const
;
/// Returns the coordinate id along which the interpolation should be
/// performed
LIB
_UTIL
ITIE
S_EXPORT
int
GetCoordId
()
const
;
FIELD
_UTILS_EXPORT
int
GetCoordId
()
const
;
/// Returns the interpolation method used by this interpolator
LIB
_UTIL
ITIE
S_EXPORT
InterpMethod
GetInterpMethod
()
const
;
FIELD
_UTILS_EXPORT
InterpMethod
GetInterpMethod
()
const
;
/// Returns the input field
LIB
_UTIL
ITIE
S_EXPORT
LibUtilities
::
PtsFieldSharedPtr
GetInField
()
const
;
FIELD
_UTILS_EXPORT
LibUtilities
::
PtsFieldSharedPtr
GetInField
()
const
;
/// Returns the output field
LIB
_UTIL
ITIE
S_EXPORT
LibUtilities
::
PtsFieldSharedPtr
GetOutField
()
const
;
FIELD
_UTILS_EXPORT
LibUtilities
::
PtsFieldSharedPtr
GetOutField
()
const
;
/// Print statics of the interpolation weights
LIB
_UTIL
ITIE
S_EXPORT
void
PrintStatistics
();
FIELD
_UTILS_EXPORT
void
PrintStatistics
();
/// sets a callback funtion which gets called every time the interpolation
/// progresses
...
...
@@ -213,29 +215,29 @@ private:
boost
::
function
<
void
(
const
int
position
,
const
int
goal
)
>
m_progressCallback
;
LIB
_UTIL
ITIE
S_EXPORT
void
CalcW_Gauss
(
const
PtsPoint
&
searchPt
,
FIELD
_UTILS_EXPORT
void
CalcW_Gauss
(
const
PtsPoint
&
searchPt
,
const
NekDouble
sigma
,
const
int
maxPts
=
250
);
LIB
_UTIL
ITIE
S_EXPORT
void
CalcW_Linear
(
const
PtsPoint
&
searchPt
,
FIELD
_UTILS_EXPORT
void
CalcW_Linear
(
const
PtsPoint
&
searchPt
,
int
coordId
);
LIB
_UTIL
ITIE
S_EXPORT
void
CalcW_NNeighbour
(
const
PtsPoint
&
searchPt
);
FIELD
_UTILS_EXPORT
void
CalcW_NNeighbour
(
const
PtsPoint
&
searchPt
);
LIB
_UTIL
ITIE
S_EXPORT
void
CalcW_Shepard
(
const
PtsPoint
&
searchPt
);
FIELD
_UTILS_EXPORT
void
CalcW_Shepard
(
const
PtsPoint
&
searchPt
);
LIB
_UTIL
ITIE
S_EXPORT
void
CalcW_Quadratic
(
const
PtsPoint
&
searchPt
,
FIELD
_UTILS_EXPORT
void
CalcW_Quadratic
(
const
PtsPoint
&
searchPt
,
int
coordId
);
LIB
_UTIL
ITIE
S_EXPORT
void
SetupTree
();
FIELD
_UTILS_EXPORT
void
SetupTree
();
LIB
_UTIL
ITIE
S_EXPORT
void
FindNeighbours
(
FIELD
_UTILS_EXPORT
void
FindNeighbours
(
const
PtsPoint
&
searchPt
,
std
::
vector
<
PtsPoint
>
&
neighbourPts
,
const
NekDouble
dist
,
const
unsigned
int
maxPts
=
1
);
LIB
_UTIL
ITIE
S_EXPORT
void
FindNNeighbours
(
FIELD
_UTILS_EXPORT
void
FindNNeighbours
(
const
PtsPoint
&
searchPt
,
std
::
vector
<
PtsPoint
>
&
neighbourPts
,
const
unsigned
int
numPts
=
1
);
...
...
library/FieldUtils/ProcessModules/ProcessInterpField.cpp
View file @
38c18f5b
...
...
@@ -41,7 +41,7 @@ using namespace std;
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
#include <boost/math/special_functions/fpclassify.hpp>
namespace
Nektar
{
...
...
@@ -231,7 +231,7 @@ void ProcessInterpField::Process(po::variables_map &vm)
}
}
SolverUtils
::
Interpolator
interp
;
Interpolator
interp
;
if
(
m_f
->
m_comm
->
GetRank
()
==
0
)
{
interp
.
SetProgressCallback
(
&
ProcessInterpField
::
PrintProgressbar
,
...
...
library/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
View file @
38c18f5b
...
...
@@ -40,7 +40,7 @@ using namespace std;
#include "ProcessInterpPointDataToFld.h"
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
...
...
@@ -114,7 +114,7 @@ void ProcessInterpPointDataToFld::Process(po::variables_map &vm)
ASSERTL0
(
coord_id
<=
m_f
->
m_fieldPts
->
GetDim
()
-
1
,
"interpcoord is bigger than the Pts files dimension"
);
SolverUtils
::
Interpolator
interp
(
SolverUtils
::
eNoMethod
,
coord_id
);
Interpolator
interp
(
eNoMethod
,
coord_id
);
if
(
m_f
->
m_comm
->
GetRank
()
==
0
)
{
...
...
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
View file @
38c18f5b
...
...
@@ -41,7 +41,7 @@ using namespace std;
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/lexical_cast.hpp>
namespace
Nektar
...
...
@@ -533,7 +533,7 @@ void ProcessInterpPoints::InterpolateFieldToPts(
int
nfields
=
field0
.
size
();
SolverUtils
::
Interpolator
interp
;
Interpolator
interp
;
if
(
m_f
->
m_comm
->
GetRank
()
==
0
)
{
interp
.
SetProgressCallback
(
&
ProcessInterpPoints
::
PrintProgressbar
,
...
...
library/SolverUtils/CMakeLists.txt
View file @
38c18f5b
...
...
@@ -31,7 +31,6 @@ SET(SOLVER_UTILS_SOURCES
Filters/FilterFieldConvert.cpp
Filters/FilterThresholdMax.cpp
Filters/FilterThresholdMin.cpp
Interpolator.cpp
RiemannSolvers/RiemannSolver.cpp
RiemannSolvers/UpwindSolver.cpp
RiemannSolvers/UpwindLDGSolver.cpp
...
...
@@ -76,7 +75,6 @@ SET(SOLVER_UTILS_HEADERS
Filters/FilterFieldConvert.h
Filters/FilterThresholdMax.h
Filters/FilterThresholdMin.h
Interpolator.h
RiemannSolvers/RiemannSolver.h
RiemannSolvers/UpwindSolver.h
RiemannSolvers/UpwindLDGSolver.h
...
...
library/SolverUtils/EquationSystem.cpp
View file @
38c18f5b
...
...
@@ -914,12 +914,12 @@ namespace Nektar
// check if we already computed this funcKey combination
std
::
string
interpKey
=
m_session
->
GetFunctionFilename
(
pFunctionName
,
pFieldName
,
domain
);
map
<
std
::
string
,
Interpolator
>::
iterator
it
map
<
std
::
string
,
FieldUtils
::
Interpolator
>::
iterator
it
=
m_interpolators
.
find
(
interpKey
);
if
(
it
==
m_interpolators
.
end
())
{
m_interpolators
[
interpKey
]
=
Solver
Utils
::
Interpolator
(
Nektar
::
Solver
Utils
::
eShepard
);
m_interpolators
[
interpKey
]
=
Field
Utils
::
Interpolator
(
Nektar
::
Field
Utils
::
eShepard
);
if
(
m_comm
->
GetRank
()
==
0
)
{
m_interpolators
[
interpKey
].
SetProgressCallback
(
...
...
library/SolverUtils/EquationSystem.h
View file @
38c18f5b
...
...
@@ -46,7 +46,7 @@
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <MultiRegions/ExpList.h>
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
#include <SolverUtils/SolverUtilsDeclspec.h>
#include <SolverUtils/Core/Misc.h>
...
...
@@ -454,7 +454,7 @@ namespace Nektar
/// Field input/output
LibUtilities
::
FieldIOSharedPtr
m_fld
;
/// Map of interpolator objects
std
::
map
<
std
::
string
,
Interpolator
>
m_interpolators
;
std
::
map
<
std
::
string
,
FieldUtils
::
Interpolator
>
m_interpolators
;
/// Array holding all dependent variables.
Array
<
OneD
,
MultiRegions
::
ExpListSharedPtr
>
m_fields
;
/// Base fields.
...
...
utilities/NekMesh/ProcessModules/ProcessCurve.cpp
View file @
38c18f5b
...
...
@@ -41,7 +41,7 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <
Solver
Utils/Interpolator.h>
#include <
Field
Utils/Interpolator.h>
#include <NekMeshUtils/MeshElements/Element.h>
...
...
@@ -218,7 +218,7 @@ NekDouble ProcessCurve::EvaluateCoordinate(NekDouble xCoord)
LibUtilities
::
PtsFieldSharedPtr
toPts
=
MemoryManager
<
LibUtilities
::
PtsField
>::
AllocateSharedPtr
(
1
,
tmp
);
Solver
Utils
::
Interpolator
interp
;
Field
Utils
::
Interpolator
interp
;
interp
.
Interpolate
(
m_fieldPts
,
toPts
);
return
tmp
[
1
][
0
];
...
...
Write
Preview
Markdown
is supported
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