| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 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 |
|
| 25 |
void _MEDsubdomainCorrespondenceSizeInfo30(int dummy, ...) { |
| 26 |
|
| 27 |
|
| 28 |
med_err _ret=-1; |
| 29 |
med_idt _datagroup1=0,_dataset=0; |
| 30 |
int _num; |
| 31 |
char _path[MED_JOINT_GRP_SIZE+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+4*MED_TAILLE_NOM_ENTITE+4]=MED_JOINT_GRP; |
| 32 |
char _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]=""; |
| 33 |
char _cstpname[2*MED_MAX_PARA+1]=""; |
| 34 |
med_sorting_type _sortingtype=0; |
| 35 |
med_int _intlocalentitype; |
| 36 |
med_int _intlocalgeotype; |
| 37 |
med_int _intremoteentitype; |
| 38 |
med_int _intremotegeotype; |
| 39 |
|
| 40 |
|
| 41 |
MED_VARGS_DECL(const, med_idt , , fid ); |
| 42 |
MED_VARGS_DECL(const, char * , const , meshname ); |
| 43 |
MED_VARGS_DECL(const, char * , const , jointname ); |
| 44 |
MED_VARGS_DECL(const, med_int , , numdt ); |
| 45 |
MED_VARGS_DECL(const, med_int , , numit ); |
| 46 |
MED_VARGS_DECL(const, int , , corit ); |
| 47 |
MED_VARGS_DECL(, med_entity_type *, const , localentitype ); |
| 48 |
MED_VARGS_DECL(, med_geometry_type *, const , localgeotype ); |
| 49 |
MED_VARGS_DECL(, med_entity_type *, const , remoteentitype ); |
| 50 |
MED_VARGS_DECL(, med_geometry_type *, const , remotegeotype ); |
| 51 |
MED_VARGS_DECL(, med_int *, const , nentitycor ); |
| 52 |
MED_VARGS_DECL(, med_err * ,, fret ); |
| 53 |
|
| 54 |
va_list params; |
| 55 |
va_start(params,dummy); |
| 56 |
|
| 57 |
MED_VARGS_DEF(const, med_idt , , fid ); |
| 58 |
MED_VARGS_DEF(const, char * , const , meshname ); |
| 59 |
MED_VARGS_DEF(const, char * , const , jointname ); |
| 60 |
MED_VARGS_DEF(const, med_int , , numdt ); |
| 61 |
MED_VARGS_DEF(const, med_int , , numit ); |
| 62 |
MED_VARGS_DEF(const, int , , corit ); |
| 63 |
MED_VARGS_DEF(, med_entity_type *, const , localentitype ); |
| 64 |
MED_VARGS_DEF(, med_geometry_type *, const , localgeotype ); |
| 65 |
MED_VARGS_DEF(, med_entity_type *, const , remoteentitype ); |
| 66 |
MED_VARGS_DEF(, med_geometry_type *, const , remotegeotype ); |
| 67 |
MED_VARGS_DEF(, med_int *, const , nentitycor ); |
| 68 |
MED_VARGS_DEF(, med_err * ,, fret ); |
| 69 |
|
| 70 |
_num = corit -1; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
_MEDmodeErreurVerrouiller(); |
| 77 |
|
| 78 |
|
| 79 |
if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) { |
| 80 |
MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd"); |
| 81 |
SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR; |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
strcat( _path, meshname); |
| 86 |
strcat( _path, "/"); |
| 87 |
strcat( _path, jointname); |
| 88 |
strcat( _path, "/"); |
| 89 |
_MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]); |
| 90 |
strcat( _path, "/"); |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) { |
| 96 |
MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit); |
| 97 |
goto ERROR; |
| 98 |
} |
| 99 |
|
| 100 |
if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) { |
| 101 |
MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path); |
| 102 |
goto ERROR; |
| 103 |
} |
| 104 |
|
| 105 |
|
| 106 |
if (_MEDattrEntierLire(_datagroup1,MED_NOM_ENT,&_intlocalentitype) < 0) { |
| 107 |
MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT); |
| 108 |
ISCRUTE(_intlocalentitype);goto ERROR; |
| 109 |
} |
| 110 |
*localentitype = (med_entity_type) _intlocalentitype; |
| 111 |
|
| 112 |
if (_MEDattrEntierLire(_datagroup1,MED_NOM_GEO,&_intlocalgeotype) < 0) { |
| 113 |
MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO); |
| 114 |
ISCRUTE(_intlocalgeotype);goto ERROR; |
| 115 |
} |
| 116 |
*localgeotype = (med_geometry_type) _intlocalgeotype; |
| 117 |
|
| 118 |
|
| 119 |
if (_MEDattrEntierLire(_datagroup1,MED_NOM_END,&_intremoteentitype) < 0) { |
| 120 |
MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT); |
| 121 |
ISCRUTE(_intremoteentitype);goto ERROR; |
| 122 |
} |
| 123 |
*remoteentitype = (med_entity_type) _intremoteentitype; |
| 124 |
|
| 125 |
if (_MEDattrEntierLire(_datagroup1,MED_NOM_GED,&_intremotegeotype) < 0) { |
| 126 |
MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO); |
| 127 |
ISCRUTE(_intremotegeotype);goto ERROR; |
| 128 |
} |
| 129 |
*remotegeotype = (med_geometry_type) _intremotegeotype; |
| 130 |
|
| 131 |
if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) { |
| 132 |
MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR); |
| 133 |
SSCRUTE(_path); |
| 134 |
goto ERROR; |
| 135 |
} |
| 136 |
|
| 137 |
if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentitycor) < 0) { |
| 138 |
MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG); |
| 139 |
SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentitycor); |
| 140 |
goto ERROR; |
| 141 |
} |
| 142 |
|
| 143 |
_ret = 0; |
| 144 |
ERROR: |
| 145 |
|
| 146 |
if (_dataset>0) if (_MEDdatasetFermer(_dataset) < 0) { |
| 147 |
MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR); |
| 148 |
ISCRUTE_id(_dataset); |
| 149 |
} |
| 150 |
|
| 151 |
if (_datagroup1>0) if (_MEDdatagroupFermer(_datagroup1) < 0) { |
| 152 |
MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path); |
| 153 |
ISCRUTE_id(_datagroup1); |
| 154 |
} |
| 155 |
|
| 156 |
va_end(params); |
| 157 |
*fret = _ret; |
| 158 |
return; |
| 159 |
} |