/*============================================================================
 * Define postprocessing output.
 *============================================================================*/

/* VERS */

/*
  This file is part of code_saturne, a general-purpose CFD tool.

  Copyright (C) 1998-2024 EDF S.A.

  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
  Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/*----------------------------------------------------------------------------*/

#include "cs_defs.h"

/*----------------------------------------------------------------------------
 * Standard C library headers
 *----------------------------------------------------------------------------*/

#include "stdlib.h"
#include "string.h"

/*----------------------------------------------------------------------------
 * Local headers
 *----------------------------------------------------------------------------*/

#include "cs_headers.h"

/*----------------------------------------------------------------------------*/

BEGIN_C_DECLS

/*============================================================================
 * Local (user defined) function definitions
 *============================================================================*/

/*----------------------------------------------------------------------------*/
/*!
 * \brief Define monitoring probes and profiles.
 *
 * Profiles are defined as sets of probes.
 */
/*----------------------------------------------------------------------------*/

void
cs_user_postprocess_probes(void)
{
  /* Define monitoring probes */

  /* A writer (id = CS_POST_WRITER_PROBES) using the format "time_plot" is
     associated by default to a set of monitoring probes.
     This is not the case for a profile. */

  /*! [post_define_probes_1] */
  {
    cs_probe_set_t  *pset = cs_probe_set_create("Monitoring");

    if (pset != NULL) {

      cs_probe_set_add_probe(pset,  0.751,  0.325,  0.001, "M1");
      cs_probe_set_add_probe(pset,  0.751,  0.327,  0.001, "M2");
      cs_probe_set_add_probe(pset,  0.751,  0.329,  0.001, "M3");
      ......
      cs_probe_set_add_probe(pset,  0.901,  0.425,  0.201, "M199002");



    } else {
      fprintf(stderr, "Error: Could not create probe set 'Monitoring'\n");
      return;
    }
  }
  /*! [post_define_probes_1] */

  /*! [post_set_probes_interpolate] */
  {
    cs_probe_set_t  *pset = cs_probe_set_get("Monitoring");

    if (pset != NULL) {
      cs_probe_set_option(pset, "interpolation", "1");
    } else {
      fprintf(stderr, "Error: Probe set 'Monitoring' not found\n");
    }
  }
  /*! [post_set_probes_interpolate] */
}

void
cs_user_postprocess_values(const char            *mesh_name,
                           int                    mesh_id,
                           int                    cat_id,
                           cs_probe_set_t        *probes,
                           cs_lnum_t              n_cells,
                           cs_lnum_t              n_i_faces,
                           cs_lnum_t              n_b_faces,
                           cs_lnum_t              n_vertices,
                           const cs_lnum_t        cell_list[],
                           const cs_lnum_t        i_face_list[],
                           const cs_lnum_t        b_face_list[],
                           const cs_lnum_t        vertex_list[],
                           const cs_time_step_t  *ts);

/*----------------------------------------------------------------------------*/

END_C_DECLS
