$$$$ POSI NOTICE BP208322 21/10/25 21:15:08 11146 DATE 21/10/25 Operateur POSI Voir aussi : EXIS,DANS -------------- Section : Langage Objets Section : Langage Caracteres FRAN=========================================================== Objet : _______ L'opérateur POSI recherche la ou les positions d'un ou plusieurs items au sein d'une liste. Syntaxe : _________ OBJET1 = POSI OBJET2 'DANS' OBJET3 (OBJET4) ('TOUS') Types possibles detailles ci-apres : => Cherche la premiere occurrence d'un item dans une liste ENTIER = POSI ENTIER 'DANS' LISTENTI ; ENTIER = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) ; ENTIER = POSI MOT 'DANS' LISTMOTS ('NOCA') ; ENTIER = POSI MOT 'DANS' MOT ('NOCA') ; ENTIER = POSI POINT 'DANS' MAILLAGE ; => Cherche toutes les occurrences d'un item dans une liste LISTENTI = POSI ENTIER 'DANS' LISTENTI 'TOUS' ; LISTENTI = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) 'TOUS' ; LISTENTI = POSI MOT 'DANS' LISTMOTS ('NOCA') 'TOUS' ; LISTENTI = POSI MOT 'DANS' MOT ('NOCA') 'TOUS' ; LISTENTI = POSI POINT 'DANS' MAILLAGE 'TOUS' ; => Cherche la premiere occurrence de plusieurs items dans une liste LISTENTI = POSI LISTENTI 'DANS' LISTENTI ; LISTENTI = POSI LISTREEL 'DANS' LISTREEL (FLOT1) ; LISTENTI = POSI LISTMOTS 'DANS' LISTMOTS ('NOCA') ; LISTENTI = POSI MAILLAGE 'DANS' MAILLAGE ; Commentaires : ______________ 1) Si OBJET2 (ou un de ses items) n'est pas trouve dans la liste OBJET3, sa position vaut 0. 2) Le premier item de la liste OBJET3 occupe la position 1. 3) Pour detecter que deux nombres reels sont egaux, on compare leur difference (en valeur absolue) avec un nombre juge suffisamment petit. Par defaut, on utilise un critere RELATIF base sur la precision machine. L'utilisateur peut imposer une valeur ABSOLUE pour ce critere via la donnee de FLOT1 (type FLOTTANT). 4) Par defaut, la comparaison de chaines est sensible a la casse, ce qui signifie que l'on distingue les majuscules des minuscules. On peut indiquer a la directive que l'on souhaite plutot faire une recherche insensible a la casse grace au mot-cle "NOCA". 5) Les maillages doivent etre elementaires et de POI1. ANGL=========================================================== Description : _____________ The POSI instruction returns the index(es) of one or several items in a list. Syntax : ________ OBJECT1 = POSI OBJECT2 'DANS' OBJECT3 (OBJECT4) ('TOUS') possible types detailed herefater : => Seeks the first occurrence of an item in a list ENTIER = POSI ENTIER 'DANS' LISTENTI ; ENTIER = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) ; ENTIER = POSI MOT 'DANS' LISTMOTS ('NOCA') ; ENTIER = POSI POINT 'DANS' MAILLAGE ; => Seeks all the occurrences of an item in a list LISTENTI = POSI ENTIER 'DANS' LISTENTI 'TOUS' ; LISTENTI = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) 'TOUS' ; LISTENTI = POSI MOT 'DANS' LISTMOTS ('NOCA') 'TOUS' ; LISTENTI = POSI POINT 'DANS' MAILLAGE 'TOUS' ; => Seeks the first occurrence of several items in a list LISTENTI = POSI LISTENTI 'DANS' LISTENTI ; LISTENTI = POSI LISTREEL 'DANS' LISTREEL (FLOT1) ; LISTENTI = POSI LISTMOTS 'DANS' LISTMOTS ('NOCA') ; LISTENTI = POSI MAILLAGE 'DANS' MAILLAGE ; Comments : __________ 1) If OBJECT2 (or one of its items) is not found in the list OBJECT3, its position is set to 0. 2) The index of the first item in OBJECT3 is 1. 3) In order to check whether two real numbers are equal, their difference (in absolute value) is compared to a small enough value. The default criterion is a RELATIVE value based on machine precision. Instead, the user can provide FLOT1 (FLOTTANT type) as an ABSOLUTE value for this criterion. 4) By default, string comparison is case sensitive, which means that upper-case and lower-case letters are not considered the same character. One can rather perform a case-insensitive search by providing the 'NOCA' keyword. 5) The meshes (MAILLAGE) must be composed of POI1 element.