5.1 Some init

In order to read this file, we have to create a format file :  /.Nbody/formats/simpleformat.py. First add the following lines that tells pNbody which functions to use when reading and writing a file. Here, the functions will be self.read_particles and self.write_particles.

class Nbody_simpleformat(NbodyDefault):
  
  def get_read_fcts(self):
    return [self.read_particles]
    
  def get_write_fcts(self):
    return [self.write_particles]

Now, if you need it, specify specific variables and their default values, with the function get_spec_vars

    
  def get_spec_vars(self):
    '''
    return specific variables default values for the class
    '''
    return {'tnow'   :0.,
            'ngas'   :0,
            'nstars' :0
	    }

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