MED fichier
UsesCase_MEDstructElement_1.c
Aller à la documentation de ce fichier.
1/* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2020 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 * StructElement use case 1 : write struct elements model in a file
20 * STEP 1 : suppport mesh creation
21 * STEP 2 : struct element model creation
22 * STEP 3 : computation mesh creation
23 */
24
25#include <med.h>
26#define MESGERR 1
27#include <med_utils.h>
28
29#include <string.h>
30
31int main (int argc, char **argv) {
32 med_idt fid;
33 char elementname[MED_NAME_SIZE+1]="";
34 const char ballsupportname[MED_NAME_SIZE+1]="BALL_SUPPORT_MESH";
35 const char beamsupportname[MED_NAME_SIZE+1]="BEAM_SUPPORT_MESH";
36 const char computmeshname[MED_NAME_SIZE+1]="COMPUT_MESH";
37 const char beamsectionname[MED_NAME_SIZE+1]="BEAM_SECTION_MESH";
38 const med_int elementdim = 3;
39 med_int nnode;
41 med_int ncomp;
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,
44 0.0,0.0,2.0,
45 0.0,0.0,4.0,
46 0.0,0.0,5.0,
47 0.0,0.0,7.0,
48 0.0,0.0,10.0,
49 0.0,0.0,11.0 };
50 const med_float beamsectioncoo[9*3] = {-0.2,-0.2,0.0,
51 0.0,-0.2,0.0,
52 0.2,-0.2,0.0,
53 -0.2, 0.0,0.0,
54 0.0, 0.0,0.0,
55 0.2, 0.0,0.0,
56 -0.2, 0.2,0.0,
57 0.0, 0.2,0.0,
58 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;
61 /* 123456789012345612345678901234561234567890123456 */
62 const char axisname[3*MED_SNAME_SIZE+1] = "x y z "