CellNormal

Description

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

The direction of the normal vector field is implicitly given by the connectivity of elements. This is slightly different from antares.treatment.TreatmentBoundaryNormal with which the direction is explicitly chosen.

Parameters

  • base: Base

    The input base representing a geometric surface or line. The base is 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 orientation defined by the connectivity of elements.

    • -1: the opposite orientation.

  • origin: list(float), default= None

    Coordinates of the origin point used to set up the normal orientation. If it is not given, the orientation depends on the ordering of the mesh element nodes.

  • unit: bool, default= False

    If True then the output vectors are unit vectors.

  • auto_orient: class:bool, default= False

    If True then all normals are oriented in the same direction. Note that this may be memory and time consuming.

Preconditions

The treatment only works on a 1D or 2D dataset. Geometric 2D elements are in a 3D physical space (3 coordinates). Geometric 1D elements are in a 2D physical space (2 coordinates).

If cylindrical_coordinates is specified, the first cartesian coordinate is the revolution axis.

If auto_orient is True, the connectivity array must contain information for non-disjoint mesh parts. You may use antares.treatment.TreatmentMerge with the options duplicates_detection and tolerance_decimals to merge all zones in a single one.

Postconditions

The input base is modified in-place, 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('CellNormal')
myt['base'] = base
myt['coordinates'] = ['x', 'y', 'z']
myt['unit'] = True
myt.execute()

Main functions

class antares.treatment.TreatmentCellNormal.TreatmentCellNormal
execute()

Compute the normal vector of mesh elements.