27 #include <med_utils.h>
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");