netgen/libsrc/visualization/soldata.hpp

102 lines
2.4 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;
2009-07-23 19:02:40 +06:00
class DLL_HEADER 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[],
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
virtual bool GetMultiValue (int elnr, 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
2009-07-20 14:36:36 +06:00
virtual bool GetSurfValue (int /* selnr */,
double /* lam1 */, double /* lam2 */,
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 GetSurfValue (int selnr,
const double xref[], const double x[], const double dxdxref[],
double * values)
2010-07-19 18:00:52 +06:00
{
return GetSurfValue (selnr, xref[0], xref[1], values);
}
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
virtual bool GetMultiSurfValue (int selnr, 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 = GetSurfValue (selnr, &xref[i*sxref], &x[i*sx], &dxdxref[i*sdxdxref], &values[i*svalues]);
return res;
}
2009-01-13 04:40:13 +05:00
2009-07-20 14:36:36 +06:00
void SetMultiDimComponent (int mc)
{ multidimcomponent = mc; }
};
}
2009-01-13 04:40:13 +05:00
#endif