From c30018924a3eeac19636737a9f1c057cae5d9ec7 Mon Sep 17 00:00:00 2001 From: nri Date: Fri, 25 Jun 2004 13:15:14 +0000 Subject: [PATCH] DCQ : Merge with Ecole Ete a6. --- ...DMEM_InterpolationHighLevelObjects.hxx.old | 104 ++ src/MEDMEM/INTERPOLATION/Makefile.in | 4 +- .../INTERPOLATION/create_mesh_interpolation.c | 982 ++++++++---------- .../test_MEDMEM_Interpolation.cxx | 56 + src/MedClient/src/Makefile.in | 2 +- src/MedClient/test/environ/csh/init1.in | 2 +- src/MedClient/test/environ/csh/init3.in | 2 +- .../test/environ/csh/runContainer.in | 24 +- .../test/environ/csh/runEnvironTests.in | 4 +- .../test/environ/csh/stopContainer.in | 18 +- src/MedClient/test/environ/runTestMedCorba.in | 18 +- src/MedClient/test/test1/Makefile.in | 2 +- src/MedClient/test/test1/TestMedCorba1.py | 2 +- src/MedClient/test/test1/TestMedCorba2.py | 2 +- src/MedClient/test/test1/TestMedCorba3.py | 2 +- src/MedClient/test/test1/TestMedCorba4.py | 2 +- src/MedClient/test/test1/TestMedCorba5.py | 2 +- .../test1/resources/CatalogModuleTest.xml | 25 + src/MedClient/test/test2/Makefile.in | 2 +- src/MedClient/test/test2/TestMedCorba6.py | 2 +- src/MedClient/test/test2/TestMedCorba7.py | 2 +- src/MedClient/test/test2/TestMedCorba8.py | 2 +- 22 files changed, 687 insertions(+), 574 deletions(-) create mode 100644 src/MEDMEM/INTERPOLATION/MEDMEM_InterpolationHighLevelObjects.hxx.old create mode 100644 src/MEDMEM/INTERPOLATION/test_MEDMEM_Interpolation.cxx create mode 100644 src/MedClient/test/test1/resources/CatalogModuleTest.xml diff --git a/src/MEDMEM/INTERPOLATION/MEDMEM_InterpolationHighLevelObjects.hxx.old b/src/MEDMEM/INTERPOLATION/MEDMEM_InterpolationHighLevelObjects.hxx.old new file mode 100644 index 000000000..7ab49bb4b --- /dev/null +++ b/src/MEDMEM/INTERPOLATION/MEDMEM_InterpolationHighLevelObjects.hxx.old @@ -0,0 +1,104 @@ +#ifndef MEDMEM_INTERPOLATION_HIGHLEVEL_OBJECTS_HXX + +#define MEDMEM_INTERPOLATION_HIGHLEVEL_OBJECTS_HXX +#include "MEDMEM_Connectivity.hxx" +#include "MEDMEM_WrapperConnectivity.hxx" +#include "MEDMEM_dTree.hxx" +#include "MEDMEM_WrapperNodes.hxx" +#include "MEDMEM_WrapperMesh.hxx" +#include "MEDMEM_WrapperCells.hxx" +#include "MEDMEM_Mapping.hxx" + +// DECLARATIONS + +template class Meta_dTree : public dTree,Wrapper_Nuage_Noeud,DIMENSION> +{ +protected : + Wrapper_Nuage_Noeud * nuagetmp; +public : + Meta_dTree(int nn,double * fullinterlace); + ~Meta_dTree() {if ((etat==DTREE_RACINE)&&(nuagetmp)) delete nuagetmp;} + inline int trouve_plus_proche_point(double *node); +}; + +class Meta_Nuage_Maille : public Wrapper_Nuage_Maille +{ +protected : + Wrapper_Med_Connectivity * connectivite_med; +public : + Meta_Nuage_Maille(CONNECTIVITY * connmed); + Meta_Nuage_Maille():Wrapper_Nuage_Maille(connectivite_med=new Wrapper_Med_Connectivity) {} + ~Meta_Nuage_Maille() {if (connectivite_med) delete connectivite_med;} +}; + + +typedef Wrapper_Maillage Meta_Maillage; + +template class Meta_Mapping : public Mapping,Wrapper_Noeud,DIMENSION> +{ +protected : + Wrapper_Nuage_Noeud * wrapping_nuage_source; + Wrapper_Nuage_Noeud * wrapping_nuage_cible; +public : + Meta_Mapping(Meta_Maillage * mb,double * noeudssource,int ns,double * noeudscible,int nc); + ~Meta_Mapping() {if (wrapping_nuage_source) delete wrapping_nuage_source;if (wrapping_nuage_cible) delete wrapping_nuage_cible;} + inline int Trouve_Maille_Contenant_Noeud(double * node,int num_maille, int flag_convexe=0); + double donne_valeur_interpolee_P1(double * node,vector vals); +}; + +// CODE + +template Meta_dTree::Meta_dTree(int nn,double * fullinterlace) +:dTree,Wrapper_Nuage_Noeud,DIMENSION> +(nuagetmp=new Wrapper_Nuage_Noeud(nn,fullinterlace)) + { + } + +template inline int Meta_dTree::trouve_plus_proche_point(double *node) + { + static Wrapper_Noeud nodetmp; + nodetmp.positionne(node); + return dTree,Wrapper_Nuage_Noeud,DIMENSION>::trouve_plus_proche_point(Wrapper_Noeud(nodetmp)); + } + +//* +Meta_Nuage_Maille::Meta_Nuage_Maille(CONNECTIVITY * conmed):Wrapper_Nuage_Maille(connectivite_med=new Wrapper_Med_Connectivity(conmed)) + { + } +//*/ + +template Meta_Mapping::Meta_Mapping(Meta_Maillage * mb,double * noeudssource,int ns,double * noeudscible,int nc) +:Mapping,Wrapper_Noeud,DIMENSION> +(mb, +wrapping_nuage_source=new Wrapper_Nuage_Noeud(ns,noeudssource), +wrapping_nuage_cible=new Wrapper_Nuage_Noeud(nc,noeudscible)) + { + } + +template inline int Meta_Mapping::Trouve_Maille_Contenant_Noeud(double * node,int num_maille,int flag_convexe) + { + int interdit=num_maille; + int max_loop=100; + int nme=0; + static Wrapper_Noeud nodetmp; + nodetmp.positionne(node); + return Mapping,Wrapper_Noeud,DIMENSION>::Trouve_Maille_Contenant_Point_Mth_Co(nodetmp,num_maille,interdit,max_loop,nme,flag_convexe); + } +template double Meta_Mapping::donne_valeur_interpolee_P1(double * node,vector vals) + { + int num_maille_contenant=Trouve_Maille_Contenant_Noeud(node,0); + double valeur_interpol=0; + vector valeurs=CB->Calcule_Coord_Baryc(num_maille_contenant,node); + int i; + int num_som; + for (i=0;i pas de profils utilisateur */ +#define MED_NOPFLi " " /* Variable Interne */ +#define MED_NOPF 0 /* -> pas de profils pour _MEDdataseNnumEcrire */ +#define MED_NOPDT -1 /* rem: pas de pas de temps negatifs */ +#define MED_NONOR -1 /* rem: pas de n°ordre negatif */ +#define MED_DIM1 1 /* PAS */ + +#define MED_ALL 0 + /*****************************************************************************************************/ void affiche_noeuds(med_float * nodes,int nnpl) -{ - int nbr_nodes=nnpl*nnpl*nnpl; - int i; + { + int nbr_nodes=nnpl*nnpl*nnpl; + int i; + + for (i=0;i=3*nbr_nodes) - {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} - if (3*num_noeud+1>=3*nbr_nodes) - {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} - if (3*num_noeud+2>=3*nbr_nodes) - {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} - - coord_nodes[3*num_noeud ]= (double) (i+flag)/diviseur; - coord_nodes[3*num_noeud+1]= (double) (j+flag)/diviseur; - coord_nodes[3*num_noeud+2]= (double) (k+flag)/diviseur; - } + { + int i,j,k; + int nbr_nodes=nnpl*nnpl*nnpl; + int num_noeud; + int diviseur=nnpl-1+flag; + + /*coord_nodes=(med_float *) malloc(3*nbr_nodes*sizeof(med_float));*/ + + for (i=0;i=3*nbr_nodes) {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} + if (3*num_noeud+1>=3*nbr_nodes) {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} + if (3*num_noeud+2>=3*nbr_nodes) {printf("%d : OUT OF RANGE REQUEST\n",num_noeud);exit(-1);} + + coord_nodes[3*num_noeud ]= (double) (i+flag)/diviseur; + coord_nodes[3*num_noeud+1]= (double) (j+flag)/diviseur; + coord_nodes[3*num_noeud+2]= (double) (k+flag)/diviseur; + } + + affiche_noeuds(coord_nodes,nnpl); + + } void cree_num_nodes(med_int * num_nodes,int nnpl) -{ - int nbr_nodes=nnpl*nnpl*nnpl; - int i; - /*num_nodes=(med_int *) malloc(nbr_nodes*sizeof(med_int));*/ - for (i=0;i=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+1>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+2>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+3>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+4>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+5>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+6>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - if (8*num_hexa8+7>=8*nbr_hexa8) - {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8 >=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+1>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+2>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+3>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+4>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+5>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+6>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} + if (8*num_hexa8+7>=8*nbr_hexa8) {printf("%d : OUT OF RANGE REQUEST\n",num_hexa8);exit(-1);} - conn_hexa8[8*num_hexa8 ] = num_nodes[ i0+nnpl*j1+nnpl*nnpl*k1 ]; - conn_hexa8[8*num_hexa8+1] = num_nodes[ i0+nnpl*j0+nnpl*nnpl*k1 ]; - conn_hexa8[8*num_hexa8+2] = num_nodes[ i1+nnpl*j0+nnpl*nnpl*k1 ]; - conn_hexa8[8*num_hexa8+3] = num_nodes[ i1+nnpl*j1+nnpl*nnpl*k1 ]; - conn_hexa8[8*num_hexa8+4] = num_nodes[ i0+nnpl*j1+nnpl*nnpl*k0 ]; - conn_hexa8[8*num_hexa8+5] = num_nodes[ i0+nnpl*j0+nnpl*nnpl*k0 ]; - conn_hexa8[8*num_hexa8+6] = num_nodes[ i1+nnpl*j0+nnpl*nnpl*k0 ]; - conn_hexa8[8*num_hexa8+7] = num_nodes[ i1+nnpl*j1+nnpl*nnpl*k0 ]; + conn_hexa8[8*num_hexa8 ] = num_nodes[ i0+nnpl*j1+nnpl*nnpl*k1 ]; + conn_hexa8[8*num_hexa8+1] = num_nodes[ i0+nnpl*j0+nnpl*nnpl*k1 ]; + conn_hexa8[8*num_hexa8+2] = num_nodes[ i1+nnpl*j0+nnpl*nnpl*k1 ]; + conn_hexa8[8*num_hexa8+3] = num_nodes[ i1+nnpl*j1+nnpl*nnpl*k1 ]; + conn_hexa8[8*num_hexa8+4] = num_nodes[ i0+nnpl*j1+nnpl*nnpl*k0 ]; + conn_hexa8[8*num_hexa8+5] = num_nodes[ i0+nnpl*j0+nnpl*nnpl*k0 ]; + conn_hexa8[8*num_hexa8+6] = num_nodes[ i1+nnpl*j0+nnpl*nnpl*k0 ]; + conn_hexa8[8*num_hexa8+7] = num_nodes[ i1+nnpl*j1+nnpl*nnpl*k0 ]; - } + } - for (num_hexa8=0;num_hexa8 0 - - les numeros de familles des elements sont < 0 - - rien d'imposer sur les noms de familles - */ - - /* la famille 0 */ - - if (ret == 0) - { - strcpy(nomfam,"FAMILLE_0"); - numfam = 0; - ret = MEDfamCr(fromfid,frommaa,nomfam,numfam,&attide,&attval,attdes,0, - gro,0); - } - - printf("MEDfamCr : %d \n",ret); - /*****************************************************************************************************/ - if (ret == 0) - { - strcpy(nomfam,"FAMILLE_0"); - numfam = 0; - ret = MEDfamCr(tofid,tomaa,nomfam,numfam,&attide,&attval,attdes,0,gro,0); - } - - printf("MEDfamCr : %d \n",ret); - /*****************************************************************************************************/ - /* Les champs */ - - if (ret == 0) - { - ret = MEDchampCr(fromfid,champnode,MED_FLOAT64,champnode_comp, - champnode_unit,1); - - printf("MEDchampCr : %d \n",ret); - - if (ret == 0) - { - ret = MEDchampEcr(fromfid, frommaa, champnode, - (unsigned char *)fieldnodedouble, - MED_FULL_INTERLACE, fromnnoe, MED_NOGAUSS, - MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0, - MED_NOPDT," ", 0. , MED_NONOR); + nbr_nodes=nnpl*nnpl*nnpl; + nbr_hexa8=(nnpl-1)*(nnpl-1)*(nnpl-1); - printf("MEDchampEcr : %d \n",ret); - } - } + fromcoo = (med_float *) malloc(3*nbr_nodes*sizeof(med_float)); cree_nodes ( fromcoo , nnpl, 0 ); + fromnumnoe = (med_int *) malloc(nbr_nodes*sizeof(med_int)); cree_num_nodes ( fromnumnoe , nnpl ); + fromnufano = (med_int *) malloc(nbr_nodes*sizeof(med_int)); cree_fam_nodes ( fromnufano , nnpl ); + fromhexa8 = (med_int *) malloc(8*nbr_hexa8*sizeof(med_int)); cree_Hexa8 ( fromhexa8 , nnpl ,fromnumnoe); + fromnomhexa8 = (char *) malloc((nbr_hexa8*MED_TAILLE_PNOM+1)*sizeof(char)); cree_noms_mailles ( fromnomhexa8 , nnpl ); + fromnumhexa8 = (med_int *) malloc(nbr_hexa8*sizeof(med_int)); cree_num_mailles ( fromnumhexa8 , nnpl ); + fromnufahexa8 = (med_int *) malloc(nbr_hexa8*sizeof(med_int)); cree_fam_mailles ( fromnufahexa8 , nnpl ); - if (ret == 0) - { - ret = MEDchampCr(fromfid,champcell,MED_FLOAT64,champcell_comp, - champcell_unit,3); + fieldnodedouble = (med_float *) malloc(nbr_nodes*sizeof(med_float)); cree_valeurs_champ_node ( fieldnodedouble , nnpl ); + fieldnodedoublevector = (med_float *) malloc(3*nbr_nodes*sizeof(med_float)); cree_valeurs_champ_vector_node ( fieldnodedoublevector , nnpl ); + fieldcelldouble = (med_float *) malloc(nbr_hexa8*sizeof(med_float)); cree_valeurs_champ_cell ( fieldcelldouble , nnpl ); + fieldcelldoublevector = (med_float *) malloc(3*nbr_hexa8*sizeof(med_float)); cree_valeurs_champ_vector_cell ( fieldcelldoublevector , nnpl ); + - printf("MEDchampCr : %d \n",ret); + nbr_nodes=(nnpl-1)*(nnpl-1)*(nnpl-1); + nbr_hexa8=(nnpl-2)*(nnpl-2)*(nnpl-2); - if (ret == 0) - { - ret = MEDchampEcr(fromfid, frommaa, champcell, - (unsigned char *)fieldcelldoublevector, - MED_FULL_INTERLACE, fromnhexa8, MED_NOGAUSS, - MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, - MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR); + tocoo = (med_float *) malloc(3*nbr_nodes*sizeof(med_float)); cree_nodes ( tocoo , nnpl-1, 1 ); + tonumnoe = (med_int *) malloc(nbr_nodes*sizeof(med_int)); cree_num_nodes ( tonumnoe , nnpl-1 ); + tonufano = (med_int *) malloc(nbr_nodes*sizeof(med_int)); cree_fam_nodes ( tonufano , nnpl-1 ); + tohexa8 = (med_int *) malloc(8*nbr_hexa8*sizeof(med_int)); cree_Hexa8 ( tohexa8 , nnpl-1 ,tonumnoe); + tonomhexa8 = (char *) malloc((nbr_hexa8*MED_TAILLE_PNOM+1)*sizeof(char)); cree_noms_mailles ( tonomhexa8 , nnpl-1 ); + tonumhexa8 = (med_int *) malloc(nbr_hexa8*sizeof(med_int)); cree_num_mailles ( tonumhexa8 , nnpl-1 ); + tonufahexa8 = (med_int *) malloc(nbr_hexa8*sizeof(med_int)); cree_fam_mailles ( tonufahexa8 , nnpl-1 ); - printf("MEDchampEcr : %d \n",ret); - } - } - - if (ret == 0) - { - ret = MEDchampCr(fromfid,champcellscalar,MED_FLOAT64, - champcellscalar_comp,champcellscalar_unit,1); + +/*****************************************************************************************************/ + fromfid = MEDouvrir("fromMesh.med",MED_REMP); + if (fromfid < 0) + ret = -1; + else + ret = 0; + printf("MEDouvrir : %d\n",ret); + +/*****************************************************************************************************/ + tofid = MEDouvrir("toMesh.med",MED_REMP); + if (tofid < 0) + ret = -1; + else + ret = 0; + printf("MEDouvrir : %d\n",ret); +/*****************************************************************************************************/ + if (ret == 0) + ret = MEDmaaCr(fromfid,frommaa,mdim); + printf("MEDmaaCr : %d\n",ret); - printf("MEDchampCr : %d \n",ret); +/*****************************************************************************************************/ - if (ret == 0) - { - ret = MEDchampEcr(fromfid, frommaa, champcellscalar, - (unsigned char *)fieldcelldouble, - MED_FULL_INTERLACE, fromnhexa8, MED_NOGAUSS, - MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, - MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR); + if (ret == 0) + ret = MEDmaaCr(tofid,tomaa,mdim); + printf("MEDmaaCr : %d\n",ret); - printf("MEDchampEcr : %d \n",ret); - } - } - - if (ret == 0) - { - ret = MEDchampCr(fromfid,champnodevector,MED_FLOAT64, - champnodevector_comp,champnodevector_unit,3); - printf("MEDchampCr : %d \n",ret); - - if (ret == 0) - { - ret = MEDchampEcr(fromfid, frommaa, champnodevector, - (unsigned char *)fieldnodedoublevector, - MED_FULL_INTERLACE, fromnnoe, MED_NOGAUSS, - MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, - 0, MED_NOPDT," ", 0. , MED_NONOR); +/*****************************************************************************************************/ + if (ret == 0) + ret = MEDnoeudsEcr(fromfid,frommaa,mdim,fromcoo,MED_FULL_INTERLACE,MED_CART, + // nomcoo,unicoo,nomnoe,MED_FAUX,fromnumnoe,MED_VRAI, + nomcoo,unicoo,nomnoe,MED_FAUX,fromnumnoe,MED_FAUX, + fromnufano,fromnnoe,MED_ECRI); + printf("MEDnoeudsEcr : %d\n",ret); +/*****************************************************************************************************/ - printf("MEDchampEcr : %d \n",ret); - } - } - - - /***************************************************************************/ - ret = MEDfermer(fromfid); + if (ret == 0) + ret = MEDnoeudsEcr(tofid,tomaa,mdim,tocoo,MED_FULL_INTERLACE,MED_CART, + //nomcoo,unicoo,nomnoe,MED_FAUX,tonumnoe,MED_VRAI, + nomcoo,unicoo,nomnoe,MED_FAUX,tonumnoe,MED_FAUX, + tonufano,tonnoe,MED_ECRI); + printf("MEDnoeudsEcr : %d\n",ret); - printf("MEDfermer : %d\n",ret); - /***************************************************************************/ - ret = MEDfermer(tofid); - printf("MEDfermer : %d\n",ret); +/*****************************************************************************************************/ +/* ecriture des mailles MED_HEXA8 : + - connectivite + - noms (optionnel) + - numeros (optionnel) + - numeros des familles */ + if (ret == 0) + ret = MEDelementsEcr(fromfid,frommaa,mdim,fromhexa8,MED_FULL_INTERLACE, + fromnomhexa8,MED_FAUX,fromnumhexa8,MED_VRAI,fromnufahexa8,fromnhexa8, + MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI); + printf("MEDelementsEcr : %d \n",ret); - return 0; +/*****************************************************************************************************/ +/* ecriture des mailles MED_HEXA8 : + - connectivite + - noms (optionnel) + - numeros (optionnel) + - numeros des familles */ + + if (ret == 0) + ret = MEDelementsEcr(tofid,tomaa,mdim,tohexa8,MED_FULL_INTERLACE, + tonomhexa8,MED_FAUX,tonumhexa8,MED_VRAI,tonufahexa8,tonhexa8, + MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI); + printf("MEDelementsEcr : %d \n",ret); + +/*****************************************************************************************************/ +/* ecriture des familles */ +/* Conventions : + - toujours creer une famille de numero 0 ne comportant aucun attribut + ni groupe (famille de reference pour les noeuds ou les elements + qui ne sont rattaches a aucun groupe ni attribut) + - les numeros de familles de noeuds sont > 0 + - les numeros de familles des elements sont < 0 + - rien d'imposer sur les noms de familles + */ + +/* la famille 0 */ + if (ret == 0) + { + strcpy(nomfam,"FAMILLE_0"); + numfam = 0; + ret = MEDfamCr(fromfid,frommaa,nomfam,numfam,&attide,&attval,attdes,0,gro,0); + } + printf("MEDfamCr : %d \n",ret); +/*****************************************************************************************************/ + + if (ret == 0) + { + strcpy(nomfam,"FAMILLE_0"); + numfam = 0; + ret = MEDfamCr(tofid,tomaa,nomfam,numfam,&attide,&attval,attdes,0,gro,0); + } + printf("MEDfamCr : %d \n",ret); + +/*****************************************************************************************************/ +/* Les champs */ + + if (ret == 0) + { + ret = MEDchampCr(fromfid,champnode,MED_REEL64,champnode_comp,champnode_unit,1); + printf("MEDchampCr : %d \n",ret); + if (ret == 0) + { + ret = MEDchampEcr(fromfid, frommaa, champnode, (unsigned char *)fieldnodedouble, + MED_FULL_INTERLACE, fromnnoe, + MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD, + 0, MED_NOPDT," ", 0. , MED_NONOR); + printf("MEDchampEcr : %d \n",ret); + } + } + + if (ret == 0) + { + ret = MEDchampCr(fromfid,champcell,MED_REEL64,champcell_comp,champcell_unit,3); + printf("MEDchampCr : %d \n",ret); + if (ret == 0) + { + ret = MEDchampEcr(fromfid, frommaa, champcell, (unsigned char *)fieldcelldoublevector, + MED_FULL_INTERLACE, fromnhexa8, + MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE, + MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR); + printf("MEDchampEcr : %d \n",ret); + } + } + + if (ret == 0) + { + ret = MEDchampCr(fromfid,champcellscalar,MED_REEL64,champcellscalar_comp,champcellscalar_unit,1); + printf("MEDchampCr : %d \n",ret); + if (ret == 0) + { + ret = MEDchampEcr(fromfid, frommaa, champcellscalar, (unsigned char *)fieldcelldouble, + MED_FULL_INTERLACE, fromnhexa8, + MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE, + MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR); + printf("MEDchampEcr : %d \n",ret); + } + } + + if (ret == 0) + { + ret = MEDchampCr(fromfid,champnodevector,MED_REEL64,champnodevector_comp,champnodevector_unit,3); + printf("MEDchampCr : %d \n",ret); + if (ret == 0) + { + ret = MEDchampEcr(fromfid, frommaa, champnodevector, (unsigned char *)fieldnodedoublevector, + MED_FULL_INTERLACE, fromnnoe, + MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD, + 0, MED_NOPDT," ", 0. , MED_NONOR); + printf("MEDchampEcr : %d \n",ret); + } + } + + +/***************************************************************************/ +ret = MEDfermer(fromfid); +printf("MEDfermer : %d\n",ret); +/***************************************************************************/ +ret = MEDfermer(tofid); +printf("MEDfermer : %d\n",ret); + +return 0; } diff --git a/src/MEDMEM/INTERPOLATION/test_MEDMEM_Interpolation.cxx b/src/MEDMEM/INTERPOLATION/test_MEDMEM_Interpolation.cxx new file mode 100644 index 000000000..5d8112d8e --- /dev/null +++ b/src/MEDMEM/INTERPOLATION/test_MEDMEM_Interpolation.cxx @@ -0,0 +1,56 @@ +#include "MEDMEM_Exception.hxx" +#include "MEDMEM_define.hxx" + +#include "MEDMEM_Field.hxx" +#include "MEDMEM_Mesh.hxx" +#include "MEDMEM_Interpolation.hxx" + +#include "stdio.h" + +main () { + + const char * fromFileName = "fromMesh.med"; + const char * toFileName = "toMesh.med"; + //const char * fieldName = "fieldcelldoublevector"; + const char * fieldName = "fieldnodedouble"; + + const char * fromMeshName = "fromMesh"; + const char * toMeshName = "toMesh"; + + try { + + cout<<"Lecture du Maillage Source : "< fromField (&fromSupport,MED_DRIVER,fromFileName,fieldName); cout<<"OK !"< myInter (fromField,toMesh); + + //FIELD * toField = myInter.interpolate(0,1); + FIELD * toField = myInter.interpolate(1,1); + + cout<<"Creation du driver"<addDriver(MED_DRIVER,toFileName,toField->getName()) ; + + cout<<"toField->getName() = "<getName() <getDescription() = "<getDescription() <getNumberOfComponents() = "<getNumberOfComponents() <getNumberOfValues() = "<getNumberOfValues() <getComponentsNames() = "<getComponentsNames() <getComponentsDescriptions() = "<getComponentsDescriptions()<getMEDComponentsUnits() = "<getMEDComponentsUnits() <getIterationNumber() = "<getIterationNumber() <getTime() = "<getTime() <getOrderNumber() = "<getOrderNumber() <getValueType() = "<getValueType() <write(); + + cout<<"Fin"<& /dev/null" >> ${SALOME_BIN_TESTS}/killEnviron ${TERMINAL} ${TITRE3} -e ${SALOME_BIN_TESTS}/csh/init3 & echo "kill -9 $! >& /dev/null" >> ${SALOME_BIN_TESTS}/killEnviron -echo "cd ${SALOME_ROOT_DIR}/bin ; ./allkill ; killall python >& /dev/null" >> ${SALOME_BIN_TESTS}/killEnviron +echo "cd ${MED_ROOT_DIR}/bin ; ./allkill ; killall python >& /dev/null" >> ${SALOME_BIN_TESTS}/killEnviron echo "\\rm -f ${SALOME_BIN_TESTS}/killEnviron" >> ${SALOME_BIN_TESTS}/killEnviron chmod u+x ${SALOME_BIN_TESTS}/killEnviron diff --git a/src/MedClient/test/environ/csh/stopContainer.in b/src/MedClient/test/environ/csh/stopContainer.in index 5d3a362be..95cfa69e4 100644 --- a/src/MedClient/test/environ/csh/stopContainer.in +++ b/src/MedClient/test/environ/csh/stopContainer.in @@ -34,19 +34,19 @@ fi PYTHON_VERSION=python2.2 -# you must define SALOME_ROOT_DIR and SALOME_SITE_DIR (if you need it) +# you must define KERNEL_ROOT_DIR and MED_ROOT_DIR (if you need it) -if test -n ${SALOME_ROOT_DIR} +if test -n ${KERNEL_ROOT_DIR} then - export PATH=${SALOME_ROOT_DIR}/bin:${PATH} - export LD_LIBRARY_PATH=${SALOME_ROOT_DIR}/lib:${LD_LIBRARY_PATH} - export PYTHONPATH=${SALOME_ROOT_DIR}/lib:${SALOME_ROOT_DIR}/lib/${PYTHON_VERSION}/site-packages/salome:${PYTHONPATH} + export PATH=${KERNEL_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + export PYTHONPATH=${KERNEL_ROOT_DIR}/lib:${KERNEL_ROOT_DIR}/lib/${PYTHON_VERSION}/site-packages/salome:${PYTHONPATH} fi -if test -n ${SALOME_SITE_DIR} +if test -n ${MED_ROOT_DIR} then - export PATH=${SALOME_SITE_DIR}/bin:${PATH} - export LD_LIBRARY_PATH=${SALOME_SITE_DIR}/lib:${LD_LIBRARY_PATH} - export PYTHONPATH=${SALOME_SITE_DIR}/lib:${SALOME_SITE_DIR}/lib/${PYTHON_VERSION}/site-packages/salome:${PYTHONPATH} + export PATH=${MED_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${MED_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + export PYTHONPATH=${MED_ROOT_DIR}/lib:${MED_ROOT_DIR}/lib/${PYTHON_VERSION}/site-packages/salome:${PYTHONPATH} fi if test -d ${HOME}/.salome/bin diff --git a/src/MedClient/test/environ/runTestMedCorba.in b/src/MedClient/test/environ/runTestMedCorba.in index 0e33fed11..c152b3c71 100644 --- a/src/MedClient/test/environ/runTestMedCorba.in +++ b/src/MedClient/test/environ/runTestMedCorba.in @@ -2,19 +2,19 @@ PYTHON_VERSION=python@PYTHON_VERSION@ -if test -n $SALOME_ROOT_DIR +if test -n $MED_ROOT_DIR then - export PATH=$SALOME_ROOT_DIR/bin:${PATH} - export LD_LIBRARY_PATH=$SALOME_ROOT_DIR/lib:${LD_LIBRARY_PATH} - export PYTHONPATH=${SALOME_ROOT_DIR}/lib:${SALOME_ROOT_DIR}/lib/$PYTHON_VERSION/site-packages/salome:${SALOME_ROOT_DIR}/share/salome/resources:${PYTHONPATH} + export PATH=$MED_ROOT_DIR/bin:${PATH} + export LD_LIBRARY_PATH=$MED_ROOT_DIR/lib:${LD_LIBRARY_PATH} + export PYTHONPATH=${MED_ROOT_DIR}/lib:${MED_ROOT_DIR}/lib/$PYTHON_VERSION/site-packages/salome:${MED_ROOT_DIR}/share/salome/resources:${PYTHONPATH} # add bin, because some script are in (SALOME_SWIG) !!!! - export PYTHONPATH=${SALOME_ROOT_DIR}/bin:${PYTHONPATH} + export PYTHONPATH=${MED_ROOT_DIR}/bin:${PYTHONPATH} fi -if test -n $SALOME_SITE_DIR +if test -n $MED_ROOT_DIR then - export PATH=$SALOME_SITE_DIR/bin:${PATH} - export LD_LIBRARY_PATH=$SALOME_SITE_DIR/lib:${LD_LIBRARY_PATH} - export PYTHONPATH=${SALOME_SITE_DIR}/lib:${SALOME_SITE_DIR}/lib/$PYTHON_VERSION/site-packages/salome:${SALOME_SITE_DIR}/share/salome/resources:${PYTHONPATH} + export PATH=$MED_ROOT_DIR/bin:${PATH} + export LD_LIBRARY_PATH=$MED_ROOT_DIR/lib:${LD_LIBRARY_PATH} + export PYTHONPATH=${MED_ROOT_DIR}/lib:${MED_ROOT_DIR}/lib/$PYTHON_VERSION/site-packages/salome:${MED_ROOT_DIR}/share/salome/resources:${PYTHONPATH} fi mkdir -p resultats diff --git a/src/MedClient/test/test1/Makefile.in b/src/MedClient/test/test1/Makefile.in index d40d1998f..560a739e3 100644 --- a/src/MedClient/test/test1/Makefile.in +++ b/src/MedClient/test/test1/Makefile.in @@ -28,7 +28,7 @@ top_srcdir=@top_srcdir@ top_builddir=../../../.. srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:@srcdir@/resources:@top_srcdir@/idl:${KERNEL_ROOT_DIR}/idl/salome +VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:@srcdir@/resources:@top_srcdir@/idl @COMMENCE@ diff --git a/src/MedClient/test/test1/TestMedCorba1.py b/src/MedClient/test/test1/TestMedCorba1.py index 51e414e9d..c62ef22ce 100644 --- a/src/MedClient/test/test1/TestMedCorba1.py +++ b/src/MedClient/test/test1/TestMedCorba1.py @@ -1,5 +1,5 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test1/TestMedCorba2.py b/src/MedClient/test/test1/TestMedCorba2.py index 04960610c..6376e4da3 100644 --- a/src/MedClient/test/test1/TestMedCorba2.py +++ b/src/MedClient/test/test1/TestMedCorba2.py @@ -1,5 +1,5 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test1/TestMedCorba3.py b/src/MedClient/test/test1/TestMedCorba3.py index a13b7555d..9ec34ebe2 100644 --- a/src/MedClient/test/test1/TestMedCorba3.py +++ b/src/MedClient/test/test1/TestMedCorba3.py @@ -1,5 +1,5 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test1/TestMedCorba4.py b/src/MedClient/test/test1/TestMedCorba4.py index 341db6e7d..f937a640d 100644 --- a/src/MedClient/test/test1/TestMedCorba4.py +++ b/src/MedClient/test/test1/TestMedCorba4.py @@ -1,5 +1,5 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test1/TestMedCorba5.py b/src/MedClient/test/test1/TestMedCorba5.py index 7b5b47da9..f18add816 100644 --- a/src/MedClient/test/test1/TestMedCorba5.py +++ b/src/MedClient/test/test1/TestMedCorba5.py @@ -1,5 +1,5 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test1/resources/CatalogModuleTest.xml b/src/MedClient/test/test1/resources/CatalogModuleTest.xml new file mode 100644 index 000000000..431ae25c8 --- /dev/null +++ b/src/MedClient/test/test1/resources/CatalogModuleTest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + Compo1Py + Solver + RASCLE + 1.0 + Essai Aster + 1 + ModuleASTER.png + hostname = localhost + + + diff --git a/src/MedClient/test/test2/Makefile.in b/src/MedClient/test/test2/Makefile.in index 3d323f8fd..30976ae43 100644 --- a/src/MedClient/test/test2/Makefile.in +++ b/src/MedClient/test/test2/Makefile.in @@ -28,7 +28,7 @@ top_srcdir=@top_srcdir@ top_builddir=../../../.. srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome +VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl @COMMENCE@ diff --git a/src/MedClient/test/test2/TestMedCorba6.py b/src/MedClient/test/test2/TestMedCorba6.py index 7b6dc840e..403690f02 100644 --- a/src/MedClient/test/test2/TestMedCorba6.py +++ b/src/MedClient/test/test2/TestMedCorba6.py @@ -3,7 +3,7 @@ import os ## ne fonctionne pas ? ## import salome -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'carre_en_quad4_seg2.med' diff --git a/src/MedClient/test/test2/TestMedCorba7.py b/src/MedClient/test/test2/TestMedCorba7.py index f0672e41f..46e2e4dbc 100644 --- a/src/MedClient/test/test2/TestMedCorba7.py +++ b/src/MedClient/test/test2/TestMedCorba7.py @@ -1,6 +1,6 @@ import os -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'test_hydro_darcy1a_out.med' diff --git a/src/MedClient/test/test2/TestMedCorba8.py b/src/MedClient/test/test2/TestMedCorba8.py index b141b1e62..74538d53d 100644 --- a/src/MedClient/test/test2/TestMedCorba8.py +++ b/src/MedClient/test/test2/TestMedCorba8.py @@ -2,7 +2,7 @@ import os # import salome -BASE = os.environ["SALOME_ROOT_DIR"] + '/share/salome/resources/' +BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/' fileName = BASE + 'pointe.med' fileName = BASE + 'test_hydro_darcy1a_out.med' -- 2.39.2