Commit Graph

3881 Commits

Author SHA1 Message Date
Monty Montgomery
ae87c7005c Two nullptr deref fixes in table
Don't delete memory that wasn't allocated.

Similarly, we can't deref the first element of an array that was never
allocated.
2022-05-15 01:16:58 -04:00
Monty Montgomery
6ba4a6e6c6 Correct deletion of non-allocated memory in ngarray
A default-constructed (or just empty) ngarray will have 'ownmem' set
despite not having an allocated data array.  Destructor would then
trigger an abort.
2022-05-15 01:16:58 -04:00
Monty Montgomery
5ee4e43393 Fix nullptr deref in archive
Hardened toolchains (eg, mainline Fedora) no longer tolerate null
derefs that were silently trapped/ignored in earlier versions.  This
eliminates a nullptr deref in archive.hpp that was failing several
unit tests (and causing crashes) when trying to manipulate
default-constructed archive objects.
2022-05-15 01:16:58 -04:00
Monty Montgomery
97d3c1ce9e Adjust python module path in __init__, add checks to pytest
Adjust path setup of the python modules in __init__ such that it's
possible to run pytests from a mock root during package build/test.

Also add checks to pytest/CMakelists.txt to make sure pytest abd check
are present instead of failing with an inscrutible traceback if
they're not installed or usable.
2022-05-15 01:16:58 -04:00
Monty Montgomery
5d0e69c7ed Alter name use of 'netgen' and 'netgen-mesher'
The name of the 'netgen' executable collides with an older UNIX pcb
trace routing application also named 'netgen'.  Fedora, for this
reason, renames this mesher package to 'netgen-mesher' and the
executable, likewise, to 'netgen-mesher'.  I propose the same change
here.

Ironically though, the current python module is already named
'netgen-mesher', which complicates loading of the module as 'netgen',
often resulting in it being unfindable.  For this reason, I similarly
reverse the usage, renaming the python module from 'netgen-mesher' to
'netgen'.
2022-05-15 01:16:58 -04:00
Monty Montgomery
b82796e58d CMake enhancements for automated external package building
Add explicit defaults where missing for clarity.

Support passing in NETGEN_GIT_VERSION for use when building, eg, RPM
packages using rpkg, which requires building from an untagged source
bundle, that is, not directly from a git checkout.

Add option to choose build against internal or external Pybind11; add
cmake module to find and configure against system Pybind.

re-add versioning of shared library files.

Add section for GCC-specific options setting (right now, to turn off
harmless warnings).

Warn if pybind11_stubgen is not found.

Adjust stubgen paths to work when build is not in-place in the source tree.
2022-05-15 01:16:51 -04:00
Monty Montgomery
e9eae568ff Don't fail silently in VersionInfo(), print useful message
Having version.hpp throw an exception when built against a malformed
version number (due to, eg, not having the git tag available in an
automated package build from source bundle) results in _init_ failing
during an otherwise apparently successful dlopen(), as well as the
netgen-mesher executable crashing before hitting main().

This patch both forces an abort and prints a helpful message alerting
the builder/user that something went wrong instead of handing over
either a coredump or a weirdly malfunctioning library with no apparent
cause.  Hopefully this will avoid a repeat of automated Fedora builds
shipping nonfunctional Netgen RPMs for several years!
2022-05-14 23:37:22 -04:00
Joachim Schoeberl
e8ec2b3550 netgen-std includes before tcl 2022-05-07 20:40:40 +02:00
Joachim Schoeberl
bac77b1f58 define ng_tcl_volatile, ... 2022-05-07 19:54:43 +02:00
Joachim Schoeberl
1a634c1957 Tcl_FreeProc + volatile/static/dynamic constants of correct type 2022-05-07 19:45:38 +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
Schöberl, Joachim
1a174508db Merge branch 'occ_consistent_maxh' into 'master'
make shape.solids.maxh = ... consistent with solid.maxh = ...

See merge request ngsolve/netgen!503
2022-05-07 15:10:57 +02:00
Joachim Schoeberl
4f09633b80 remove old mpi-wrapper 2022-05-06 18:21:44 +02:00
Christopher Lackner
9b44069e54 fix tuple creation in return color 2022-05-06 17:47:50 +02:00
Christopher Lackner
c61753d89d FD color gives 3-tuple, transparency as separate property 2022-05-06 17:14:10 +02:00
Joachim Schoeberl
cad2391e34 unify MPI 2022-05-06 16:39:06 +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
Christopher Lackner
456cb927d1 make shape.solids.maxh = ... consistent with solid.maxh = ... 2022-05-05 18:09:42 +02:00
Schöberl, Joachim
81b22633cd Merge branch 'ge_directionalintervall' into 'master'
__ge__ and __le__ operator for DirectionalInterval

See merge request ngsolve/netgen!502
2022-05-05 18:09:09 +02:00
Matthias Hochsteger
03347e8e33 fix tcl/tk build flags 2022-05-05 18:08:29 +02:00
Christopher Lackner
a04b7b5d5d __ge__ and __le__ operator for DirectionalInterval 2022-05-05 17:32:25 +02:00
Matthias Hochsteger
66078cb285 private tcl include dir 2022-05-05 17:01:12 +02:00
Hochsteger, Matthias
8076407e08 Merge branch 'separate_gui_code' into 'master'
rework build system, separate gui and non-gui code

See merge request ngsolve/netgen!501
2022-05-05 14:55:32 +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
Matthias Hochsteger
233dba2408 handle multiple closesurface identifications correctly 2022-05-05 11:21:48 +02:00
Matthias Hochsteger
8e25c382d9 build with VS2019 on Windows, update pybind11 to v2.9.1 2022-05-03 09:21:19 +02:00
Joachim Schoeberl
326e313d75 copy-ctor for head-tail array with generic types 2022-05-02 08:42:07 +02:00
Joachim Schoeberl
6a8050998b shape comparison macro 2022-05-01 11:56:22 +02:00
Joachim Schoeberl
bf22f8d4df fix shared loop: in rare cases elements have been called twice 2022-04-30 10:39:26 +02:00
Joachim Schoeberl
aa00749f97 fix some deprecated 2022-04-29 13:05:38 +02:00
Joachim Schoeberl
db0339a143 no MPI command sending in netgen 2022-04-29 12:23:40 +02:00
Joachim Schoeberl
ab7f1be9ab fix topology for deprecated functions 2022-04-29 12:23:26 +02:00
Joachim Schoeberl
f082d89326 fix deprecaed in clusters 2022-04-29 12:06:05 +02:00
Joachim Schoeberl
712f6d4c87 no deprecated call in header 2022-04-29 07:20:52 +02:00
Joachim Schoeberl
25df08f7a4 fix deprecated 2022-04-29 07:20:52 +02:00
Matthias Hochsteger
6b36a2d9d8 load geometries from command line with python netgen executable 2022-04-28 10:46:49 +02:00
Joachim Schoeberl
bac314a666 fix range-check exception for 0-sized array 2022-04-26 23:26:19 +02:00
Joachim Schoeberl
41bd58dd31 paralleltop also in sequential version - only tye type 2022-04-26 23:10:49 +02:00
Joachim Schoeberl
cf6c69ed69 paralleltop also in sequential version - only tye type 2022-04-26 23:04:11 +02:00
Joachim Schoeberl
ab5b653133 paralleltop also in sequential version - only tye type 2022-04-26 22:58:02 +02:00
Joachim Schoeberl
76c0c52bed paralleltop also in sequential version 2022-04-26 22:45:08 +02:00
Joachim Schoeberl
fd77d17e2b MPI unification 2022-04-26 22:07:31 +02:00
Matthias Hochsteger
b62c7b30ef DLL_HEADER for fieldline code 2022-04-26 18:44:14 +02:00
Joachim Schoeberl
212c5dd130 dummy mpi-waitany for non-parallel 2022-04-26 16:54:18 +02:00
Joachim Schoeberl
eef95eed52 more mpi from ngcore 2022-04-26 16:28:52 +02:00
Matthias Hochsteger
d165d67765 fix build 2022-04-25 20:30:27 +02:00
Matthias Hochsteger
9ceb2baeaa make fieldlines code available in non-gui builds 2022-04-25 18:42:26 +02:00
Christopher Lackner
1f793e66ea fix edge meshing in nglib 2022-04-25 12:03:16 +02:00