Exemplo n.º 1
0
void done_mdoutf(gmx_mdoutf_t of)
{
    if (of->fp_ene != NULL)
    {
        close_enx(of->fp_ene);
    }
    if (of->fp_xtc)
    {
        close_xtc(of->fp_xtc);
    }
    if (of->fp_trn)
    {
        close_trn(of->fp_trn);
    }
    if (of->fp_dhdl != NULL)
    {
        gmx_fio_fclose(of->fp_dhdl);
    }
    if (of->fp_field != NULL)
    {
        gmx_fio_fclose(of->fp_field);
    }
    gmx_tng_close(&of->tng);
    gmx_tng_close(&of->tng_low_prec);

    sfree(of);
}
Exemplo n.º 2
0
void done_mdoutf(gmx_mdoutf_t of)
{
    if (of->fp_ene != NULL)
    {
        close_enx(of->fp_ene);
    }
    if (of->fp_xtc)
    {
        close_xtc(of->fp_xtc);
    }
    if (of->fp_trn)
    {
        gmx_trr_close(of->fp_trn);
    }
    if (of->fp_dhdl != NULL)
    {
        gmx_fio_fclose(of->fp_dhdl);
    }
    if (of->fp_field != NULL)
    {
        /* This is opened sometimes with xvgropen, sometimes with
         * gmx_fio_fopen, so we use the least common denominator for closing.
         */
        gmx_fio_fclose(of->fp_field);
    }

    gmx_tng_close(&of->tng);
    gmx_tng_close(&of->tng_low_prec);

    sfree(of);
}
Exemplo n.º 3
0
void mdoutf_tng_close(gmx_mdoutf_t of)
{
    if (of->tng || of->tng_low_prec)
    {
        wallcycle_start(of->wcycle, ewcTRAJ);
        gmx_tng_close(&of->tng);
        gmx_tng_close(&of->tng_low_prec);
        wallcycle_stop(of->wcycle, ewcTRAJ);
    }
}
Exemplo n.º 4
0
static void list_tng(const char gmx_unused *fn)
{
#ifdef GMX_USE_TNG
    tng_trajectory_t     tng;
    gmx_int64_t          nframe = 0;
    gmx_int64_t          i, *block_ids = NULL, step, ndatablocks;
    gmx_bool             bOK;

    gmx_tng_open(fn, 'r', &tng);
    gmx_print_tng_molecule_system(tng, stdout);

    bOK    = gmx_get_tng_data_block_types_of_next_frame(tng, -1,
             0,
             NULL,
             &step, &ndatablocks,
             &block_ids);
    do
    {
        for (i = 0; i < ndatablocks; i++)
        {
            double               frame_time;
            real                 prec, *values = NULL;
            gmx_int64_t          n_values_per_frame, n_atoms;
            char                 block_name[STRLEN];

            gmx_get_tng_data_next_frame_of_block_type(tng, block_ids[i], &values,
                    &step, &frame_time,
                    &n_values_per_frame, &n_atoms,
                    &prec,
                    block_name, STRLEN, &bOK);
            if (!bOK)
            {
                /* Can't write any output because we don't know what
                   arrays are valid. */
                fprintf(stderr, "\nWARNING: Incomplete frame at time %g, will not write output\n", frame_time);
            }
            else
            {
                list_tng_inner(fn, (0 == i), values, step, frame_time,
                               n_values_per_frame, n_atoms, prec, nframe, block_name);
            }
        }
        nframe++;
    }
    while (gmx_get_tng_data_block_types_of_next_frame(tng, step,
            0,
            NULL,
            &step,
            &ndatablocks,
            &block_ids));

    if (block_ids)
    {
        sfree(block_ids);
    }

    gmx_tng_close(&tng);
#endif
}
Exemplo n.º 5
0
void close_trx(t_trxstatus *status)
{
    gmx_tng_close(&status->tng);
    if (status->fio)
    {
        gmx_fio_close(status->fio);
    }
    sfree(status);
}
Exemplo n.º 6
0
void close_trx(t_trxstatus *status)
{
    if (status == nullptr)
    {
        return;
    }
    gmx_tng_close(&status->tng);
    if (status->fio)
    {
        gmx_fio_close(status->fio);
    }
    sfree(status);
}
Exemplo n.º 7
0
void close_trj(t_trxstatus *status)
{
    gmx_tng_close(&status->tng);
    if (status->fio)
    {
        gmx_fio_close(status->fio);
    }

    /* The memory in status->xframe is lost here,
     * but the read_first_x/read_next_x functions are deprecated anyhow.
     * read_first_frame/read_next_frame and close_trx should be used.
     */
    sfree(status);
}
Exemplo n.º 8
0
void close_trx(t_trxstatus *status)
{
    if (status == nullptr)
    {
        return;
    }
    gmx_tng_close(&status->tng);
    if (status->fio)
    {
        gmx_fio_close(status->fio);
    }
    sfree(status->persistent_line);
#if GMX_USE_PLUGINS
    sfree(status->vmdplugin);
#endif
    /* The memory in status->xframe is lost here,
     * but the read_first_x/read_next_x functions are deprecated anyhow.
     * read_first_frame/read_next_frame and close_trx should be used.
     */
    sfree(status);
}