Commit Graph

455 Commits

Author SHA1 Message Date
Monty Montgomery
de7ffc5906 Eliminate a "C++ initialization order fiasco" for geometryregister
Current initialization of the global geometryregister suffers from a
classic 'initialization order fiasco'.  Depending on the order the
compilation units are loaded/linked, the initialization of the global
geometryregisterarray is not guaranteed to happen (and indeed often
does not happen) before it is used.  This leads to entries being
appended before it's initialized (usually 'suceeding, but potentially
causing memory corruption if the segment at that point isn't zeroed),
initialization then happening halfway through (wiping the initial
entries) and then the last entries being the only ones that show up.

The net effect is either a crash at startup, or several geometry types
seeming to be missing.  Eg, step files will oad, but STL files are
just ignored.  The bug is actively observed on, eg, Linux.

This patch implements a simple 'initialize at first access' convention
for the array, eliminating the ordering problem.

I've not reviewed the rest of the source for other potential examples
of the fiasco pattern; this fixes only the geometryregister, since
that was actively biting.
2022-05-22 11:29:10 -04:00
Joachim Schoeberl
e8ec2b3550 netgen-std includes before tcl 2022-05-07 20:40:40 +02:00
Joachim Schoeberl
03332c1146 define type Tcl_FreeProc 2022-05-07 19:40:16 +02:00
Matthias Hochsteger
81f5ed5415 fix ngsolve loading 2022-05-07 15:13:35 +02:00
Matthias Hochsteger
165947295e move ngtcl.hpp interface to meshing/visual_interface.hpp 2022-05-06 12:23:50 +02:00
Matthias Hochsteger
22e57a1159 Don't load gui libraries when importing netgen 2022-05-06 10:59:59 +02:00
Matthias Hochsteger
03347e8e33 fix tcl/tk build flags 2022-05-05 18:08:29 +02:00
Matthias Hochsteger
66078cb285 private tcl include dir 2022-05-05 17:01:12 +02:00
Matthias Hochsteger
b694b4667a rework build system, separate gui and non-gui code
move fieldlines code to meshing dir

move visualization function pointers to meshing directory

DLL_HEADER -> NGGUI_API in visualization lib

move soldata.hpp to meshing

update occ, no freetype necessary anymore
2022-05-05 14:39:31 +02:00
Joachim Schoeberl
db0339a143 no MPI command sending in netgen 2022-04-29 12:23:40 +02:00
Joachim Schoeberl
fd77d17e2b MPI unification 2022-04-26 22:07:31 +02:00
luz paz
4033fac1b3 Fix various typos
Found via `codespell -q 3 -S ./external_dependencies/pybind11 -L alledges,allright,ane,anormal,ans,apoints,ba,boxs,cancle,childs,co-ordinate,co-ordinates,daty,enty,filld,hel,identifyable,ist,linz,lod,ned,nd,selt,statics,suround,thev,thist,thisy,timere,upto,wel`
2022-03-25 18:22:05 -04:00
mhochsteger@cerbsim.com
cf59f297a7 use std::filesystem::path 2022-02-23 11:56:00 +01:00
mhochsteger@cerbsim.com
17458889aa Change interface of LoadFromMeshFile
Fetch the first (geometry identification) token only once (and not on each try to load a different type)
2021-11-10 18:37:24 +01:00
mhochsteger@cerbsim.com
d9e8b815f5 pip installer 2021-10-27 16:51:41 +02:00
Matthias Hochsteger
dc57935468 include gzsteram.h only where needed 2021-10-21 10:25:40 +02:00
mhochsteger@cerbsim.com
dbd9c34d17 tcl wrapper (no need to have tcl.h to build ngsolve) 2021-10-11 16:04:00 +02:00
Christopher Lackner
f04040f409 allow changing number of colors in colorbar 2021-10-06 16:01:48 +02:00
Joachim Schoeberl
8404fb8a40 fix namespace 2021-09-06 17:44:46 +02:00
Joachim Schoeberl
aa3f778d06 separat metis-partitioning call, pickling partition number of mesh elements 2021-06-08 13:48:27 +02:00
Matthias Hochsteger
b2fea6dec1 Clean up multiple definitions of DLL_HEADER
- define DLL_HEADER only once in mydefs.hpp
- define/use NGLIB_API in nglib.h
- use NGCORE_API_EXPORT for explicit export of symbols
2021-02-18 14:53:38 +01:00
Christopher Lackner
1e8715dc34 remove unused global mpi_comm 2020-12-18 14:25:00 +01:00
Matthias Hochsteger
94ecf8de92 Fix private linking of Python
The CMake export of Interface libraries also exports PRIVATE build
settings, which leads to build errors with non-existing include paths and .lib files for binary distributions.

Use the work-around mentioned here to circumvent this behavior:
https://gitlab.kitware.com/cmake/cmake/-/issues/15415#note_849405
2020-12-18 11:05:10 +01:00
mhochsteger
d7a1dda042 cmake - add version info to netgen.exe on Windows 2020-11-24 11:50:24 +01:00
Christopher Lackner
bdb04f9784 allow visualizing smaller tangent points 2020-10-14 19:00:44 +02:00
Matthias Hochsteger
267e8b33fb cmake - use git to generate version string 2020-05-18 15:55:40 +02:00
Christopher Lackner
58e6e5dc18 modernize and improve GenerateBoundaryLayer 2020-04-19 20:00:06 +02:00
Matthias Hochsteger
db5ad09b79 Initial CGNS format read support 2020-03-11 13:39:40 +01:00
Matthias Hochsteger
bd600f48ac Fix declaration of ngscript 2020-03-02 18:03:54 +01:00
Matthias Hochsteger
1d652d8206 DLL_HEADER in onetcl 2020-03-02 16:56:46 +00:00
Matthias Hochsteger
d994c589d3 Remove onetcl.cpp from netgen exe (is already in meshing lib) 2020-03-02 17:29:35 +01:00
Joachim Schöberl
bc06d0781a trigger new version 2020-01-09 19:19:35 +01:00
Matthias Hochsteger
4a6b6e8ab8 Remove redundant declaration
fixes build error on Windows
2019-12-10 14:10:18 +01:00
Matthias Hochsteger
d6095e9364 Move global visual scene from ngpkg.cpp to mvdraw.cpp
... so it is available in Snapshot()
also rename the global variables:
vs -> visual_scene
vscross -> visual_scene_cross
2019-12-10 12:21:29 +01:00
Matthias Hochsteger
52b3e807a5 New Snapshot function (custom resolution) 2019-12-10 12:21:29 +01:00
Matthias Hochsteger
385040333b [cmake] Fix non-gui build 2019-11-27 14:03:41 +01:00
Matthias Hochsteger
f3d9d3ad67 [cmake] Don't link python libraries in unix-conda environment
Conda links python libs statically to python executable
2019-11-26 19:26:18 +00:00
Christopher Lackner
073e215bb6 add closeedge meshsize to base geometry (not used)
closedgefac moved to meshingparameters for this
2019-11-04 19:34:46 +01:00
Joachim Schöberl
c127711d4d reduce refresh rate to 25 times persecond 2019-10-23 18:47:53 +02:00
Joachim Schöberl
e400c10f07 set tcl-variables only if values are changed 2019-10-22 22:54:27 +02:00
Christopher Lackner
bee097b153 start unify meshing with occ meshing 2019-10-07 15:17:03 +02:00
Matthias Hochsteger
04de18d0b4 Check badness quality in tests 2019-10-04 10:25:14 +00:00
Christopher Lackner
5eb2ab470e only do optimization for occ surface mesh 2019-09-30 12:02:08 +02:00
Matthias Hochsteger
6a7030b81a Activate multithreading when meshing from GUI
- Meshing options for parallelization and number of threads
 - RegionTaskManager() to locally start the TaskManager
2019-09-27 11:54:33 +02:00
Matthias Hochsteger
4deffe6cbe Button to write selected chart to separate .stlb file 2019-09-24 13:09:49 +02:00
Joachim Schöberl
1fb048e399 Merge branch 'draw_stl_to_plain' into 'master'
Draw stl to plain

See merge request jschoeberl/netgen!241
2019-09-22 16:18:49 +00:00
Christopher Lackner
57ddf46b8c enable stop on segment and stop on face debug options 2019-09-22 14:56:56 +02:00
Christopher Lackner
4eb7c1860c allow 2d plainview to be moved using meta key 2019-09-22 14:37:14 +02:00
Christopher Lackner
cd78f0e440 draw stl meshing 2d local coordinates 2019-09-21 22:08:35 +02:00
Christopher Lackner
3f255d9139 fix set stl tolerance from gui 2019-09-20 13:08:15 +02:00