/usr/share/netgen/libsrc/visualization/vssolution.hpp is in netgen-headers 4.9.13.dfsg-8build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | #ifndef FILE_VSSOLUTION
#define FILE_VSSOLUTION
#ifndef SMALLLIB
#ifndef NOTCL
extern
void ImportSolution (const char * filename);
extern int Ng_Vis_Set (ClientData clientData,
Tcl_Interp * interp,
int argc, tcl_const char *argv[]);
#endif
#endif
class FieldLineCalc;
class VisualSceneSolution : public VisualScene
{
friend class FieldLineCalc;
class ClipPlaneTrig
{
public:
struct ps
{
int pnr, locpnr;
};
ps points[3];
ElementIndex elnr;
};
class ClipPlanePoint
{
public:
ElementIndex elnr;
Point<3> lami;
Point<3> p;
};
int surfellist;
int linelist;
int clipplanelist;
int isolinelist;
int clipplane_isolinelist;
int surface_vector_list;
// int cone_list;
int isosurface_list;
int pointcurvelist;
bool draw_fieldlines;
bool drawpointcurves;
bool draw_isosurface;
int num_fieldlines;
bool fieldlines_randomstart;
int fieldlineslist;
int num_fieldlineslists;
int fieldlines_startarea;
Array<double> fieldlines_startarea_parameter;
int fieldlines_startface;
string fieldlines_filename;
double fieldlines_reltolerance;
int fieldlines_rktype;
double fieldlines_rellength;
double fieldlines_relthickness;
int fieldlines_vecfunction;
bool fieldlines_fixedphase;
float fieldlines_phase;
int fieldlines_maxpoints;
int surfeltimestamp, clipplanetimestamp, solutiontimestamp;
int surfellinetimestamp;
int fieldlinestimestamp, surface_vector_timestamp;
int pointcurve_timestamp;
int isosurface_timestamp;
int subdivision_timestamp;
int timetimestamp;
double minval, maxval;
NgLock *lock;
#ifdef PARALLELGL
Array<int> par_linelists;
Array<int> par_surfellists;
#endif
public:
enum EvalFunc {
FUNC_ABS = 1,
FUNC_ABS_TENSOR = 2,
FUNC_MISES = 3,
FUNC_MAIN = 4
};
EvalFunc evalfunc;
enum SolType
{
SOL_NODAL = 1,
SOL_ELEMENT = 2,
SOL_SURFACE_ELEMENT = 3,
SOL_NONCONTINUOUS = 4,
SOL_SURFACE_NONCONTINUOUS = 5,
SOL_VIRTUALFUNCTION = 6,
SOL_MARKED_ELEMENTS = 10,
SOL_ELEMENT_ORDER = 11,
};
class SolData
{
public:
SolData ();
~SolData ();
char * name;
double * data;
int components;
int dist;
int order;
bool iscomplex;
bool draw_volume;
bool draw_surface;
SolType soltype;
SolutionData * solclass;
// internal variables:
int size;
};
Array<SolData*> soldata;
int usetexture; // 0..no, 1..1D texture (standard), 2..2D-texture (complex)
int clipsolution; // 0..no, 1..scal, 2..vec
int scalfunction, scalcomp, vecfunction;
int gridsize;
double xoffset, yoffset;
int autoscale, logscale;
double mminval, mmaxval;
int numisolines;
int subdivisions;
bool showclipsolution;
bool showsurfacesolution;
bool lineartexture;
int numtexturecols;
int multidimcomponent;
// bool fieldlineplot;
double time;
int deform;
double scaledeform;
bool imag_part;
private:
void BuildFieldLinesFromFile(Array<Point3d> & startpoints);
void BuildFieldLinesFromFace(Array<Point3d> & startpoints);
void BuildFieldLinesFromBox(Array<Point3d> & startpoints);
void BuildFieldLinesFromLine(Array<Point3d> & startpoints);
public:
VisualSceneSolution ();
virtual ~VisualSceneSolution ();
virtual void BuildScene (int zoomall = 0);
virtual void DrawScene ();
virtual void MouseDblClick (int px, int py);
void BuildFieldLinesPlot ();
void AddSolutionData (SolData * soldata);
void ClearSolutionData ();
void UpdateSolutionTimeStamp ();
SolData * GetSolData (int i);
int GetNSolData () { return soldata.Size(); }
void SaveSolutionData (const char * filename);
static void RealVec3d (const double * values, Vec3d & v,
bool iscomplex, bool imag);
static void RealVec3d (const double * values, Vec3d & v,
bool iscomplex, double phaser, double phasei);
void SetSubdivision (int sd)
{
subdivisions = sd;
subdivision_timestamp = solutiontimestamp = NextTimeStamp();
}
private:
void GetMinMax (int funcnr, int comp, double & minv, double & maxv) const;
void GetClippingPlaneTrigs (Array<ClipPlaneTrig> & trigs, Array<ClipPlanePoint> & pts);
void GetClippingPlaneGrid (Array<ClipPlanePoint> & pts);
void DrawCone (const Point<3> & p1, const Point<3> & p2, double r);
void DrawCylinder (const Point<3> & p1, const Point<3> & p2, double r);
// Get Function Value, local coordinates lam1, lam2, lam3,
bool GetValue (const SolData * data, ElementIndex elnr,
double lam1, double lam2, double lam3,
int comp, double & val) const;
bool GetValue (const SolData * data, ElementIndex elnr,
const double xref[], const double x[], const double dxdxref[],
int comp, double & val) const;
bool GetValueComplex (const SolData * data, ElementIndex elnr,
double lam1, double lam2, double lam3,
int comp, complex<double> & val) const;
bool GetValues (const SolData * data, ElementIndex elnr,
double lam1, double lam2, double lam3,
double * values) const;
bool GetValues (const SolData * data, ElementIndex elnr,
const double xref[], const double x[], const double dxdxref[],
double * values) const;
bool GetMultiValues (const SolData * data, ElementIndex elnr, int npt,
const double * xref, int sxref,
const double * x, int sx,
const double * dxdxref, int sdxdxref,
double * val, int sval) const;
bool GetSurfValue (const SolData * data, SurfaceElementIndex elnr,
double lam1, double lam2,
int comp, double & val) const;
bool GetSurfValue (const SolData * data, SurfaceElementIndex elnr,
const double xref[], const double x[], const double dxdxref[],
int comp, double & val) const;
bool GetSurfValueComplex (const SolData * data, SurfaceElementIndex elnr,
double lam1, double lam2,
int comp, complex<double> & val) const;
bool GetSurfValues (const SolData * data, SurfaceElementIndex elnr,
double lam1, double lam2,
double * values) const;
bool GetSurfValues (const SolData * data, SurfaceElementIndex elnr,
const double xref[], const double x[], const double dxdxref[],
double * values) const;
bool GetMultiSurfValues (const SolData * data, SurfaceElementIndex elnr, int npt,
const double * xref, int sxref,
const double * x, int sx,
const double * dxdxref, int sdxdxref,
double * val, int sval) const;
double ExtractValue (const SolData * data, int comp, double * values) const;
complex<double> ExtractValueComplex (const SolData * data, int comp, double * values) const;
Vec<3> GetDeformation (ElementIndex elnr, const Point<3> & p) const;
Vec<3> GetSurfDeformation (SurfaceElementIndex selnr, double lam1, double lam2) const;
void GetPointDeformation (int pnum, Point<3> & p, SurfaceElementIndex elnr = -1) const;
public:
/// draw elements (build lists)
void DrawSurfaceElements ();
void DrawSurfaceElementLines ();
void DrawSurfaceVectors ();
void DrawTrigSurfaceVectors(const Array< Point<3> > & lp, const Point<3> & pmin, const Point<3> & pmax,
const int sei, const SolData * vsol);
void DrawIsoSurface(const SolData * sol, const SolData * grad, int comp);
void DrawIsoLines (const Point<3> & p1,
const Point<3> & p2,
const Point<3> & p3,
double val1, double val2, double val3);
// double minval, double maxval, int n);
// draw isolines between lines (p1,p2) and (p3,p4)
void DrawIsoLines2 (const Point<3> & p1,
const Point<3> & p2,
const Point<3> & p3,
const Point<3> & p4,
double val1, double val2, double val3, double val4);
// double minval, double maxval, int n);
void DrawClipPlaneTrigs (const SolData * sol, int comp,
const Array<ClipPlaneTrig> & trigs,
const Array<ClipPlanePoint> & points);
// void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0);
void SetOpenGlColor(double val);
// 0 .. non, 1 .. scalar, 2 .. complex
void SetTextureMode (int texturemode) const;
#ifndef SMALLLIB
#ifndef NOTCL
friend int Ng_Vis_Set (ClientData clientData,
Tcl_Interp * interp,
int argc, tcl_const char *argv[]);
#endif
#endif
#ifdef PARALLELGL
void Broadcast ();
#endif
};
class RKStepper
{
private:
Array<double> c,b;
TABLE<double> *a;
int steps;
int order;
double tolerance;
Array<Vec3d> K;
int stepcount;
double h;
double startt;
double startt_bak;
Point3d startval;
Point3d startval_bak;
bool adaptive;
int adrun;
Point3d valh;
int notrestarted;
public:
~RKStepper();
RKStepper(int type = 0);
void SetTolerance(const double tol){tolerance = tol;}
void StartNextValCalc(const Point3d & astartval, const double astartt, const double ah, const bool aadaptive = false);
bool GetNextData(Point3d & val, double & t, double & ah);
bool FeedNextF(const Vec3d & f);
};
class FieldLineCalc
{
private:
const Mesh & mesh;
VisualSceneSolution & vss;
const VisualSceneSolution::SolData * vsol;
RKStepper stepper;
double maxlength;
int maxpoints;
int direction;
Point3d pmin, pmax;
double rad;
double phaser, phasei;
double critical_value;
bool randomized;
double thickness;
public:
FieldLineCalc(const Mesh & amesh, VisualSceneSolution & avss, const VisualSceneSolution::SolData * solution,
const double rel_length, const int amaxpoints = -1,
const double rel_thickness = -1, const double rel_tolerance = -1, const int rk_type = 0, const int adirection = 0);
void SetPhase(const double real, const double imag) { phaser = real; phasei = imag; }
void SetCriticalValue(const double val) { critical_value = val; }
void Randomized(void) { randomized = true; }
void NotRandomized(void) { randomized = false; }
void Calc(const Point3d & startpoint, Array<Point3d> & points, Array<double> & vals, Array<bool> & drawelems, Array<int> & dirstart);
void GenerateFieldLines(Array<Point3d> & potential_startpoints, const int numlines, const int gllist,
const double minval, const double maxval, const int logscale, double phaser, double phasei);
};
extern VisualSceneSolution vssolution;
#endif
|