parallel-io/heat-restart/c/utilities.c
void allocate_field(field *temperature)
{
    // Allocate also ghost layers
    temperature->data =
        malloc_2d(temperature->nx + 2, temperature->ny + 2);

    // Initialize to zero
    memset(temperature->data[0], 0.0,
           (temperature->nx + 2) * (temperature->ny + 2) * sizeof(double));
}
/* Allocate memory for a temperature field and initialise it to zero */
Allocate memory for a temperature field and initialise it to zero
Allocate memory for a temperature field and initialise it to zero
void allocate_field(field *temperature)
{
    temperature->data =
        malloc_2d(temperature->nx + 2, temperature->ny + 2);
    memset(temperature->data[0], 0.0,
           (temperature->nx + 2) * (temperature->ny + 2) * sizeof(double));
}
void allocate_field ( field * temperature ) { temperature -> data = malloc_2d ( temperature -> nx + 2 , temperature -> ny + 2 ) ; memset ( temperature -> data [ 0 ] , 0.0 , ( temperature -> nx + 2 ) * ( temperature -> ny + 2 ) * sizeof ( double ) ) ; }
Allocate memory for a temperature field and initialise it to zero
Allocate memory for a temperature field and initialise it to zero
// Allocate also ghost layers // Initialize to zero