DirectInterpolation.hpp

00001 
00002 #include <fish/fiber/field/DirectProductArray.hpp> 
00003 #include <fish/fiber/vector/Interpolate.hpp>
00004 #include <fish/fiber/vector/LinearIpol.hpp>
00005 #include <fish/fiber/baseop/UniGridMapper.hpp>
00006 #include <fish/fiber/baseop/LocalFromWorldPoint.hpp>
00007 #include <fish/fiber/baseop/ExpandBBox.hpp>
00008 
00009 #include <fish/fiber/field/Fragment.hpp>
00010 #include <fish/fiber/grid/Chart.hpp>
00011 
00012 #include <fish/fiber/baseop/BundleBaseSpaceFunctions.hpp>
00013 
00014 #include <eagle/PhysicalSpace.hpp>
00015 //#include <eagle/KDTree.hpp>
00016 #include <eagle/FixedArray.hpp>
00017 
00018 #include <memcore/RefPtr.hpp>
00019 #include "FragmentSkeleton.hpp"
00020 #include "PointSearch.hpp"
00021 #include "gridopDllApi.h"
00022 
00023 using namespace Fiber;
00024 using namespace Eagle;
00025 using namespace Eagle::PhysicalSpace;
00026 
00027 
00028 class DirectInterpolate
00029 {
00030  
00031   typedef MemArray<3, Eagle::tvector3> VectorArray_t; 
00032   typedef MemArray<3, point> CoordsArray_t;
00033   typedef std::list<MultiIndex<3> > IndexList_t; 
00034   //typedef pair< RefPtr<MemArray<1, point> >, RefPtr<MemArray<1, Eagle::tvector3> > > Pair_t;
00035 
00036   RefPtr<Field> Coords;
00037   CartesianFragments FragmentProperties;
00038   //RefPtr<Field> vecField;
00039 
00040   RefPtr<KDTree<3, int> > MyTree;
00041   //RefPtr<UniGridMapper> uniMap;
00042 
00043 public:
00044 
00045   typedef MemArray<1, point> CoordArray_t;
00046   typedef MemArray<1, Eagle::tvector3> VecArray_t;
00047   typedef pair<RefPtr<CoordArray_t>,RefPtr<VecArray_t> > pairArray_t;
00048 
00049   DirectInterpolate(const RefPtr<Field>&coordinates, const RefPtr<Grid>&grid);
00050   ~DirectInterpolate();
00051 
00052   bool getPoint(const point&pos, const RefPtr<Field>&vectField, tvector&outputField);  
00053   int PointInCell(const point&p, const MultiArray<1, point>&coords);//const point&c1, const point&c2, const point&c3, const point&c4, const double z_up);
00054   unsigned interpVectorField(const point&p, const MultiArray<3, tvector3>&vecField, const MultiArray<3, point>&coords, tvector&outputField,const RefPtr<UniGridMapper>&uniMap);
00055   void InterpCell(const point&p, const MultiArray<1, tvector3>&vecField, const MultiArray<1, point>&coords, tvector&outVector);
00056   double InterpQuad(const point&p, const MultiArray<1, tvector3>&vecField, const MultiArray<1, point>&coords, double v[], int offset, double *zface);
00057   void RearrangePoints(RefPtr<MemArray<1, point> >&vertexCoord, RefPtr<MemArray<1, tvector3> >&vertexVector, pairArray_t&cell);
00058    
00059 };
00060 
00061