netgen/libsrc/visualization/soldata.hpp

143 lines
3.5 KiB
C++
Raw Normal View History

2009-01-13 04:40:13 +05:00
#ifndef FILE_SOLDATA
#define FILE_SOLDATA
2009-07-20 14:36:36 +06:00
namespace netgen
2009-01-13 04:40:13 +05:00
{
2009-07-20 14:36:36 +06:00
using namespace std;
class SolutionData
2009-07-20 14:36:36 +06:00
{
protected:
string name;
int components;
bool iscomplex;
int multidimcomponent;
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
public:
SolutionData (const string & aname,
int acomponents = 1, bool aiscomplex = 0)
: name(aname), components(acomponents), iscomplex(aiscomplex)
{ ; }
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual ~SolutionData ()
{ ; }
2009-01-13 04:40:13 +05:00
2010-07-19 18:00:52 +06:00
int GetComponents()
{
return components;
}
bool IsComplex()
{
return iscomplex;
}
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual bool GetValue (int /* elnr */,
double /* lam1 */, double /* lam2 */, double /* lam3 */,
double * /* values */)
2010-07-19 18:00:52 +06:00
{
return false;
}
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual bool GetValue (int selnr,
const double xref[], const double x[], const double dxdxref[],
2012-04-27 00:22:49 +06:00
double * values)
2010-07-19 18:00:52 +06:00
{
return GetValue (selnr, xref[0], xref[1], xref[2], values);
}
2009-01-13 04:40:13 +05:00
2012-04-27 00:22:49 +06:00
virtual bool GetMultiValue (int elnr, int facetnr, int npts,
const double * xref, int sxref,
const double * x, int sx,
const double * dxdxref, int sdxdxref,
2010-07-19 18:00:52 +06:00
double * values, int svalues)
{
bool res = false;
for (int i = 0; i < npts; i++)
res = GetValue (elnr, &xref[i*sxref], &x[i*sx], &dxdxref[i*sdxdxref], &values[i*svalues]);
return res;
}
2009-01-13 04:40:13 +05:00
2012-04-27 00:22:49 +06:00
virtual bool GetSurfValue (int /* selnr */, int facetnr,
2009-07-20 14:36:36 +06:00
double /* lam1 */, double /* lam2 */,
double * /* values */)
2010-07-19 18:00:52 +06:00
{
return false;
}
2009-01-13 04:40:13 +05:00
2012-04-27 00:22:49 +06:00
virtual bool GetSurfValue (int selnr, int facetnr,
2009-07-20 14:36:36 +06:00
const double xref[], const double x[], const double dxdxref[],
double * values)
2010-07-19 18:00:52 +06:00
{
2012-04-27 00:22:49 +06:00
return GetSurfValue (selnr, facetnr, xref[0], xref[1], values);
2010-07-19 18:00:52 +06:00
}
2009-01-13 04:40:13 +05:00
2012-04-27 00:22:49 +06:00
virtual bool GetMultiSurfValue (int selnr, int facetnr, int npts,
2009-07-20 14:36:36 +06:00
const double * xref, int sxref,
const double * x, int sx,
const double * dxdxref, int sdxdxref,
2010-07-19 18:00:52 +06:00
double * values, int svalues)
{
bool res = false;
for (int i = 0; i < npts; i++)
2012-04-27 00:22:49 +06:00
res = GetSurfValue (selnr, facetnr, &xref[i*sxref], &x[i*sx], &dxdxref[i*sdxdxref], &values[i*svalues]);
2010-07-19 18:00:52 +06:00
return res;
}
2009-01-13 04:40:13 +05:00
#ifdef __AVX__
2016-10-30 19:01:52 +05:00
virtual bool GetMultiSurfValue (size_t selnr, size_t facetnr, size_t npts,
const __m256d * xref,
const __m256d * x,
const __m256d * dxdxref,
__m256d * values)
2016-10-30 19:01:52 +05:00
{
cerr << "GetMultiSurfVaue not overloaded for SIMD<double>" << endl;
2016-10-30 19:01:52 +05:00
return false;
}
#endif
2016-10-30 19:01:52 +05:00
2013-05-27 19:01:58 +06:00
virtual bool GetSegmentValue (int segnr, double xref, double * values)
{ return false; }
2011-09-06 21:26:14 +06:00
virtual int GetNumMultiDimComponents ()
{
return 1;
}
2017-08-16 18:49:45 +05:00
virtual void SetMultiDimComponent (int mc)
2011-09-06 21:26:14 +06:00
{
if (mc >= GetNumMultiDimComponents()) mc = GetNumMultiDimComponents()-1;
if (mc < 0) mc = 0;
multidimcomponent = mc;
}
2009-07-20 14:36:36 +06:00
};
2012-08-30 19:40:17 +06:00
class DLL_HEADER MouseEventHandler
{
public:
virtual void DblClick (int elnr, double x, double y, double z) = 0;
2012-08-30 19:40:17 +06:00
};
2014-02-24 01:31:40 +06:00
class DLL_HEADER UserVisualizationObject
{
public:
virtual void Draw () = 0;
};
2009-07-20 14:36:36 +06:00
}
2009-01-13 04:40:13 +05:00
#endif