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
00047 class MESHVIZXLM_EXTR_API MiPointProbeIjk
00048 {
00049 public:
00050 virtual ~MiPointProbeIjk() {}
00051
00053
00059 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshRegular& mesh, bool parallel = true);
00060 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshRectilinear& mesh, bool parallel = true);
00061 static MiPointProbeIjk* getNewInstance(const MiVolumeMeshCurvilinear& mesh, bool parallel = true);
00063
00067 virtual bool setLocation(const MbVec3d& point, const MiCellFilterIjk* cellFilter=NULL) = 0;
00068
00093 virtual bool moveLocation(const MbVec3d& point, size_t cellIdI, size_t cellIdJ, size_t cellIdK,
00094 const MiCellFilterIjk* cellFilter=NULL) = 0;
00095
00099 virtual bool isFound() const = 0;
00100
00104 template <typename _T>
00105 _T getValue(const MiDataSetIjk<_T>& dataset) const;
00106
00114 virtual void getCellId(size_t &i, size_t &j, size_t& k) const = 0;
00115
00116 private: protected:
00121 virtual void getWeight(std::vector<double>& weight) const = 0;
00122 };
00123
00124
00125 template <typename _T>
00126 inline _T MiPointProbeIjk::getValue(const MiDataSetIjk<_T>& dataset) const
00127 {
00128 _T val(0);
00129 if (isFound())
00130 {
00131 size_t icell,jcell,kcell;
00132 getCellId(icell,jcell,kcell);
00133 if(dataset.getBinding()==MiDataSetIjk<_T>::PER_NODE)
00134 {
00135 std::vector<double> weight(8);
00136 getWeight(weight);
00137 val += weight[0]*dataset.get(icell,jcell,kcell);
00138 val += weight[1]*dataset.get(icell+1,jcell,kcell);
00139 val += weight[2]*dataset.get(icell+1,jcell+1,kcell);
00140 val += weight[3]*dataset.get(icell,jcell+1,kcell);
00141 val += weight[4]*dataset.get(icell,jcell,kcell+1);
00142 val += weight[5]*dataset.get(icell+1,jcell,kcell+1);
00143 val += weight[6]*dataset.get(icell+1,jcell+1,kcell+1);
00144 val += weight[7]*dataset.get(icell,jcell+1,kcell+1);
00145 }
00146 else
00147 val = dataset.get(icell,jcell,kcell);
00148 }
00149 return val;
00150 }
00151
00152
00153
00154 #endif
00155
00156
00157