Test_MEDinterpCr.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2015  EDF R&D, CEA/DEN
00004  *  MED is free software: you can redistribute it and/or modify
00005  *  it under the terms of the GNU Lesser General Public License as published by
00006  *  the Free Software Foundation, either version 3 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  MED is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public License
00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #include <med.h>
00019 #define MESGERR 1
00020 #include <med_utils.h>
00021 #include <string.h>
00022 
00023 #ifdef DEF_LECT_ECR
00024 #define MODE_ACCES MED_ACC_RDWR
00025 #elif DEF_LECT_AJOUT
00026 #define MODE_ACCES MED_ACC_RDEXT
00027 #else
00028 #define MODE_ACCES MED_ACC_CREAT
00029 #endif
00030 
00031 int main (int argc, char **argv)
00032 
00033 {
00034   med_err           _ret=0;
00035   med_idt           _fid=0;
00036 
00037   /*Exemple 1 :
00038 
00039   - Elément de référence de type géométrique MED_TRIA3
00040   - Point X(X1,X2) quelconque dans le plan de l'élément de référence
00041   - Fonctions de base : P1(X)=1-X1-X2 ; P2(X)=X1; P3(X)=X2;
00042     (issu du choix de la base polynomiale (1,X1,X2)
00043      et des trois noeuds de la maille de référence pour
00044      construire l'interpolation)
00045   */
00046   const char         _interpname1[]   ="interpname1";
00047   med_geometry_type  _geotype1        =MED_TRIA3;
00048   med_bool           _cellnodes1      =MED_TRUE;
00049 /*   med_int            _nbasisfunc1  =3; */
00050   med_int            _nvariable1   =2;
00051   med_int            _maxdegree1      =1;
00052   med_int            _nmaxcoefficient1=3;
00053 
00054  /* Ouverture en mode creation du fichier "current.med" */
00055   _fid = MEDfileOpen("current.med",MODE_ACCES);
00056   if (_fid < 0) {
00057     MESSAGE("Erreur a la creation du fichier current.med");
00058     return -1;
00059   }
00060 
00061   if ( (_ret = MEDinterpCr(_fid,
00062                            _interpname1,
00063                            _geotype1,
00064                            _cellnodes1,
00065                            _nvariable1,
00066                            _maxdegree1,
00067                            _nmaxcoefficient1
00068                            ) <0) ) {
00069     MESSAGE("Erreur à la création de la fonction d'interpolation n°1");
00070   }
00071 
00072 
00073   if (MEDfileClose(_fid) < 0) {
00074     MESSAGE("ERROR : file closing");
00075     return -1;
00076   }
00077 
00078 
00079   return _ret;
00080 
00081 }
00082 

Généré le Thu Oct 8 14:26:17 2015 pour MED fichier par  doxygen 1.6.1