Giter Site home page Giter Site logo

trelau / smesh Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 31.0 1.7 MB

Mesh module from the Salome Platform

License: GNU Lesser General Public License v2.1

CMake 7.65% C++ 7.39% C 83.14% Batchfile 0.20% Shell 0.20% Python 1.41%
mesh-generation computer-aided-engineering mesh-framework smesh salome-platform

smesh's People

Contributors

kkremitzki avatar looooo avatar trelau avatar wwmayer avatar zebmason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

smesh's Issues

Update to SMESH 9.11?

I'm in the process of porting FreeCAD to OpenBSD and I'm not sure whether it makes sense to package SMESH from this fork (as it has been done in Fedora for example) or use official sources (or the one included in the FreeCAD sources). From an difficulty-to-port perspective I think this fork is the way to go, but I'd first like to make sure that it will remain active and updated. With that said, I'd like to ask the following:

What is the status of this fork? Is it still maintained?
Any plans to keep up with upstream?
From the FreeCAD perspective, does it make sense to follow the latest SMESH releases?

error: ISO C++17 does not allow dynamic exception specifications

would be nice to add the patch for the exception again.

$PREFIX/include/smesh/SMESH/SMESH_Gen.hxx:70:5: error: ISO C++17 does not allow dynamic exception specifications
   70 |     throw(SALOME_Exception);
      |     ^~~~~
In file included from ../src/Mod/MeshPart/App/Mesher.cpp:49:
$PREFIX/include/smesh/StdMeshers/StdMeshers_MaxLength.hxx:38:33: error: ISO C++17 does not allow dynamic exception specifications
   38 |   void SetLength(double length) throw(SALOME_Exception);
      |                                 ^~~~~
In file included from ../src/Mod/MeshPart/App/Mesher.cpp:50:
$PREFIX/include/smesh/SMESH/SMESH_Mesh.hxx:136:5: error: ISO C++17 does not allow dynamic exception specifications
  136 |     throw(SALOME_Exception);
      |     ^~~~~

Issue description

(Provide a short description, state the expected behavior and what actually happens.)

Reproducible example code

(The code should be minimal, have no external dependencies, isolate the function(s) that cause breakage. Submit matched and complete snippets that can be easily compiled and run to diagnose the issue.)

8.3.0.3 does not build with med 4.0.0 on Fedora Rawhide

n file included from /builddir/build/BUILD/SMESH-8.3.0.3/src/DriverMED/DriverMED_Family.cxx:28:
/builddir/build/BUILD/SMESH-8.3.0.3/inc/DriverMED_Family.h:37:10: fatal error: MED_Common.hxx: No such file or directory
   37 | #include "MED_Common.hxx"
      |          ^~~~~~~~~~~~~~~~

MED_Common.hxx does not exist in med 4.0.0, at least in the archive. I don't suppose it could be a generated header?

Missing option to build smesh without VTK

I wonder if there is some possibility to build smesh as a library without VTK if one does not need visualization (assuming VTK isn't somehow needed for the core meshing functionality). As it is not it seems VTK is a hard coded requirement, but I wonder if there is some way to build it without going through all sources to eliminate VTK dependencies manually?

GCC8 build failure?

Issue description

Hi, I'm trying to build SMESH on Debian Unstable. I simply do:

cmake -DOpenCASCADE_DIR=/usr/lib/cmake/occt ../repo && make -j8

However, I get some failures that look like this:

In file included from /usr/include/c++/8/map:60,
                 from /home/kurt/Desktop/Packages/smesh/repo/inc/SMESH_Algo.hxx:43,
                 from /home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_2D.hxx:32,
                 from /home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_1D2D.hxx:29,
                 from /home/kurt/Desktop/Packages/smesh/repo/src/StdMeshers/StdMeshers_Projection_1D2D.cxx:26:
/usr/include/c++/8/bits/stl_tree.h: In instantiation of ‘class std::_Rb_tree<const SMDS_MeshNode*, std::pair<const SMDS_MeshNode* const, const
SMDS_MeshNode*>, std::_Select1st<std::pair<const SMDS_MeshNode* const, const SMDS_MeshNode*> >, TIDCompare, std::allocator<std::pair<const SMDS
_MeshNode* const, const SMDS_MeshNode*> > >’:
/usr/include/c++/8/bits/stl_map.h:151:17:   required from ‘class std::map<const SMDS_MeshNode*, const SMDS_MeshNode*, TIDCompare>’
/home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_2D.hxx:68:44:   required from here
/usr/include/c++/8/bits/stl_tree.h:452:21: error: static assertion failed: comparison object must be invocable with two arguments of key type
       static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Got any ideas on how to address this?

Support for Salome Platform 9.8

Version 9.8 is available which looks like it includes proper support for Netgen 6.2.

Note that Salome still uses a patched version of OCCT 7.5, so unclear how feasible upgrading OCCT version will be...

SMESH fails to export "*.med"

I use "mesh->ExportMED "and" mesh->MEDToMesh "exports the mesh and it does not react, even in Pyocct7.4 using" mesh. MEDToMesh"

Unclear instructions for PTHREADS on windows

Issue description

Everything is clear on UNIX, but building on windows fails due to PTHREADS. The description in README only states that PTHREAD_INCLUDE_DIR has to be set manually. However, it is unclear where to get it. Tried many things on web, but did not get any further. Would be very helpful to update README

Update to latest smesh release (8.3 -> 9.3)

Issue description

Occt7.4 is available and it seems like their mesh libraries changed a lot. So this version of smesh doesn't seem to be compatible anymore and we should update to the latest salome smesh.

Reproducible example code

Building with conda:
conda-forge/smesh-feedstock#27

I wonder if this can be done in an automated way. This fork seems to be not compatible with upstream anymore but I guess directly building upstream is also no option. So some how the projects need to merge. Is there any good strategy to do so?

Require build instruction

One could see the CMakeLists.txt file, but figuring out the dependencies and build steps especially for Windows is difficult, A brief build instruction would be great.

Tests not passing on OSX

Summary:

  • Trying implementing the "native architecture" aspect and then got different results on linux vs. windows so reverted that. Didn't seem to fix the osx issues anyway
  • Maybe something related to this catchorg/Catch2#487?
  • Disable building Netgen and NETGENPlugin for OSX and split one StdMeshers test into its own exe and it still fails...

Cc @looooo

c++17 compatibility

Building with -std=c++17 is not yet working:
eg.:

FAILED: CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o 
$BUILD_PREFIX/bin/x86_64-conda_cos6-linux-gnu-c++  -DCSFDB -DHAVE_CONFIG_H -DHAVE_FREEIMAGE -DHAVE_LIMITS_H -DHAVE_TBB -DLIN -DOCC_CONVERT_SIGNALS -DSMDS_EXPORTS -I$PREFIX/include/opencascade -I$PREFIX/include -I$PREFIX/include/freetype2 -I$PREFIX/include/python3.7m -I$PREFIX/include/libxml2 -I$PREFIX/include/netgen -I$PREFIX/include/netgen/occ -I$PREFIX/include/netgen/meshing -I$PREFIX/include/netgen/general -I$PREFIX/include/netgen/linalg -I$PREFIX/include/netgen/csg -I$PREFIX/include/netgen/geom2d -I$PREFIX/include/netgen/gprim -I$PREFIX/include/netgen/include -I$PREFIX/include/netgen/stlgeom -I../inc -isystem $PREFIX/include/vtk-8.1 -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I$PREFIX/include -fdebug-prefix-map==/usr/local/src/conda/- -fdebug-prefix-map==/usr/local/src/conda-prefix -O3 -DNDEBUG -fPIC   -std=gnu++1z -MD -MT CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o -MF CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o.d -o CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o -c ../src/SMDS/SMDS_Mesh0DElement.cxx
In file included from ../src/SMDS/SMDS_Mesh0DElement.cxx:31:0:
../inc/SMDS_Mesh.hxx:698:55: error: ISO C++1z does not allow dynamic exception specifications
   static int CheckMemory(const bool doNotRaise=false) throw (std::bad_alloc);

conda-forge boost now is build with c++17. Somehow this introduce some incompatibilities for packages linked against boost and not build with c++17.

ref.: conda-forge/boost-cpp-feedstock#43

trying to compile latest sources fails with:

branch 'int_32_test' set up to track 'origin/int_32_test'.
Traceback (most recent call last):
  File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/work/SMESH/prepare.py", line 185, in <module>
    prepare_netgen()
  File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/work/SMESH/prepare.py", line 20, in prepare_netgen
    pset = patch.fromfile('external/NETGENPlugin/src/NETGEN/netgen62ForSalome.patch')
  File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/_build_env/lib/python3.9/site-packages/patch.py", line 167, in fromfile
    fp = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'external/NETGENPlugin/src/NETGEN/netgen62ForSalome.patch'
Traceback (most recent call last):
  File "/Users/lo/mambaforge/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 488, in main
    execute(sys.argv[1:])
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 477, in execute
    outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/api.py", line 186, in build
    return build_tree(
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 3088, in build_tree
    packages_from_this = build(metadata, stats,
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 2211, in build
    utils.check_call_env(cmd, env=env, rewrite_stdout_env=rewrite_env,
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 411, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 391, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)

not sure what I did wrong. Can we do a ci-run to see if everything is still working? @trelau

python prepare.py fails

Issue description

Trying to run python prepare.py from current git master on Fedora rawhide:

$ python prepare.py
Traceback (most recent call last):
  File "/home/orion/fedora/smesh/SMESH-ab0f4357a2fc8c250102bbf9ff2e057a9ca6a1aa/prepare.py", line 119, in <module>
    prepare_netgen()
  File "/home/orion/fedora/smesh/SMESH-ab0f4357a2fc8c250102bbf9ff2e057a9ca6a1aa/prepare.py", line 21, in prepare_netgen
    pset = patch.fromfile('external/NETGENPlugin/src/NETGEN/netgen53ForSalome.patch')
AttributeError: module 'patch' has no attribute 'fromfile'

SMESH fails to build with GCC 12

Fedora Rawhide has updated to gcc 12 and several packages are failing to build including SMESH which has the following error:

/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx: In member function 'void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*, const std::vector<std::_Rb_tree_iterator<std::pair<const SMDS_MeshNode* const, std::__cxx11::list<const SMDS_MeshNode*> > > >&, std::__cxx11::list<const SMDS_MeshElement*>&, size_t, SMESH_SequenceOfElemPtr&)':
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:18: error: no matching function for call to 'swap(std::vector<bool>::reference, std::vector<bool>::reference)'
 4310 |         std::swap( isSingleNode[0], isSingleNode[1] );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/bits/exception_ptr.h:43,
                 from /usr/include/c++/12/exception:168,
                 from /usr/include/boost/smart_ptr/bad_weak_ptr.hpp:21,
                 from /usr/include/boost/smart_ptr/detail/shared_count.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESHDS/SMESH_Controls.hxx:32,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.hxx:33,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:27:
/usr/include/c++/12/bits/move.h:196:5: note: candidate: 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = _Bit_reference; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' (near match)
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/12/bits/move.h:196:5: note:   conversion of argument 2 would be ill-formed:
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:51: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::vector<bool>::reference'
 4310 |         std::swap( isSingleNode[0], isSingleNode[1] );
      |                                     ~~~~~~~~~~~~~~^
/usr/include/c++/12/bits/move.h:220:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~

Cut 9.6.0 release

Reminder to cut a new release for 9.6.0 when ready.

@looooo I see smesh-feedstock is now on 9.6.0. Seems safe to cut a release for this repo, right?

SALOME_USE_64BIT_IDS should be stored in a cmake config for other projects

Issue description

FreeCAD relies on smesh. In earlier versions of smesh SALOME_USE_64BIT_IDS was not set and therefor 32bit ids were used.
To solve this FreeCAD needs to know if smesh was compiled with SALOME_USE_64BIT_IDS set or not. So somehow this information must be passed to the Freecad-build process.

MEFISTO2 trte.f/.c

In extra/MEFISTO2/trte.c, these lines: 1925 and 1968 don't seem to match the original source, trte.f line 1297. I believe this is a mistake, because, as far as I can tell, it looks like the upstream developers mean to invoke this version of the function defined in aptrte.cxx which returns a value as opposed to modifying an out-parameter. They seem to also be relying on undefined behavior, passing extra parameters that are not in the declaration.

netgen 6.2.2004

Issue description

Building with netgen 6.2.2004 I see this error:

../src/NETGENPlugin/NETGENPlugin_Mesher.cxx:3058:17: error: 'OCCRefinementSurfaces' is not a member of 'netgen'
         netgen::OCCRefinementSurfaces ref (occgeo);
                 ^~~~~~~~~~~~~~~~~~~~~
../src/NETGENPlugin/NETGENPlugin_Mesher.cxx:3058:17: note: suggested alternative: 'OCCOptimizeSurface'
         netgen::OCCRefinementSurfaces ref (occgeo);

vtk9

Issue description

we need to apply these changes to make smesh work with vtk9:
wwmayer/FreeCAD@bb9bcbd

But as we use newer smesh sources we cannot apply this commit directly.

missing OpenCASCADE

hi
I am beginner to compiling.
I am facing the same problem but i want to compile smesh without conda. I downloaded the source core of occt and tried to put it in src and external but did not work. i also tried to search for the variable CMAKE_MODULE_PATH in the file CMakeLists.txt but did not find it.
i am using void linux and I was facing a lot of problems when tried to use salome so I thought that I can compile smesh because I only need smesh and geometry modules in salome.

i know that there is a similar issue #17 (comment)
but it is solved by using conda and I prefere not to use it. becouse I need a simple way of installing without the need to install a complete package manager just to install smesh

Consider reverting back to netgen 6.2.1804

Use netgen 6.2.1804. With 6.2.1808 I'm seeing all kinds of meshing errors in tests in other packages.
image

Starting to see why Salome is still just sticking with netgen 5.X...

SMESH Dependencies

Hi, trelau, I have some urgent problems with smesh:

  1. Whether your SMESH must have a dependenciy with pyocct?
  2. And I have a project via tpaviot's pythonocc, but this package has not a SMESH module yet, so is it possible I use Pythonocc with your SMESH here?
  3. I have install smesh via 'conda install -c conda-forge smesh', but I still can't import smesh module, and I also find that the file library of smesh only have two files named 'info' and 'Library', It's not a python file?
    Forgive my ignorance please, I would be very grateful if you can provide any help.

is support mingw officially?

I am using mingw on msys2.
I create a makefile with cmake, and there are too many errors during build.
I can build it by modifying it one by one, but I don't know if this is correct.
smesh is officially support mingw?

gcc.exe (Rev1, Built by MSYS2 project) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.