Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
MiPointProbeHexahedronIjk.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#ifndef _MiPointProbeHexahedronIjk_h
24#define _MiPointProbeHexahedronIjk_h
25
29
30
31#include<Inventor/STL/cassert>
32
44{
45public:
46
53 static MiPointProbeHexahedronIjk* getNewInstance(const MiVolumeMeshHexahedronIjk& mesh, bool parallel = true);
54
60 template <typename _T>
61 _T getValue(const MiDataSetI<_T>& dataset) const;
62
68 template <typename _T>
69 _T getValue(const MiDataSetIjk<_T>& dataset) const;
70
71private:protected:
79 virtual const MiVolumeCell* getCell() const = 0;
80
81};
82
83//-----------------------------------------------------------------------------
84template <typename _T>
86{
87 _T val(0);
88 if (isFound())
89 {
90 assert(dataset.getBinding()==MiDataSetI<_T>::PER_NODE);
91 const MiCell *cell = getCell();
92 std::vector<double> weight(cell->getNumNodes());
93 getWeight(weight);
94 for (size_t i=0; i<cell->getNumNodes(); ++i)
95 val += weight[i]*dataset.get(cell->getNodeIndex(i));
96 }
97 return val;
98}
99
100//-----------------------------------------------------------------------------
101template <typename _T>
103{
104 _T val(0);
105 if (isFound())
106 {
107 assert(dataset.getBinding()==MiDataSetIjk<_T>::PER_CELL);
108 size_t icell,jcell,kcell;
109 getCellId(icell,jcell,kcell);
110 val = dataset.get(icell,jcell,kcell);
111 }
112 return val;
113}
114
115#endif
116
117
#define MESHVIZXLM_EXTR_API
valueRef getValue() const
Definition SoSubField.h:234
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract cell...
Definition MiCell.h:74
virtual size_t getNodeIndex(size_t node) const =0
Gets the index (in the mesh) of a node.
virtual size_t getNumNodes() const =0
Gets the number of nodes.
virtual DataBinding getBinding() const =0
Returns the data binding of this data set.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic data set interfa...
Definition MiDataSetI.h:40
virtual _T get(size_t i) const =0
Returns the i-th value of this set.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic data set interfa...
virtual _T get(size_t i, size_t j, size_t k) const =0
Returns the ijk-th value of this set.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
_T getValue(const MiDataSetI< _T > &dataset) const
Gets the value at the current probe location in the given PER_NODE dataset.
virtual const MiVolumeCell * getCell() const =0
Gets the cell of the mesh containing the current location of the probe.
static MiPointProbeHexahedronIjk * getNewInstance(const MiVolumeMeshHexahedronIjk &mesh, bool parallel=true)
Factory method returning a new instance of a class implementing this abstract class.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
virtual void getCellId(size_t &i, size_t &j, size_t &k) const =0
Gets the ids of the cell of the mesh containing the current location of the probe.
virtual void getWeight(std::vector< double > &weight) const =0
Gets the weights at the current probe location.
virtual bool isFound() const =0
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract cell...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> IJK Hexahedron volume me...