Aller à la documentation de ce fichier.
31 int main (
int argc,
char **argv) {
34 const char ballsupportname[
MED_NAME_SIZE+1]=
"BALL_SUPPORT_MESH";
35 const char beamsupportname[
MED_NAME_SIZE+1]=
"BEAM_SUPPORT_MESH";
37 const char beamsectionname[
MED_NAME_SIZE+1]=
"BEAM_SECTION_MESH";
42 const med_float ballmeshnodescoo[3] = {0.0, 0.0, 0.0 };
43 const med_float beammeshnodescoo[3*7] = {0.0,0.0,0.0,
50 const med_float beamsectioncoo[9*3] = {-0.2,-0.2,0.0,
59 const med_int seg2connectivity[2*6] = {1,2, 2,3, 3,4, 4,5, 5,6, 6,7};
60 med_int spacedim, meshdim,nseg2;
64 const med_float attvalue[6] = {0.2,0.3,0.4,0.4,0.3,0.2};
66 const char attprovalue[2*
MED_NAME_SIZE+1] = {
"EXTREMITY_1_____________________________________________________" \
67 "EXTREMITY_2_____________________________________________________" };
68 const char profilename[
MED_NAME_SIZE+1] =
"EXTREMITY_PROFILE_NAME";
70 const med_int profile[2] = {1,6};
71 const med_float meshcoo[3*12] = { 0.0, 0.0, 0.0,
84 const med_int beamconnectivity[12] = { 6,7,
91 const med_int labels[3] = { 1, 2, 3 };
92 const med_int ballconnectivity[2] = { 4, 5 };
93 const med_float balldiameter[2] = { 2.0, 5.8 };
95 const med_int beamsectionconnectivity[4*4] = { 4,5,2,1,
104 MESSAGE(
"ERROR : file creation");
113 if (
MEDsupportMeshCr(fid, ballsupportname, spacedim, meshdim,
"Support mesh for a ball model",
115 MESSAGE(
"ERROR : creating a support mesh ...");
122 MESSAGE(
"ERROR : write nodes coordinates ...");
127 if (
MEDsupportMeshCr(fid, beamsupportname, spacedim, meshdim,
"Support mesh for a beam model",
129 MESSAGE(
"ERROR : creating a support mesh ...");
136 MESSAGE(
"ERROR : write nodes coordinates ...");
142 MESSAGE(
"ERROR : write cells connectivity ...");
148 if (
MEDsupportMeshCr(fid, beamsectionname, spacedim, meshdim,
"Support mesh for a section of the beam model",
150 MESSAGE(
"ERROR : creating a support mesh ...");
157 MESSAGE(
"ERROR : write nodes coordinates ...");
163 MESSAGE(
"ERROR : write cells connectivity ...");
172 MESSAGE(
"ERROR : creating struct element");
178 MESSAGE(
"ERROR : creating struct element");
186 MESSAGE(
"ERROR : creating struct element");
192 MESSAGE(
"ERROR : creating struct element");
201 MESSAGE(
"ERROR : creating struct element");
209 MESSAGE(
"ERROR : creating struct element");
215 if (
MEDprofileWr(fid, profilename, profilesize, profile ) < 0) {
216 MESSAGE(
"ERROR : create profile ...");
222 "BEAM_EXTREMITIES_LABELS",
227 (
void*) attprovalue) < 0) {
228 MESSAGE(
"ERROR : creating struct element");
238 MESSAGE(
"ERROR : creating computation mesh ...");
246 MESSAGE(
"ERROR : writing nodes coordinates ...");
259 MESSAGE(
"ERROR : beam connectivity ...");
274 MESSAGE(
"ERROR : writing particles connectivity ...");
282 nentity, labels) < 0 ) {
283 MESSAGE(
"ERROR : writing variable attributes ...");
295 MESSAGE(
"ERROR : writing balls connectivity");
302 nentity, balldiameter) < 0 ) {
303 MESSAGE(
"ERROR : writing variable attributes ...");
313 MESSAGE(
"ERROR : file closing");
#define MED_BALL_DIAMETER
MEDC_EXPORT med_err MEDstructElementConstAttWr(const med_idt fid, const char *const modelname, const char *const constattname, const med_attribute_type constatttype, const med_int ncomponent, const med_entity_type sentitytype, const void *const value)
Cette routine définit un attribut caractéristique constant d'un modèle d'éléments de structure.
#define MED_PARTICLE_LABEL
MEDC_EXPORT med_err MEDmeshCr(const med_idt fid, const char *const meshname, const med_int spacedim, const med_int meshdim, const med_mesh_type meshtype, const char *const description, const char *const dtunit, const med_sorting_type sortingtype, const med_axis_type axistype, const char *const axisname, const char *const axisunit)
Cette routine permet de créer un maillage dans un fichier.
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
MEDC_EXPORT med_err MEDstructElementConstAttWithProfileWr(const med_idt fid, const char *const modelname, const char *const constattname, const med_attribute_type constatttype, const med_int ncomponent, const med_entity_type sentitytype, const char *const profilename, const void *const value)
Cette routine définit un attribut caractéristique constant d'un modèle d'éléments de structure.
#define MED_PARTICLE_NAME
#define ISCRUTE_int(entier)
int main(int argc, char **argv)
MEDC_EXPORT med_err MEDmeshStructElementVarAttWr(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_geometry_type mgeotype, const char *const varattname, const med_int nentity, const void *const value)
Cette routine écrit les valeurs d'un attribut caractéristique variable sur les éléments de structure ...
MEDC_EXPORT med_err MEDmeshNodeCoordinateWr(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_float dt, const med_switch_mode switchmode, const med_int nentity, const med_float *const coordinates)
Cette routine permet d'écrire dans un maillage le tableau des coordonnées des noeuds,...
MEDC_EXPORT med_geometry_type MEDstructElementGeotype(const med_idt fid, const char *const modelname)
Cette routine renvoie le type géométrique mgeotype associé au modèle d'éléments de structure de nom m...
#define MED_BEAM_THICKNESS
MEDC_EXPORT med_err MEDprofileWr(const med_idt fid, const char *const profilename, const med_int profilesize, const med_int *const profilearray)
Cette routine permet d'écrire un profil dans un fichier MED.
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
MEDC_EXPORT med_err MEDmeshElementConnectivityWr(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_float dt, const med_entity_type entitype, const med_geometry_type geotype, const med_connectivity_mode cmode, const med_switch_mode switchmode, const med_int nentity, const med_int *const connectivity)
Cette routine permet d'écrire dans un maillage le tableau des connectivités pour un type géométrique ...
MEDC_EXPORT med_err MEDstructElementVarAttCr(const med_idt fid, const char *const modelname, const char *const varattname, const med_attribute_type varatttype, const med_int ncomponent)
Cette routine déclare la présence d'un attribut caractéristique variable attaché aux éléments de type...
MEDC_EXPORT med_err MEDsupportMeshCr(const med_idt fid, const char *const supportmeshname, const med_int spacedim, const med_int meshdim, const char *const description, const med_axis_type axistype, const char *const axisname, const char *const axisunit)
Cette routine permet de créer un maillage support.
MEDC_EXPORT med_geometry_type MEDstructElementCr(const med_idt fid, const char *const modelname, const med_int modeldim, const char *const supportmeshname, const med_entity_type sentitytype, const med_geometry_type sgeotype)
Cette routine permet de créer un nouveau modèle d'éléments de structure dans un fichier MED.