From 857b4a9facb0595f4a70d355af2608f548ddf6c2 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 25 Oct 2016 14:06:38 +0300 Subject: [PATCH] 23285: [CEA 1778] SauvReader: only keep the meshes named in the table MED_MAIL --- resources/CMakeLists.txt | 1 + resources/test_MED_MAIL.sauv | 623 ++++++++++++++++++++++++++ src/MEDLoader/SauvMedConvertor.cxx | 50 ++- src/MEDLoader/Swig/SauvLoaderTest.py | 3 +- src/MEDLoader/Test/SauvLoaderTest.cxx | 30 +- src/MEDLoader/Test/SauvLoaderTest.hxx | 2 + 6 files changed, 701 insertions(+), 8 deletions(-) create mode 100644 resources/test_MED_MAIL.sauv diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index b93e5bc95..8934218c5 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -88,6 +88,7 @@ SET(MED_other_FILES BDC-714.sauv portico_3subs.sauv agitateur.med + test_MED_MAIL.sauv ) SET(MED_RESOURCES_FILES ${MED_test_fig_files}) diff --git a/resources/test_MED_MAIL.sauv b/resources/test_MED_MAIL.sauv new file mode 100644 index 000000000..7ce548142 --- /dev/null +++ b/resources/test_MED_MAIL.sauv @@ -0,0 +1,623 @@ + ENREGISTREMENT DE TYPE 4 + NIVEAU 18 NIVEAU ERREUR 0 DIMENSION 3 + DENSITE 0.00000E+00 + ENREGISTREMENT DE TYPE 7 + NOMBRE INFO CASTEM2000 8 + IFOUR 2 NIFOUR 0 IFOMOD 2 IECHO 0 IIMPI 0 IOSPI 0 ISOTYP 1 + NSDPGE 0 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 1NBRE OBJETS NOMMES 66NBRE OBJETS 88 + SGE DCVD2 DCVF2 DCBV2 DBAS2 DCHV2 SCV2 DCEV2 + DCIV2 DEXT2 SCR2 SCE2 SCH2 SCB2 SCBAS2 SCEXT2 + SCF2 SCD2 MC2 DGEV2 DGIV2 SGV2 DGHV2 DGBV2 + SGI2 SGE2 SGR2 SGH2 SGB2 DGIH2 DGEH2 DGEB2 + DGIB2 MG2 RAC2 MC SCE SCB SCH SCD + SCF SCR SCV SCEXT SGI SGB SGH SGR + SGV MG RAC DCEV DCIV DCVD DCHV DGEH + DGEV DGIV DGIB DGHV DGBV DGEB DGIH IMC + MCREF ALL + 1 2 3 4 5 6 7 8 9 10 + 11 12 13 14 15 16 17 18 19 20 + 21 22 23 24 25 1 26 27 28 29 + 30 31 32 33 34 19 12 14 13 18 + 17 11 7 16 25 28 27 26 22 33 + 34 8 9 2 6 30 20 21 32 23 + 24 31 29 35 19 36 + 8 0 4 4 6 + 20 37 38 39 + 0 0 0 0 0 0 + 7 8 9 10 8 11 12 9 10 9 + 13 14 9 12 15 13 14 13 16 17 + 13 15 18 16 + 2 0 0 2 1 + 0 + 1 2 + 2 0 0 2 1 + 0 + 3 4 + 2 0 0 2 1 + 0 + 2 3 + 2 0 0 2 3 + 0 0 0 + 1 2 2 3 3 4 + 2 0 0 2 3 + 0 0 0 + 6 19 19 20 20 5 + 8 0 4 4 3 + 5 8 40 9 + 0 0 0 + 1 2 19 6 2 3 20 19 3 4 + 5 20 + 2 0 0 2 1 + 0 + 4 5 + 2 0 0 2 1 + 0 + 6 1 + 2 0 0 2 2 + 0 0 + 3 4 4 5 + 8 0 4 4 3 + 41 42 43 44 + 0 0 0 + 1 21 22 6 21 23 24 22 23 25 + 26 24 + 8 0 4 4 3 + 8 45 46 47 + 0 0 0 + 4 5 27 28 28 27 29 30 30 29 + 26 25 + 0 2 0 0 0 + 48 49 + 8 0 4 4 3 + 4 50 51 52 + 0 0 0 + 2 3 31 32 32 31 33 34 34 33 + 23 21 + 8 0 4 4 9 + 5 53 54 55 + 0 0 0 0 0 0 0 0 0 + 1 2 35 36 2 3 37 35 3 4 + 38 37 36 35 39 40 35 37 41 39 + 37 38 42 41 40 39 43 44 39 41 + 45 43 41 42 46 45 + 8 0 4 4 6 + 10 56 57 58 + 0 0 0 0 0 0 + 3 4 28 31 4 5 27 28 31 28 + 30 33 28 27 29 30 33 30 25 23 + 30 29 26 25 + 8 0 4 4 3 + 3 59 60 61 + 0 0 0 + 3 4 28 31 31 28 30 33 33 30 + 25 23 + 4 0 0 3 3 + 0 0 0 + 1 2 32 1 32 34 1 34 21 + 0 2 0 0 0 + 62 63 + 2 0 0 2 2 + 0 0 + 7 8 8 11 + 2 0 0 2 2 + 0 0 + 47 48 48 49 + 8 0 4 4 2 + 20 23 64 24 + 0 0 + 7 8 48 47 8 11 49 48 + 2 0 0 2 1 + 0 + 11 49 + 2 0 0 2 1 + 0 + 47 7 + 8 0 4 4 6 + 21 65 66 67 + 0 0 0 0 0 0 + 47 48 50 51 48 49 52 50 51 50 + 53 54 50 52 55 53 54 53 56 57 + 53 55 58 56 + 8 0 4 4 2 + 68 69 70 71 + 0 0 + 17 16 56 57 16 18 58 56 + 8 0 4 4 3 + 23 29 72 30 + 0 0 0 + 11 49 52 12 12 52 55 15 15 55 + 58 18 + 8 0 4 4 3 + 24 31 73 32 + 0 0 0 + 47 7 10 51 51 10 14 54 54 14 + 17 57 + 2 0 0 2 3 + 0 0 0 + 49 52 52 55 55 58 + 2 0 0 2 3 + 0 0 0 + 18 15 15 12 12 11 + 2 0 0 2 3 + 0 0 0 + 7 10 10 14 14 17 + 2 0 0 2 3 + 0 0 0 + 57 54 54 51 51 47 + 14 0 3 8 6 + 22 74 75 + 0 0 0 0 0 0 + 7 8 48 47 10 9 50 51 8 11 + 49 48 9 12 52 50 10 9 50 51 + 14 13 53 54 9 12 52 50 13 15 + 55 53 14 13 53 54 17 16 56 57 + 13 15 55 53 16 18 58 56 + 14 0 3 8 12 + 25 16 76 + 0 0 0 0 0 0 0 0 0 0 + 0 0 + 47 48 50 51 59 60 61 62 48 49 + 52 50 60 63 64 61 51 50 53 54 + 62 61 65 66 50 52 55 53 61 64 + 67 65 54 53 56 57 66 65 68 69 + 53 55 58 56 65 67 70 68 59 60 + 61 62 3 4 28 31 60 63 64 61 + 4 5 27 28 62 61 65 66 31 28 + 30 33 61 64 67 65 28 27 29 30 + 66 65 68 69 33 30 25 23 65 67 + 70 68 30 29 26 25 + 0 2 0 0 0 + 77 78 + 0 4 0 0 0 + 79 80 81 82 + 2 0 0 2 3 + 0 0 0 + 11 12 12 15 15 18 + 2 0 0 2 2 + 0 0 + 18 16 16 17 + 2 0 0 2 3 + 0 0 0 + 17 14 14 10 10 7 + 2 0 0 2 3 + 0 0 0 + 5 20 20 19 19 6 + 2 0 0 2 3 + 0 0 0 + 1 21 21 23 23 25 + 2 0 0 2 1 + 0 + 25 26 + 2 0 0 2 3 + 0 0 0 + 26 24 24 22 22 6 + 2 0 0 2 1 + 0 + 6 1 + 2 0 0 2 3 + 0 0 0 + 5 27 27 29 29 26 + 2 0 0 2 1 + 0 + 26 25 + 2 0 0 2 3 + 0 0 0 + 25 30 30 28 28 4 + 8 0 0 4 6 + 0 0 0 0 0 0 + 19 20 71 72 20 5 27 71 72 71 + 73 74 71 27 29 73 74 73 24 22 + 73 29 26 24 + 4 0 0 3 3 + 0 0 0 + 6 19 72 6 72 74 6 74 22 + 2 0 0 2 3 + 0 0 0 + 3 31 31 33 33 23 + 2 0 0 2 1 + 0 + 23 21 + 2 0 0 2 3 + 0 0 0 + 21 34 34 32 32 2 + 2 0 0 2 3 + 0 0 0 + 4 38 38 42 42 46 + 2 0 0 2 3 + 0 0 0 + 46 45 45 43 43 44 + 2 0 0 2 3 + 0 0 0 + 44 40 40 36 36 1 + 2 0 0 2 3 + 0 0 0 + 5 27 27 29 29 26 + 2 0 0 2 2 + 0 0 + 26 25 25 23 + 2 0 0 2 3 + 0 0 0 + 23 33 33 31 31 3 + 2 0 0 2 3 + 0 0 0 + 4 28 28 30 30 25 + 2 0 0 2 1 + 0 + 25 23 + 2 0 0 2 3 + 0 0 0 + 23 33 33 31 31 3 + 14 0 0 8 6 + 0 0 0 0 0 0 + 2 3 20 19 32 31 71 72 3 4 + 5 20 31 28 27 71 32 31 71 72 + 34 33 73 74 31 28 27 71 33 30 + 29 73 34 33 73 74 21 23 24 22 + 33 30 29 73 23 25 26 24 + 16 0 0 6 3 + 0 0 0 + 1 32 2 6 72 19 1 34 32 6 + 74 72 1 21 34 6 22 74 + 2 0 0 2 2 + 0 0 + 49 48 48 47 + 2 0 0 2 3 + 0 0 0 + 49 52 52 55 55 58 + 2 0 0 2 2 + 0 0 + 58 56 56 57 + 2 0 0 2 3 + 0 0 0 + 57 54 54 51 51 47 + 2 0 0 2 2 + 0 0 + 17 16 16 18 + 2 0 0 2 1 + 0 + 18 58 + 2 0 0 2 2 + 0 0 + 58 56 56 57 + 2 0 0 2 1 + 0 + 57 17 + 2 0 0 2 1 + 0 + 58 18 + 2 0 0 2 1 + 0 + 17 57 + 8 0 4 4 2 + 85 86 87 88 + 0 0 + 17 16 56 57 16 18 58 56 + 8 0 0 4 18 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 7 8 9 10 8 11 12 9 11 49 + 52 12 49 48 50 52 48 47 51 50 + 47 7 10 51 10 9 13 14 9 12 + 15 13 12 52 55 15 52 50 53 55 + 50 51 54 53 51 10 14 54 14 13 + 16 17 13 15 18 16 15 55 58 18 + 55 53 56 58 53 54 57 56 54 14 + 17 57 + 8 0 0 4 20 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 47 48 60 59 48 49 63 60 49 52 + 64 63 52 55 67 64 55 58 70 67 + 58 56 68 70 56 57 69 68 57 54 + 66 69 54 51 62 66 51 47 59 62 + 59 60 4 3 60 63 5 4 63 64 + 27 5 64 67 29 27 67 70 26 29 + 70 68 25 26 68 69 23 25 69 66 + 33 23 66 62 31 33 62 59 3 31 + 14 0 0 8 6 + 6 6 6 6 6 6 + 2 3 20 19 32 31 71 72 3 4 + 5 20 31 28 27 71 32 31 71 72 + 34 33 73 74 31 28 27 71 33 30 + 29 73 34 33 73 74 21 23 24 22 + 33 30 29 73 23 25 26 24 + 16 0 0 6 3 + 6 6 6 + 1 32 2 6 72 19 1 34 32 6 + 74 72 1 21 34 6 22 74 + 14 0 0 8 54 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 7 8 48 47 10 9 50 51 8 11 + 49 48 9 12 52 50 10 9 50 51 + 14 13 53 54 9 12 52 50 13 15 + 55 53 14 13 53 54 17 16 56 57 + 13 15 55 53 16 18 58 56 47 48 + 50 51 59 60 61 62 48 49 52 50 + 60 63 64 61 51 50 53 54 62 61 + 65 66 50 52 55 53 61 64 67 65 + 54 53 56 57 66 65 68 69 53 55 + 58 56 65 67 70 68 59 60 61 62 + 3 4 28 31 60 63 64 61 4 5 + 27 28 62 61 65 66 31 28 30 33 + 61 64 67 65 28 27 29 30 66 65 + 68 69 33 30 25 23 65 67 70 68 + 30 29 26 25 7 8 48 47 10 9 + 50 51 8 11 49 48 9 12 52 50 + 10 9 50 51 14 13 53 54 9 12 + 52 50 13 15 55 53 14 13 53 54 + 17 16 56 57 13 15 55 53 16 18 + 58 56 47 48 50 51 59 60 61 62 + 48 49 52 50 60 63 64 61 51 50 + 53 54 62 61 65 66 50 52 55 53 + 61 64 67 65 54 53 56 57 66 65 + 68 69 53 55 58 56 65 67 70 68 + 59 60 61 62 3 4 28 31 60 63 + 64 61 4 5 27 28 62 61 65 66 + 31 28 30 33 61 64 67 65 28 27 + 29 30 66 65 68 69 33 30 25 23 + 65 67 70 68 30 29 26 25 2 3 + 20 19 32 31 71 72 3 4 5 20 + 31 28 27 71 32 31 71 72 34 33 + 73 74 31 28 27 71 33 30 29 73 + 34 33 73 74 21 23 24 22 33 30 + 29 73 23 25 26 24 2 3 20 19 + 32 31 71 72 3 4 5 20 31 28 + 27 71 32 31 71 72 34 33 73 74 + 31 28 27 71 33 30 29 73 34 33 + 73 74 21 23 24 22 33 30 29 73 + 23 25 26 24 2 3 20 19 32 31 + 71 72 3 4 5 20 31 28 27 71 + 32 31 71 72 34 33 73 74 31 28 + 27 71 33 30 29 73 34 33 73 74 + 21 23 24 22 33 30 29 73 23 25 + 26 24 + 16 0 0 6 9 + 0 0 0 0 0 0 0 0 0 + 1 32 2 6 72 19 1 34 32 6 + 74 72 1 21 34 6 22 74 1 32 + 2 6 72 19 1 34 32 6 74 72 + 1 21 34 6 22 74 1 32 2 6 + 72 19 1 34 32 6 74 72 1 21 + 34 6 22 74 + 8 0 0 4 86 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 + 7 8 48 47 8 11 49 48 47 48 + 50 51 48 49 52 50 51 50 53 54 + 50 52 55 53 54 53 56 57 53 55 + 58 56 11 49 52 12 12 52 55 15 + 15 55 58 18 17 16 56 57 16 18 + 58 56 47 7 10 51 51 10 14 54 + 54 14 17 57 7 8 9 10 8 11 + 12 9 10 9 13 14 9 12 15 13 + 14 13 16 17 13 15 18 16 1 21 + 22 6 21 23 24 22 23 25 26 24 + 1 2 19 6 2 3 20 19 3 4 + 5 20 2 3 31 32 32 31 33 34 + 34 33 23 21 3 4 28 31 31 28 + 30 33 33 30 25 23 4 5 27 28 + 28 27 29 30 30 29 26 25 17 16 + 56 57 16 18 58 56 7 8 48 47 + 8 11 49 48 11 49 52 12 12 52 + 55 15 15 55 58 18 47 7 10 51 + 51 10 14 54 54 14 17 57 7 8 + 9 10 8 11 12 9 10 9 13 14 + 9 12 15 13 14 13 16 17 13 15 + 18 16 47 48 50 51 48 49 52 50 + 51 50 53 54 50 52 55 53 54 53 + 56 57 53 55 58 56 1 21 22 6 + 21 23 24 22 23 25 26 24 1 2 + 19 6 2 3 20 19 3 4 5 20 + 2 3 31 32 32 31 33 34 34 33 + 23 21 3 4 28 31 31 28 30 33 + 33 30 25 23 4 5 27 28 28 27 + 29 30 30 29 26 25 19 20 71 72 + 20 5 27 71 72 71 73 74 71 27 + 29 73 74 73 24 22 73 29 26 24 + 19 20 71 72 20 5 27 71 72 71 + 73 74 71 27 29 73 74 73 24 22 + 73 29 26 24 + 4 0 0 3 12 + 0 0 0 0 0 0 0 0 0 0 + 0 0 + 1 2 32 1 32 34 1 34 21 1 + 2 32 1 32 34 1 34 21 6 19 + 72 6 72 74 6 74 22 6 19 72 + 6 72 74 6 74 22 + 0 2 0 0 0 + 62 63 + 0 2 0 0 0 + 62 63 + 2 0 0 2 2 + 0 0 + 17 16 16 18 + 2 0 0 2 1 + 0 + 18 58 + 2 0 0 2 2 + 0 0 + 58 56 56 57 + 2 0 0 2 1 + 0 + 57 17 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 10NBRE OBJETS NOMMES 1NBRE OBJETS 1 + MED_MAIL + 1 + 132 + 27 15 1 34 27 16 1 83 27 17 + 1 33 27 18 1 12 27 19 1 17 + 27 20 1 14 27 21 1 13 27 22 + 1 7 27 23 1 11 27 24 1 25 + 27 25 1 1 27 26 1 28 27 27 + 1 27 27 28 1 22 27 29 1 26 + 27 30 1 18 27 31 1 34 27 32 + 1 84 27 33 1 19 27 34 1 33 + 27 35 1 12 27 36 1 17 27 37 + 1 14 27 38 1 13 27 39 1 7 + 27 40 1 11 27 41 1 1 27 42 + 1 28 27 43 1 26 27 44 1 27 + 27 45 1 25 27 46 1 22 27 47 + 1 18 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 25NBRE OBJETS NOMMES 1NBRE OBJETS 1 + PI + 1 + 1 + 3.14159265358979E+00 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 27NBRE OBJETS NOMMES 14NBRE OBJETS 47 + #2 #3 #4 D C DEBP DEBM OPTI + REST XDR LIST MED_MAIL SAUV FORM + 1 2 3 4 5 6 7 8 9 10 + 11 12 13 14 + 250 47 + #2#3#4DROICERCDEBPDEBMOPTIRESTXDRLISTMED_MAILSAUVFORMGAP1_1FUEL1_1CLADD + ING1_1SCE1_1SCF1_1SCB1_1SCH1_1SCV1_1SCR1_1SGI1_1SGE1_1SGB1_1SGH1_1SGV1_ + 1SGR1_1SCD1_1GAP_1FUEL_1FUELREF_1CLADDING_1SCE_1SCF_1SCB_1SCH_1SCV_1SCR + _1SGE_1SGB_1SGR_1SGH_1SGI_1SGV_1SCD_1 + 2 4 6 10 14 18 22 26 30 33 + 37 45 49 53 59 66 77 83 89 95 + 101 107 113 119 125 131 137 143 149 155 + 160 166 175 185 190 195 200 205 210 215 + 220 225 230 235 240 245 250 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 32NBRE OBJETS NOMMES 12NBRE OBJETS 74 + PCIVD2 PCBVD2 PCBVF2 PCEVF2 PCEHV2 PCIHV2 PCBVF PCEVF + PCBVD PCIVD PCEHV PCIHV + 1 2 3 4 5 6 3 4 2 1 + 5 6 + 74 + 25 26 27 28 32 29 1 2 4 3 + 7 8 6 5 9 20 19 21 30 31 + 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 + 53 54 55 56 57 58 16 10 11 12 + 17 13 14 18 15 22 24 23 59 60 + 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 + ENREGISTREMENT DE TYPE 2 + PILE NUMERO 33NBRE OBJETS NOMMES 0NBRE OBJETS 1 + 316 + 4.75000000000000E-03 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 4.75000000000000E-03 0.00000000000000E+00 + 1.60000000000000E-04 0.00000000000000E+00 4.70936309152560E-03 + 6.19999413045245E-04 0.00000000000000E+00 0.00000000000000E+00 + 4.70936309152560E-03 6.19999413045245E-04 1.60000000050786E-04 + 0.00000000000000E+00 4.58814767487307E-03 1.22939046423697E-03 + 0.00000000000000E+00 0.00000000000000E+00 4.58814767487307E-03 + 1.22939046423697E-03 1.60000000050786E-04 0.00000000000000E+00 + 4.75000000000000E-03 0.00000000000000E+00 7.03000000000000E-03 + 0.00000000000000E+00 4.70936309152560E-03 6.19999413045245E-04 + 7.02999999996064E-03 0.00000000000000E+00 4.58814767487307E-03 + 1.22939046423697E-03 7.02999999996064E-03 0.00000000000000E+00 + 4.18000000000000E-03 0.00000000000000E+00 1.60000000000000E-04 + 0.00000000000000E+00 4.18000000000000E-03 0.00000000000000E+00 + 7.03000000000000E-03 0.00000000000000E+00 4.14423952054253E-03 + 5.45599483479816E-04 1.60000000050786E-04 0.00000000000000E+00 + 4.14423952054253E-03 5.45599483479816E-04 7.02999999996064E-03 + 0.00000000000000E+00 4.03756995388830E-03 1.08186360852854E-03 + 1.60000000050786E-04 0.00000000000000E+00 4.03756995388830E-03 + 1.08186360852854E-03 7.02999999996064E-03 0.00000000000000E+00 + 4.18000000000000E-03 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 4.14423952054253E-03 5.45599483479816E-04 + 0.00000000000000E+00 0.00000000000000E+00 4.03756995388830E-03 + 1.08186360852854E-03 0.00000000000000E+00 0.00000000000000E+00 + 4.38842777942861E-03 1.81774630373418E-03 0.00000000000000E+00 + 0.00000000000000E+00 4.38842777942861E-03 1.81774630373418E-03 + 1.60000000050786E-04 0.00000000000000E+00 4.38842777942861E-03 + 1.81774630373418E-03 7.02999999996064E-03 0.00000000000000E+00 + 3.86181644589718E-03 1.59961674728608E-03 1.60000000050786E-04 + 0.00000000000000E+00 3.86181644589718E-03 1.59961674728608E-03 + 7.02999999996064E-03 0.00000000000000E+00 3.86181644589718E-03 + 1.59961674728608E-03 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 0.00000000000000E+00 3.19999999987886E-04 + 0.00000000000000E+00 3.05000000000000E-03 0.00000000000000E+00 + 0.00000000000000E+00 0.00000000000000E+00 3.55550000000000E-03 + 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 + 4.09650000000000E-03 0.00000000000000E+00 1.60000000000000E-04 + 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 + 6.90499999996064E-03 0.00000000000000E+00 3.05000000000000E-03 + 0.00000000000000E+00 6.90500000000000E-03 0.00000000000000E+00 + 3.55550000000000E-03 0.00000000000000E+00 6.90500000000000E-03 + 0.00000000000000E+00 4.09650000000000E-03 0.00000000000000E+00 + 6.90500000000000E-03 0.00000000000000E+00 2.81783257415943E-03 + 1.16718446871352E-03 0.00000000000000E+00 0.00000000000000E+00 + 2.81783257415942E-03 1.16718446871352E-03 6.90499999996064E-03 + 0.00000000000000E+00 3.28485367784388E-03 1.36063094377408E-03 + 0.00000000000000E+00 0.00000000000000E+00 3.28485367784388E-03 + 1.36063094377408E-03 6.90499999996064E-03 0.00000000000000E+00 + 3.78467250493249E-03 1.56766268068359E-03 1.60000000050786E-04 + 0.00000000000000E+00 3.78467250493249E-03 1.56766268068359E-03 + 6.90499999996064E-03 0.00000000000000E+00 4.06145387461781E-03 + 5.34700546429441E-04 6.90499999996064E-03 0.00000000000000E+00 + 4.06145387461781E-03 5.34700546429441E-04 1.60000000050786E-04 + 0.00000000000000E+00 3.95691514739317E-03 1.06025221826248E-03 + 6.90499999996064E-03 0.00000000000000E+00 3.95691514739317E-03 + 1.06025221826248E-03 1.60000000050786E-04 0.00000000000000E+00 + 3.52508220461458E-03 4.64085876438393E-04 0.00000000000000E+00 + 0.00000000000000E+00 3.02390682719012E-03 3.98104886271157E-04 + 0.00000000000000E+00 0.00000000000000E+00 3.43434927537078E-03 + 9.20231114862012E-04 0.00000000000000E+00 0.00000000000000E+00 + 2.94607377018166E-03 7.89398087562688E-04 0.00000000000000E+00 + 0.00000000000000E+00 3.02390682719012E-03 3.98104886271157E-04 + 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 3.19999999987886E-04 0.00000000000000E+00 + 3.52508220461458E-03 4.64085876438393E-04 0.00000000000000E+00 + 0.00000000000000E+00 4.06145387461781E-03 5.34700546429441E-04 + 1.60000000050786E-04 0.00000000000000E+00 2.94607377018166E-03 + 7.89398087562688E-04 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 0.00000000000000E+00 3.19999999987886E-04 + 0.00000000000000E+00 3.43434927537078E-03 9.20231114862013E-04 + 0.00000000000000E+00 0.00000000000000E+00 3.95691514739317E-03 + 1.06025221826248E-03 1.60000000050786E-04 0.00000000000000E+00 + 2.81783257415943E-03 1.16718446871352E-03 0.00000000000000E+00 + 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 + 3.19999999987886E-04 0.00000000000000E+00 3.28485367784388E-03 + 1.36063094377408E-03 0.00000000000000E+00 0.00000000000000E+00 + 3.78467250493249E-03 1.56766268068359E-03 1.60000000050786E-04 + 0.00000000000000E+00 3.86775000000000E-03 0.00000000000000E+00 + 0.00000000000000E+00 5.42591715837579E-05 4.13825000000000E-03 + 0.00000000000000E+00 1.60000000000000E-04 5.42591715837579E-05 + 4.10284669758017E-03 5.40150014954628E-04 1.60000000050786E-04 + 5.42591715837579E-05 3.83466086257855E-03 5.04842679959104E-04 + 0.00000000000000E+00 5.42591715837579E-05 4.13825000000000E-03 + 0.00000000000000E+00 6.90500000000000E-03 5.42591715837579E-05 + 4.10284669758017E-03 5.40150014954628E-04 6.90499999996064E-03 + 5.42591715837579E-05 3.99724255064074E-03 1.07105791339551E-03 + 1.60000000050786E-04 5.42591715837579E-05 3.73595961462954E-03 + 1.00104736169527E-03 0.00000000000000E+00 5.42591715837579E-05 + 3.99724255064074E-03 1.07105791339551E-03 6.90499999996064E-03 + 5.42591715837579E-05 3.82324447541483E-03 1.58363971398483E-03 + 1.60000000050786E-04 5.42591715837579E-05 3.57333506187053E-03 + 1.48012384553008E-03 0.00000000000000E+00 5.42591715837579E-05 + 3.82324447541483E-03 1.58363971398483E-03 6.90499999996064E-03 + 5.42591715837579E-05 3.52508220461458E-03 4.64085876438393E-04 + 6.90499999996064E-03 0.00000000000000E+00 3.02390682719012E-03 + 3.98104886271157E-04 6.90499999996064E-03 0.00000000000000E+00 + 3.43434927537078E-03 9.20231114862013E-04 6.90499999996064E-03 + 0.00000000000000E+00 2.94607377018166E-03 7.89398087562688E-04 + 6.90499999996064E-03 0.00000000000000E+00 0.00000000000000E+00 + 0.00000000000000E+00 -1.00000000000000E+03 0.00000000000000E+00 + 0.00000000000000E+00 0.00000000000000E+00 1.00000000000000E+03 + 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 + -1.43751562500000E-02 0.00000000000000E+00 4.18000000000000E-03 + 0.00000000000000E+00 6.90500000000000E-03 0.00000000000000E+00 + 4.75000000000000E-03 0.00000000000000E+00 6.90500000000000E-03 + 0.00000000000000E+00 + ENREGISTREMENT DE TYPE 5 +LABEL_AUTOMATIQUE_1 diff --git a/src/MEDLoader/SauvMedConvertor.cxx b/src/MEDLoader/SauvMedConvertor.cxx index cdecd1994..a075af9e4 100644 --- a/src/MEDLoader/SauvMedConvertor.cxx +++ b/src/MEDLoader/SauvMedConvertor.cxx @@ -2402,7 +2402,9 @@ MEDCoupling::MEDFileUMesh* IntermediateMED::makeMEDFileMesh() // check if all needed piles are present checkDataAvailability(); - // set long names + decreaseHierarchicalDepthOfSubgroups(); + + // set long names (before orienting!) setGroupLongNames(); // fix element orientation @@ -2412,7 +2414,6 @@ MEDCoupling::MEDFileUMesh* IntermediateMED::makeMEDFileMesh() orientElements3D(); // process groups - decreaseHierarchicalDepthOfSubgroups(); eraseUselessGroups(); //detectMixDimGroups(); @@ -2444,6 +2445,16 @@ MEDCoupling::MEDFileUMesh* IntermediateMED::makeMEDFileMesh() void IntermediateMED::setGroupLongNames() { + if ( _listGIBItoMED_mail.empty() ) + return; + + // IMP 0023285: only keep the meshes named in the table MED_MAIL + // clear all group names + for ( size_t i = 0; i < _groups.size(); ++i ) + if ( !_groups[i]._isProfile ) + _groups[i]._name.clear(); + + // IMP 0020434: mapping GIBI names to MED names // set med names to objects (mesh, fields, support, group or other) @@ -2474,6 +2485,41 @@ void IntermediateMED::setGroupLongNames() grp._refNames.push_back( _mapStrings[ (*itGIBItoMED).med_id ]); } } + + // IMP 0023285: only keep the meshes named in the table MED_MAIL + // remove all cells belonging to non-named groups only + + // use Cell::_reverse to mark cells to keep + for ( size_t i = 0; i < _groups.size(); ++i ) + { + SauvUtilities::Group & grp = _groups[i]; + if ( grp._isProfile || !grp._name.empty() ) + { + for ( size_t iC = 0; iC < grp._cells.size(); ++iC ) + grp._cells[iC]->_reverse = true; + + for (size_t j = 0; j < grp._groups.size(); ++j ) + for ( size_t iC = 0; iC < grp._groups[j]->_cells.size(); ++iC ) + grp._groups[j]->_cells[iC]->_reverse = true; + } + } + // remove non-marked cells (with _reverse == false) + CellsByDimIterator cellsIt( *this ); + while ( cellsIt.nextType() ) + { + std::set & cells = _cellsByType[ cellsIt.type() ]; + std::set::iterator cIt = cells.begin(); + while ( cIt != cells.end() ) + if ( cIt->_reverse ) + { + cIt->_reverse = false; + ++cIt; + } + else + { + cells.erase( cIt++ ); + } + } } //================================================================================ diff --git a/src/MEDLoader/Swig/SauvLoaderTest.py b/src/MEDLoader/Swig/SauvLoaderTest.py index 55f1f992b..40b301940 100644 --- a/src/MEDLoader/Swig/SauvLoaderTest.py +++ b/src/MEDLoader/Swig/SauvLoaderTest.py @@ -130,7 +130,8 @@ class SauvLoaderTest(unittest.TestCase): self.assertEqual(2, um0.getNumberOfCellsWithType( NORM_PYRA5 )) self.assertEqual(2, um0.getNumberOfCellsWithType( NORM_HEXA8 )) um1 = m.getMeshAtLevel(-1) - self.assertEqual(2, um1.getNumberOfCellsWithType( NORM_TRI3 )) + #self.assertEqual(2, um1.getNumberOfCellsWithType( NORM_TRI3 )) + self.assertEqual(1, um1.getNumberOfCellsWithType( NORM_TRI3 )) pointeUM0 = pointeMedMesh.getMeshAtLevel(0) self.assertTrue(m.getCoords().isEqualWithoutConsideringStr(pointeMedMesh.getCoords(),1e-12)) self.assertEqual( um0.getMeasureField(0).accumulate(0), diff --git a/src/MEDLoader/Test/SauvLoaderTest.cxx b/src/MEDLoader/Test/SauvLoaderTest.cxx index 3a5b6d1c5..22f86515c 100644 --- a/src/MEDLoader/Test/SauvLoaderTest.cxx +++ b/src/MEDLoader/Test/SauvLoaderTest.cxx @@ -255,7 +255,8 @@ void SauvLoaderTest::testMed2Sauv() CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PYRA5 )); CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 )); MCAuto um1 = m->getMeshAtLevel(-1); - CPPUNIT_ASSERT_EQUAL(2, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 )); + CPPUNIT_ASSERT_EQUAL(1, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 )); + //CPPUNIT_ASSERT_EQUAL(2, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 )); MCAuto pointeUM0 = static_cast( pointeMedMesh->getMeshAtLevel(0)); DataArrayDouble *coo = m->getCoords(); @@ -314,17 +315,36 @@ void SauvLoaderTest::testMed2Sauv() CPPUNIT_ASSERT( d->isEqual( *fof->getArray(), 1e-12 )); } +void SauvLoaderTest::testCellsWithLingNames() +{ + // test IMP 3285: [CEA 1778] SauvReader: only keep the meshes named in the table MED_MAIL + std::string file = INTERP_TEST::getResourceFile("test_MED_MAIL.sauv", 3); + MCAuto sr=SauvReader::New(file.c_str()); + MCAuto d2=sr->loadInMEDFileDS(); + // check that the mesh contains + // - Nombre de noeuds : 74 + // - Nombre de mailles de type MED_TRIA3 : 6 + // - Nombre de mailles de type MED_QUAD4 : 43 + // - Nombre de mailles de type MED_HEXA8 : 24 + // - Nombre de mailles de type MED_PENTA6 : 3 + MEDFileUMesh* m = static_cast( d2->getMeshes()->getMeshAtPos(0)); + CPPUNIT_ASSERT_EQUAL(6, m->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 )); + CPPUNIT_ASSERT_EQUAL(43, m->getNumberOfCellsWithType( INTERP_KERNEL::NORM_QUAD4 )); + CPPUNIT_ASSERT_EQUAL(24, m->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 )); + CPPUNIT_ASSERT_EQUAL(3, m->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PENTA6 )); +} + void SauvLoaderTest::tearDown() { const int nbFilesToRemove = 3; const char* fileToRemove[nbFilesToRemove] = { "allPillesTest.med", "pointe.sauv", "mesh_with_void_family.sauv" }; for ( int i = 0; i < nbFilesToRemove; ++i ) - { + { #ifdef WIN32 - if (GetFileAttributes(fileToRemove[i]) != INVALID_FILE_ATTRIBUTES) + if (GetFileAttributes(fileToRemove[i]) != INVALID_FILE_ATTRIBUTES) #else - if (access(fileToRemove[i], F_OK) == 0) + if (access(fileToRemove[i], F_OK) == 0) #endif - remove(fileToRemove[i]); + remove(fileToRemove[i]); } } diff --git a/src/MEDLoader/Test/SauvLoaderTest.hxx b/src/MEDLoader/Test/SauvLoaderTest.hxx index 5b9485133..81ccc1b21 100644 --- a/src/MEDLoader/Test/SauvLoaderTest.hxx +++ b/src/MEDLoader/Test/SauvLoaderTest.hxx @@ -33,12 +33,14 @@ namespace MEDCoupling CPPUNIT_TEST( testMed2Sauv ); CPPUNIT_TEST( testMed2SauvOnAMeshWithVoidFamily ); CPPUNIT_TEST( testSauv2MedOnA3SubsField ); + CPPUNIT_TEST( testCellsWithLingNames ); CPPUNIT_TEST_SUITE_END(); public: void testSauv2Med(); void testMed2Sauv(); void testMed2SauvOnAMeshWithVoidFamily(); void testSauv2MedOnA3SubsField(); + void testCellsWithLingNames(); public: void tearDown(); -- 2.39.2