Commit 7a2bd709 authored by Kilian Lackhove's avatar Kilian Lackhove
Browse files

Interpolator: renamed methods array

parent 8560bddf
......@@ -45,7 +45,7 @@ Interpolator::Interpolator(const PtsFieldSharedPtr inField, PtsFieldSharedPtr &o
m_inField(inField),
m_outField(outField),
m_dim(3),
m_method(ePtsNoMethod)
m_method(eNoMethod)
{
ASSERTL0(inField->GetNFields() == outField->GetNFields(), "number of fields does not match");
}
......@@ -61,7 +61,7 @@ Interpolator::Interpolator(const PtsFieldSharedPtr inField, PtsFieldSharedPtr &o
* Set coord_id to -1 to use n-D interpolation for an n-dimensional field.
* The most suitable algorithm is chosen automatically.
*/
void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDouble width)
void Interpolator::CalcWeights(InterpMethod method, short int coordId, NekDouble width)
{
int nOutPts = m_outField->GetNpoints();
int lastProg = 0;
......@@ -82,21 +82,21 @@ void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDou
m_rtree.insert(inPoints.begin(), inPoints.end());
// set a default method
if(method == ePtsNoMethod)
if(method == eNoMethod)
{
if (m_dim == 1 || coordId >= 0)
{
method = ePtsQuadratic;
method = eQuadratic;
}
else
{
method = ePtsShepard;
method = eShepard;
}
}
switch (method)
{
case ePtsNearestNeighbour:
case eNearestNeighbour:
{
for (int i = 0; i < nOutPts; ++i)
{
......@@ -120,7 +120,7 @@ void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDou
break;
}
case ePtsQuadratic:
case eQuadratic:
{
ASSERTL0(m_dim == 1 || coordId >= 0, "not implemented");
......@@ -159,7 +159,7 @@ void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDou
break;
}
case ePtsShepard:
case eShepard:
{
for (int i = 0; i < nOutPts; ++i)
{
......@@ -183,7 +183,7 @@ void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDou
break;
}
case ePtsGauss:
case eGauss:
{
NekDouble sigma = width * 0.4246609001;
ASSERTL0(width > NekConstants::kNekZeroTol, "No filter width set");
......@@ -226,7 +226,7 @@ void Interpolator::CalcWeights(PtsInterpMethod method, short int coordId, NekDou
* @SetWeights.
*/
void Interpolator::Interpolate(
Nektar::LibUtilities::PtsInterpMethod method, short int coordId, Nektar::NekDouble width)
Nektar::LibUtilities::InterpMethod method, short int coordId, Nektar::NekDouble width)
{
if ( m_weights.num_elements() == 0)
{
......
......@@ -118,12 +118,12 @@ namespace LibUtilities
enum PtsInterpMethod{
ePtsNoMethod,
ePtsNearestNeighbour,
ePtsQuadratic,
ePtsShepard,
ePtsGauss,
enum InterpMethod{
eNoMethod,
eNearestNeighbour,
eQuadratic,
eShepard,
eGauss,
};
class Interpolator
......@@ -133,12 +133,12 @@ class Interpolator
LIB_UTILITIES_EXPORT Interpolator(const PtsFieldSharedPtr inField, PtsFieldSharedPtr &outField);
LIB_UTILITIES_EXPORT void CalcWeights(
PtsInterpMethod method,
InterpMethod method,
short int coordId = -1,
NekDouble width = 0.0);
LIB_UTILITIES_EXPORT void Interpolate(
PtsInterpMethod method = ePtsNoMethod,
InterpMethod method = eNoMethod,
short int coordId = -1,
NekDouble width = 0.0);
......@@ -172,11 +172,11 @@ class Interpolator
int m_dim;
/// Interpolation Method
PtsInterpMethod m_method;
InterpMethod m_method;
/// A tree structure to speed up the neighbour search.
/// Note that we fill it with an iterator, so instead of rstar, the
/// packing algorithm is used.
bgi::rtree< PtsPoint, bgi::rstar<16> > m_rtree;
bgi::rtree< PtsPoint, bgi::rstar<16> > m_rtree;
/// Interpolation weights for each neighbour.
/// Structure: m_weights[physPtIdx][neighbourIdx]
Array<OneD, Array<OneD, float> > m_weights;
......
......@@ -114,7 +114,7 @@ void ProcessInterpPointDataToFld::Process(po::variables_map &vm)
}
LibUtilities::Interpolator Interp(m_f->m_fieldPts, outPts);
Interp.Interpolate(Nektar::LibUtilities::ePtsNoMethod, coord_id, 0.0);
Interp.Interpolate(Nektar::LibUtilities::eNoMethod, coord_id, 0.0);
cout << " done" << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment