MED fichier

MEDmeshNodeRd.c
Aller à la documentation de ce fichier.
1 /* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2021 EDF R&D, CEA/DEN
4 * MED is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * MED is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with MED. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19 #include <med.h>
20 #include <med_config.h>
21 #include <med_outils.h>
22 #include <string.h>
23 #include <stdlib.h>
24
43 med_err MEDmeshNodeRd(const med_idt fid,
44 const char * const meshname,
45 const med_int numdt,
46 const med_int numit,
47 const med_switch_mode switchmode,
48 med_float * const coordinate,
49 med_bool * const withnodename,
50 char * const nodename,
51 med_bool * const withnodenumber,
52 med_int * const nodenumber,
53 med_bool * const withfamnumber,
54 med_int * const famnumber) {
55
56 med_err _ret = -1;
57 med_entity_type _entitype = MED_NODE;
58 med_geometry_type _geotype = MED_NONE;
59 med_bool _chgt=MED_FALSE, _trsf=MED_FALSE;
60
61 *withnodename = MED_FALSE;
62 *withnodenumber = MED_FALSE;
63 *withfamnumber = MED_FALSE;
64
65 if ( (_ret = MEDmeshNodeCoordinateRd(fid,
66 meshname,
67 numdt,
68 numit,
69 switchmode,
70 coordinate) ) < 0 ) {
71 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshNodeCoordinateRd");
72 goto ERROR;
73 }
74
75
76 if ( MEDmeshnEntity(fid, meshname, numdt, numit,
77 _entitype,_geotype,MED_NAME, MED_NO_CMODE,
78 &_chgt, &_trsf) > 0) {
79 *withnodename=MED_TRUE;
80 }
81
82
83 if ( *withnodename )
84 if ( (_ret = MEDmeshEntityNameRd(fid,
85 meshname,
86 numdt,
87 numit,
88 _entitype,
89 _geotype,
90 nodename) ) < 0 ) {
91 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNameRd");
92 goto ERROR;
93 }
94
95 if ( MEDmeshnEntity(fid, meshname, numdt, numit,
96 _entitype,_geotype,MED_NUMBER, MED_NO_CMODE,
97 &_chgt, &_trsf) > 0) {
98 *withnodenumber=MED_TRUE;
99 }
100
101
102 if ( *withnodenumber )
103 if ( (_ret = MEDmeshEntityNumberRd(fid,
104 meshname,
105 numdt,
106 numit,
107 _entitype,
108 _geotype,
109 nodenumber) ) < 0 ) {
110 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNumberRd");
111 goto ERROR;
112 }
113
114 if ( MEDmeshnEntity(fid, meshname, numdt, numit,
115 _entitype,_geotype,MED_FAMILY_NUMBER, MED_NO_CMODE,
116 &_chgt, &_trsf) > 0) {
117 *withfamnumber=MED_TRUE;
118 }
119
120
121 if (*withfamnumber)
122 if ( (_ret = MEDmeshEntityFamilyNumberRd(fid,
123 meshname,
124 numdt,
125 numit,
126 _entitype,
127 _geotype,
128 famnumber) ) < 0 ) {
129 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityFamilyNumberRd");
130 goto ERROR;
131 }
132
133 _ret = 0;
134 ERROR:
135 return _ret;
136 }
MED_ERR_API
#define MED_ERR_API
Definition: med_err.h:111
MEDmeshnEntity
MEDC_EXPORT med_int MEDmeshnEntity(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, const med_data_type datatype, const med_connectivity_mode cmode, med_bool *const changement, med_bool *const transformation)
Cette routine permet de lire le nombre d'entités dans un maillage pour une étape de calcul donnée.
Definition: MEDmeshnEntity.c:44
MEDmeshEntityNumberRd
MEDC_EXPORT med_err MEDmeshEntityNumberRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, med_int *const number)
Cette routine permet de lire les numéros d'un type d'entité d'un maillage.
Definition: MEDmeshEntityNumberRd.c:38
med_geometry_type
int med_geometry_type
Definition: med.h:194
med_idt
hid_t med_idt
Definition: med.h:331
MED_ERR_
#define MED_ERR_(rt, r1, r2, r3)
Definition: med_utils.h:160
med_err
herr_t med_err
Definition: med.h:332
MED_TRUE
Definition: med.h:260
med_entity_type
med_entity_type
Definition: med.h:143
MED_NO_CMODE
Definition: med.h:255
MED_FALSE
Definition: med.h:260
med_int
int med_int
Definition: med.h:342
MED_NUMBER
Definition: med.h:149
MED_ERR_CALL
#define MED_ERR_CALL
Definition: med_err.h:48
med.h
med_bool
med_bool
Definition: med.h:260
MEDmeshEntityNameRd
MEDC_EXPORT med_err MEDmeshEntityNameRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, char *const name)
Cette routine permet de lire les noms d'un type d'entité d'un maillage.
Definition: MEDmeshEntityNameRd.c:38
MED_FAMILY_NUMBER
Definition: med.h:149
med_float
double med_float
Definition: med.h:336
MED_NONE
#define MED_NONE
Definition: med.h:231
MED_NODE
Definition: med.h:143
MEDmeshNodeRd
med_err MEDmeshNodeRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_switch_mode switchmode, med_float *const coordinate, med_bool *const withnodename, char *const nodename, med_bool *const withnodenumber, med_int *const nodenumber, med_bool *const withfamnumber, med_int *const famnumber)
Cette routine permet la lecture des noeuds d'un maillage non structuré pour une étape de calcul donné...
Definition: MEDmeshNodeRd.c:43
med_switch_mode
med_switch_mode
Definition: med.h:96
MEDmeshNodeCoordinateRd
MEDC_EXPORT med_err MEDmeshNodeCoordinateRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_switch_mode switchmode, med_float *const coordinates)
Cette routine permet de lire dans un maillage le tableau des coordonnées des noeuds,...
Definition: MEDmeshNodeCoordinateRd.c:37
med_outils.h
med_config.h
MEDmeshEntityFamilyNumberRd
MEDC_EXPORT med_err MEDmeshEntityFamilyNumberRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, med_int *const number)
Cette routine permet la lecture des numéros de famille d'un type d'entité d'un maillage.
Definition: MEDmeshEntityFamilyNumberRd.c:39
MED_NAME
Definition: med.h:149