00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MiPointProbeIjk_h
00024 #define _MiPointProbeIjk_h
00025
00026 #include <MeshVizXLM/extractors/MiPointProbeUnstructured.h>
00027
00028 #include <MeshVizXLM/mesh/data/MiDataSetIjk.h>
00029 #include <MeshVizXLM/mesh/cell/MiCell.h>
00030
00031 class MiCellFilterIjk;
00032 class MiVolumeMeshRegular;
00033 class MiVolumeMeshRectilinear;
00034 class MiVolumeMeshCurvilinear;
00035 class MiVolumeMeshUnstructuredIjk;
00036
00048 class MESHIVIZ_API MiPointProbeIjk
00049 {
00050 public:
00051 virtual ~MiPointProbeIjk() {}
00052
00054
00057 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshRegular& mesh, bool parallel = true);
00058 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshRectilinear& mesh, bool parallel = true);
00059 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshCurvilinear& mesh, bool parallel = true);
00061
00065 virtual bool setLocation(const MbVec3d& point, const MiCellFilterIjk* cellFilter=NULL) = 0;
00066
00091 virtual bool moveLocation(const MbVec3d& point, size_t cellIdI, size_t cellIdJ, size_t cellIdK,
00092 const MiCellFilterIjk* cellFilter=NULL) = 0;
00093
00097 virtual bool isFound() const = 0;
00098
00102 template <typename _T>
00103 _T getValue(const MiDataSetIjk<_T>& dataset) const;
00104
00112 virtual void getCellId(size_t &i, size_t &j, size_t& k) const = 0;
00113
00114 private: protected:
00119 virtual void getWeight(std::vector<double>& weight) const = 0;
00120 };
00121
00122
00123 template <typename _T>
00124 inline _T MiPointProbeIjk::getValue(const MiDataSetIjk<_T>& dataset) const
00125 {
00126 _T val(0);
00127 if (isFound())
00128 {
00129 size_t icell,jcell,kcell;
00130 getCellId(icell,jcell,kcell);
00131 if(dataset.getBinding()==MiDataSetIjk<_T>::PER_NODE)
00132 {
00133 std::vector<double> weight(8);
00134 getWeight(weight);
00135 val += weight[0]*dataset.get(icell,jcell,kcell);
00136 val += weight[1]*dataset.get(icell+1,jcell,kcell);
00137 val += weight[2]*dataset.get(icell+1,jcell+1,kcell);
00138 val += weight[3]*dataset.get(icell,jcell+1,kcell);
00139 val += weight[4]*dataset.get(icell,jcell,kcell+1);
00140 val += weight[5]*dataset.get(icell+1,jcell,kcell+1);
00141 val += weight[6]*dataset.get(icell+1,jcell+1,kcell+1);
00142 val += weight[7]*dataset.get(icell,jcell+1,kcell+1);
00143 }
00144 else
00145 val = dataset.get(icell,jcell,kcell);
00146 }
00147 return val;
00148 }
00149
00150
00151
00152 #endif
00153
00154
00155