Both Gmsh and Salome_Meca are commonly used open-source meshers capable of generating hexahedral elements. Before exporting such a solid mesh it’s necessary to remove the redundant line and surface elements automatically created by the aforementioned meshers.
The following steps are necessary to properly export a solid mesh created in:
a) Use Physical groups → Add → Volume, select the volume, confirm with “e”
b) Regenerate the mesh
c) Use File → Export, guess from extension, type .inp
Details shown here: PrePoMax (CalculiX FEA) - Tutorial 20 - Hex mesh from Gmsh - YouTube
a) In the Geometry module use New Entity → Group → Create Group
b) Select the Main Shape (geometry used for meshing), switch the Shape Type to edges, click Select All, Apply
c) Repeat for faces and volumes
d) In the Mesh module use Mesh → Create Groups from Geometry, select the generated mesh, as Geometry for Elements pick the newly created group of edges from the tree
e) Repeat for groups of faces and volumes
f) In the tree expand the containers with those groups, right-click the group containing edges, select Delete Groups with Contents and Apply
g) Repeat for the group with faces, leaving only the one with volumes
h) Select the mesh and use File → Export → UNV file
Optionally, use this converter to obtain the .inp file: GitHub - calculix/unv2ccx: Salome universal to CalculiX converter. Converts UNV mesh to the CalculiX INP format.