function getEntityName with fortran api
Hello gmsh developers team I'm struggling with how to call the getEntityName (dim, tag, name) routine from a Fortran subroutine, especially how to declare the "name" variable. All my attempts have resulted in a string of characters that I can't decipher when I display the contents of this variable on the screen. Do you have a solution please? I should mention that I'm using version 4.11.1 of gmsh. Here's an example of what I've tried, among other things:
use, intrinsic :: ISO_C_BINDING
use gmsh_fortran
implicit none
integer :: dim, num_entities, i, j, k, num_physical_groups, ierr
integer, dimension(:), allocatable :: physical_tags
integer, dimension(:,:), allocatable :: geom
**character(len=:), allocatable :: entity_name**
character nom_geo
type(gmsh_model_t) :: model
type(gmsh_t) :: gmsh
call gmsh%initialize()
call gmsh.model.occ.importShapes(nom_geo, geom , .false.)
call gmsh.model.occ.synchronize()
dim = 2
i=1
**call gmsh.model.getEntityName (dim, i, entity_name,ierr)**
write(*,*) entity_name
return
99 return 1 end subroutine
Edited by Amen Barabas