QMG 2.0.1, November 17, 1999.

This document describes patch 1 to QMG 2.0. You can download the entire patched version. The installation procedure is the same as the QMG 2.0 installation procedure. If you already have downloaded QMG 2.0, then you can make the patches yourself following these instructions.
  1. Platform: Tcl/Tk

    Problem: The statement

    puts -nonewline stdout a
    does not work in tkcon.tcl because of a bug in tkcon. This affects, among other things, gmsummary.

    Solution: Replace line 2295 of QMGROOT/tcl/tkcon.tcl, which is,

    [regexp {^(stdout|stderr)$} [lreplace $args 2 2] junk tmp]} {
    by
    [regexp {^(stdout|stderr)$} [lrange $args 1 1] junk tmp]} {
  2. Platform: All

    Problem: QMG's ray intersection routines can fail for higher degree parametric patches.

    Solution: Download the completely rewritten version of qpatchmath.cpp. It is believed that this version is more robust than its predecessor. Replace QMGROOT/src/common/qpatchmath.cpp with the downloaded version. Also, modify QMGROOT/src/common/qpatchmath.h as follows. Replace line 49 of qpatchmath.h, which is

    bool marker_active_;
    by
    int marker_active_;
  3. Platform: All

    Problem: Under some rare circumstances, the gmdouble routine could access a nonexistent output stream through an uninitialized pointer.

    Solution: Add the following four lines after line 1447 (may be different if other patches below have been applied) of QMGROOT/src/meshgen/double.cpp (which is a declaration "ostream log2(0);"),

    #ifdef DEBUGGING
      Local_to_PatchMath_CPP::dump_everything = false;
      Local_to_PatchMath_CPP::debug_str = &log2;
    #endif
    
  4. Platform: Unix

    Problem: The new version of qpatchtab.cpp invokes routines in LAPACK not invoked by the previous version. This means that the custom file may need to be redone if the LAPACK routine names have been remapped with -D options.

    Solution: To indicate this, change the comment in line 21 of QMGROOT/build/unixmatlab/custom and line 11 of custom of QMGROOT/build/unixtcl/custom, which was formerly

    #   zgegv
    
    to
    #   zgeqrf_, zunmqr_, zungqr_, zgghrd_, zhgeqz_
    
  5. Platform: Matlab

    Problem: gmfem.m does not correctly compute the contribution of the source term, that is, the contribution from f in the boundary value problem div(c grad u) = −f.

    Solution: To fix this problem, download the new version of gmfem.m and save it in QMGROOT/mfiles/.

  6. Platform: Matlab

    Problem: The QMG documentation incorrectly implies that QMG 2.0 is compatible with all versions of Matlab 5.x. In fact, it is not compatible with Matlab 5.0 or 5.1. There is no workaround.

  7. Platform: Matlab

    Problem: When a sparse zba matrix is displayed, the subscripting shown is 1-based instead of zero-based.

    Workaround: Replace the statement

    a.entries
    
    in QMGROOT/mfiles/@zba/display.m with
    if issparse(a.entries)
      [ii,jj,ss] = find(a.entries);
      if length(ii) == 0
        disp('Empty zba sparse matrix')
      else
        for p = 1 : length(ii)
          disp(sprintf('  (%d,%d) %d', ii(p)-1, jj(p)-1,ss(p)))
        end
      end
    else
      if (length(a.entries)) == 0
        disp('Empty zba matrix')
      else
        disp(a.entries)
      end
    end
    
    This solution has problems of its own. For instance, it ignores the current setting of the output format. A full solution to this problem will be postponed for a future major release of QMG.
  8. Platform: Windows, Visual C++ 6.0 compiler

    Problem: QMG 2.0 will not compile under Visual C++ 6.0 because of bugs in the compiler. Note: the following patches apply to VC++ 6.0 SP3. They have not been tested on other SP's.

    Solution:

    1. First, change the files QMGROOT/build/windowstcl/custom and QMGROOT/build/windowsmatlab/custom to add the following comment before the declaration of MSROOT.
      # If using VC++ 6.0, the followings statement should be
      # modified to:
      # MSROOT = c:\Program Files\Microsoft Visual Studio\VC98
      # or something similar, depending on where VC++ 6.0 is installed.
      
    2. Next, there are many warnings generated during compilation. To avoid these warnings, add the following statements in QMGROOT/src/common/objectstream.cpp and QMGROOT/src/common/qnamesp.h before any of the #include directives:
      #ifdef _MSC_VER
      #if _MSC_VER == 1200
      #pragma warning (disable: 4786)
      #pragma warning (disable: 4788)
      #endif
      #endif
      
    3. Next, there are internal compiler errors that terminate compilation. To fix this problem, insert the following statements
      #ifdef _MSC_VER
      #if _MSC_VER == 1200
      #include "qmatvec.h"
      #endif
      #endif
      
      before all #include directives in the following files: QMGROOT/src/meshgen/align.cpp, QMGROOT/src/meshgen/crtsubbox.cpp, QMGROOT/src/meshgen/double.cpp, QMGROOT/src/meshgen/meshgen.cpp, QMGROOT/src/meshgen/qboxstack.cpp, QMGROOT/src/meshgen/qinctab.cpp, QMGROOT/src/meshgen/qpatchtab.cpp, QMGROOT/src/meshgen/qseparation.cpp, QMGROOT/src/meshgen/split1.cpp, QMGROOT/src/model/checktri.cpp, QMGROOT/src/model/gmapply.cpp, QMGROOT/src/model/gm_polytri.cpp, QMGROOT/src/model/gm_vizp.cpp, QMGROOT/src/model/polytri.cpp, QMGROOT/src/matlab/qfrontend.cpp, and QMGROOT/src/tcl/qfrontend.cpp.
    4. To fix a problem with code generation that occurs with QMGROOT/src/meshgen/qpatchtab.cpp, replace line 1993 (line number may be higher after you have made the preceding modification to qpatchtab.cpp) of qpatchtab.cpp, which is currently
      if (next_chamber != Brep::Face_Spec(-1,-1)) {
      with the following
      #ifdef _MSC_VER
      #if _MSC_VER == 1200
            Brep::Face_Spec tmpfspec = Brep::Face_Spec(-1,-1);
            if (next_chamber != tmpfspec) 
      #else
            if (next_chamber != Brep::Face_Spec(-1,-1)) 
      #endif
      #else
            if (next_chamber != Brep::Face_Spec(-1,-1)) 
      #endif
              {
      
    5. There are patches available for Visual C++ 6.0 from the Dinkumware website. These patches have not been tested with QMG under VC++ 6.0. (They were tested with VC++ 5.0.) It's your choice whether to install them. But you should probably install the SSTREAM patch that is described in the the QMG 2.0 installation procedure since the SSTREAM bug in Visual C++ 5.0 is still present in 6.0.
  9. Replace the string "QMG 2.0" in QMGROOT/tcl/qmg_interactive_init.tcl (occurring in lines 26, 38, and 50) with "QMG 2.0.1".
  10. Replace the string "QMG 2.0" in line 44 of QMGROOT/ex/startup.m with "QMG 2.0.1".