.. _python_API_volumetric_surface:

.. currentmodule:: flow360

**************************
Volumetric and Surface
**************************

This example demonstrates how to configure and retrieve volumetric and surface field data from a steady-state simulation using the Flow360 Python API.
It details the setup for specifying desired output fields (like primitive variables, Mach number, Cp, Cf) for both the entire volume and specific surfaces.
Furthermore, it shows the process of downloading and extracting these results after the simulation completion.

.. literalinclude:: ../../../../../Flow360/examples/post_processing/field_data/volumetric_and_surface.py
  :language: python
  :linenos:

Notes
=====

- The ``fl.VolumeOutput`` and ``fl.SurfaceOutput`` classes within the ``outputs`` list are used to specify the desired field data and target entities.
- Simulation results, including volumetric and surface data files, are accessed through the ``case.results`` object.
- The script uses standard Python libraries (``os``, ``tarfile``, ``tempfile``) to manage the download and extraction of the output archives.
