Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmsh integration #968

Merged
merged 15 commits into from
Jun 23, 2023
Merged

Gmsh integration #968

merged 15 commits into from
Jun 23, 2023

Conversation

ole-alb
Copy link

@ole-alb ole-alb commented May 17, 2023

Description

How Has This Been Tested?

Screenshots, that help to understand the changes(if applicable):

Checklist:

  • A test for the new functionality was added.
  • All tests run without failure.
  • The new code complies with the TiGL style guide.
  • New classes have been added to the Python interface.
  • API changes were documented properly in tigl.h.

Copy link
Contributor

@joergbrech joergbrech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ole-alb! I have a few comments, see below.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Show resolved Hide resolved
src/mesher/Mesher.cpp Outdated Show resolved Hide resolved
tests/unittests/tiglMesher.cpp Outdated Show resolved Hide resolved
tests/unittests/tiglMesher.cpp Outdated Show resolved Hide resolved
tests/unittests/tiglMesher.cpp Outdated Show resolved Hide resolved
tests/unittests/tiglMesher.cpp Outdated Show resolved Hide resolved
tests/unittests/tiglMesher.cpp Outdated Show resolved Hide resolved
@joergbrech
Copy link
Contributor

Oh, and we should keep in mind that we still have to adapt the CMake integration of gmsh. Using gmsh-integration should be optional and a user should be able to turn it on and off using a CMAKE flag. Finding and/or installing of CMake during the configuration step could probably be improved as well. Just writing this here as a reminder. Nothing has to be done as part of this PR.

Copy link
Collaborator

@rainman110 rainman110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, the integration of GMESH needs to be thought through. Since

  • It increases build requirements / dependencies
  • It is tightly integrated into the tigl library

I think a better strategy is to design a library on top of tigl and gmsh, that add mesh generation via gmsh. (just me two cents ;) )

if ( GMSH_FOUND )
MESSAGE( STATUS "GMSH found: header(${GMSH_INCLUDE_DIR}) lib(${GMSH_LIBRARY}) executable(${GMSH_EXECUTABLE})" )
MESSAGE( STATUS "GL2PS found: lib(${GL2PS_LIBRARY})" )
MESSAGE( STATUS "GL found: lib(${GL_LIBRARY})" )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should create an imported library GMSH target here to avoid using the old school variable approach. (I.e. the requirement to use ${GMSH_LIBRARY} and ${GMSH_INCLUDE_DIR}). See for example: https://github.com/DLR-SC/tixi/blob/master/cmake/FindLibXml2.cmake#L99

@@ -87,6 +87,7 @@ target_include_directories(tigl3_objects
PRIVATE ${TIGL_INCLUDES}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/api
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${GMSH_INCLUDE_DIR}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using variables from findXXX.cmake scripts (i.e. use an imported target instead)

target_link_libraries (tigl3 PRIVATE ${OpenCASCADE_LIBRARIES} ${VLD_LIBRARIES}
PRIVATE Boost::filesystem Boost::thread Boost::system Boost::atomic Boost::chrono Boost::date_time
PRIVATE ${CMAKE_THREAD_LIBS_INIT}
PRIVATE ${GMSH_LIBRARY}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@joergbrech
Copy link
Contributor

I think, the integration of GMESH needs to be thought through. Since

* It increases build requirements / dependencies

* It is tightly integrated into the tigl library

I think a better strategy is to design a library on top of tigl and gmsh, that add mesh generation via gmsh. (just me two cents ;) )

Good point. But that rules out ever having a Mesh-Exporter in TiGLViewer.

Either way, I suggest to keep developing the Mesher as part of TiGL as part of this seperate branch gmsh-integration for now. I think porting the Mesher to a new library that links to tigl and gmsh should not be too hard if we decide to go that way at a later point.

src/mesher/Mesher.cpp Outdated Show resolved Hide resolved
src/mesher/Mesher.cpp Outdated Show resolved Hide resolved
src/mesher/Mesher.h Outdated Show resolved Hide resolved
@joergbrech
Copy link
Contributor

joergbrech commented Jun 23, 2023

@ole-alb There are still some CMake issues. We should keep @rainman110's comments in mind and define an imported library target. Also, in the current design, gmsh is required and not optional. I will go ahead and merge this into gmsh_integration anyway so that you can continue to work.

@joergbrech joergbrech merged commit 594662e into gmsh-integration Jun 23, 2023
@joergbrech joergbrech deleted the gmsh_exp_ole branch June 23, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants