1 // Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle 2 // 3 // See the LICENSE.txt file in the Gmsh root directory for license information. 4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues. 5 6 #ifndef LEVELSET_H 7 #define LEVELSET_H 8 9 #include "Plugin.h" 10 11 class GMSH_LevelsetPlugin : public GMSH_PostPlugin { 12 private: 13 double _invert; 14 void _addElement(int np, int numEdges, int numComp, double xp[12], 15 double yp[12], double zp[12], double valp[12][9], 16 PViewDataList *out, bool firstStep); 17 void _cutAndAddElements(PViewData *vdata, PViewData *wdata, int ent, int ele, 18 int step, int wstep, double x[8], double y[8], 19 double z[8], double levels[8], double scalarValues[8], 20 PViewDataList *out); 21 22 protected: 23 double _ref[3], _targetError; 24 int _valueTimeStep, _valueView, _valueIndependent, _recurLevel, 25 _extractVolume; 26 typedef enum { NONE, PLANE, SPHERE, MAP } ORIENTATION; 27 ORIENTATION _orientation; 28 29 public: 30 GMSH_LevelsetPlugin(); 31 virtual double levelset(double x, double y, double z, double val) const = 0; 32 virtual PView *execute(PView *); 33 void assignSpecificVisibility() const; 34 }; 35 36 #endif 37