dropped support of OCC in ngpkg.cpp?

2014-02-10
2014-02-12
  • It seems that OpenCascade support was dropped in ng/ngpkg.cpp
    in the latest version. It renders netgen almost useless as many
    peaople have not access to libacis.

    Could you please re-enable it?

     
  • Hi Christophe,

    Which version are you talking about ? Netgen 5.1, or the recently posted 5.2-alpha ?
    OpenCascade is supported, at least it should be.

    For modularity (which is slowly improving), the geometry interfaces went into individual shared libraries, so it was removed from ngpgk.cpp

    Joachim

     
  • The trouble is that trying to load a STP geometry with netgen-mesher (File/Load Geometry menu) leads to:

    NETGEN-5.1
    Developed by Joachim Schoeberl at
    2010-xxxx Vienna University of Technology
    2006-2010 RWTH Aachen University
    1996-2006 Johannes Kepler University Linz
    Run parallel Netgen with 'mpirun -np xy netgen'
    optfile ./ng.opt does not exist - using default values
    ERROR: IGES import requires the OpenCascade geometry kernel. Please install OpenCascade as described in the Netgen-website
    errinfo: IGES import requires the OpenCascade geometry kernel. Please install OpenCascade as described in the Netgen-website
    while executing
    "Ng_LoadGeometry $file "
    invoked from within
    ".#ngmenu.#ngmenu#file invoke active"
    ("uplevel" body line 1)
    invoked from within
    "uplevel #0 [list $w invoke active]"
    (procedure "tk::MenuInvoke" line 50)
    invoked from within
    "tk::MenuInvoke .#ngmenu.#ngmenu#file 1"
    (command bound to event)

     
  • To be more precise, the troube is in :
    int Ng_LoadGeometry (ClientData clientData,
    Tcl_Interp * interp,
    int argc, tcl_const char argv[])
    ...
    if ((strcmp (&lgfilename[strlen(lgfilename)-4], "iges") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-3], "igs") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-3], "IGS") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-4], "IGES") == 0))
    {
    Tcl_SetResult (interp, (char
    )"IGES import requires the OpenCascade geometry kernel. "
    "Please install OpenCascade as described in the Netgen-website",
    TCL_STATIC);
    return TCL_ERROR;
    }
    ...

    So when trying to load an iges file (same behaviour also for step, brep files)
    the code launch a TCL_ERROR with the message quoted in the previous emails.

    My guess is that we should add something like, just like in 4.9.13:
    ...
    if ((strcmp (&lgfilename[strlen(lgfilename)-4], "iges") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-3], "igs") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-3], "IGS") == 0) ||
    (strcmp (&lgfilename[strlen(lgfilename)-4], "IGES") == 0))
    {

    ifdef OCCGEOMETRY

        // strcpy (geomfilename, lgfilename);
        PrintMessage (1, "Load IGES geometry file ", lgfilename);
        occgeometry = LoadOCC_IGES (lgfilename);
        ng_geometry = occgeometry;
    

    else

        Tcl_SetResult (interp, (char*)"IGES import requires the OpenCascade geometry kernel. "
                   "Please install OpenCascade as described in the Netgen-website",
                   TCL_STATIC);
        return TCL_ERROR;
    

    endif

               }
    

    ...

     
  • Hi Christophe,

    you did the configer with --enable-occ ?

    this should generate libraries libocc.so (for meshing) and liboccvis.so (additional GUI functionality). Maybe you have to rebuild them.

    If present, the shared library is loaded in the first line of occgeom.tcl.
    For testing you can uncomment the error output in the next two lines.

    Joachim

     
  • Hi Joachim,
    I don't understand exactly which lines I shall comment
    You mean the lines within the test for the "iges" extension?

     
  • Hi Joachim,
    I managed to make netgen 5.1 working.
    In fact what has to be done is to change noinst_LTLIBRARIES to lib_LTLIBRARIES
    for libocc.la and others shared lib required by tcl files. Then comment out the two lines in each test for iges,...

     
  • Christophe,
    which automake-files are you using ?
    The netgen-5.1 release and others on sourceforge have the correct lib_LTLIBRARIES. I am not maintaining other code distributions.
    Joachim