FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
ContinuousFieldLevel.hpp
1#if 0
2
3#ifndef __GRIDOP_CONTINUOUSFIELDLEVEL_HPP
4#define __GRIDOP_CONTINUOUSFIELDLEVEL_HPP
5
6#include "gridopDllApi.h"
7
8#include <field/MemArray.hpp>
9#include <field/DirectProductArray.hpp>
10
11#include <vector/CubicIpol.hpp>
12#include <vector/LinearIpol.hpp>
13#include <vector/Interpolate.hpp>
14
15#include <ocean/eagle/PhysicalSpace.hpp>
16
17namespace Fiber
18{
19
20template <int Dims, typename real=double>
21struct ContinuousFieldLevel
22{
23 enum { N = Dims };
24
25 typedef FixedArray<real, N> Point_t;
26 typedef DirectProductMemArray<Eagle::point3> ProcArray_t;
27
29
30 RefPtr<LinearArray<double> > Coordinates[N];
31
32 ContinuousFieldLevel*Neighbours[N][2];
33
34 ContinuousFieldLevel(const ProcArray_t&Crds)
35 {
36 for(int k=0; k<N; k++)
37 {
38 Coordinates[k] = Crds.Components[k];
39 if (!Coordinates[k] )
40 throw "ContinuousFieldLevel(): Nonlinear coordinates found, not good.";
41 }
42 }
43
44 Location_t locate(const Point_t&P)
45 {
46 Point_t point;
47
48 // Compute
49 for(int k=0; k<N; k++)
50 {
51 point[k] = (Coordinates[k])->reverse( P[k] );
52
53 if (point[k] < 0.0)
54 {
55 if (!Neighbours[k][0])
56 throw P;
57
58 return Neighbours[k][0]->locate(P);
59 }
60
61 if (point[k] > Coordinates[k]->Length() )
62 {
63 if (!Neighbours[k][1])
64 throw P;
65
66 return Neighbours[k][1]->locate(P);
67 }
68
69 }
70
71 return Location_t(point, this);
72 }
73
74/*
75 {
76 const MultiArray_t&M;
77
78 Interpolate_t Ipol(M, point);
79
80 return Ipol.eval();
81 }
82*/
83};
84
85template <int Dims, typename real=double>
86struct ContinuousField
87{
88 typedef ContinuousFieldLevel<Dims, real> ContinuousFieldLevel_t;
89
90 typedef typename ContinuousFieldLevel_t::Location_t Location_t;
91 typedef typename ContinuousFieldLevel_t::Point_t Point_t;
92
93 typedef set< ContinuousFieldLevel_t*> FragmentsPerLevel_t;
94
95 typedef map<int, FragmentsPerLevel_t> AllLevels_t;
96
97 AllLevels_t AllLevels;
98
99 Location_t locate(const Point_t&P, ContinuousFieldLevel_t*hint)
100 {
101
102 }
103};
104
105
106} /* namespace Fiber */
107
108#endif /* __GRIDOP_CONTINUOUSFIELDLEVEL_HPP */
109
110#endif
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