# BoundaryNormal¶

## Description¶

Compute the outward normal vectors at centers of 1D or 2D mesh elements in the Cartesian/cylindrical coordinate system. The input data is the boundaries of a geometric volume or surface.

The normal vector field points towards the outside of the domain by default.
This is slightly different from
`antares.treatment.TreatmentCellNormal`

.

## Parameters¶

**base**:`Base`

The input base representing a geometric volume or surface with boundary conditions. The boundary conditions of the base are modified in-place at the output.

**coordinates**:`list(str)`

The ordered coordinate names of the Cartesian coordinate system.

**cylindrical_coordinates**:`list(str)`

, default=*None*The ordered coordinate names of the cylindrical coordinate system. If set, the components of the normal vector will also be given in the cylindrical coordinate system.

**orientation**:`int`

in [-1, 1], default=*1*Normal orientation.

1: the outward orientation or towards the outside of the bounded domain.

-1: the inward orientation or towards the inside of the bounded domain.

For unstructured grids, it is assumed that the connectivity already respects the outward orientation. For structured grids, if the chosen orientation is the opposite of the one given by the connectivity, then note that the connectivity still remains unchanged.

**unit**:`bool`

, default=*False*If True then the output vectors are unit vectors.

## Preconditions¶

The treatment only works on a 2D or 3D dataset that owns boundary conditions.

If **cylindrical_coordinates** is specified, the first Cartesian coordinate is
the revolution axis.

## Postconditions¶

The boundary conditions of the input **base** are modified in-place at the
output.
They extended with the components of the normal vector for each mesh element.
The three components of the normal vector in the Cartesian coordinate system
are named with the following convention:
(‘normal_<Cartesian_coordinate_name>’, ‘cell’).
The cell surface is stored under (‘surface’, ‘cell’).

If **cylindrical_coordinates** is given, then the three components of the
normal vector are also given in the cylindrical coordinate system:
(‘normal_<cylindrical_coordinate_name>’, ‘cell’).

## Example¶

The following example computes unit normal vectors at cell centers.

```
myt = ant.Treatment('BoundaryNormal')
myt['base'] = base
myt['coordinates'] = ['x', 'y', 'z']
myt['unit'] = True
myt.execute()
```