7.2 Init functions

init( )
Initialize a model. Ensure that all variables are well defined.

set_ftype( [ftype='binary'],[npart=None])
Return a new object with a type defined by ftype.

>>> from pNbody import *
>>> nb = Nbody('disk.gad',ftype='gadget')
>>> nb.ftype
'Nbody_gadget'
>>> nb = nb.set_ftype('binary')
>>> nb.ftype
'Nbody_binary'

get_num( )
Compute the num variable in order to be consistent with npart.

get_spec_vars( )
Return specific variables default values for the class

set_pio( pio)
Set parallel input/output or not io. pio may be "yes" or "no".

rename( p_name)
Rename the file(s). p_name may be a string or a list of string, in case of multiple files.

set_filenames( p_name,[pio=None])
Set the local and global names, in case of parallel input/output.

print_filenames( )
Print files names

get_massarr_and_nzero( )
Return the massarr and nzero variables, computed from mass.

See About this document... for information on suggesting changes.