netgen-mesher 6.2.2505.post48.dev0__cp313-cp313-win_amd64.whl → 6.2.2506.post48.dev0__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. netgen/__init__.pyi +3 -3
  2. netgen/cmake/NetgenConfig.cmake +9 -8
  3. netgen/config/__init__.pyi +7 -7
  4. netgen/config/config.py +6 -6
  5. netgen/config/config.pyi +7 -7
  6. netgen/include/core/archive.hpp +18 -3
  7. netgen/include/core/array.hpp +20 -4
  8. netgen/include/core/autodiff.hpp +9 -11
  9. netgen/include/core/autodiffdiff.hpp +0 -2
  10. netgen/include/core/bitarray.hpp +1 -1
  11. netgen/include/core/flags.hpp +1 -1
  12. netgen/include/core/hashtable.hpp +1 -1
  13. netgen/include/core/memtracer.hpp +7 -7
  14. netgen/include/core/ngcore.hpp +5 -0
  15. netgen/include/core/ngcore_api.hpp +11 -0
  16. netgen/include/core/register_archive.hpp +8 -0
  17. netgen/include/core/simd_arm64.hpp +100 -5
  18. netgen/include/core/simd_generic.hpp +187 -6
  19. netgen/include/core/simd_math.hpp +3 -2
  20. netgen/include/core/statushandler.hpp +37 -0
  21. netgen/include/core/table.hpp +2 -2
  22. netgen/include/core/taskmanager.hpp +34 -1
  23. netgen/include/include/netgen_version.hpp +3 -3
  24. netgen/include/meshing/basegeom.hpp +1 -4
  25. netgen/include/meshing/global.hpp +0 -17
  26. netgen/include/meshing/hpref_tet.hpp +41 -0
  27. netgen/include/meshing/hprefinement.hpp +2 -0
  28. netgen/include/meshing/meshtype.hpp +1 -0
  29. netgen/include/meshing/msghandler.hpp +9 -6
  30. netgen/include/meshing/topology.hpp +2 -2
  31. netgen/include/nginterface.h +3 -2
  32. netgen/include/occ/occ_utils.hpp +26 -0
  33. netgen/include/occ/occgeom.hpp +8 -0
  34. netgen/include/pybind11/attr.h +40 -8
  35. netgen/include/pybind11/buffer_info.h +14 -14
  36. netgen/include/pybind11/cast.h +553 -29
  37. netgen/include/pybind11/chrono.h +4 -1
  38. netgen/include/pybind11/conduit/README.txt +15 -0
  39. netgen/include/pybind11/conduit/pybind11_conduit_v1.h +116 -0
  40. netgen/include/pybind11/conduit/pybind11_platform_abi_id.h +87 -0
  41. netgen/include/pybind11/conduit/wrap_include_python_h.h +72 -0
  42. netgen/include/pybind11/critical_section.h +56 -0
  43. netgen/include/pybind11/detail/class.h +172 -97
  44. netgen/include/pybind11/detail/common.h +270 -189
  45. netgen/include/pybind11/detail/cpp_conduit.h +75 -0
  46. netgen/include/pybind11/detail/descr.h +55 -0
  47. netgen/include/pybind11/detail/dynamic_raw_ptr_cast_if_possible.h +39 -0
  48. netgen/include/pybind11/detail/exception_translation.h +71 -0
  49. netgen/include/pybind11/detail/function_record_pyobject.h +191 -0
  50. netgen/include/pybind11/detail/init.h +113 -9
  51. netgen/include/pybind11/detail/internals.h +479 -344
  52. netgen/include/pybind11/detail/native_enum_data.h +209 -0
  53. netgen/include/pybind11/detail/pybind11_namespace_macros.h +82 -0
  54. netgen/include/pybind11/detail/struct_smart_holder.h +378 -0
  55. netgen/include/pybind11/detail/type_caster_base.h +506 -133
  56. netgen/include/pybind11/detail/using_smart_holder.h +22 -0
  57. netgen/include/pybind11/detail/value_and_holder.h +90 -0
  58. netgen/include/pybind11/eigen/matrix.h +19 -10
  59. netgen/include/pybind11/eigen/tensor.h +15 -11
  60. netgen/include/pybind11/embed.h +50 -46
  61. netgen/include/pybind11/eval.h +11 -6
  62. netgen/include/pybind11/functional.h +58 -49
  63. netgen/include/pybind11/gil.h +34 -82
  64. netgen/include/pybind11/gil_safe_call_once.h +12 -1
  65. netgen/include/pybind11/gil_simple.h +37 -0
  66. netgen/include/pybind11/native_enum.h +67 -0
  67. netgen/include/pybind11/numpy.h +272 -93
  68. netgen/include/pybind11/pybind11.h +947 -265
  69. netgen/include/pybind11/pytypes.h +127 -21
  70. netgen/include/pybind11/stl/filesystem.h +23 -25
  71. netgen/include/pybind11/stl.h +277 -59
  72. netgen/include/pybind11/stl_bind.h +42 -7
  73. netgen/include/pybind11/subinterpreter.h +299 -0
  74. netgen/include/pybind11/trampoline_self_life_support.h +65 -0
  75. netgen/include/pybind11/typing.h +177 -4
  76. netgen/include/pybind11/warnings.h +75 -0
  77. netgen/lib/libnggui.lib +0 -0
  78. netgen/lib/ngcore.lib +0 -0
  79. netgen/lib/nglib.lib +0 -0
  80. netgen/libnggui.dll +0 -0
  81. netgen/libngguipy.pyd +0 -0
  82. netgen/libngpy/_NgOCC.pyi +220 -141
  83. netgen/libngpy/_csg.pyi +26 -26
  84. netgen/libngpy/_geom2d.pyi +34 -25
  85. netgen/libngpy/_meshing.pyi +262 -111
  86. netgen/libngpy/_stl.pyi +3 -4
  87. netgen/libngpy.pyd +0 -0
  88. netgen/ngcore.dll +0 -0
  89. netgen/nglib.dll +0 -0
  90. netgen/read_gmsh.py +41 -0
  91. netgen/togl.dll +0 -0
  92. netgen/version.py +1 -1
  93. netgen/webgui.py +38 -2
  94. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/METADATA +2 -1
  95. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/RECORD +144 -124
  96. pyngcore/pyngcore.cp313-win_amd64.pyd +0 -0
  97. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/boundarycondition.geo +0 -0
  98. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/boxcyl.geo +0 -0
  99. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/circle_on_cube.geo +0 -0
  100. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cone.geo +0 -0
  101. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cube.geo +0 -0
  102. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubeandring.geo +0 -0
  103. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubeandspheres.geo +0 -0
  104. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubemcyl.geo +0 -0
  105. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cubemsphere.geo +0 -0
  106. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cylinder.geo +0 -0
  107. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/cylsphere.geo +0 -0
  108. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/doc/ng4.pdf +0 -0
  109. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ellipsoid.geo +0 -0
  110. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ellipticcyl.geo +0 -0
  111. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/extrusion.geo +0 -0
  112. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/fichera.geo +0 -0
  113. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/frame.step +0 -0
  114. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/hinge.stl +0 -0
  115. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/lshape3d.geo +0 -0
  116. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/manyholes.geo +0 -0
  117. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/manyholes2.geo +0 -0
  118. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/matrix.geo +0 -0
  119. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/ortho.geo +0 -0
  120. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/part1.stl +0 -0
  121. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/period.geo +0 -0
  122. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/exportNeutral.py +0 -0
  123. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/mesh.py +0 -0
  124. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/py_tutorials/shaft.geo +0 -0
  125. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/revolution.geo +0 -0
  126. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/screw.step +0 -0
  127. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sculpture.geo +0 -0
  128. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/shaft.geo +0 -0
  129. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/shell.geo +0 -0
  130. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sphere.geo +0 -0
  131. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/sphereincube.geo +0 -0
  132. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/square.in2d +0 -0
  133. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/squarecircle.in2d +0 -0
  134. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/squarehole.in2d +0 -0
  135. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/torus.geo +0 -0
  136. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/trafo.geo +0 -0
  137. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twobricks.geo +0 -0
  138. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twocubes.geo +0 -0
  139. {netgen_mesher-6.2.2505.post48.dev0.data → netgen_mesher-6.2.2506.post48.dev0.data}/data/share/netgen/twocyl.geo +0 -0
  140. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/AUTHORS +0 -0
  141. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/LICENSE +0 -0
  142. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/WHEEL +0 -0
  143. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/entry_points.txt +0 -0
  144. {netgen_mesher-6.2.2505.post48.dev0.dist-info → netgen_mesher-6.2.2506.post48.dev0.dist-info}/top_level.txt +0 -0
@@ -48,6 +48,13 @@ namespace ngcore
48
48
  return k;
49
49
  }
50
50
 
51
+ constexpr size_t LargestPowerOfTwo (size_t x)
52
+ {
53
+ size_t y = 1;
54
+ while (2*y <= x) y *= 2;
55
+ return y;
56
+ }
57
+
51
58
 
52
59
  template <typename T, int N=GetDefaultSIMDSize()> class SIMD;
53
60
 
@@ -89,7 +96,8 @@ namespace ngcore
89
96
  template <int N>
90
97
  class alignas(GetLargestNativeSIMDPart(N)*sizeof(int64_t)) SIMD<mask64,N>
91
98
  {
92
- static constexpr int N1 = GetLargestNativeSIMDPart(N);
99
+ // static constexpr int N1 = GetLargestNativeSIMDPart(N);
100
+ static constexpr size_t N1 = LargestPowerOfTwo(N-1);
93
101
  static constexpr int N2 = N-N1;
94
102
 
95
103
  SIMD<mask64,N1> lo;
@@ -111,6 +119,113 @@ namespace ngcore
111
119
  }
112
120
 
113
121
 
122
+ ////////////////////////////////////////////////////////////////////////////
123
+ // int32
124
+
125
+ template<>
126
+ class SIMD<int32_t,1>
127
+ {
128
+ int32_t data;
129
+
130
+ public:
131
+ static constexpr int Size() { return 1; }
132
+ SIMD () {}
133
+ SIMD (const SIMD &) = default;
134
+ SIMD & operator= (const SIMD &) = default;
135
+ // SIMD (int val) : data{val} {}
136
+ SIMD (int32_t val) : data{val} {}
137
+ SIMD (size_t val) : data(val) {}
138
+ explicit SIMD (std::array<int32_t, 1> arr) : data{arr[0]} {}
139
+
140
+
141
+
142
+ int32_t operator[] (int i) const { return ((int32_t*)(&data))[i]; }
143
+ auto Data() const { return data; }
144
+ static SIMD FirstInt(int32_t n0=0) { return {n0}; }
145
+ template <int I>
146
+ int32_t Get()
147
+ {
148
+ static_assert(I==0);
149
+ return data;
150
+ }
151
+ };
152
+
153
+ template<int N>
154
+ class alignas(GetLargestNativeSIMDPart(N)*sizeof(int64_t)) SIMD<int32_t,N>
155
+ {
156
+ // static constexpr int N1 = GetLargestNativeSIMDPart(N);
157
+ static constexpr size_t N1 = LargestPowerOfTwo(N-1);
158
+ static constexpr int N2 = N-N1;
159
+
160
+ SIMD<int32_t,N1> lo;
161
+ SIMD<int32_t,N2> high;
162
+
163
+ public:
164
+ static constexpr int Size() { return N; }
165
+
166
+ SIMD () {}
167
+ SIMD (const SIMD &) = default;
168
+ SIMD & operator= (const SIMD &) = default;
169
+
170
+ // SIMD (int val) : lo{val}, high{val} { ; }
171
+ SIMD (int32_t val) : lo{val}, high{val} { ; }
172
+ SIMD (size_t val) : lo{val}, high{val} { ; }
173
+ SIMD (int32_t * p) : lo{p}, high{p+N1} { ; }
174
+
175
+ SIMD (SIMD<int32_t,N1> lo_, SIMD<int32_t,N2> high_) : lo(lo_), high(high_) { ; }
176
+
177
+ explicit SIMD( std::array<int32_t, N> arr )
178
+ : lo(detail::array_range<N1>(arr, 0)),
179
+ high(detail::array_range<N2>(arr, N1))
180
+ {}
181
+
182
+
183
+ template<typename ...T>
184
+ explicit SIMD(const T... vals)
185
+ : lo(detail::array_range<N1>(std::array<int32_t, N>{vals...}, 0)),
186
+ high(detail::array_range<N2>(std::array<int32_t, N>{vals...}, N1))
187
+ {
188
+ static_assert(sizeof...(vals)==N, "wrong number of arguments");
189
+ }
190
+
191
+
192
+ template<typename T, typename std::enable_if<std::is_convertible<T, std::function<int32_t(int)>>::value, int>::type = 0>
193
+ SIMD (const T & func)
194
+ {
195
+ for(auto i : IntRange(N1))
196
+ lo[i] = func(i);
197
+ for(auto i : IntRange(N2))
198
+ high[i] = func(N1+i);
199
+ }
200
+
201
+ auto Lo() const { return lo; }
202
+ auto Hi() const { return high; }
203
+
204
+ int32_t operator[] (int i) const { return ((int32_t*)(&lo))[i]; }
205
+
206
+ void Store (int32_t * p) { lo.Store(p); high.Store(p+N1); }
207
+
208
+
209
+ /*
210
+ operator tuple<int32_t&,int32_t&,int32_t&,int32_t&> ()
211
+ { return tuple<int32_t&,int32_t&,int32_t&,int32_t&>((*this)[0], (*this)[1], (*this)[2], (*this)[3]); }
212
+ */
213
+
214
+ /*
215
+ static SIMD FirstInt() { return { 0, 1, 2, 3 }; }
216
+ */
217
+ static SIMD FirstInt(int32_t n0=0) { return {SIMD<int32_t,N1>::FirstInt(n0), SIMD<int32_t,N2>::FirstInt(n0+N1)}; }
218
+ template <int I>
219
+ int32_t Get()
220
+ {
221
+ static_assert(I>=0 && I<N, "Index out of range");
222
+ if constexpr(I<N1) return lo.template Get<I>();
223
+ else return high.template Get<I-N1>();
224
+ }
225
+ };
226
+
227
+
228
+
114
229
  ////////////////////////////////////////////////////////////////////////////
115
230
  // int64
116
231
 
@@ -145,7 +260,8 @@ namespace ngcore
145
260
  template<int N>
146
261
  class alignas(GetLargestNativeSIMDPart(N)*sizeof(int64_t)) SIMD<int64_t,N>
147
262
  {
148
- static constexpr int N1 = GetLargestNativeSIMDPart(N);
263
+ // static constexpr int N1 = GetLargestNativeSIMDPart(N);
264
+ static constexpr size_t N1 = LargestPowerOfTwo(N-1);
149
265
  static constexpr int N2 = N-N1;
150
266
 
151
267
  SIMD<int64_t,N1> lo;
@@ -209,6 +325,7 @@ namespace ngcore
209
325
  }
210
326
  };
211
327
 
328
+
212
329
 
213
330
  ////////////////////////////////////////////////////////////////////////////
214
331
  // double
@@ -262,7 +379,8 @@ namespace ngcore
262
379
  template<int N>
263
380
  class alignas(GetLargestNativeSIMDPart(N)*sizeof(double)) SIMD<double, N>
264
381
  {
265
- static constexpr int N1 = GetLargestNativeSIMDPart(N);
382
+ // static constexpr int N1 = GetLargestNativeSIMDPart(N);
383
+ static constexpr size_t N1 = LargestPowerOfTwo(N-1);
266
384
  static constexpr int N2 = N-N1;
267
385
 
268
386
  SIMD<double, N1> lo;
@@ -314,7 +432,7 @@ namespace ngcore
314
432
 
315
433
  template<typename ...T>
316
434
  explicit SIMD(const T... vals)
317
- : lo(detail::array_range<N1>(std::array<double, N>{vals...}, 0)),
435
+ : lo(detail::array_range<N1>(std::array<double, N>{vals...}, 0)),
318
436
  high(detail::array_range<N2>(std::array<double, N>{vals...}, N1))
319
437
  {
320
438
  static_assert(sizeof...(vals)==N, "wrong number of arguments");
@@ -327,8 +445,8 @@ namespace ngcore
327
445
  high.Store(p+N1, mask.Hi());
328
446
  }
329
447
 
330
- auto Lo() const { return lo; }
331
- auto Hi() const { return high; }
448
+ NETGEN_INLINE auto Lo() const { return lo; }
449
+ NETGEN_INLINE auto Hi() const { return high; }
332
450
 
333
451
  double operator[] (int i) const { return ((double*)(&lo))[i]; }
334
452
 
@@ -642,7 +760,11 @@ namespace ngcore
642
760
  reciprocal square root
643
761
  Quake III algorithm, or intrinsics
644
762
  */
763
+ //
764
+ #ifndef __CUDACC__
645
765
  NETGEN_INLINE double rsqrt (double x) { return 1.0/sqrt(x); }
766
+ #endif
767
+
646
768
  template <int N>
647
769
  SIMD<double,N> rsqrt (SIMD<double,N> x)
648
770
  {
@@ -661,6 +783,29 @@ namespace ngcore
661
783
  }
662
784
 
663
785
 
786
+
787
+
788
+ template <typename T, int N>
789
+ auto Min (SIMD<T,N> a, SIMD<T,N> b)
790
+ {
791
+ if constexpr (N==1)
792
+ return SIMD<T,1> (std::min(a[0], b[0]));
793
+ else
794
+ return SIMD<T,N> (Min(a.Lo(), b.Lo()), Min(a.Hi(), b.Hi()));
795
+ }
796
+
797
+ template <typename T, int N>
798
+ auto Max (SIMD<T,N> a, SIMD<T,N> b)
799
+ {
800
+ if constexpr (N==1)
801
+ return SIMD<T,1> (std::max(a[0], b[0]));
802
+ else
803
+ return SIMD<T,N> (Max(a.Lo(), b.Lo()), Max(a.Hi(), b.Hi()));
804
+ }
805
+
806
+
807
+
808
+
664
809
 
665
810
  template <typename T, int N>
666
811
  ostream & operator<< (ostream & ost, SIMD<T,N> simd)
@@ -862,6 +1007,42 @@ namespace ngcore
862
1007
  FMAddSub(a.Hi(), b.Hi(), c.Hi()));
863
1008
  }
864
1009
  }
1010
+
1011
+
1012
+
1013
+
1014
+ template <int BASE, typename Tuple, std::size_t ... Is>
1015
+ auto subtuple (const Tuple& tup, std::index_sequence<Is...>)
1016
+ {
1017
+ return std::make_tuple(std::get<BASE+Is>(tup)...);
1018
+ }
1019
+
1020
+ template <typename ...Args, typename T, int M>
1021
+ auto Concat (std::tuple<SIMD<T,M>, Args...> tup)
1022
+ {
1023
+ constexpr size_t N = std::tuple_size<std::tuple<SIMD<T,M>, Args...>>();
1024
+
1025
+ if constexpr (N == 1)
1026
+ return get<0>(tup);
1027
+ else
1028
+ {
1029
+ static constexpr size_t N1 = LargestPowerOfTwo(N-1);
1030
+ static constexpr int N2 = N-N1;
1031
+
1032
+ auto SEQ1 = std::make_index_sequence<N1>();
1033
+ auto sub1 = subtuple<0>(tup, SEQ1);
1034
+
1035
+ auto SEQ2 = std::make_index_sequence<N2>();
1036
+ auto sub2 = subtuple<N1>(tup, SEQ2);
1037
+
1038
+ auto S1 = Concat(sub1);
1039
+ auto S2 = Concat(sub2);
1040
+ return SIMD<T,S1.Size()+S2.Size()>(S1, S2);
1041
+ }
1042
+ }
1043
+
1044
+
1045
+
865
1046
  }
866
1047
 
867
1048
 
@@ -57,7 +57,7 @@ namespace ngcore
57
57
  template <int N>
58
58
  auto sincos (SIMD<double,N> x)
59
59
  {
60
- auto y = round(x / (M_PI/2));
60
+ auto y = round((2/M_PI) * x);
61
61
  auto q = lround(y);
62
62
 
63
63
  auto [s1,c1] = sincos_reduced(x - y * (M_PI/2));
@@ -151,7 +151,7 @@ namespace ngcore
151
151
  // x = ldexp( x, n );
152
152
  }
153
153
 
154
-
154
+ /*
155
155
  inline auto Test1 (SIMD<double> x)
156
156
  {
157
157
  return myexp(x);
@@ -171,6 +171,7 @@ namespace ngcore
171
171
  {
172
172
  return sincos(x);
173
173
  }
174
+ */
174
175
 
175
176
  }
176
177
 
@@ -0,0 +1,37 @@
1
+ #ifndef NETGEN_CORE_STATUSHANDLER
2
+ #define NETGEN_CORE_STATUSHANDLER
3
+
4
+ #include <string>
5
+ #include "utils.hpp"
6
+
7
+ namespace ngcore
8
+ {
9
+
10
+ class NGCORE_API multithreadt
11
+ {
12
+ public:
13
+ int pause;
14
+ int testmode;
15
+ int redraw;
16
+ int drawing;
17
+ int terminate;
18
+ int running;
19
+ double percent;
20
+ const char * task;
21
+ bool demorunning;
22
+ std::string * tcl_todo = new std::string(""); // tcl commands set from parallel thread
23
+ multithreadt();
24
+ };
25
+
26
+ NGCORE_API extern volatile multithreadt multithread;
27
+
28
+
29
+ extern NGCORE_API void SetStatMsg(const std::string& s);
30
+
31
+ extern NGCORE_API void PushStatus(const std::string& s);
32
+ extern NGCORE_API void PushStatusF(const std::string& s);
33
+ extern NGCORE_API void PopStatus();
34
+ extern NGCORE_API void SetThreadPercent(double percent);
35
+ extern NGCORE_API void GetStatus(std::string & s, double & percentage);
36
+ }
37
+ #endif
@@ -262,14 +262,14 @@ namespace ngcore
262
262
  const MemoryTracer& GetMemoryTracer() const { return mt; }
263
263
 
264
264
  private:
265
- size_t GetMemUsage() const { return size == 0 ? 0 : sizeof(T)*index[size] + sizeof(IndexType) * size+1; }
265
+ NETGEN_INLINE size_t GetMemUsage() const { return size == 0 ? 0 : sizeof(T)*index[size] + sizeof(IndexType) * size+1; }
266
266
  MemoryTracer mt;
267
267
  };
268
268
 
269
269
 
270
270
  /// Print table
271
271
  template <class T, typename IndexType>
272
- inline ostream & operator<< (ostream & s, const Table<T,IndexType> & table)
272
+ inline ostream & operator<< (ostream & s, FlatTable<T,IndexType> table)
273
273
  {
274
274
  for (auto i : table.Range())
275
275
  {
@@ -94,10 +94,14 @@ namespace ngcore
94
94
  NGCORE_API void StartWorkers();
95
95
  NGCORE_API void StopWorkers();
96
96
 
97
- void SuspendWorkers(int asleep_usecs = 1000 )
97
+ bool IsSleeping() const { return sleep; }
98
+
99
+ int SuspendWorkers(int asleep_usecs = 1000 )
98
100
  {
101
+ int old_sleep_usecs = sleep_usecs;
99
102
  sleep_usecs = asleep_usecs;
100
103
  sleep = true;
104
+ return old_sleep_usecs;
101
105
  }
102
106
  void ResumeWorkers() { sleep = false; }
103
107
 
@@ -179,6 +183,35 @@ namespace ngcore
179
183
  }
180
184
  };
181
185
 
186
+ class SuspendTaskManager
187
+ {
188
+ int old_sleep_usecs = 0;
189
+ bool old_sleep = false;
190
+ TaskManager * tm = nullptr;
191
+
192
+ public:
193
+ SuspendTaskManager(int asleep_usecs=1000)
194
+ : tm(task_manager)
195
+ {
196
+ if(!tm)
197
+ return;
198
+
199
+ old_sleep = tm->IsSleeping();
200
+ old_sleep_usecs = tm->SuspendWorkers(asleep_usecs);
201
+ }
202
+
203
+ ~SuspendTaskManager()
204
+ {
205
+ if(!tm)
206
+ return;
207
+
208
+ if(old_sleep) // restore old sleep time
209
+ tm->SuspendWorkers(old_sleep_usecs);
210
+ else
211
+ tm->ResumeWorkers();
212
+ }
213
+ };
214
+
182
215
  NETGEN_INLINE int TasksPerThread (int tpt)
183
216
  {
184
217
  // return task_manager ? tpt*task_manager->GetNumThreads() : 1;
@@ -1,9 +1,9 @@
1
1
  #ifndef NETGEN_VERSION_HPP_INCLUDED
2
2
  #define NETGEN_VERSION_HPP_INCLUDED
3
- #define NETGEN_VERSION "6.2.2505-48-gdf5d2ec7"
3
+ #define NETGEN_VERSION "6.2.2506-48-g8263c0bc"
4
4
  #define NETGEN_VERSION_MAJOR 6
5
5
  #define NETGEN_VERSION_MINOR 2
6
- #define NETGEN_VERSION_PATCH 2505
6
+ #define NETGEN_VERSION_PATCH 2506
7
7
  #define NETGEN_VERSION_TWEAK 48
8
- #define NETGEN_VERSION_HASH "gdf5d2ec7"
8
+ #define NETGEN_VERSION_HASH "g8263c0bc"
9
9
  #endif // NETGEN_VERSION_HPP_INCLUDED
@@ -42,10 +42,7 @@ namespace netgen
42
42
  string GetName() const { return name ? *name : "default"; }
43
43
  Vec<4> GetColor() { return col ? *col : Vec<4>{0., 1., 0., 1.}; }
44
44
 
45
- void DoArchive(Archive& ar)
46
- {
47
- ar & name & col & maxh & hpref & layer;
48
- }
45
+ void DoArchive(Archive& ar);
49
46
  };
50
47
 
51
48
  class GeometryShape;
@@ -31,23 +31,6 @@ namespace netgen
31
31
 
32
32
  DLL_HEADER extern mutex tcl_todo_mutex;
33
33
 
34
- class DLL_HEADER multithreadt
35
- {
36
- public:
37
- int pause;
38
- int testmode;
39
- int redraw;
40
- int drawing;
41
- int terminate;
42
- int running;
43
- double percent;
44
- const char * task;
45
- bool demorunning;
46
- string * tcl_todo = new string(""); // tcl commands set from parallel thread
47
- multithreadt();
48
- };
49
-
50
- DLL_HEADER extern volatile multithreadt multithread;
51
34
 
52
35
  class DebugParameters;
53
36
  class Mesh;
@@ -4184,6 +4184,47 @@ HPRef_Struct reftet_3f_0e_0v =
4184
4184
 
4185
4185
 
4186
4186
 
4187
+
4188
+ // HP_TET_ALFELD
4189
+ int reftet_Alfeld_splitedges[][3] =
4190
+ {
4191
+ { 0, 0, 0 }
4192
+ };
4193
+ int reftet_Alfeld_splitfaces[][4] =
4194
+ {
4195
+ { 0, 0, 0, 0 }
4196
+ };
4197
+
4198
+ int reftet_Alfeld_splitelements[][5] =
4199
+ {
4200
+ { 1, 2, 3, 4, 5},
4201
+ { 0 }
4202
+ };
4203
+
4204
+ HPREF_ELEMENT_TYPE reftet_Alfeld_newelstypes[] =
4205
+ {
4206
+ HP_TET, HP_TET, HP_TET, HP_TET,
4207
+ HP_NONE,
4208
+ };
4209
+
4210
+ int reftet_Alfeld_newels[][8] =
4211
+ {
4212
+ { 1, 2, 3, 5 },
4213
+ { 1, 4, 2, 5 },
4214
+ { 1, 3, 4, 5 },
4215
+ { 3, 2, 4, 5 }
4216
+ };
4217
+ HPRef_Struct reftet_Alfeld =
4218
+ {
4219
+ HP_TET,
4220
+ reftet_Alfeld_splitedges,
4221
+ reftet_Alfeld_splitfaces,
4222
+ reftet_Alfeld_splitelements,
4223
+ reftet_Alfeld_newelstypes,
4224
+ reftet_Alfeld_newels
4225
+ };
4226
+
4227
+
4187
4228
  /*
4188
4229
 
4189
4230
  */
@@ -189,6 +189,8 @@ enum HPREF_ELEMENT_TYPE {
189
189
 
190
190
  HP_TET_3F_0E_0V = 700, // 3 singular faces, no additional points or edges NEW done
191
191
 
192
+ HP_TET_ALFELD,
193
+
192
194
  HP_PRISM = 1000,
193
195
  HP_PRISM_SINGEDGE,
194
196
  HP_PRISM_SINGEDGE_V12,
@@ -1334,6 +1334,7 @@ namespace netgen
1334
1334
  auto PNums() const { return FlatArray<const PointIndex> (GetNP(), &pnums[0]); }
1335
1335
  auto PNums() { return FlatArray<PointIndex> (GetNP(), &pnums[0]); }
1336
1336
 
1337
+ auto Vertices() const { return FlatArray<const PointIndex> (2, &pnums[0]); }
1337
1338
 
1338
1339
  ELEMENT_TYPE GetType() const
1339
1340
  {
@@ -45,13 +45,16 @@ namespace netgen
45
45
  const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
46
46
  extern DLL_HEADER void PrintTime(const MyStr& s1="", const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
47
47
  const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
48
- extern DLL_HEADER void SetStatMsg(const MyStr& s);
49
48
 
50
- extern DLL_HEADER void PushStatus(const MyStr& s);
51
- extern DLL_HEADER void PushStatusF(const MyStr& s);
52
- extern DLL_HEADER void PopStatus();
53
- extern DLL_HEADER void SetThreadPercent(double percent);
54
- extern DLL_HEADER void GetStatus(MyStr & s, double & percentage);
49
+
50
+
51
+
52
+ inline void PushStatusF(const std::string& s)
53
+ {
54
+ PushStatus (s);
55
+ PrintFnStart(s);
56
+ }
57
+
55
58
  }
56
59
 
57
60
 
@@ -390,7 +390,7 @@ inline short int MeshTopology :: GetNEdges (ELEMENT_TYPE et)
390
390
  // default:
391
391
  // cerr << "Ng_ME_GetNEdges, illegal element type " << et << endl;
392
392
  }
393
- return -99;
393
+ return 0;
394
394
  }
395
395
 
396
396
 
@@ -431,7 +431,7 @@ inline short int MeshTopology :: GetNFaces (ELEMENT_TYPE et)
431
431
  return 6;
432
432
 
433
433
  default:
434
- return -99;
434
+ return 0;
435
435
  // default:
436
436
  // cerr << "Ng_ME_GetNVertices, illegal element type " << et << endl;
437
437
  }
@@ -353,10 +353,11 @@ extern "C" {
353
353
 
354
354
  DLL_HEADER void RunParallel ( void * (*fun)(void *), void * in);
355
355
 
356
- DLL_HEADER void Ng_PushStatus (const char * str);
356
+ #define NG_STATUS_USES_STD_STRING
357
+ DLL_HEADER void Ng_PushStatus (const std::string& str);
357
358
  DLL_HEADER void Ng_PopStatus ();
358
359
  DLL_HEADER void Ng_SetThreadPercentage (double percent);
359
- DLL_HEADER void Ng_GetStatus (char ** str, double & percent);
360
+ DLL_HEADER void Ng_GetStatus (std::string& str, double & percent);
360
361
 
361
362
  DLL_HEADER void Ng_SetTerminate(void);
362
363
  DLL_HEADER void Ng_UnSetTerminate(void);
@@ -71,6 +71,20 @@ namespace netgen
71
71
  return gp_Pnt(p(0), p(1), p(2));
72
72
  }
73
73
 
74
+ inline void CheckValidPropertyType(const TopoDS_Shape & shape)
75
+ {
76
+ switch (shape.ShapeType())
77
+ {
78
+ case TopAbs_SOLID:
79
+ case TopAbs_FACE:
80
+ case TopAbs_EDGE:
81
+ case TopAbs_VERTEX:
82
+ break;
83
+ default:
84
+ throw Exception("Cannot query properties of compound shapes - setting properties sets property on all highest dimension subshape type");
85
+ }
86
+ }
87
+
74
88
  DLL_HEADER Box<3> GetBoundingBox( const TopoDS_Shape & shape );
75
89
 
76
90
  struct OCCIdentification
@@ -152,6 +166,10 @@ namespace netgen
152
166
  {
153
167
  return SubShapes(TopAbs_SOLID);
154
168
  }
169
+ ListOfShapes Shells() const
170
+ {
171
+ return SubShapes(TopAbs_SHELL);
172
+ }
155
173
  ListOfShapes Faces() const
156
174
  {
157
175
  return SubShapes(TopAbs_FACE);
@@ -199,6 +217,14 @@ namespace netgen
199
217
  return sub;
200
218
  }
201
219
 
220
+ inline ListOfShapes GetShells(const TopoDS_Shape & shape)
221
+ {
222
+ ListOfShapes sub;
223
+ for (TopExp_Explorer e(shape, TopAbs_SHELL); e.More(); e.Next())
224
+ sub.push_back(e.Current());
225
+ return sub;
226
+ }
227
+
202
228
  inline ListOfShapes GetFaces(const TopoDS_Shape & shape)
203
229
  {
204
230
  ListOfShapes sub;
@@ -146,6 +146,14 @@ namespace netgen
146
146
 
147
147
  static ShapeProperties& GetProperties(const TopoDS_Shape& shape)
148
148
  {
149
+ try
150
+ {
151
+ CheckValidPropertyType(shape);
152
+ }
153
+ catch(Exception& e)
154
+ {
155
+ cerr << "WARNING: " << e.what() << endl;
156
+ }
149
157
  auto index = OCCGeometry::global_shape_property_indices.FindIndex(shape);
150
158
  if(index > 0)
151
159
  return OCCGeometry::global_shape_properties