forked from VB6Hobbyst7/cgx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendMpc.c
3769 lines (3500 loc) · 142 KB
/
sendMpc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* -------------------------------------------------------------------- */
/* CALCULIX */
/* - GRAPHICAL INTERFACE - */
/* */
/* A 3-dimensional pre- and post-processor for finite elements */
/* Copyright (C) 1996 Klaus Wittig */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; version 2 of */
/* the License. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* -------------------------------------------------------------------- */
/* BUGS
search for "bug:"
*/
#include <cgx.h>
#define TEST 0
#define MIN_NODE_DIST 1.e-12 /* minimum gap between ind and dep for normal-vector calcs */
#define MAXLOOPS 10 /* loops in areampc to adjust the node-pos */
/* WARNING: Never save the model after the following switches were activated */
#define STORE_CONNECTIVITY 0 /* connectivity.txt stores the PIDs of the parts connected with RBEs (mata has to be used after mesh! */
extern int neqn; /* offset der equations fuer ansys, bzw. MPC ID or elemnr for RBEs fuer Nast. */
extern double gtol;
extern char delPntFlag; /* 1: deleted points exists */
extern char delLineFlag; /* 1: deleted lines exists */
extern char delLcmbFlag; /* 1: deleted lcmbs exists */
extern char delSurfFlag; /* 1: deleted surfs exists */
extern char delBodyFlag; /* 1: deleted bodys exists */
extern Scale scale[1];
extern Summen anz[1];
extern Edges *edge;
extern Nodes *node;
extern Elements *e_enqire;
extern Datasets *lcase;
extern Faces *face;
extern Alias *alias;
extern Sets *set;
extern Psets *pset;
extern Points *point;
extern Lines *line;
extern Lcmb *lcmb;
extern Gsur *surf;
extern Gbod *body;
extern Nurbs *nurbs;
extern SumGeo anzGeo[1];
extern SumAsci sumAsci[1];
extern SpecialSet specialset[1];
extern int setall; /* setNr of the default set "all" */
extern char printFlag; /* printf 1:on 0:off */
extern CopiedNodeSets copiedNodeSets[1];
extern int nasMpc; /* 1: areampc generates mpcs; 0: rbes with optional heat-expansion-coefficient */
extern double nasRbeHec;
#define DOFX 1
#define DOFY 2
#define DOFZ 3
#define DOFP 8
#define DOFT 11
#define DPHI_TOL 0.017453 /* 1grd */
#define MIN_VECTOR 0.0001
#define N_CLOSEST_NODES 10
double MIN_C={0.5}; /* zulaessiger flaechenfehler in calcCoefficientsTri() */
double MAX_C={2.}; /* wird durch verschieben der nodes korrigiert */
void sendMpc( char *setname, char *format, char *rotation , double *vector)
{
int i,j;
int length, setNr, indeql;
char prognam[MAX_LINE_LENGTH], boundary[MAX_LINE_LENGTH];
FILE *handle, *handle_boundary;
double sum[3]={0.,0.,0.};
static int ntwist=0;
#if STORE_CONNECTIVITY
FILE *handle_pid;
#endif
if(neqn<anz->emax) neqn=anz->emax;
strcpy ( prognam, setname);
length= strlen ( setname );
setNr=getSetNr(setname);
if (setNr<0)
{
printf (" ERROR: set:%s does not exist\n", setname);
return;
}
strcpy ( prognam, setname);
length= strlen ( setname );
strcpy (&prognam[length], ".mpc");
handle = fopen (prognam, "w");
if ( handle== NULL )
{
printf ("\nThe input file %s could not be opened.\n\n", prognam);
return;
}
/* write the mpcs in nastran-format as RBE2 */
if (compare( format, "nas", 3)== 3)
{
if((rotation[0]=='v')||(rotation[0]=='n'))
{
/* free the additional midside-nodes for higher order elements */
for(i=anz->orign; i<anz->n; i++) node[node[i].nr].pflag=-1;
anz->n= anz->orign;
anz->nmax=anz->orignmax;
/* define a node in the center of the dependent nodes if no coordinates are specified */
indeql=anz->nnext++;
if(rotation[0]=='v')
{
if(strlen(rotation)>1) indeql=atoi(&rotation[1]);
nod( anz, &node, 1, indeql, vector[0], vector[1], vector[2], 1 );
}
else
{
if(rotation[0]=='n') if(strlen(rotation)>1) indeql=atoi(&rotation[1]);
for (i=0; i<set[setNr].anz_n; i++ )
{
sum[0]+=node[set[setNr].node[i]].nx;
sum[1]+=node[set[setNr].node[i]].ny;
sum[2]+=node[set[setNr].node[i]].nz;
}
for (i=0; i<3; i++) sum[i]/=set[setNr].anz_n;
nod( anz, &node, 1, indeql, sum[0], sum[1], sum[2], 0 );
}
seta(setall, "n", indeql);
/* define the rbe */
//fprintf(handle, "RBE2,%8d,%8d, 123456", ++neqn, indeql);
fprintf(handle, "RBE2 %8d%8d 123456", ++neqn, indeql);
j=0; for (i=0; i<set[setNr].anz_n; i++ )
{
//fprintf(handle, ",%8d", set[setNr].node[i] );
fprintf(handle, "%8d", set[setNr].node[i] );
if(i!=set[setNr].anz_n-1)
{ if( i==4 ) { fprintf(handle, "\n "); j++; }
if( (i-4)==8*j ) { fprintf(handle, "\n "); j++; }
}
}
if(nasRbeHec>0.) fprintf(handle, "%5.2fE-5", nasRbeHec*1e5 );
fprintf(handle, "\n");
fclose(handle);
#if STORE_CONNECTIVITY
/* generate a list of connection pid and first neqn (only use with care, dep and ind sets are changed) */
handle_pid = fopen ("connectivity.txt", "a");
if (handle==NULL) { printf ("\nThe output file \"connectivity.txt\" could not be opened.\n\n"); return; }
else printf (" connectivity.txt opened\n" );
completeSet(set[setNr].name,"up");
if(set[setNr].anz_e)
{
printf("Set %s PID %d connected by elem %d to_node %d\n", set[setNr].name, e_enqire[set[setNr].elem[0]].mat, neqn, indeql);
fprintf(handle_pid,"Set %s PID %d connected by elem %d to_node %d ", set[setNr].name, e_enqire[set[setNr].elem[0]].mat, neqn, indeql);
if(nasRbeHec>0.) fprintf(handle_pid, "HC %5.2fE-5 ", nasRbeHec*1e5 );
fprintf (handle_pid,"DOFs: 123456\n");
}
else
{
printf("Set %s w/o_elems connected by elem %d to_node %d\n", set[setNr].name, neqn, indeql);
fprintf(handle_pid,"Set %s PID %d connected by elem %d to_node %d ", set[setNr].name, neqn, indeql);
if(nasRbeHec>0.) fprintf(handle_pid, "HC %5.2fE-5 ", nasRbeHec*1e5 );
fprintf (handle_pid,"DOFs: 123456\n");
}
fclose(handle_pid);
printf("\nWARNING: sets %s were upwards completed, do not save.\n\n", set[setNr].name);
#endif
/* new midnodes */
adjustDrawNodes(1);
makeSurfaces();
getElemNormalen( e_enqire, node, anz->e );
realloc_colNr();
updateDispLists();
}
else
{
errMsg(" ERROR: format %s does not yet support %s \n", format, rotation);
}
}
/* write the mpcs in abaqus-format */
else if (compare( format, "abq", 3)== 3)
{
if((rotation[0]=='v')||(rotation[0]=='n'))
{
/* free the additional midside-nodes for higher order elements */
for(i=anz->orign; i<anz->n; i++) node[node[i].nr].pflag=-1;
anz->n= anz->orign;
anz->nmax=anz->orignmax;
/* define a node in the center of the dependent nodes if no coordinates are specified */
indeql=anz->nnext++;
if(rotation[0]=='v')
{
if(strlen(rotation)>1) indeql=atoi(&rotation[1]);
nod( anz, &node, 1, indeql, vector[0], vector[1], vector[2], 1 );
}
else
{
if(rotation[0]=='n') if(strlen(rotation)>1) indeql=atoi(&rotation[1]);
for (i=0; i<set[setNr].anz_n; i++ )
{
sum[0]+=node[set[setNr].node[i]].nx;
sum[1]+=node[set[setNr].node[i]].ny;
sum[2]+=node[set[setNr].node[i]].nz;
}
for (i=0; i<3; i++) sum[i]/=set[setNr].anz_n;
nod( anz, &node, 1, indeql, sum[0], sum[1], sum[2], 0 );
}
seta(setall, "n", indeql);
/* define the rbe */
neqn++;
fprintf(handle, "*NSET, NSET=NRB%d\n", neqn );
j=0; for (i=0; i<set[setNr].anz_n; i++ )
{
fprintf(handle, "%d,\n", set[setNr].node[i] );
}
fprintf(handle, "*RIGID BODY,NSET=NRB%d,REF NODE=%d\n", neqn, indeql );
fclose(handle);
/* new midnodes */
adjustDrawNodes(1);
makeSurfaces();
getElemNormalen( e_enqire, node, anz->e );
realloc_colNr();
updateDispLists();
}
else
{
strcpy ( boundary, setname);
length= strlen ( setname );
strcpy (&boundary[length], ".bou");
handle_boundary = fopen (boundary, "w");
if ( handle_boundary== NULL )
{
printf ("\nThe input file %s could not be opened.\n\n", boundary);
return;
}
fprintf(handle, "** WARNING: THE USE OF THE ORIGINAL COORDINATE SYSTEM IS MANDATORY\n");
fprintf(handle, "** INCLUDE THE FOLLOWING LINES IN THE MODEL-DEFINITION-SECTION:\n");
fprintf(handle, "** THE LOCATION OF THE INDEPENDENT NODE FOR PRETWIST\n");
fprintf(handle, "** IS USED TO DEFINE THE DIRECTION OF THE ROTATIONAL VECTOR\n");
fprintf(handle, "** AROUND X: 1.,0.,0.\n");
fprintf(handle, "** AROUND Y: 0.,1.,0.\n");
fprintf(handle, "** AROUND Z: 0.,0.,1. (DEFAULT)\n");
fprintf(handle, "*NODE, NSET=Ntwist\n");
fprintf(handle, "%d,%lf,%lf,%lf\n",anz->nnext+ntwist,vector[0],vector[1],vector[2] );
fprintf(handle, "*MPC, USER\n1,");
//fprintf(handle, "*MPC\n");
j=0; for (i=0; i<set[setNr].anz_n; i++ )
{
//if( i==0 ) { fprintf(handle, "1,"); j++; }
//if( i==0 ) { fprintf(handle, "USER,"); j++; }
if( j>12 )
{
j=0;
fprintf(handle, "\n0,");
}
fprintf(handle, "%d,",set[setNr].node[i]);
j++;
fprintf(handle, "%d,",set[setNr].node[i]);
j++;
fprintf(handle, "%d,",set[setNr].node[i]);
j++;
}
if(j>14) fprintf(handle, "\n0,%d\n", anz->nnext+ntwist);
else fprintf(handle, "%d\n", anz->nnext+ntwist);
fclose(handle);
fprintf(handle_boundary, "** INCLUDE THE FOLLOWING LINES IN A STEP:\n");
fprintf(handle_boundary, "** Pretwist of %s degree\n*BOUNDARY\n", rotation);
fprintf(handle_boundary, "%d, 1, 1, %lf\n", anz->nnext+ntwist, atof(rotation)*PI/180.);
fclose(handle_boundary);
// inc the nr of twist nodes (deactivated to give the user control about the reference node)
//ntwist++;
}
}
else
{
errMsg(" ERROR: format %s not yet supported\n", format );
}
printf (" ready\n");
}
void cycmpc(int set1, int set2, char *format, char *value, char *corr)
{
int i,j,s,n;
int firstrun;
int ni,nj;
char datout[MAX_LINE_LENGTH], buffer[MAX_LINE_LENGTH];
double dphi, phi_teilung, phi_vorgabe=0.;
char csys, axis;
double *nx1=0, *nx2=0;
double *nt1=0, *nt2=0;
double *nr1=0, *nr2=0;
double *phi=0;
FILE *handle, *handle2=NULL;
double rmin,dx,dr,R,f;
int node2j=0, *nodbuf=NULL;
int lastNode=-1;
double nv[3];
if ( (compare( format, "abq", 3)!= 3)&&
(compare( format, "ans", 3)!= 3)&&
(compare( format, "ids", 3)!= 3)&&
(compare( format, "nas", 3)!= 3) )
{
errMsg ("ERROR: format:%s not known\n\n", format);
return;
}
/* ---- clear special sets ----- */
delSet(specialset->mpc );
delSet(specialset->nompc );
/* Open the files and check to see that it was opened correctly */
sprintf(datout, "%s.equ", set[set1].name);
if(printFlag) printf ("datout:%s set1:%s set2:%s\n",datout, set[set1].name, set[set2].name);
handle = fopen (datout, "w");
if (handle==NULL) { printf ("\nThe output file \"%s\" could not be opened.\n\n", datout); return; }
else printf (" %s opened\n", datout);
if (compare( format, "abq", 3)== 3) fprintf(handle, "** cycmpc based on set %s %s\n",set[set1].name, set[set2].name );
else if (compare( format, "ans", 3)== 3) fprintf(handle, "! cycmpc based on set %s %s\n",set[set1].name, set[set2].name );
else if (compare( format, "nas", 3)== 3) fprintf(handle, "$ cycmpc based on set %s %s\n",set[set1].name, set[set2].name );
else if (compare( format, "ids", 3)== 3)
{
sprintf(datout, "%s2", datout);
handle2 = fopen (datout, "w");
if (handle2==NULL) { printf ("\nThe output file \"%s\" could not be opened.\n\n", datout); return; }
else printf (" %s opened\n", datout);
}
csys=value[0];
axis=value[1];
i=atoi(&corr[1]); /* startnummer der equations in abaqus, oder id in nastran */
if(i>0) neqn=i-1;
f=atof(&value[2]);
if(f!=0.) phi_vorgabe=2.*PI /f; /* teilungswinkel, berechnet aus der segmentzahl */
/* ------- node-koordinaten berechnen und am ende wieder scalieren ------ */
descalNodes ( anz->n, node, scale );
/* for cfd equations the faces have to be translated to nodes */
if(compare( format, "abqf", 4)== 4)
{
if ( (nodbuf = (int *)malloc( set[set1].anz_n * sizeof(int))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
return;
}
for(i=0; i<set[set1].anz_n; i++) nodbuf[i]=set[set1].node[i];
n=set[set1].anz_n;
for(i=0; i<n; i++) setr(set1,"n",nodbuf[i]);
free(nodbuf);
if ( (nodbuf = (int *)malloc( set[set2].anz_n * sizeof(int))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
return;
}
for(i=0; i<set[set2].anz_n; i++) nodbuf[i]=set[set2].node[i];
n=set[set2].anz_n;
for(i=0; i<n; i++) setr(set2,"n",nodbuf[i]);
free(nodbuf);
// remember the last regular node
lastNode=anz->nmax;
// create a node in the center of the faces
nodbuf=NULL;
for(i=0; i<set[set1].anz_f; i++)
{
s=set[set1].face[i];
if (face[s].type == 7) n = 3; /* TRI3 */
else if (face[s].type == 8) n = 6; /* TRI6 */
else if (face[s].type == 9) n = 4; /* QUAD4 */
else if (face[s].type == 10) n = 8; /* QUAD8 */
else if (face[s].type == 11) n = 2; /* beam2 */
else if (face[s].type == 12) n = 3; /* beam3 */
for(j=0; j<3; j++) nv[j]=0;
for(j=0; j<n; j++)
{
nv[0]+=node[face[s].nod[j]].nx;
nv[1]+=node[face[s].nod[j]].ny;
nv[2]+=node[face[s].nod[j]].nz;
}
for(j=0; j<3; j++) nv[j]/=n;
nod( anz, &node, 0, anz->nmax+1, nv[0], nv[1], nv[2], 0 );
seta(set1,"n",anz->nmax);
if ( (nodbuf = (int *)realloc((int *)nodbuf, (anz->nmax+1) * sizeof(int))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
return;
}
nodbuf[anz->nmax]=s;
}
for(i=0; i<set[set2].anz_f; i++)
{
s=set[set2].face[i];
if (face[s].type == 7) n = 3; /* TRI3 */
else if (face[s].type == 8) n = 6; /* TRI6 */
else if (face[s].type == 9) n = 4; /* QUAD4 */
else if (face[s].type == 10) n = 8; /* QUAD8 */
else if (face[s].type == 11) n = 2; /* beam2 */
else if (face[s].type == 12) n = 3; /* beam3 */
for(j=0; j<3; j++) nv[j]=0;
for(j=0; j<n; j++)
{
nv[0]+=node[face[s].nod[j]].nx;
nv[1]+=node[face[s].nod[j]].ny;
nv[2]+=node[face[s].nod[j]].nz;
}
for(j=0; j<3; j++) nv[j]/=n;
nod( anz, &node, 0, anz->nmax+1, nv[0], nv[1], nv[2], 0 );
seta(set2,"n",anz->nmax);
if ( (nodbuf = (int *)realloc((int *)nodbuf, (anz->nmax+1) * sizeof(int))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
return;
}
nodbuf[anz->nmax]=s;
}
}
/* --------- Seitenflaeche einlesen und Daten aufbereiten --------------- */
if ( (nx1 = (double *)malloc( set[set1].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (nx2 = (double *)malloc( set[set2].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (nt1 = (double *)malloc( set[set1].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (nt2 = (double *)malloc( set[set2].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (nr1 = (double *)malloc( set[set1].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (nr2 = (double *)malloc( set[set2].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
if ( (phi = (double *)malloc( set[set1].anz_n * sizeof(double))) == NULL )
{
errMsg("\nERROR: malloc failed in cycmpc() \n\n");
goto end;
}
/* --------- R,Theta,x Koordinaten berechnen */
if (set[set1].anz_n > anz->n) {printf(" ERROR: side has more nodes than the model"); exit(-1);}
if(axis=='x')
{
if(printFlag) printf(" x-axis specified\n");
for (i=0; i<set[set1].anz_n; i++ )
{
ni=set[set1].node[i];
nx1[i]= node[ni].nx;
nr1[i]= sqrt( node[ni].nz*node[ni].nz + node[ni].ny*node[ni].ny );
if ( nr1[i] )
{
nt1[i]= p_angle( node[ni].nz, node[ni].ny );
}
}
for (i=0; i<set[set2].anz_n; i++ )
{
ni=set[set2].node[i];
nx2[i]= node[ni].nx;
nr2[i]= sqrt( node[ni].nz*node[ni].nz + node[ni].ny*node[ni].ny );
if ( nr2[i] )
{
nt2[i]= p_angle( node[ni].nz, node[ni].ny );
}
}
/* suche nodepaare, berechne differenzwinkel und schreibe EQUATION's */
for (i=0; i<set[set1].anz_n; i++ )
{
ni=set[set1].node[i];
if (nr1[i]>0)
{
/* suche gegenueber liegenden naechsten node */
rmin=MAX_INTEGER;
for (j=0; j<set[set2].anz_n; j++ )
{
nj=set[set2].node[j];
if ((nr2[j]>0)&&( nj!= ni))
{
dx= nx2[j]-nx1[i];
dr= nr2[j]-nr1[i];
R=sqrt( dx*dx + dr*dr );
if (R<rmin)
{
rmin=R;
node2j=j;
}
}
}
nj=set[set2].node[node2j];
/* berechne den differenzwinkel */
phi[i]= nt2[node2j]-nt1[i];
/* definiere den Zielwinkel, entweder vorgabe oder wie berechnet */
if(phi_vorgabe==0.) phi_teilung=phi[i];
else phi_teilung=phi_vorgabe;
firstrun=1;
nexttryx:;
/* kontrolliere den differenzwinkel mit der teilung */
dphi = phi_teilung - phi[i];
if(dphi>2.*PI-DPHI_TOL) while (dphi>2.*PI-DPHI_TOL) dphi-=2.*PI;
if(dphi<-2.*PI+DPHI_TOL) while (dphi<-2.*PI+DPHI_TOL) dphi+=2.*PI;
if ((dphi*dphi > DPHI_TOL)&&(firstrun))
{
firstrun=0;
phi_teilung=-phi_vorgabe;
goto nexttryx;
}
else if ((dphi*dphi > DPHI_TOL)&&(!firstrun))
{
errMsg ("ERROR: korresponding node too far away:%lf grd, see set %s\n",dphi*180./PI, specialset->nompc);
sprintf( buffer, "%d", ni);
pre_seta(specialset->nompc, "n", buffer);
}
else
{
if(printFlag) printf(" theta(%d):%lf theta(%d):%lf dtheta:%lf dtheta_corr:%lf rmin:%lf\n",
ni, nt1[i]*180./PI, set[set2].node[node2j], nt2[node2j]*180./PI,
phi[i]*180./PI, phi_teilung*180./PI, rmin);
if (corr[0]=='c')
{
/* versetze den gefundenen Knoten auf die korrespondierende pos. */
/* der dependent node wird auf die pos des indep gesetzt */
node[ni].nx = node[set[set2].node[node2j]].nx;
if ( nr1[i] )
{
node[ni].ny = node[set[set2].node[node2j]].ny*cos(phi_teilung)-node[set[set2].node[node2j]].nz*sin(phi_teilung);
node[ni].nz = node[set[set2].node[node2j]].ny*sin(phi_teilung)+node[set[set2].node[node2j]].nz*cos(phi_teilung);
}
}
if ((csys=='t')||(csys=='p'))
{
if (compare( format, "abqf", 4)== 4)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 2);
if(csys=='t'){
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFT, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFT, -1. );}
else{
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFP, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFP, -1. );}
}
else if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
if(csys=='t'){
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFT, 1.,
set[set2].node[node2j], DOFT, -1. ); }
else{
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFP, 1.,
set[set2].node[node2j], DOFP, -1. ); }
}
else if (compare( format, "ids", 3)== 3)
{
/* schreibe die EQUATIOS als knotenliste */
fprintf(handle, "%d\n", ni);
fprintf(handle2, "%d\n", set[set2].node[node2j]);
}
}
if (csys=='r')
{
if(compare( format, "abqf", 4)== 4)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFX, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFX, -1. );
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf\n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFY, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFY, -cos(phi_teilung), face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFZ, sin(phi_teilung) );
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf\n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFZ, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFY, -sin(phi_teilung), face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFZ, -cos(phi_teilung) );
}
else if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf, %d,%d,%.12lf\n", ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -cos(phi_teilung), set[set2].node[node2j], DOFZ, sin(phi_teilung) );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf, %d,%d,%.12lf\n", ni, DOFZ, 1.,
set[set2].node[node2j], DOFY, -sin(phi_teilung), set[set2].node[node2j], DOFZ, -cos(phi_teilung) );
}
else if (compare( format, "ans", 3)== 3)
{
/* schreibe die EQUATIOS im Ansysformat */
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UX", 1.,
ni, "UX", 1., set[set2].node[node2j], "UX", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, ni, "UY", 1.,
set[set2].node[node2j], "UY", -cos(phi_teilung), set[set2].node[node2j], "UZ", sin(phi_teilung) );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, ni, "UZ", 1.,
set[set2].node[node2j], "UY", -sin(phi_teilung), set[set2].node[node2j], "UZ", -cos(phi_teilung) );
}
else if (compare( format, "nas", 3)== 3)
{
/* schreibe die EQUATIOS im Nastranformat */
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -cos(phi_teilung));
fprintf(handle, ", ,%8d,%8d,%.12lf\n", set[set2].node[node2j], DOFZ, sin(phi_teilung) );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFZ, 1.,
set[set2].node[node2j], DOFY, -sin(phi_teilung));
fprintf(handle, ", ,%8d,%8d,%.12lf\n", set[set2].node[node2j], DOFZ, -cos(phi_teilung) );
}
}
if (csys=='c')
{
if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -1. );
}
else if (compare( format, "ans", 3)== 3)
{
/* schreibe die EQUATIOS im Ansysformat */
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UX", 1.,
ni, "UX", 1., set[set2].node[node2j], "UX", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UY", 1.,
ni, "UY", 1., set[set2].node[node2j], "UY", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UZ", 1.,
ni, "UZ", 1., set[set2].node[node2j], "UZ", -1. );
}
else if (compare( format, "nas", 3)== 3)
{
/* schreibe die EQUATIOS im Nastranformat */
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -1. );
}
}
sprintf( buffer, "%d", ni);
pre_seta(specialset->mpc, "n", buffer);
}
}
}
}
else if(axis=='y')
{
if(printFlag) printf("y-axis specified\n");
for (i=0; i<set[set1].anz_n; i++ )
{
ni=set[set1].node[i];
nx1[i]= node[ni].ny;
nr1[i]= sqrt( node[ni].nz*node[ni].nz + node[ni].nx*node[ni].nx );
if ( nr1[i] )
{
nt1[i]= p_angle( node[ni].nx, node[ni].nz );
}
}
for (i=0; i<set[set2].anz_n; i++ )
{
ni=set[set2].node[i];
nx2[i]= node[ni].ny;
nr2[i]= sqrt( node[ni].nz*node[ni].nz + node[ni].nx*node[ni].nx );
if ( nr2[i] )
{
nt2[i]= p_angle( node[ni].nx, node[ni].nz );
}
}
/* suche nodepaare, berechne differenzwinkel und schreibe EQUATION's */
for (i=0; i<set[set1].anz_n; i++ )
{
ni=set[set1].node[i];
if (nr1[i]>0)
{
/* suche gegenueber liegenden naechsten node */
rmin=MAX_INTEGER;
for (j=0; j<set[set2].anz_n; j++ )
{
nj=set[set2].node[j];
if ((nr2[j]>0)&&( nj!= ni))
{
dx= nx2[j]-nx1[i];
dr= nr2[j]-nr1[i];
R=sqrt( dx*dx + dr*dr );
if (R<rmin)
{
rmin=R;
node2j=j;
}
}
}
nj=set[set2].node[node2j];
/* berechne den differenzwinkel */
phi[i]= nt2[node2j]-nt1[i];
/* definiere den Zielwinkel, entweder vorgabe oder wie berechnet */
if(phi_vorgabe==0.) phi_teilung=phi[i];
else phi_teilung=phi_vorgabe;
firstrun=1;
nexttryy:;
/* kontrolliere den differenzwinkel mit der teilung */
dphi = phi_teilung - phi[i];
if(dphi>2.*PI-DPHI_TOL) while (dphi>2.*PI-DPHI_TOL) dphi-=2.*PI;
if(dphi<-2.*PI+DPHI_TOL) while (dphi<-2.*PI+DPHI_TOL) dphi+=2.*PI;
if ((dphi*dphi > DPHI_TOL)&&(firstrun))
{
firstrun=0;
phi_teilung=-phi_vorgabe;
goto nexttryy;
}
else if ((dphi*dphi > DPHI_TOL)&&(!firstrun))
{
errMsg ("ERROR: korresponding node too far away:%lf grd, see set %s\n",dphi*180./PI, specialset->nompc);
sprintf( buffer, "%d", ni);
pre_seta(specialset->nompc, "n", buffer);
}
else
{
if(printFlag) printf(" theta(%d):%lf theta(%d):%lf dtheta:%lf dtheta_corr:%lf rmin:%lf\n",
ni, nt1[i]*180./PI, set[set2].node[node2j], nt2[node2j]*180./PI,
phi[i]*180./PI, phi_teilung*180./PI, rmin);
if (corr[0]=='c')
{
/* versetze den gefundenen Knoten auf die korrespondierende pos. */
/* der dependent node wird auf die pos des indep gesetzt */
node[ni].ny = node[set[set2].node[node2j]].ny;
if ( nr1[i] )
{
node[ni].nx = node[set[set2].node[node2j]].nz*sin(phi_teilung) + node[set[set2].node[node2j]].nx*cos(phi_teilung);
node[ni].nz = node[set[set2].node[node2j]].nz*cos(phi_teilung) - node[set[set2].node[node2j]].nx*sin(phi_teilung);
}
}
if ((csys=='t')||(csys=='p'))
{
if (compare( format, "abqf", 4)== 4)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 2);
if(csys=='t'){
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFT, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFT, -1. );}
else{
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFP, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFP, -1. );}
}
else if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
if(csys=='t'){
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFT, 1.,
set[set2].node[node2j], DOFT, -1. ); }
else{
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFP, 1.,
set[set2].node[node2j], DOFP, -1. ); }
}
else if (compare( format, "ids", 3)== 3)
{
/* schreibe die EQUATIOS als knotenliste */
fprintf(handle, "%d\n", ni);
fprintf(handle2, "%d\n", set[set2].node[node2j]);
}
}
if (csys=='r')
{
if (compare( format, "abqf", 4)== 4)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf \n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFY, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFY, -1. );
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf\n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFZ, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFZ, -cos(phi_teilung), face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFX, sin(phi_teilung) );
fprintf(handle, "*EQUATIONF\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf, %d,S%d,%d,%.12lf\n", face[nodbuf[ni]].elem_nr, face[nodbuf[ni]].nr+1, DOFX, 1.,
face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFZ, -sin(phi_teilung), face[nodbuf[nj]].elem_nr, face[nodbuf[nj]].nr+1, DOFX, -cos(phi_teilung) );
}
else if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf, %d,%d,%.12lf\n", ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -cos(phi_teilung), set[set2].node[node2j], DOFX, sin(phi_teilung) );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 3);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf, %d,%d,%.12lf\n", ni, DOFX, 1.,
set[set2].node[node2j], DOFZ, -sin(phi_teilung), set[set2].node[node2j], DOFX, -cos(phi_teilung) );
}
else if (compare( format, "ans", 3)== 3)
{
/* schreibe die EQUATIOS im Ansysformat */
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UY", 1.,
ni, "UY", 1., set[set2].node[node2j], "UY", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, ni, "UZ", 1.,
set[set2].node[node2j], "UZ", -cos(phi_teilung), set[set2].node[node2j], "UX", sin(phi_teilung) );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, ni, "UX", 1.,
set[set2].node[node2j], "UZ", -sin(phi_teilung), set[set2].node[node2j], "UX", -cos(phi_teilung) );
}
else if (compare( format, "nas", 3)== 3)
{
/* schreibe die EQUATIOS im Nastranformat */
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -cos(phi_teilung));
fprintf(handle, ", ,%8d,%8d,%.12lf\n", set[set2].node[node2j], DOFX, sin(phi_teilung) );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFX, 1.,
set[set2].node[node2j], DOFZ, -sin(phi_teilung));
fprintf(handle, ", ,%8d,%8d,%.12lf\n", set[set2].node[node2j], DOFX, -cos(phi_teilung) );
}
}
if (csys=='c')
{
if (compare( format, "abq", 3)== 3)
{
/* schreibe die EQUATIOS im Abaqusformat */
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "*EQUATION\n");
fprintf(handle, "%d\n", 2);
fprintf(handle, "%d,%d,%.12lf, %d,%d,%.12lf \n", ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -1. );
}
else if (compare( format, "ans", 3)== 3)
{
/* schreibe die EQUATIOS im Ansysformat */
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UX", 1.,
ni, "UX", 1., set[set2].node[node2j], "UX", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UY", 1.,
ni, "UY", 1., set[set2].node[node2j], "UY", -1. );
neqn++;
fprintf(handle, "CE,%d,0,%d,%s,%.12lf, %d,%s,%.12lf, %d,%s,%.12lf\n",
neqn, -1, "UZ", 1.,
ni, "UZ", 1., set[set2].node[node2j], "UZ", -1. );
}
else if (compare( format, "nas", 3)== 3)
{
/* schreibe die EQUATIOS im Nastranformat */
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFX, 1.,
set[set2].node[node2j], DOFX, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFY, 1.,
set[set2].node[node2j], DOFY, -1. );
fprintf(handle, "MPC,%8d,%8d,%8d,%.12lf,%8d,%8d,%.12lf\n", neqn+1, ni, DOFZ, 1.,
set[set2].node[node2j], DOFZ, -1. );
}
}
sprintf( buffer, "%d", ni);
pre_seta(specialset->mpc, "n", buffer);
}
}
}
}
else if(axis=='z')
{
if(printFlag) printf("z-axis specified\n");
for (i=0; i<set[set1].anz_n; i++ )
{
ni=set[set1].node[i];
nx1[i]= node[ni].nz;
nr1[i]= sqrt( node[ni].nx*node[ni].nx + node[ni].ny*node[ni].ny );
if ( nr1[i] )
{
nt1[i]= p_angle( node[ni].ny, node[ni].nx );