BodiesGenerator - A new GaMField integrated tool to improve potential field data generation

GaMField is a freely available integrated system tool, released in 2011 and upgraded in 2018, able to construct and visualize subsurface 3-D sources and to compute their gravimetric and magnetic effects. Since its first release, scientists and users worldwide have provided feedback and requested to implement new features. In this paper I describe a new tool named “BodiesGenerator”. This tool is an add-on to GaMField package which provides the possibility to quickly generate more articulate geometry bodies.

Even if there are some analytical equations to compute directly the magnetic fields generated by such primitive bodies, it would not be possible to insert magnetization discontinuities. That's why the GaMField prisms approximation is convenient to be used also for such bodies. In fact, the user can change independently the magnetization each prism composing the full body making such body inhomogeneous.
Moreover, an additional need risen up by GaMField use is related to prisms size. In fact, building the actual sources requires a regular equally sized prisms ensemble. Such requirement forces the user to define multiple models and sum their fields if such models are composed by sources sized at very different scale. This is accomplished by the GUI tool named "BodiesGenerator" which is described in this paper. The tool is an independent stand-alone program but it has been also inserted as callable feature in GaMField. This tool will be described in this paper and, as GaMField, it is maintained by INGV (Italian National Institute of Geophysics and Volcanology).

BodiesGenerator description
An extensive description of GaMField main principles and its modules can be found in Pignatelli et al., [2011] and in Pignatelli et al., [2018].
The basic "GaMField idea" is using magnetic and gravimetric field linearity to model complex sources using a set of uniformly magnetized rectangular prisms. The total intensity field at a given location is given by the sum of each prism field at that location.
To build the magnetic/gravimetric sources, the user can specifically set up a calculation volume divided into equal rectangular prisms with uniform magnetization/density, named herein prisms array (see Figure 1). Once such volume has been set up, the user needs to interactively select the prisms and attribute a specific magnetization/density value to model any complex magnetic source.

Alessandro Pignatelli
2 Figure 1. The prisms array. the source is composed selecting prisms to be magnetized by means of horizontal or vertical sections.

BodiesGenerator concepts
BodiesGenerator is specifically designed to produce magnetic sources and to calculate their fields. However, the final produced models can be imported into GaMField as magnetic or gravimetric sources. If the user wants to calculate the gravimetric fields, the chosen magnetization (A/m) values will be considered as density values (g/c.c.) BodiesGenerator final goal is to design magnetized sources called "Models". Models can be imported directly into BodiesGenerator to estimate their magnetic fields or exported to ascii files importable in GaMField or any other software accepting such format [Pignatelli et al., 2011].
As stated in the introduction, the existing ModelBuilder module of GamField requires the input of a single prisms array. If the sizes of the multiple bodies are very different, in order to get the correct resolution, the user needs to set prism sizes to the scale of the smaller prisms.
This means that the larger bodies will be composed by many prisms, with concomitant memory and execution times issues. Alternatively, the user can realize separate models and then sum their fields.
The most important new feature of BodiesGenerator is the possibility to create a model using multiple-prisms arrays.
Basically, a model is composed by multiple sources, and each source will be associated to a single prisms array as shown in Figure 2. It is important to notice that a source is not meant to be a single body but a composition of magnetized geometrical shapes built in the same prisms array (in other words needing the same prisms approximation resolution). According to these concepts, to create a model, a user needs to: 1) Define a prism array 2) Use the provided software tools to compose a source (one or more magnetized bodies) 3) Add the built source to Model

4) Iterate the previous three steps until the Model is complete
All the previous steps will be detailed in the next sections together with BodiesGenerator use description.

Software installation
BodiesGenerator runs only on Microsoft™ Windows platform. Its installation procedures are basically the same as GaMField [Pignatelli et al., 2011;Pignatelli et al., 2018] so users have to register to geosoftware.sci.ingv.it, download the zip file and decompress it into a single folder (preferably using a path containing no spaces). After the decompression, the user has to click the setup icon file and follow the standard windows installation procedures.
This will automatically provide everything is needed. After the installation, the program can run by means of the produced exe file or looking for the program clicking the windows start button. When BodiesGenerator starts, the GUI shown in Figure 3 will appear.

Prism array generation
Once the program has been started, the first need is to generate a prism array. As stated in the introduction, the prism array is a calculation volume divided into equal rectangular prisms. Initially, such prisms are not magnetized and the software features will help the user to select and magnetize some of them to compose magnetic sources.
The prism array can be defined by BodiesGenerator GUI (see Figure 3) in the section "PRISMS ARRAY PARAMETERS".
The edit boxes Northing Start, Easting Start and Depth Start will define the spatial coordinates of the first prism starting point, the edit boxes Northing End, Easting End and Depth End will define the last prism ending point.
Finally, the correspondent three step edit boxes will define prism sizes along the three directions. Once the user has decided such parameters, the prisms array can be created by clicking the button "Create Prisms Array" button. The program will pop up a confirmation message box to confirm the prisms array creation. It is very important to keep in mind that, when clicking "Create Prisms Array" button, all not saved previous work will be lost. In this case, the software will warn the user with a confirmation dialog box.

Magnetic parameters definition
After the prisms array generation, before starting adding sources, another preliminary choice needs to be done.
For each source different magnetic parameters can be selected. The three essential parameters are magnetic inclination, magnetic declination and source magnetization intensity. They can be set by the specific edit boxes in BodiesGenerator GUI under the panel "SOURCE MAGNETIC PARAMETERS". Additional edit boxes have been added to implement magnetic susceptibilities rather than magnetization value. In this case, the user has to fill the edit boxes "Source susceptibility", "Main Field Value", "Main Field Inclination", "Main Field Declination" and click "Compute Magnetization" button. The software will automatically provide the magnetization value into "Source Magnetization" edit box.

Source creations
When all parameters have been set, the user can finally create a source. To accomplish such task, the user has just to select a "Source type" combo box value and set the corresponding parameters according to auxiliary section "source types" provided with the software, where all possible sources and significant parameters are listed and described. Once this has been completed, it is just needed to click "Add Source" button to create source. The software will automatically magnetize all the prisms inside the chosen geometrical figure source type and visualize it by means of a 3d plot. Moreover, a horizontal slice of the created source is shown in order to check geometrical shapes as holed spheres and cylinders that could not be properly seen inside the full source. When creating a source, it is very important to check that source parameters are consistent with prisms array (for example avoid to choose a sphere which center is outside the prisms array) otherwise the software will show an error dialog box. An example of source and its slice is shown in Figure 4.

Add source to model
When the source has been completed, it is possible to add it to the model by means of the button "Add to Model". The software will ask to give a name to the source to be added. The user is recommended to insert a descriptive name. All added sources names will be shown in the "Models List" popup menu and the user will be always able to modify or delete them by means of the specific buttons. Once the source has been added to model, it is considered to be saved into the software RAM so the user can create new prisms array without losing his/her work. The user can see the full model source 3d plot (including the working source) at any time by means of the button "View full Model"

ModelBuilder 2.0
In this GaMField packages update, a new version of ModelBuilder using the concepts described in section 2.1 has been provided. So now, ModelBuilder can only take a model as input. ModelBuilder 2.0 can be called by BodiesGenerator module and it will automatically pass the built model.
As a model is an ensemble of sources created into generally different prism arrays, the user cannot modify the full model at same time. He has to use the combo box "Source" shown in Figure 13 to change geometric and magnetic source features. Up to this point, source modifications can be done as described in Pignatelli et al., [2011] and Pignatelli et al., [2018].
Once the model modifications have been completed, the Model can be saved by means of File ->Save Model. Furthermore, the model can be exported to GaMField format by means of menu File ->Export for GaMField.
Finally, the user can also load a model previously realized and saved by means of menu File ->Load Model.

Field computation and model exporting
When the model has been completed, the user can use BodiesGenerator GUI to compute the produced magnetic field or export the model to be loaded from GaMField.
As described in Pignatelli et al., 2011 andPignatelli et al., 2018, before computing the magnetic field, the user has to specify a survey grid. To accomplish this task, BodiesGenerator provides the section "SURVEY PARAMETERS" where the user can define the survey grid using the same conventions as GaMField main module.
Once the survey grid is defined, the button "Compute Field" needs to be clicked in order to compute the produced magnetic field.
The user can also use the following: 1) File → Load model to load a previous saved model.
2) File → Save model to save the actual model and work on it on a next working session.
3) File → Export actual source to ascii to export the single actual prisms array source and load it into GaMField.

4)
File → Export Full model to ascii to save the model and load it into GaMField. 5) File → Save compute field to export the computed fields, its components and gradients according to the format described in Pignatelli et al., [2011].

Anthropic source example
In order to show BodiesGenerator possibilities a simplification of archeological temple as shown in Figure 14 has been realized. It has been realized by composing six geometric structures: a holed semisphere, four cylinders and a sphere slice as base. By means of ModelBuilder, it has been possible to insert a magnetization perturbation as can be seen in Figure 15. The example is provided with files repository packages. The computed field is shown in Figure 16.

Conclusions
GaMField was freely released for the first time in 2011 and an updated version has been realized in 2018. Since then a lot of users have been registered at website http://geosoftware.sci.ingv.it to download it. During these years, a lot of positive feedback and improvement proposals have been received. This circumstance triggered the effort to release new versions of the software. In this paper BodiesGenerator, a new tool designed to better realize magnetic sources has been described.