コード例 #1
0
    def plot_it(self, ui=None, res_dir=None):
        """Orchestrate output plot generation"""
        print_it("plotting results")
        plt_profiles(res_dir)
        print_it("plotting other", PrintOpts.lvl1.value)
        plt_contact(self.pin, self.disk, PltOpts.DD.value, res_dir,
                    SubDir.contacts.value)
        plt_contact(self.pin, self.disk, PltOpts.DDD.value, res_dir,
                    SubDir.contacts.value)
        plt_3d(self.pin.x_axis, self.pin.y_axis, self.pin.press,
               self.pin.x_label, self.pin.y_label, 'pressure in MPa',
               'contact_pressure_pin', res_dir, SubDir.pressures.value,
               'contact_pressure')
        plt_2d(self.pin.x_axis, self.pin.rel_vel, self.pin.x_label, 'rel vel',
               'rel vel', res_dir, SubDir.energy.value, 'rel_vel')
        plt_2d(self.pin.x_axis, self.pv, self.pin.x_label,
               'pv_rel in {}'.format(Unit.pvrel.value), 'pv_rel', res_dir,
               SubDir.energy.value, 'pv_rel')
        plt_2d_scatt_line(self.pin.x_axis, self.e_akin, self.pin.x_axis,
                          self.e_akin, self.pin.x_label,
                          'e_akin in W $m^{-2}$', 'e_akin', res_dir,
                          SubDir.energy.value, 'e_akin')
        plt_2d_2y_ax(self.pin.x_axis, self.e_akin, self.pin.x_axis, self.pv,
                     self.pin.x_label, 'e_akin vs pv_rel',
                     'e_akin in {}'.format(Unit.eakin.value),
                     'pv_rel in {}'.format(Unit.eakin.value), res_dir,
                     SubDir.energy.value, 'e_akin_vs_pv_rel')

        plt_cum_dist(self.pin.press, 'pressure in {}'.format(Unit.press.value),
                     res_dir, SubDir.pressures.value,
                     'cumulative pressure distribution')
コード例 #2
0
    def plot_it(self, ui=None, res_dir=None):
        """Orchestrate output plot generation"""
        print_it("plotting results")
        plt_profile(self.sun, PltOpts.DD.value, res_dir, SubDir.profiles.value)
        plt_profile(self.sun, PltOpts.DDD.value, res_dir, SubDir.profiles.value)
        plt_profile(self.planet, PltOpts.DD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile(self.planet, PltOpts.DDD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile_approx(res_dir, SubDir.profiles.value)
        plt_contact(self.sun, self.planet, PltOpts.DD.value, res_dir,
                    SubDir.contacts.value)
        plt_contact(self.sun, self.planet, PltOpts.DDD.value, res_dir,
                    SubDir.contacts.value)

        plt_3d(self.sun.x_axis, self.sun.y_axis, self.sun.press,
               self.sun.x_label, self.sun.y_label, 'pressure in MPa',
               'contact_pressure_sun', res_dir, SubDir.pressures.value,
               'contact_pressure_sun')
        plt_2d_scatt_line(self.sun.x_axis, self.pv, self.sun.x_axis, self.pv,
                          self.sun.x_label,
                          'pv_rel in {}'.format(Unit.pvrel.value), 'pv_rel',
                          res_dir, SubDir.energy.value, 'pv_rel')
        plt_2d_scatt_line(self.sun.x_axis, self.sun.e_akin, self.sun.x_axis,
                          self.sun.e_akin, self.sun.x_label,
                          'e_akin in {}'.format(Unit.eakin.value), 'e_akin',
                          res_dir, SubDir.energy.value, 'sun.e_akin')
        plt_2d_scatt_line(self.planet.x_axis, self.planet.e_akin,
                          self.planet.x_axis, self.planet.e_akin,
                          self.planet.x_label,
                          'e_akin in {}'.format(Unit.eakin.value), 'e_akin',
                          res_dir,
                          SubDir.energy.value, 'planet.e_akin')
        plt_energy_ring_on_ring(self, res_dir, SubDir.energy.value,
                                'e-akin-vs-pv-rel')
コード例 #3
0
    def plot_it(self, ui=None, res_dir=None):
        """Orchestrate output plot generation"""
        print_it("plotting results and finishing up")
        plt_profile(self.ball, PltOpts.DD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile(self.ball, PltOpts.DDD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile(self.plate, PltOpts.DD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile(self.plate, PltOpts.DDD.value, res_dir,
                    SubDir.profiles.value)
        plt_profile_approx(res_dir, SubDir.profiles.value)
        plt_contact(self.ball, self.plate, PltOpts.DD.value, res_dir,
                    SubDir.contacts.value)
        plt_contact(self.ball, self.plate, PltOpts.DDD.value, res_dir,
                    SubDir.contacts.value)

        plt_3d(self.ball.x_axis, self.ball.y_axis, self.ball.press,
               self.ball.x_label, self.ball.y_label, 'pressure in MPa',
               'contact pressure', res_dir, SubDir.pressures.value,
               'contact-pressure')
        plt_2d(self.ball.x_axis, self.pv, self.ball.x_label,
               'pv_rel in {}'.format(Unit.pvrel.value), 'pv_rel', res_dir,
               SubDir.energy.value, 'pv_rel')
        plt_2d_scatt_line(self.ball.x_axis, self.e_akin, self.ball.x_axis,
                          self.e_akin, self.ball.x_label,
                          'e_akin in {}'.format(Unit.eakin.value), 'e_akin',
                          res_dir, SubDir.energy.value, 'e_akin')
        plt_2d_2y_ax(self.ball.x_axis, self.e_akin, self.ball.x_axis, self.pv,
                     self.ball.x_label, 'e_akin vs pv_rel',
                     'e_akin in {}'.format(Unit.eakin.value),
                     'pv_rel in {}'.format(Unit.pvrel.value), res_dir,
                     SubDir.energy.value, 'e_akin_vs_pv_rel')
コード例 #4
0
 def generate_latex_figures(self, ui=None, res_dir=None):
     """Generate calculation-specific figures for LaTeX report"""
     plt_contact(self.sun, self.planet, PltOpts.DDD.value, res_dir,
                 SubDir.tex_figs.value, 'contact1')
     plt_profile_approx(res_dir, SubDir.tex_figs.value)
     plt_3d(self.sun.x_axis, self.sun.y_axis, self.sun.press,
            self.sun.x_label, self.sun.y_label, 'pressure in MPa',
            'contact_pressure_sun', res_dir, SubDir.tex_figs.value,
            'pressure1')
     plt_energy_ring_on_ring(self, res_dir, SubDir.tex_figs.value, 'energy1')
コード例 #5
0
 def generate_latex_figures(self, ui=None, res_dir=None):
     """Generate calculation-specific figures for LaTeX report"""
     plt_profile_approx(res_dir, SubDir.tex_figs.value)
     plt_contact(self.ball, self.plate, PltOpts.DDD.value, res_dir,
                 SubDir.tex_figs.value, 'contact1')
     plt_3d(self.ball.x_axis, self.ball.y_axis, self.ball.press,
            self.ball.x_label, self.ball.y_label, 'pressure in MPa',
            'contact pressure', res_dir, SubDir.tex_figs.value, 'pressure1')
     plt_2d_2y_ax(self.ball.x_axis, self.e_akin, self.ball.x_axis, self.pv,
                  self.ball.x_label, 'e_akin vs pv_rel',
                  'e_akin in {}'.format(UnitTex.eakin.value),
                  'pv_rel in {}'.format(UnitTex.pvrel.value), res_dir,
                  SubDir.tex_figs.value, 'energy1')
コード例 #6
0
    def generate_latex_figures(self, ui=None, res_dir=None):
        """Generate calculation-specific figures for LaTeX report"""
        plt_contact(self.pin, self.disk, PltOpts.DDD.value, res_dir,
                    SubDir.tex_figs.value, 'contact1')
        plt_profile_approx(res_dir, SubDir.tex_figs.value)
        plt_3d(self.pin.x_axis, self.pin.y_axis, self.pin.press,
               self.pin.x_label, self.pin.y_label, 'pressure in MPa',
               'contact_pressure_pin', res_dir, SubDir.tex_figs.value,
               'pressure1')

        plt_2d_2y_ax(self.pin.x_axis, self.e_akin, self.pin.x_axis, self.pv,
                     self.pin.x_label, 'e_akin vs pv_rel',
                     'e_akin in W $\mathregular{m^{-2}}$',
                     'pv_rel in W $\mathregular{m^{-2}}$', res_dir,
                     SubDir.tex_figs.value, 'energy1')
コード例 #7
0
 def plt_profiles_contacts(self, res_dir):
     """Generate plots of profiles and contacts"""
     print_it("plotting contacts", PrintOpts.lvl1.value)
     plt_contact(self.roller, self.ring1, PltOpts.DD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring1, PltOpts.DDD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring2, PltOpts.DD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring2, PltOpts.DDD.value, res_dir,
                 SubDir.contacts.value)
コード例 #8
0
 def generate_latex_figures(self, ui=None, res_dir=None):
     """Generate calculation-specific figures for LaTeX report"""
     plt_profile_approx(res_dir, SubDir.tex_figs.value)
     plt_contact(self.roller, self.ring1, PltOpts.DDD.value, res_dir,
                 SubDir.tex_figs.value, 'contact1')
     plt_3d(self.roller.x_axis, self.roller.y_axis, self.ring1.press[:, :],
            self.roller.x_label, self.roller.y_label,
            'pressure in MPa', 'pressure at highest normal force', res_dir,
            SubDir.tex_figs.value, 'pressure1')
     plt_2d_scatt_line(self.roller.x_axis, self.roller.slip,
                       self.roller.x_axis, self.roller.slip,
                       self.roller.x_label, "roller slip in percent (0-1)",
                       "roller slip", res_dir,
                       SubDir.tex_figs.value, "slip1")
     plt_2d_2y_ax(self.roller.x_axis, self.e_akin, self.roller.x_axis,
                  self.pv, self.roller.x_label, 'e_akin vs pv_rel',
                  'e_akin in {}'.format(Unit.eakin.value),
                  'pv_rel in {}'.format(Unit.pvrel.value), res_dir,
                  SubDir.tex_figs.value, 'energy1')
コード例 #9
0
 def generate_latex_figures(self, ui=None, res_dir=None):
     """Generate calculation-specific part of the LaTeX output file"""
     plt_profile_approx(res_dir, SubDir.tex_figs.value)
     plt_contact(self.ball, self.disk, PltOpts.DDD.value, res_dir,
                 SubDir.tex_figs.value, 'contact1')
     plt_3d(self.ball.x_axis, self.ball.y_axis, self.ball.press,
            self.ball.x_label, self.ball.y_label,
            'pressure in {}'.format(UnitTex.pressure.value),
            'contact_pressure_ball', res_dir, SubDir.tex_figs.value,
            'pressure1')
     plt_2d_2y_ax(self.ball.x_axis, self.ball.e_akin, self.ball.x_axis,
                  self.pv, self.ball.x_label, 'e_akin vs pv_rel',
                  'e_akin in {}'.format(UnitTex.eakin.value),
                  'pv_rel in {}'.format(UnitTex.pvrel.value), res_dir,
                  SubDir.tex_figs.value, 'energy1')
     plt_2d_2y_ax(self.disk.x_axis, self.disk.e_akin, self.disk.x_axis,
                  self.pv, self.disk.x_label, 'e_akin vs pv_rel',
                  'e_akin in {}'.format(UnitTex.eakin.value),
                  'pv_rel in {}'.format(UnitTex.pvrel.value), res_dir,
                  SubDir.tex_figs.value, 'energy2')
コード例 #10
0
 def plot_it(self, ui=None, res_dir=None):
     """Orchestrate output plot generation"""
     print_it("plotting results and finishing up")
     plt_profile(self.rot_ball, PltOpts.DD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.rot_ball, PltOpts.DDD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.stat_ball, PltOpts.DD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.stat_ball, PltOpts.DDD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile_approx(res_dir, SubDir.profiles.value)
     plt_contact(self.rot_ball, self.stat_ball, PltOpts.DD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.rot_ball, self.stat_ball, PltOpts.DDD.value, res_dir,
                 SubDir.contacts.value)
     plt_3d(self.rot_ball.x_axis, self.rot_ball.y_axis, self.rot_ball.press,
            self.rot_ball.x_label,
            self.rot_ball.y_label, 'pressure in MPa', 'contact_pressure',
            res_dir, SubDir.pressures.value,
            'contact-pressure')
     plt_2d_scatt_line(self.rot_ball.x_axis, self.pv, self.rot_ball.x_axis,
                       self.pv, self.rot_ball.x_label,
                       'pv_rel in W $\mathregular{m^{-2}}$', 'pv_rel',
                       res_dir, SubDir.energy.value,
                       'pv_rel')
     plt_2d_scatt_line(self.stat_ball.x_axis, self.e_akin,
                       self.stat_ball.x_axis, self.e_akin,
                       self.stat_ball.x_label, 'a_akin in W $m^{-2}$',
                       'e_akin', res_dir,
                       SubDir.energy.value, 'e_akin')
     plt_2d_2y_ax(self.stat_ball.x_axis, self.e_akin, self.stat_ball.x_axis,
                  self.pv, self.stat_ball.x_label,
                  'e_akin vs pv_rel', 'e_akin in W $\mathregular{m^{-2}}$',
                  'pv_rel in W $\mathregular{m^{-2}}$',
                  res_dir, SubDir.energy.value, 'e_akin_vs_pv_rel')
コード例 #11
0
 def plt_profiles_and_contacts(self, res_dir):
     """Generate plots of profiles and contacts"""
     plt_profile(self.roller, PltOpts.DD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.roller, PltOpts.DDD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.ring1, PltOpts.DD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.ring1, PltOpts.DDD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.ring2, PltOpts.DD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile(self.ring2, PltOpts.DDD.value, res_dir,
                 SubDir.profiles.value)
     plt_profile_approx(res_dir, SubDir.profiles.value)
     plt_contact(self.roller, self.ring1, PltOpts.DD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring1, PltOpts.DDD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring2, PltOpts.DD.value, res_dir,
                 SubDir.contacts.value)
     plt_contact(self.roller, self.ring2, PltOpts.DDD.value, res_dir,
                 SubDir.contacts.value)
コード例 #12
0
    def generate_latex_figures(self, ui=None, res_dir=None):
        """Append system-specific output data to latex file"""
        max_press_field_ring1 = self.ring1.press[:, :, 0, 0]
        max_press_field_ring2 = self.ring2.press[:, :, 0, 0]

        plt_profile_approx(res_dir, SubDir.tex_figs.value)
        plt_contact(self.roller, self.ring1, PltOpts.DDD.value, res_dir,
                    SubDir.tex_figs.value, 'contact1')
        plt_contact(self.roller, self.ring2, PltOpts.DDD.value, res_dir,
                    SubDir.tex_figs.value, 'contact2')
        polplt_scatt_line(self.pol_coords_slip, self.slip_data, self.pol_ax,
                          self.roller.slip, 'roller slip', 'roller slip',
                          res_dir, SubDir.tex_figs.value, 'slip1')

        plt_3d(self.roller.x_axis, self.roller.y_axis, max_press_field_ring1,
               self.roller.x_label, self.roller.y_label, 'Pressure in MPa',
               'pressure at highest normal force', res_dir,
               SubDir.tex_figs.value, 'pressure1')

        plt_3d(self.roller.x_axis, self.roller.y_axis, max_press_field_ring2,
               self.roller.x_label, self.roller.y_label, 'Pressure in MPa',
               'pressure at highest normal force', res_dir,
               SubDir.tex_figs.value, 'pressure2')

        polplt_scatt_line(
            np.append(self.phi_mat[0, :], self.phi_mat[0, 0]),
            np.append(self.roller_norm_forces[0, :],
                      self.roller_norm_forces[0, 0]),
            np.append(self.phi_mat[0, :], self.phi_mat[0, 0]),
            np.append(self.roller_norm_forces[0, :],
                      self.roller_norm_forces[0, 0]), 'normal force in N',
            'load distribution', res_dir, SubDir.tex_figs.value, 'load1')

        plot_axis_pol = np.linspace(-math.pi,
                                    math.pi - 2 * math.pi / self.res_pol,
                                    int(self.res_pol))
        plot_data_ring1 = np.concatenate(
            (self.ring1.pv[round(self.res_pol / 2) - 1:-1, :],
             self.ring2.pv[0:round(self.res_pol / 2), :]),
            axis=0)
        plot_data_ring2 = np.concatenate(
            (self.ring2.pv[round(self.res_pol / 2) - 1:-1, :],
             self.ring2.pv[0:round(self.res_pol / 2), :]),
            axis=0)

        polplt_line_line(
            plot_axis_pol, plot_data_ring1[:,
                                           round(self.roller.res_x / 2) - 1],
            plot_axis_pol, plot_data_ring2[:,
                                           round(self.roller.res_x / 2) - 1],
            'pv in {}'.format(Unit.pvrel.value),
            'pv_rel inner (max) and outer ring', 'inner ring (max)',
            'outer ring', res_dir, SubDir.tex_figs.value, 'energy1')

        if self.rot_vel1 == 0:
            plot_data = np.concatenate(
                (self.ring1.e_akin.transpose()[round(self.res_pol / 2) -
                                               1:-1, :],
                 self.ring1.e_akin.transpose()[0:round(self.res_pol / 2), :]),
                axis=0)
            polplt_line(plot_axis_pol,
                        plot_data[:, round(self.roller.res_x / 2) - 1],
                        'e_a,kin_rel max in {}'.format(Unit.eakin.value),
                        'e_a,kin max inner ring', res_dir,
                        SubDir.tex_figs.value, 'energy2')
        else:
            plt_2d_scatt_line(self.roller.x_axis, self.ring1.e_akin,
                              self.roller.x_axis, self.ring1.e_akin,
                              self.roller.x_label,
                              'average e_a,kin in {}'.format(Unit.eakin.value),
                              'average e_a,kin inner ring', res_dir,
                              SubDir.tex_figs.value, 'energy2')
        if self.rot_vel2 == 0:
            plot_data = np.concatenate(
                (self.ring2.e_akin.transpose()[round(self.res_pol / 2) -
                                               1:-1, :],
                 self.ring2.e_akin.transpose()[0:round(self.res_pol / 2), :]),
                axis=0)
            polplt_line(plot_axis_pol,
                        plot_data[:, round(self.roller.res_x / 2) - 1],
                        'e_a,kin_rel max in {}'.format(Unit.eakin.value),
                        'e_a,kin max outer ring', res_dir,
                        SubDir.tex_figs.value, 'energy3')
        else:
            plt_2d_scatt_line(self.roller.x_axis, self.ring2.e_akin,
                              self.roller.x_axis, self.ring2.e_akin,
                              self.roller.x_label,
                              'average e_a,kin in {}'.format(Unit.eakin.value),
                              'average e_a,kin outer ring', res_dir,
                              SubDir.tex_figs.value, 'energy3')