@staticmethod
def _compute_n_bytes_per_state(header: dict, wordsize: int) ->int:
    """ Computes the number of bytes for every state

        Parameters
        ----------
        header : `dict`
            header information of a d3plot
        wordsize : `int`
            size of every word in bytes in the d3plot

        Returns
        -------
        n_bytes_per_state : `int`
            number of bytes of every state
        """
    if not header:
        return 0
    timestep_offset = 1 * wordsize
    global_vars_offset = header['nglbv'] * wordsize
    n_node_vars = (header['iu'] + header['iv'] + header['ia']) * header['ndim']
    if header['it'] == 1:
        n_node_temp_vars = 1
    elif header['it'] == 2:
        n_node_temp_vars = 4
    elif header['it'] == 3:
        n_node_temp_vars = 6
    else:
        n_node_temp_vars = 0
    if header['has_mass_scaling']:
        n_node_temp_vars += 1
    node_data_offset = int(n_node_vars + n_node_temp_vars) * int(header[
        'numnp']) * int(wordsize)
    therm_data_offset = header['nt3d'] * header['nel8'
        ] * wordsize if 'nt3d' in header else 0
    solid_offset = header['nel8'] * header['nv3d'] * wordsize
    tshell_offset = header['nelth'] * header['nv3dt'] * wordsize
    beam_offset = header['nel2'] * header['nv1d'] * wordsize
    shell_offset = (header['nel4'] - header['numrbe']) * header['nv2d'
        ] * wordsize
    cfd_data_offset = 0
    sph_offset = header['nmsph'] * header['num_sph_vars'] * wordsize
    elem_deletion_offset = 0
    if header['mdlopt'] == 1:
        elem_deletion_offset = header['numnp'] * wordsize
    elif header['mdlopt'] == 2:
        elem_deletion_offset = (header['nel2'] + header['nel4'] + header[
            'nel8'] + header['nelth']) * wordsize
    elif header['mdlopt'] == 0:
        pass
    else:
        err_msg = 'Unexpected value of mdlop: {}, expected was 0, 1 or 2.'
        raise RuntimeError(err_msg.format(header['mdlopt']))
    if 'airbag' in header:
        particle_state_offset = (header['airbag']['npartgas'] * header[
            'airbag']['nstgeom'] + header['airbag']['npart'] * header[
            'airbag']['nvar']) * wordsize
    else:
        particle_state_offset = 0
    road_surface_offset = header['rigid_road']['nsurf'
        ] * 6 * wordsize if 'rigid_road' in header else 0
    if header['has_rigid_body_data']:
        n_rigids = header['nrigid']
        n_rigid_vars = 12 if header['has_reduced_rigid_body_data'] else 24
        rigid_body_motion_offset = n_rigids * n_rigid_vars * wordsize
    else:
        rigid_body_motion_offset = 0
    extra_data_offset = 0
    n_bytes_per_state = (timestep_offset + global_vars_offset +
        node_data_offset + therm_data_offset + solid_offset + tshell_offset +
        beam_offset + shell_offset + cfd_data_offset + sph_offset +
        elem_deletion_offset + particle_state_offset + road_surface_offset +
        rigid_body_motion_offset + extra_data_offset)
    return n_bytes_per_state
