Esempio n. 1
0
def initial_print(partial_state):
    print('The initial potential energy is:')
    print(np.average(Energy.potential_energy(partial_state))/pow(MPl, 4))
    print('Initial Phi Gradient energy is:')
    print(np.average(Energy.phi_gradient_energy(partial_state))/pow(MPl, 4))
    print('Initial Chi Gradient energy is:')
    print(np.average(Energy.chi_gradient_energy(partial_state))/pow(MPl, 4))
    print('Initial Phi Kinetic energy is:')
    print(np.average(Energy.phi_kinetic_energy(partial_state))/pow(MPl, 4))
    print('Initial Chi Kinetic energy is:')
    print(np.average(Energy.chi_kinetic_energy(partial_state))/pow(MPl, 4))
    def write_curent_data(self, partial_state, step_num, h):
        self.files_with_data['energyData'].write(repr(partial_state.a))
        self.files_with_data['energyData'].write('	')
        self.files_with_data['energyData'].write(
            repr(np.average(Energy.phi_kinetic_energy(partial_state)) / pow(MPl, 4)))
        self.files_with_data['energyData'].write('	')
        self.files_with_data['energyData'].write(
            repr(np.average(Energy.chi_kinetic_energy(partial_state)) / pow(MPl, 4)))
        self.files_with_data['energyData'].write('	')
        self.files_with_data['energyData'].write(
            repr(np.average(Energy.phi_gradient_energy(partial_state)) / pow(MPl, 4)))
        self.files_with_data['energyData'].write('	')
        self.files_with_data['energyData'].write(
            repr(np.average(Energy.chi_gradient_energy(partial_state)) / pow(MPl, 4)))
        self.files_with_data['energyData'].write('	')
        if write_separate_potential_energy:
            self.files_with_data['energyData'].write(
                repr(np.average(Energy.inflaton_potential_energy(partial_state)) / pow(MPl, 4)))
            self.files_with_data['energyData'].write('	')
            self.files_with_data['energyData'].write(
                repr(np.average(Energy.chi_potential_energy(partial_state)) / pow(MPl, 4)))
            self.files_with_data['energyData'].write('\n')
        else:
            self.files_with_data['energyData'].write(
                repr(np.average(Energy.potential_energy(partial_state)) / pow(MPl, 4)))
            self.files_with_data['energyData'].write('\n')

        # writing fields in program units:
        self.files_with_data['fieldData'].write(repr(partial_state.a))
        self.files_with_data['fieldData'].write('	')
        self.files_with_data['fieldData'].write(repr(partial_state.pa))
        self.files_with_data['fieldData'].write('	')
        self.files_with_data['fieldData'].write(repr(np.average(partial_state.phi)))
        self.files_with_data['fieldData'].write('	')
        self.files_with_data['fieldData'].write(repr(np.average(partial_state.chi)))
        self.files_with_data['fieldData'].write('	')
        self.files_with_data['fieldData'].write(repr(np.average(partial_state.phiPi)))
        self.files_with_data['fieldData'].write('	')
        self.files_with_data['fieldData'].write(repr(np.average(partial_state.chiPi)))
        self.files_with_data['fieldData'].write('\n')
        self.files_with_data['chiMagnitudeData'].write(repr(partial_state.a))
        self.files_with_data['chiMagnitudeData'].write('	')
        self.files_with_data['chiMagnitudeData'].write(repr(np.sqrt(np.average(pw2(partial_state.chi)))))
        self.files_with_data['chiMagnitudeData'].write('\n')

        self.files_with_data['dtList'].write(repr(step_num))
        self.files_with_data['dtList'].write(' ')
        self.files_with_data['dtList'].write(repr(h))
        self.files_with_data['dtList'].write('\n')