Swap Axes

Swap the axis of a base. Set i and j as the axis system for two-dimensional structured base.

Parameters

  • base: Base

    The Base on which the swapping will be performed.

Preconditions

Swapping is based on the axes of the FIRST zone, and is applied to all zones. The orientation remains unchanged: either right-handed orientation or left-handed orientation.

Main functions

class antares.treatment.TreatmentSwapAxes.TreatmentSwapAxes
execute()

Execute the treatment.

Returns:

a new base with swapped axis

Return type:

Base

Example

import os
if not os.path.isdir('OUTPUT'):
    os.makedirs('OUTPUT')

from antares import Reader, Treatment, Writer

r = Reader('hdf_cgns')
r['filename'] = os.path.join('..', 'data', 'SHEARLAYER', 'Delville_mmfinal4_047.cgns')
base = r.read()

print(base)
print(base[0])
print(base[0].boundaries)
print(base[0].boundaries[0])

t = Treatment('swapaxes')
t['base'] = base
base = t.execute()

print(base)
print(base[0])
print(base[0].boundaries)
print(base[0].boundaries[0])

w = Writer('hdf_cgns')
w['base'] = base
w['filename'] = os.path.join('OUTPUT', 'ex_swap_Delville_mmfinal4_047.hdf')
w.dump()