2009-01-13 04:40:13 +05:00
|
|
|
#ifndef FILE_SOLDATA
|
|
|
|
#define FILE_SOLDATA
|
|
|
|
|
2019-02-07 19:58:53 +05:00
|
|
|
#include <myadt.hpp> // for tAVX
|
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;
|
2017-11-27 14:19:43 +05:00
|
|
|
/*
|
2017-11-24 01:26:23 +05:00
|
|
|
#if defined __AVX512F__
|
|
|
|
typedef __m512 tAVX;
|
|
|
|
typedef __m512d tAVXd;
|
|
|
|
#elif defined __AVX__
|
|
|
|
typedef __m256 tAVX;
|
|
|
|
typedef __m256d tAVXd;
|
|
|
|
#endif
|
2017-11-27 14:19:43 +05:00
|
|
|
*/
|
2017-11-24 01:26:23 +05:00
|
|
|
|
2013-11-25 15:57:35 +06:00
|
|
|
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,
|
2010-03-22 15:35:54 +05: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++)
|
|
|
|
res = GetValue (elnr, &xref[i*sxref], &x[i*sx], &dxdxref[i*sdxdxref], &values[i*svalues]);
|
|
|
|
return res;
|
|
|
|
}
|
2010-03-22 15:35:54 +05:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2017-11-27 14:19:43 +05:00
|
|
|
#ifdef __SSE__
|
2016-10-30 19:01:52 +05:00
|
|
|
virtual bool GetMultiSurfValue (size_t selnr, size_t facetnr, size_t npts,
|
2019-02-08 00:32:01 +05:00
|
|
|
const ngsimd::tAVXd * xref,
|
|
|
|
const ngsimd::tAVXd * x,
|
|
|
|
const ngsimd::tAVXd * dxdxref,
|
|
|
|
ngsimd::tAVXd * values)
|
2016-10-30 19:01:52 +05:00
|
|
|
{
|
2017-04-19 21:02:27 +05:00
|
|
|
cerr << "GetMultiSurfVaue not overloaded for SIMD<double>" << endl;
|
2016-10-30 19:01:52 +05:00
|
|
|
return false;
|
|
|
|
}
|
2017-04-20 20:55:56 +05:00
|
|
|
#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:
|
2014-02-12 21:13:35 +06:00
|
|
|
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:
|
2020-05-26 23:57:25 +05:00
|
|
|
virtual ~UserVisualizationObject() { ; }
|
2014-02-24 01:31:40 +06:00
|
|
|
virtual void Draw () = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-07-20 14:36:36 +06:00
|
|
|
}
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|