/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N D E L A G E S T I O N D E L ' E N S E M B L E D E P A R T I C U L E S : */
/* */
/* */
/* Author of '$xrq/particle.M8$I' : */
/* */
/* Jean-Francois Colonna (LACTAMME, 1994??????????). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N D E D E U X P A R T I C U L E S F I C T I V E S N E C E S S A I R E S */
/* A L A G E S T I O N D E L ' E N S E M B L E D E P A R T I C U L E S : */
/* */
/*************************************************************************************************************************************/
#define PARTICULE_NON_DEFINIE \
ADRESSE(particule_non_definie)
DEFV(Local,DEFV(Particule,particule_non_definie));
/* Pour permettre la reference de particules non definies, ce qui est necessaire d'une part */
/* pour initialiser la liste des particules, et d'autre part pour faire des validations. */
#define PARTICULE_INDIFFERENTE \
ADRESSE(particule_indifferente)
DEFV(Local,DEFV(Particule,particule_indifferente));
/* Au cas ou une particule indifferente serait necessaire. */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N D E L A L I S T E D E L ' E N S E M B L E D E P A R T I C U L E S ( F I N ) : */
/* */
/*************************************************************************************************************************************/
CREATION_D_UNE_LISTE(Particule
,premiere_particule,derniere_particule
,nombre_instantane_de_particules
,debordement_de_la_liste_des_particules
,PARTICULE_NON_DEFINIE
);
/* Creation de la liste des particules... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* G E S T I O N D E S E N S E M B L E S D E P A R T I C U L E S : */
/* */
/*************************************************************************************************************************************/
#define CREATION_D_UNE_PARTICULE(particule_a_creer) \
Bblock \
INSERTION_ELEMENT(Particule \
,premiere_particule,derniere_particule \
,nombre_instantane_de_particules \
,debordement_de_la_liste_des_particules \
,PARTICULE_NON_DEFINIE \
,SUIVANTE,PRECEDENTE,VALIDATION \
,particule_a_creer \
,BLOC(EGAL(NOM(particule_a_creer),PARTICULE_NAISSANTE);) \
); \
Eblock \
/* Creation d'une particule. */
#define DESTRUCTION_D_UNE_PARTICULE(particule_a_detruire) \
Bblock \
DESTRUCTION_ELEMENT(Particule \
,premiere_particule,derniere_particule \
,nombre_instantane_de_particules \
,debordement_de_la_liste_des_particules \
,PARTICULE_NON_DEFINIE \
,SUIVANTE,PRECEDENTE,VALIDATION \
,particule_a_detruire \
,BLOC(Test(IFNE(NOM(particule_a_detruire),PARTICULE_INEXISTANTE)) \
Bblock \
EGAL(NOM(particule_a_detruire),PARTICULE_INEXISTANTE); \
Eblock \
ATes \
Bblock \
PRINT_ERREUR("la particule a detruire est deja INEXISTANTE"); \
Eblock \
ETes \
) \
); \
Eblock \
/* Destruction d'une particule. */
#define ENSEMBLE_DES_PARTICULES(sequence) \
Bblock \
PARCOURS_D_UNE_LISTE(Particule \
,premiere_particule,derniere_particule \
,nombre_instantane_de_particules \
,debordement_de_la_liste_des_particules \
,PARTICULE_NON_DEFINIE \
,SUIVANTE,PRECEDENTE,VALIDATION \
,particule_courante \
,BLOC(sequence) \
); \
Eblock \
/* Repetition d'une certaine sequence sur l'ensemble des particules. */
#define COURANTE(particule_courante) \
ACCES_A_UN_ELEMENT_D_UNE_LISTE(particule_courante) \
/* Acces a une particule donnee... */
#define PARTICULE_COURANTE \
COURANTE(particule_courante) \
/* Definition de la particule courante dans la procedure 'ENSEMBLE_DES_PARTICULES(...)'. */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* E T I Q U E T T A G E D E S P A R T I C U L E S : */
/* */
/*************************************************************************************************************************************/
DEFV(Local,DEFV(Positive,INIT(etiquette_de_la_prochaine_particule_a_creer,UN)));
/* Etiquette unique de la prochaine particule a creer... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* T E S T D E P R E S E N C E D A N S L ' U N I V E R S P O U R U N E P A R T I C U L E : */
/* */
/*************************************************************************************************************************************/
#define EXTENSION_DE_L_UNIVERS(dimension) \
GRO2(FRA1(dimension)) \
/* Afin que l'univers des particules soit superieur a l'univers visible... */
#define EST_HORS_DE_L_UNIVERS(particule) \
IFGT(RdisF3D(POSITION_COURANTE_X(particule) \
,POSITION_COURANTE_Y(particule) \
,POSITION_COURANTE_Z(particule) \
,Xcentre_ESPACE \
,Ycentre_ESPACE \
,Zcentre_ESPACE \
) \
,MOIT(RdisF3D(EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,origine,x)) \
,EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,origine,y)) \
,EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,origine,z)) \
,EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,extremite,x)) \
,EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,extremite,y)) \
,EXTENSION_DE_L_UNIVERS(ASD2(espace_physique,extremite,z)) \
) \
) \
) \
/* Test verifiant si la particule argument est dans l'univers de la simulation, l'univers */ \
/* etant une sphere circonscrite au parallelepipede le definissant dans 'espace_physique'. */