Interesting Fortran quad mesh generator and container class library

I was looking around the internet for grid generation codes that can create all quad (or hex) unstructured meshes and ran across this code HOHQMesh which generates all-quad (or hex by extrusion, rotation, etc) meshes with high-order boundary information. What is probably more interesting to non CFD or FEM programmers is a supporting library (also in Fortran) called FTObjectLibrary which is a library of “referenced counted object and container classes”. I just discovered these so I have no idea about how good they are but I thought I would pass this on so they can get added to the Modern Fortran code lists.

3 Likes

I discovered that code too some time ago. I haven’t tried it yet. But having a high-quality open source quad and hex mesh generators would be super useful.

It has been in mesh generation category of my list for some time, as has FTObjectLibrary in the Containers and Generic Programming category.

2 Likes

I have tried to compile it with gfortran under win10. When run in the same folder as the example control file(I am in the GingerbreadMan example folder), it can’t read the error txt file. Look at the control file, it points the file to Examples/2D,

\begin{CONTROL_INPUT}

   \begin{RUN_PARAMETERS}
      mesh file name   = Examples/2D/GingerbreadMan/GingerbreadManMesh.mesh
      plot file name   = Examples/2D/GingerbreadMan/GingerbreadManPlot.tec
      stats file name  = Examples/2D/GingerbreadMan/GingerbreadManStats.txt

So has to run in HOHQMesh’s root folder, where the Examples folder is in it. like this:

D:\00fea\HOHQMesh-main>hohqmesh -f Examples/2D/GingerbreadMan/GingerbreadMan.control

If run in the control file folder, need to remove Examples/2D/GingerbreadMan/ in the control file, like this:

\begin{CONTROL_INPUT}

   \begin{RUN_PARAMETERS}
      mesh file name   = GingerbreadManMesh.mesh
      plot file name   = GingerbreadManPlot.tec
      stats file name  = GingerbreadManStats.txt

I have attached my HOHQMesh.exe here. After download, you need to remove .txt and upzip. Put the exe in Window’s Path, so you could run it in any folder.

HOHQMesh.zip.txt (1.1 MB)

Should this be a win10 file name ?

You mean change / to \ ?

Still not working.

Same issue occurs on my Linux Mint systems. I opened an issue on the HOHQMesh Github site. Also suggested they add a fpm build option.

1 Like

Thanks. I have no access to my github account now, locked out by my own 2FA.

I don’t want to key in the extension name everytime, so I made a little change:

  1. if .control not keyed in, add it.
  2. run the program with: ‘hohqmesh controlFile’, no need to use the -f switch.

The change is In SUBROUTINE ReadCommandLineArguments of HOHQMesh.f90:

         !newly added code 
         IF(argCount==1)   THEN
            CALL getarg(1, controlFileName)
            if (index(controlFileName,'.control')==0) controlFileName=trim(controlFileName)//'.control'
            
         !old code, but IF changed to esleIF   
         elseIF(argCount .ne. 0)   THEN
            WRITE(OUTPUT_UNIT,*) "Command line argument error"
            CALL PrintHelpMessage(OUTPUT_UNIT)
            ERROR STOP "Error in command line argument (see `-help` for a list of available options)"
         END IF

      END SUBROUTINE ReadCommandLineArguments