diff --git a/qpms/scatsystem.c b/qpms/scatsystem.c index 900d5c8..fc3e708 100644 --- a/qpms/scatsystem.c +++ b/qpms/scatsystem.c @@ -400,6 +400,7 @@ static void add_orbit_type(qpms_scatsys_t *ss, const qpms_ss_orbit_type_t *ot_cu "The cumulative size of the symmetry-adapted bases is wrong; " "expected %d = %d * %d, got %d.", ot_new->size * bspecn, ot_new->size, bspecn, bs_cumsum); + ot_new->instance_count = 0; } @@ -580,7 +581,9 @@ qpms_scatsys_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, const qp const qpms_ss_pi_t pi_opi = current_orbit[opi]; ss->p_orbitinfo[pi_opi].t = oti; ss->p_orbitinfo[pi_opi].p = opi; + ss->p_orbitinfo[pi_opi].osn = ss->orbit_types[oti].instance_count; } + ss->orbit_types[oti].instance_count++; } } // Possibly free some space using the new ss->p_count instead of (old) ss->p_count*sym->order diff --git a/qpms/scatsystem.h b/qpms/scatsystem.h index f1f2438..4cafecd 100644 --- a/qpms/scatsystem.h +++ b/qpms/scatsystem.h @@ -352,13 +352,15 @@ typedef struct qpms_ss_orbit_type_t { * TODO doc. */ complex double *irbases; - + /// TODO doc. + size_t instance_count; } qpms_ss_orbit_type_t; /// Auxillary type used in qpms_scatsys_t that identifies the particle's orbit and its id inside that orbit. typedef struct qpms_ss_particle_orbitinfo { qpms_ss_oti_t t; ///< Orbit type. #define QPMS_SS_P_ORBITINFO_UNDEF (-1) ///< This labels that the particle has not yet been assigned to an orbit. + ptrdiff_t osn; ///< "Serial number" of the orbit in the given type. TODO type and more doc. qpms_ss_orbit_pi_t p; ///< Order (sija, ei rankki) of the particle inside that orbit type. } qpms_ss_particle_orbitinfo_t;