cgg-bern / AlgoHex

GNU Affero General Public License v3.0
18 stars 6 forks source link

Troubles installing AlgoHex #7

Closed otaolafranc closed 10 months ago

otaolafranc commented 10 months ago

Hello, I tried to install AlgoHex without success in tuxedOS 2, the followed steps were:

  1. downloaded the git https://github.com/cgg-bern/AlgoHex.git
  2. downloaded Gurobi from https://www.gurobi.com/ with a academic license into ~/Programs/gurobi1003/linux64
  3. downloaded IPOPT (sudo apt-get install coinor-libipopt-dev)
  4. entered to AlgoHex (cd AlgoHex-1.0.0)
  5. created build folder (mkdir build)
  6. entered it (cd build)
  7. run the cmake command ( cmake -DGUROBI_HOME=~/Programs/gurobi1003/linux64 ..)

there were some things i needed to change as it was not working in the compilation:

  1. the link for 5.4 gmm is not working (I remplace it in AlgoHexDownloadExternal.cmake) by https://mirrors.cloud.tencent.com/macports/distfiles/gmm/gmm-5.4.tar.gz
  2. the CoMISo cgg2 branch has an issue that the .gitmodules is missing the [submodule "cmake-library"] (and so on),so I used the master instead

with these modifications, it 'compiled' nevertheless I still got a lot of warnings and furthermore it is not making an executable, any help with this would be appreciated (I attached the log file) buildLog.txt

mheistermann commented 10 months ago

Hello!

Could you check if the GMM link used in AlgoHexDownloadExternal.cmake still doesn't work for you? Currently it's working for me, maybe there was an intermittent failure on the mirror? Anyways, I'm glad you could fix it by switching to another mirror.

Why is a missing cmake-library submodule in comiso a problem? Indeed the cgg2 branch diverged from master a bit and doesn't use the cmake-library yet, but it works. Note that AlgoHex likely will not compile or work with the master branch.

Your cmake log looks fine at first glance. Did you run make or cmake --build . in the build folder afterwards to actually compile after the cmake configuration? That should either give you an executable binary or a hard error.

Hope this helps!

otaolafranc commented 10 months ago

Hello, first of all, thanks for your answer, secondly,

Why is a missing cmake-library submodule in comiso a problem? Indeed the cgg2 branch diverged from master a bit and doesn't use the cmake-library yet, but it works. Note that AlgoHex likely will not compile or work with the master branch.

emmm... if it not, the compiler gives an error and does not continue when compiling over cgg2 branch see log:

-- AlgoHex: downloading missing dependency 'CoMISo' -- Downloading/updating CoMISo CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/franco/Programs/AlgoHex/external/.cache/CoMISo [ 11%] Creating directories for 'CoMISo-download' [ 22%] Performing download step (git clone) for 'CoMISo-download' Cloning into 'CoMISo'... warning: redirecting to https://gitlab.vci.rwth-aachen.de:9000/CoMISo/CoMISo.git/ Branch 'cgg2' set up to track remote branch 'cgg2' from 'origin'. Switched to a new branch 'cgg2' Submodule 'Base' (https://www.graphics.rwth-aachen.de:9000/CoMISo/Base.git) registered for path 'Base' fatal: No url found for submodule path 'cmake-library' in .gitmodules CMake Error at .cache/CoMISo/CoMISo-download-prefix/tmp/CoMISo-download-gitclone.cmake:62 (message): Failed to update submodules in: '/home/franco/Programs/AlgoHex/external/CoMISo' gmake[2]: [CMakeFiles/CoMISo-download.dir/build.make:99: CoMISo-download-prefix/src/CoMISo-download-stamp/CoMISo-download-download] Error 1 gmake[1]: [CMakeFiles/Makefile2:83: CMakeFiles/CoMISo-download.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2 CMake Error at cmake/DownloadProject.cmake:179 (message): Build step for CoMISo failed: 2 Call Stack (most recent call first): cmake/AlgoHexDownloadExternal.cmake:24 (download_project) cmake/AlgoHexDownloadExternal.cmake:105 (algohex_download_project) cmake/AlgoHexDependencies.cmake:54 (algohex_download_comiso) CMakeLists.txt:74 (include) -- Configuring incomplete, errors occurred!

This error terminates the compilation and (sorry if it is not the case I am not so familiar with compilation of things :/) it is because it doesnt have the submodule cmake-librart in the .gitmodules (in the cgg2 it is missing some lines that in the master branch are)

Could you check if the GMM link used in AlgoHexDownloadExternal.cmake still doesn't work for you? Currently it's working for me, maybe there was an intermittent failure on the mirror?

yes, right now it is working, I just redownloaded the git and tried to compile and the cgg2 error comes up.

Your cmake log looks fine at first glance. Did you run make or cmake --build . in the build folder afterwards to actually compile after the cmake configuration?

isnt it the command cmake -DGUROBI_HOME=~/Programs/gurobi1003/linux64 .. ? thanks in advance

mheistermann commented 10 months ago

Oh, I'll look into the cgg2/cmake-library thing, that's very strange and should not behave like this.

isnt it the command cmake -DGUROBI_HOME=~/Programs/gurobi1003/linux64 .. ?

That command only prepares the compilation, but doesn't actually compile anything yet. Afterwards, you will have to do cmake --build . (make may also work).

mheistermann commented 10 months ago

Update: CoMISo/cgg2 should be fixed now, please give it a try :)

otaolafranc commented 10 months ago

That command only prepares the compilation, but doesn't actually compile anything yet.

oh, ups... in any case it woulnt compile (before) if it was not prepared, no? (and with the cgg2 error the preparation was stopped there)

Update: CoMISo/cgg2 should be fixed now, please give it a try :)

thanks a lot!

cmake --build .

it still did not compile, it went up to 47% and I am getting the following error:

In file included from /home/franco/Programs/AlgoHex/external/CoMISo/../CoMISo/Solver/GMM_Tools.hh:39, from /home/franco/Programs/AlgoHex/external/CoMISo/Solver/CholmodSolverT.cc:34, from /home/franco/Programs/AlgoHex/external/CoMISo/Solver/CholmodSolver.hh:164, from /home/franco/Programs/AlgoHex/external/CoMISo/Solver/CholmodSolver.cc:30: /home/franco/Programs/AlgoHex/external/CoMISo/../CoMISo/Utils/gmm.hh:7:10: fatal error: gmm/gmm.h: No such file or directory 7 | #include <gmm/gmm.h> | ^~~ compilation terminated. gmake[2]: [external/CoMISo/CMakeFiles/CoMISo.dir/build.make:272: external/CoMISo/CMakeFiles/CoMISo.dir/Solver/CholmodSolver.cc.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:541: external/CoMISo/CMakeFiles/CoMISo.dir/all] Error 2 gmake: *** [Makefile:166: all] Error 2

here is the complete log for the preparation (cmake -DGUROBI_HOME=~/Programs/gurobi1003/linux64 ..) and also at the end for the cmake (cmake --build .) logPreparationCmake.txt

ps. make gives the same error as cmake --build .

mheistermann commented 10 months ago

oh, ups... in any case it woulnt compile (before) if it was not prepared, no? (and with the cgg2 error the preparation was stopped there)

Correct, you need both :)

I reworked a bit of cmake, and at least now "it works on my machine". Could you test this branch? https://github.com/cgg-bern/AlgoHex/tree/dev-cmake-fixes (You can specify --branch dev-cmake-fixes on a new clone, or use git checkout dev-cmake-fixes inside the existing repo.

Some of the trouble here originated from AlgoHex cmake pulling the latest tip of CoMISo's cgg2 branch, which had become incompatible without us noticing. In addition to (hopefully) fixing those compatibility issues, I also pinned the current CoMISo/cgg2 tip to avoid this kind of issue in the future).

otaolafranc commented 10 months ago

Hello @mheistermann , thanks a lot for your help, I can confirm that the dev-cmake-fixes branch compiles! (I used a new copy of it by git clone https://github.com/cgg-bern/AlgoHex.git --branch dev-cmake-fixes) I have some questions if I might, 1.

I am not sure into how to create the "tetrahedral mesh with user-specified feature tags". I usually do my meshes in Salome (https://www.salome-platform.org/) which enables to create groups for each edge of a b-rep model (which I understand is what you mention as user-specified feature tags). nevertheless, salome does not allow to export in VTK v2.0 (ASCII) format, only into: MED, UNV, CGNS, GMF, DAT I could also import them to gmsh and export it from there but not 100% if this would be correct.

2.

Is there any new about the 'uncopling of the gurobi' dependency?

3.

do you see by any chance the integration (once gurobi is not a dependency) of AlgoHex with other general solutions, such as Salome or Gmsh?

thanks for everything! I am impatient to test AlgoHex!

mheistermann commented 10 months ago

That's great to hear, I'll merge that branch :) Thanks for reporting the problems and being helpful in tracking down the issue :-)

  1. I'm not sure, maybe one of my colleagues knows more. It's possible to export the right format with gmsh, as it's done in HexMe. For format conversions, meshio might also be useful, however I have no idea if they support the feature tag format AlgoHex expects.
  2. We're not actively working on this, but it's on our wish list. From Hendrik's work it appears that the volume quantization problem are surprisingly "easy" for Gurobi - maybe this means that open source solvers can also give satisfactory results; however to the best of my knowledge, no-one has attempted this yet.
  3. I suppose that mostly depends on the developers of those tools. Would be cool :-)

I'll close this issue as the initial problem with compilation is solved, but feel free to reply, or better, open new issues to discuss the other topics.

otaolafranc commented 10 months ago

Thanks for answering everything!

  1. I have created a tetra mesh with group of all the edges and imported in gmsh and I exported in vtk ASCII and right now it is running getting some errors but it looks like at least it is runnig (the mesher)
  2. & 3. the Gurobi dependency makes it dificult to integrate to that type of solutions (as it will not make possible to packege with them and use for any purpose :/ I am also seeing a lot of interest of this tool for CFD applications...)
pa-beaufort commented 10 months ago

Hello @otaolafranc .

FYI, note that HexMe is not a static dataset. If AlgoHex fails while trying to hex-mesh a model, don't hesitate to propose adding this model to HexMe :-)

Feel free to open an issue on HexMe repository if you encounter any problems.

See you.

otaolafranc commented 10 months ago

Hello @otaolafranc .

FYI, note that HexMe is not a static dataset. If AlgoHex fails while trying to hex-mesh a model, don't hesitate to propose adding this model to HexMe :-)

Feel free to open an issue on HexMe repository if you encounter any problems.

See you.

hello @pa-beaufort , thanks for the reply, for the moment, i tested with two different meshes, and AlgoHex failed the two times (an mpi error if I remember correctly) I could save the log and post it as an issue if this might help. that being said, I am pretty sure that I am using it wrong. there are no indications of the creation of the tet mesh that is an input and I am affraid that this might be the culprit of algoHex not working as the geometries are way simpler that what is shown, e.g., one is a simple toroid geometry. As I mentioned previously, I am creating my meshes in salome (the algorithm used there for the tetra meshes is NETGEN 5.3.1) creating the 1D groups for all edges -> importing it in gmsh (the mesh groups are equivalent to the 'physical groups' of gmsh) -> exporting it in vtk ASCII (I dont see the exact version of it). it would be apreciated if there is a complete workflow from CAD model to hexa mesh so I can apply to other geometries. furthermore, is there any way to, in case that AlgoHex does not mesh succesfully a section of the geometry fill it up with tetras & pyramids? I would prefere to get 'at least' a mesh than not getting anything at the end. As I plan in using AlgoHex for CFD simulations which accepts mix element meshes,

thanks and best regards, F.

mheistermann commented 10 months ago

and AlgoHex failed the two times (an mpi error if I remember correctly) I could save the log and post it as an issue if this might help.

An MPI error sounds very much like an error not related to inputs. I had hoped we had solved this by now, but apparently not. So it would be great if you could post the corresponding section of the log :-) (Maybe open a new issue so it can be found more easily in the future)

dbommes commented 10 months ago

Please use the cylinder.ovm input from the demo folder as a first step to check whether AlgoHex has been compiled correctly. If you do not get a valid hexahedral mesh for this input, something is wrong with your build.

I would also recommend to remove MPI from the Cmake configuration. The external IPOPT dependency uses MUMPS, which relies on a fake implementation of MPI. Mixing this with a proper MPI causes issues on some platforms.

pa-beaufort commented 10 months ago

Hello @otaolafranc . FYI, note that HexMe is not a static dataset. If AlgoHex fails while trying to hex-mesh a model, don't hesitate to propose adding this model to HexMe :-) Feel free to open an issue on HexMe repository if you encounter any problems. See you.

hello @pa-beaufort , thanks for the reply, for the moment, i tested with two different meshes, and AlgoHex failed the two times (an mpi error if I remember correctly) I could save the log and post it as an issue if this might help. that being said, I am pretty sure that I am using it wrong. there are no indications of the creation of the tet mesh that is an input and I am affraid that this might be the culprit of algoHex not working as the geometries are way simpler that what is shown, e.g., one is a simple toroid geometry. As I mentioned previously, I am creating my meshes in salome (the algorithm used there for the tetra meshes is NETGEN 5.3.1) creating the 1D groups for all edges -> importing it in gmsh (the mesh groups are equivalent to the 'physical groups' of gmsh) -> exporting it in vtk ASCII (I dont see the exact version of it). it would be apreciated if there is a complete workflow from CAD model to hexa mesh so I can apply to other geometries. furthermore, is there any way to, in case that AlgoHex does not mesh succesfully a section of the geometry fill it up with tetras & pyramids? I would prefere to get 'at least' a mesh than not getting anything at the end. As I plan in using AlgoHex for CFD simulations which accepts mix element meshes,

thanks and best regards, F.

Hello @otaolafranc

Please note that - a priori - you have to define feature surfaces to have a conforming hex-mesh to the geometry. As you wrote, the feature-tagged entities correspond to the physical entities of gmsh. It remains to generate the tet-mesh (up to some options, cf. the metadata files) and to export it in the vtk format.

The tet-meshing workflow is actually available in a paper and hosted in a repository.

Once you have a well-defined tet-mesh, you should simply run the command given in AlgoHex README. ATM AlgoHex doesn't yield hex-dominant meshes, implying that a hex-mesh might be topologically incomplete. In the case of an incomplete mesh, don't hesitate to suggest adding to HexMe the corresponding CAD model.

Out of curiosity, which hex-meshers do you use?

otaolafranc commented 10 months ago

Hello @pa-beaufort, Thanks for the answer but as I posted in the other issue that I created, it does not work even for cylinder.omv. Regarding the meshers I use, for unstructured hexa dominant snappyHexMesh and cfmesh libraries that are attached to OpenFOAM library. They are what is called octree meshers I think? We call them cell cut meshers. Wich are rather non optimal. I mostly do hybrid structured+unstructured meshes in Salome-platform. Where I block cut my geometry manually, into bricks, prisms and poly blocks and in function of that I mesh with different strategies each block type (hexa, prisms or tetra+pyramids). I am also interested in test loopycuts but haven't successfully compiled yet. I make part of OpenFOAM community which is one of the biggest open-source cfd toolbox. But the meshing tools are quite sacarse... And as it is a subject of personal interest really like to investigate them. If you guys are looking for applicability of your meshes the community would be more than welcome.... As our result are quite mesh quality dependent.

otaolafranc commented 9 months ago

Hello @otaolafranc . FYI, note that HexMe is not a static dataset. If AlgoHex fails while trying to hex-mesh a model, don't hesitate to propose adding this model to HexMe :-) Feel free to open an issue on HexMe repository if you encounter any problems. See you.

hello @pa-beaufort , thanks for the reply, for the moment, i tested with two different meshes, and AlgoHex failed the two times (an mpi error if I remember correctly) I could save the log and post it as an issue if this might help. that being said, I am pretty sure that I am using it wrong. there are no indications of the creation of the tet mesh that is an input and I am affraid that this might be the culprit of algoHex not working as the geometries are way simpler that what is shown, e.g., one is a simple toroid geometry. As I mentioned previously, I am creating my meshes in salome (the algorithm used there for the tetra meshes is NETGEN 5.3.1) creating the 1D groups for all edges -> importing it in gmsh (the mesh groups are equivalent to the 'physical groups' of gmsh) -> exporting it in vtk ASCII (I dont see the exact version of it). it would be apreciated if there is a complete workflow from CAD model to hexa mesh so I can apply to other geometries. furthermore, is there any way to, in case that AlgoHex does not mesh succesfully a section of the geometry fill it up with tetras & pyramids? I would prefere to get 'at least' a mesh than not getting anything at the end. As I plan in using AlgoHex for CFD simulations which accepts mix element meshes, thanks and best regards, F.

Hello @otaolafranc

Please note that - a priori - you have to define feature surfaces to have a conforming hex-mesh to the geometry. As you wrote, the feature-tagged entities correspond to the physical entities of gmsh. It remains to generate the tet-mesh (up to some options, cf. the metadata files) and to export it in the vtk format.

The tet-meshing workflow is actually available in a paper and hosted in a repository.

Once you have a well-defined tet-mesh, you should simply run the command given in AlgoHex README. ATM AlgoHex doesn't yield hex-dominant meshes, implying that a hex-mesh might be topologically incomplete. In the case of an incomplete mesh, don't hesitate to suggest adding to HexMe the corresponding CAD model.

Out of curiosity, which hex-meshers do you use?

Hello @pa-beaufort , I read the article (thanks for the link) and from my understanding (correct me if I am wrong), one should use Snakemake to generate three types of tet meshes, of a CAD model (.step) and then generate the vtk exported meshes with featured tag for the edges of the CAD model using gmsh. once done AlgoHex is used over that meshes to get the hexa version of the cad model. I understand the logic but not sure how to implemented, how should look a bash script of lets say model.step?

#enter folder of hexme
cd $hex-me-if-you-canPATH

#rename model to be meshed
mv $originalPath/model.step ./original/iXXo_newModel.step
#create a .yaml file?
echo "author: otaolafranc
description: test
license:
name: iXXo_newModel
reference: " > ./meta/iXXoc_newModel.yaml
cp ./meta/iXXoc_newModel.yaml ./meta/iXXou_newModel.yaml
cp ./meta/iXXoc_newModel.yaml ./meta/iXXob_newModel.yaml
# run Snakemake ? -> run gmsh on the background
????
#get three vtk meshes (iXXoc_newModel.vtk, iXXou_newModel.vtk, iXXob_newModel.vtk
#run AlgoHex
$AlgoHexPath/Build/bin/HexMeshing -i ./iXXoc_newModel.vtk -o $outputPath/iXXoc_newModel.ovm

I am sorry, I am not familiar with snakemake, and I am afraid that I am not completly understanding the workflow (from a technical point of view) thanks in advance,

pa-beaufort commented 9 months ago

Hello @otaolafranc

Snakemake is a workflow manager. It is pretty useful to handle a dataset. If your goal is only to mesh one model .step, you only need to replicate what is done tetme.py. The metadata files (eg. s01c_cube.yaml) are just palceholders following gmsh syntax for the meshing options.

If it is still unclear how to proceed, open a new issue on HexMe GitHub.