.. _python_API_x_force:

.. currentmodule:: flow360

**************************
X Force Distribution
**************************

This script demonstrates the procedure for obtaining and analyzing the axial force distribution along the X-coordinate from a completed Flow360 simulation.
It covers setting up and running a basic aerodynamic simulation for an airplane geometry, accessing the post-processing results for X-force slicing,
and utilizing filtering options to visualize the cumulative drag coefficient (CD) contribution from selected geometry components.

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

Notes
=====

- The axial force distribution is accessed via the ``case.results.x_slicing_force_distribution`` attribute.
- Use the ``.wait()`` method on the result object to ensure the post-processing data is available before accessing it.
- The ``.filter()`` method allows for selective analysis of force contributions from specific geometry parts using ``include``, ``exclude``, or explicit lists of entity names.
