1 #include <mystdlib.h>
2 #include "meshing.hpp"
3 #include <netgen_version.hpp>
4 
5 
6 namespace netgen
7 {
8 
9   class TraceGlobal
10   {
11     string name;
12   public:
TraceGlobal(string _name)13     TraceGlobal(string _name) : name(_name) { cout << "init global " << name << endl; }
~TraceGlobal()14     ~TraceGlobal() { cout << "exit global " << name << endl; }
15   };
16 
17   // stringstream emptystr;
18   // ostream * testout = &emptystr;
19   // testout -> clear(ios::failbit);
20 
21   // ostream * testout = &cout;
22 
23   // NetgenOutStream * testout = new NetgenOutStream;
24 
25   const string netgen_version = NETGEN_VERSION;
26 
27   ostream * mycout = &cout;
28   ostream * myerr = &cerr;
29 
30   // some functions (visualization) still need a global mesh
31   // TraceGlobal glob1("global1");
32   DLL_HEADER shared_ptr<Mesh> mesh;
33   DLL_HEADER shared_ptr<NetgenGeometry> ng_geometry;
34   // TraceGlobal glob2("global2");
35 
36   // global communicator for netgen
37   // DLL_HEADER NgMPI_Comm ng_comm;
38 
39   weak_ptr<Mesh> global_mesh;
SetGlobalMesh(shared_ptr<Mesh> m)40   void SetGlobalMesh (shared_ptr<Mesh> m)
41   {
42     PrintMessage(5, "set global mesh");
43     global_mesh = m;
44   }
45 
46   // true if netgen was started using the netgen executable
47   // false if netgen.gui was imported from python
48   DLL_HEADER bool netgen_executable_started = false;
49 
50   //  Flags parameters;
51   int silentflag = 0;
52   int testmode = 0;
53 
54   volatile multithreadt multithread;
55 
56   string ngdir = ".";
57 
Ng_PrintDest(const char * s)58   void Ng_PrintDest(const char * s)
59   {
60     if (id == 0)
61       (*mycout) << s << flush;
62   }
63 
MyError(const char * ch)64   DLL_HEADER void MyError(const char * ch)
65   {
66     cout << ch;
67     (*testout) << "Error !!! " << ch << endl << flush;
68   }
69 
70   static double starttimea;
ResetTime()71   void ResetTime ()
72   {
73     starttimea = WallTime();
74   }
75 
GetTime()76   double GetTime ()
77   {
78     return WallTime() - starttimea;
79   }
80 
81 
82 
83   mutex tcl_todo_mutex;
84 
85   int h_argc = 0;
86   char ** h_argv = NULL;
87 
multithreadt()88   multithreadt :: multithreadt()
89   {
90     pause =0;
91     testmode = 0;
92     redraw = 0;
93     drawing = 0;
94     terminate = 0;
95     running = 0;
96     percent = 0;
97     task = "";
98   }
99 
100   DebugParameters debugparam;
101   bool verbose = 0;
102 
103   size_t timestamp = 0;
104   /*
105   int GetTimeStamp()
106   {
107     return timestamp;
108   }
109 
110   int NextTimeStamp()
111   {
112     timestamp++;
113     return timestamp;
114   }
115   */
116 }
117