3#ifndef __GRIDOP_CONTINUOUSFIELDLEVEL_HPP
4#define __GRIDOP_CONTINUOUSFIELDLEVEL_HPP
6#include "gridopDllApi.h"
8#include <field/MemArray.hpp>
9#include <field/DirectProductArray.hpp>
11#include <vector/CubicIpol.hpp>
12#include <vector/LinearIpol.hpp>
13#include <vector/Interpolate.hpp>
15#include <ocean/eagle/PhysicalSpace.hpp>
20template <
int Dims,
typename real=
double>
21struct ContinuousFieldLevel
25 typedef FixedArray<real, N> Point_t;
26 typedef DirectProductMemArray<Eagle::point3> ProcArray_t;
30 RefPtr<LinearArray<double> > Coordinates[N];
32 ContinuousFieldLevel*Neighbours[N][2];
34 ContinuousFieldLevel(
const ProcArray_t&Crds)
36 for(
int k=0; k<N; k++)
38 Coordinates[k] = Crds.Components[k];
40 throw "ContinuousFieldLevel(): Nonlinear coordinates found, not good.";
44 Location_t locate(
const Point_t&P)
49 for(
int k=0; k<N; k++)
55 if (!Neighbours[k][0])
58 return Neighbours[k][0]->locate(P);
61 if (
point[k] > Coordinates[k]->Length() )
63 if (!Neighbours[k][1])
66 return Neighbours[k][1]->locate(P);
71 return Location_t(
point,
this);
85template <
int Dims,
typename real=
double>
88 typedef ContinuousFieldLevel<Dims, real> ContinuousFieldLevel_t;
90 typedef typename ContinuousFieldLevel_t::Location_t Location_t;
91 typedef typename ContinuousFieldLevel_t::Point_t Point_t;
93 typedef set< ContinuousFieldLevel_t*> FragmentsPerLevel_t;
95 typedef map<int, FragmentsPerLevel_t> AllLevels_t;
97 AllLevels_t AllLevels;
99 Location_t locate(
const Point_t&P, ContinuousFieldLevel_t*hint)
constexpr void reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2