Skip to Content.
Sympa Menu

opal - Re: [Opal] Geometry and H5hut file format

opal AT

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Geometry and H5hut file format

Chronological Thread  
  • From: "Calvo Portela, Pedro" <Pedro.Calvo AT>
  • To: "opal AT" <opal AT>, Dragos Constantin <dragos.constantin AT>
  • Subject: Re: [Opal] Geometry and H5hut file format
  • Date: Thu, 2 Mar 2023 10:35:35 +0000
  • Accept-language: es-ES, en-US

Hi Dragos

The geometry is indeed an OPAL feature that is still experimental and needs to be refined. However, it can be used as an element for particle termination. Its integrated employment within the Field solver (SAAMG solver) may present some issues, but it is also available in the latest version of OPAL. You can find some information on this subject in these articles

The use of the GEOMETRY command for particle termination is directly included, so you don't have to do anything special in the OPAL compilation. If you want to include SAAMG solver you must install some extra libraries (see, and add the ENABLE_SAAMG_SOLVER flag in the OPAL compilation (

Adding arbitrary geometries to OPAL-cycl requires a careful preparation. OPAL can only handle a geometry for “vacuum space”. Thus, the initial CAD model of the accelerator or any component has to be modified to obtain an inverted solid created by the subtraction of all elements from the geometry. This ’vacuum space’ is exported to *.step format and meshed using GMSH. I have applied the following meshing process with very satisfactory results: 1D->2D->3D->2x Refine by splitting. The meshed geometry is saved into a *.vtk file and converted it into *.h5 format through a vtk2h5grid program, specifically created by the OPAL developer team. During the initial stages of a simulation, OPAL creates a voxel mesh to speed up the tests that have to be performed every time-step.

One of the drawbacks is that the vtk2h5grid program is obsolete. In order to use it, you must download the OPAL-1.4.0-1 version ( vtk2h5grid is included in the binary version, so you could use the opal bin executable (source OPAL-1.4.0-1/etc/profile.d/ to skip the compilation from source. The program is very simple and it runs adequately if there was not errors in the meshing process: vtk2h5grid GeomFile.vtk
The use of this deprecated version of OPAL is only for this step of the process. Once you have the geometry file in vtk format, you can use it in the latest OPAL release.

There is a recent option (ENABLEVTK) to save run time when geometry is included (see

I realize that these instructions are a bit confusing and that OPAL needs to improve on this. We are working on it. If you have any doubts with the geometry generation process, don't hesitate to write me

Best regards,

Dr. Pedro Calvo Portela
Unidad de Aceleradores - CIEMAT
Avenida Complutense 40, Edificio 7
28040 Madrid
Tel: +34 – 91 496 2554

De: opal-request AT <opal-request AT> en nombre de Dragos Constantin <dragos.constantin AT>
Enviado: miércoles, 1 de marzo de 2023 23:08
Para: opal AT
Asunto: [Opal] Geometry and H5hut file format
I know that the GEOMETRY is still experimental, but I would like to test its
capabilities. I have a couple of questions.

Do I have to do anything specific when I compile OPAL to get the GEOMETRY
command working or is it automatically included?

How would you build a H5hut file to incorporate a given surface mesh?


Archive powered by MHonArc 2.6.24.

Top of Page