# GasFile generate problem

**URL:** <https://root-forum.cern.ch/t/gasfile-generate-problem/64118>\
**Category:** Garfield++\
**Created:** [September 4, 2025, 8:35am UTC](https://root-forum.cern.ch/t/gasfile-generate-problem/64118 "2025-09-04T08:35:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Migu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Migu](https://root-forum.cern.ch/u/Migu)\
**Post date:** [September 4, 2025, 8:35am UTC](https://root-forum.cern.ch/t/gasfile-generate-problem/64118/1 "2025-09-04T08:35:31Z")

</div>

Hi,

When I was generating the gas file, the program got stuck at 483293V. The program is still running, but after waiting here for several hours, no new results have been generated.

 ![1756974889311](https://root-forum.cern.ch/uploads/default/original/3X/1/d/1d85df91210e00f1ca089d40c3011576785fb35d.jpeg)

 ![1756974823466](https://root-forum.cern.ch/uploads/default/original/3X/d/6/d60bce83335377a48493f9ad8f292ea50f4e4dac.jpeg)

(Where the program stuck)

![image](https://root-forum.cern.ch/uploads/default/original/3X/1/9/19ccc211b67baae89557e0ce8122666da3007d61.png)

The code I used is as follows:

```auto
#include "Garfield/FundamentalConstants.hh"
#include "Garfield/MediumMagboltz.hh"

using namespace Garfield;

int main(int argc, char* argv[]) {
  const double pressure = 0.26 * AtmosphericPressure;
  const double temperature = 300;

  // Setup the gas.
  MediumMagboltz gas("Ar", 85., "CO2", 15.);
  gas.SetTemperature(temperature);
  gas.SetPressure(pressure);

  // Set the field range to be covered by the gas table.
  const size_t nE = 20;
  const double emin = 1000.;
  const double emax = 1000000.;
  // Flag to request logarithmic spacing.
  constexpr bool useLog = true;
  gas.SetFieldGrid(emin, emax, nE, useLog);

  const int ncoll = 10;
  // Run Magboltz to generate the gas table.
  gas.GenerateGasTable(ncoll);
  // Save the table.
  gas.WriteGasFile("ar_85_co2_15.gas");
}

```

---

<div class="post-metadata">

**Author:** ![Piet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/piet/32/12536_2.png) [@Piet](https://root-forum.cern.ch/u/Piet)\
**Post date:** [September 4, 2025, 8:54am UTC](https://root-forum.cern.ch/t/gasfile-generate-problem/64118/2 "2025-09-04T08:54:39Z")

</div>

Hi, especially at very high fields this is normal behaviour, and a single step (so without update to the terminal) can easily take \> 4h. You likely got stuck on the penultimate HV point. I would propose you let it run overnight. Alternatively you can run 2 separate gasfiles, one from 1kV/cm to 100kV/cm (in 15-20 steps), and a 2nd one that will go much slower from 100kV/cm to 1MV/cm (in 3-5 steps). Like this you do not lose the computing time for the first points. In your program you can load the two gasfiles and they will be merged.

greets  
Piet

---

<div class="post-metadata">

**Author:** ![Migu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Migu](https://root-forum.cern.ch/u/Migu)\
**Post date:** [September 5, 2025, 1:03am UTC](https://root-forum.cern.ch/t/gasfile-generate-problem/64118/3 "2025-09-05T01:03:36Z")

</div>

Hi,

Thanks for your reply. I was stuck for another 9 hours and terminated the program directly.

> Alternatively you can run 2 separate gasfiles, one from 1kV/cm to 100kV/cm (in 15-20 steps), and a 2nd one that will go much slower from 100kV/cm to 1MV/cm (in 3-5 steps).

I will try to generate two gas files.

Sincerely

Migu

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [September 19, 2025, 1:03am UTC](https://root-forum.cern.ch/t/gasfile-generate-problem/64118/4 "2025-09-19T01:03:53Z")

</div>

Closed on September 19, 2025, 1:03am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
