DLR-AMR / t8code

Parallel algorithms and data structures for tree-based adaptive mesh refinement (AMR) with arbitrary element shapes.
https://dlr-amr.github.io/t8code/
GNU General Public License v2.0
137 stars 52 forks source link

`t8_cmesh_from_msh_file` with `occ` activated gives error about missing shape in `brep` file #325

Closed jmark closed 2 years ago

jmark commented 2 years ago

When executing, for example, example/geometry/t8_occ_naca.cxx with activated occ, i.e.

$ ~/install/t8code/main/bin/t8_occ_naca --fileprefix naca6412 --level 2 --rlevel 3 --plane --occ

then an error is thrown:

[libsc] This is libsc 2.8.1.5-0b70
[t8] This is t8 0.11.0.373-b6de-dirty
[t8] CPP                      
[t8] CPPFLAGS                 
[t8] CC                       gcc
[t8] CFLAGS                   -I/usr/include/vtk
[t8] LDFLAGS                  
[t8] LIBS                     -lz -lm  -lvtkIOXML -lvtkCommonExecutionModel -lvtkCommonDataModel -lvtkIOXMLParser -lvtkIOParallelXML -lvtkParallelMPI -lvtkCommonCore -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKMath     -lTKernel -lTKPrim -lTKBO -lstdc++
File was not written with this version of the topology
[libsc 0] Abort: Could not read brep file or brep file contains no shape
[...]

Both, the mesh file (naca6412.msh) and the preb file (naca6412.brep) are there and readable. I also checked with some additional debug output that the preb file is found and read in. So the reason for the error must be something about a missing shape or something.

Above execution works just fine without the --occ flag. But then it is just linear geometry and not high-order geometry as far as I understand.

sandro-elsweijer commented 2 years ago

Note:

  1. We should print the filename in the error message.
  2. There should be a different error message if the file is not found
jmark commented 2 years ago

Here are my mesh and my brep files: naca6412.zip

sandro-elsweijer commented 2 years ago

@jmark On my machine, the files work without problems. Which version of OpenCASCADE and Gmsh are you using? And can you please supply your config.log?

jmark commented 2 years ago

gmsh: 4.10.5 opencascade:

Open CASCADE Technology 7.5.3
TBB enabled (HAVE_TBB)
FreeImage enabled (HAVE_FREEIMAGE)
FFmpeg enabled (HAVE_FFMPEG)
OpenGL: desktop
OpenVR disabled
RapidJSON enabled (HAVE_RAPIDJSON)
VTK enabled (HAVE_VTK)
Exceptions enabled
Compiler: GCC 11.2.0
Architecture: AMD64
OS: Linux
jmark commented 2 years ago

My config.log

sandro-elsweijer commented 2 years ago

I have enabled some better error checking in branch fix-occ_brep_reader and created a new msh and brep file. Could you please try them? naca6412_different_version.zip

jmark commented 2 years ago

I checked out your branch and downloaded your new version of naca6412. Now I get the following error message:

$ ~/install/t8code/occ/bin/t8_occ_naca --fileprefix naca6412 --level 2 --rlevel 3 --plane --occ
[libsc] This is libsc 2.8.1.5-0b70
[t8] This is t8 0.13.0.2-4ff5-dirty
[t8] CPP                      
[t8] CPPFLAGS                 
[t8] CC                       gcc
[t8] CFLAGS                   -I/usr/include/vtk
[t8] LDFLAGS                  
[t8] LIBS                     -lz -lm  -lvtkIOXML -lvtkCommonExecutionModel -lvtkCommonDataModel -lvtkIOXMLParser -lvtkIOParallelXML -lvtkParallelMPI -lvtkCommonCore -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKMath     -lTKernel -lTKPrim -lTKBO -lstdc++
File was not written with this version of the topology
[libsc 0] Abort: Shape in naca6412.brep has an OpenCASCADE version mismatch or is empty. 
jmark commented 2 years ago

Above runs were done on my ArchLinux machine. Now, I also tried to run the same command on my Ubuntu 20.04 (WSL Win10) setup. Get the exact same error message:

$ ~/install/t8code/occ/bin/t8_occ_naca --fileprefix naca6412 --level 2 --rlevel 3 --plane --occ
[libsc] This is libsc 2.8.1.5-0b70
[t8] This is t8 0.13.0.2-4ff5
[t8] CPP                      mpicc -E
[t8] CPPFLAGS                 
[t8] CC                       mpicc
[t8] CFLAGS                   -I/home/jmark/install/vtk9/release/include/vtk-9.2 -L/home/jmark/install/vtk9/release/lib -I/usr/include/opencascade
[t8] LDFLAGS                  
[t8] LIBS                     -lz -lm  -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKMath     -lTKernel -lTKPrim -lTKBO -lstdc++
File was not written with this version of the topology
[libsc 0] Abort: Shape in naca6412.brep has an OpenCASCADE version mismatch or is empty. 
sandro-elsweijer commented 2 years ago

Slowly, I am running out of options 😅 Could you please try to configure t8code with this command?

/home/jmark/codes/t8code/configure --prefix=/home/jmark/install/t8code/debug --enable-debug --with-vtk --with-vtk_version_number=9.1.0 --with-occ CPPFLAGS='-I/usr/include/opencascade -I/usr/include/vtk' CFLAGS='-I/usr/include/opencascade -I/usr/include/vtk' LDFLAGS='-L/usr/lib'
sandro-elsweijer commented 2 years ago

And your OpenCASCADE is from the package manager, not built from scratch? Personally, I mostly tested the features with my locally built OCC version. Did you install all needed OCC libraries? libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev

jmark commented 2 years ago

Yeah, I used the OCC from the package manager. What I will try next is to build OCC myself and link against that. :relaxed:

sandro-elsweijer commented 2 years ago

On my first try, I had some Problems building OCC from scratch. But here is a good article about it: https://realglitch.com/2020/04/how-to-install-opencascade-7-4-on-ubuntu-18-04-lts/

jmark commented 2 years ago

Finally got it working. You have to compile OCC and VTK and stuff all by yourself. Then it works.