00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 #ifndef _MiPointProbeHexahedronIjk_h 00024 #define _MiPointProbeHexahedronIjk_h 00025 00026 #include <MeshVizXLM/extractors/MiPointProbeIjk.h> 00027 #include <MeshVizXLM/mesh/MiVolumeMeshHexahedronIjk.h> 00028 #include <MeshVizXLM/mesh/cell/MiVolumeCell.h> 00029 00030 00031 #include<Inventor/STL/cassert> 00032 00043 class MESHVIZXLM_EXTR_API MiPointProbeHexahedronIjk : virtual public MiPointProbeIjk 00044 { 00045 public: 00046 00053 static MiPointProbeHexahedronIjk* getNewInstance(const MiVolumeMeshHexahedronIjk& mesh, bool parallel = true); 00054 00060 template <typename _T> 00061 _T getValue(const MiDataSetI<_T>& dataset) const; 00062 00068 template <typename _T> 00069 _T getValue(const MiDataSetIjk<_T>& dataset) const; 00070 00071 private:protected: 00079 virtual const MiVolumeCell* getCell() const = 0; 00080 00081 }; 00082 00083 //----------------------------------------------------------------------------- 00084 template <typename _T> 00085 inline _T MiPointProbeHexahedronIjk::getValue(const MiDataSetI<_T>& dataset) const 00086 { 00087 _T val(0); 00088 if (isFound()) 00089 { 00090 assert(dataset.getBinding()==MiDataSetI<_T>::PER_NODE); 00091 const MiCell *cell = getCell(); 00092 std::vector<double> weight(cell->getNumNodes()); 00093 getWeight(weight); 00094 for (size_t i=0; i<cell->getNumNodes(); ++i) 00095 val += weight[i]*dataset.get(cell->getNodeIndex(i)); 00096 } 00097 return val; 00098 } 00099 00100 //----------------------------------------------------------------------------- 00101 template <typename _T> 00102 inline _T MiPointProbeHexahedronIjk::getValue(const MiDataSetIjk<_T>& dataset) const 00103 { 00104 _T val(0); 00105 if (isFound()) 00106 { 00107 assert(dataset.getBinding()==MiDataSetIjk<_T>::PER_CELL); 00108 size_t icell,jcell,kcell; 00109 getCellId(icell,jcell,kcell); 00110 val = dataset.get(icell,jcell,kcell); 00111 } 00112 return val; 00113 } 00114 00115 #endif 00116 00117 00118