493 niters = rand() %
iters + 1;
494 printf(
" iterations within this iter: %d\n", niters);
500 for (iter = 0; iter < niters; iter++) {
525 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n", x[0], x[1], x[2]);
530 fprintf(
outputfile,
"R %+16.8e %+16.8e %+16.8e", R[0], R[3], R[6]);
531 fprintf(
outputfile,
" %+16.8e %+16.8e %+16.8e", R[1], R[4], R[7]);
532 fprintf(
outputfile,
" %+16.8e %+16.8e %+16.8e\n", R[2], R[5], R[8]);
536 fprintf(
outputfile,
"T %+16.8e %+16.8e %+16.8e\n",
542 fprintf(
outputfile,
"E %+16.8e %+16.8e %+16.8e\n",
547 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n", v[0], v[1], v[2]);
548 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n\n", w[0], w[1], w[2]);
555 fprintf(stdout,
"reference node:\n");
557 fprintf(stdout,
"x={%+16.8e,%+16.8e,%+16.8e}\n", x[0], x[1], x[2]);
561 fprintf(stdout,
"R={{%+16.8e,%+16.8e,%+16.8e};\n", R[0], R[3], R[6]);
562 fprintf(stdout,
" {%+16.8e,%+16.8e,%+16.8e};\n", R[1], R[4], R[7]);
563 fprintf(stdout,
" {%+16.8e,%+16.8e,%+16.8e}}\n", R[2], R[5], R[8]);
567 fprintf(stdout,
" theta={%+16.8e,%+16.8e,%+16.8e\n}",
573 fprintf(stdout,
"euler123={%+16.8e,%+16.8e,%+16.8e}\n",
577 fprintf(stdout,
"v={%+16.8e,%+16.8e,%+16.8e}\n", v[0], v[1], v[2]);
578 fprintf(stdout,
"w={%+16.8e,%+16.8e,%+16.8e}\n", w[0], w[1], w[2]);
596 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
597 n_x[3*n], n_x[3*n + 1], n_x[3*n + 2]);
609 " %+16.8e %+16.8e %+16.8e"
610 " %+16.8e %+16.8e %+16.8e\n",
611 n_r[9*n], n_r[9*n + 3], n_r[9*n + 6],
612 n_r[9*n + 1], n_r[9*n + 4], n_r[9*n + 7],
613 n_r[9*n + 2], n_r[9*n + 5], n_r[9*n + 8]);
618 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
619 n_r[3*n], n_r[3*n + 1], n_r[3*n + 2]);
624 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
625 n_r[3*n], n_r[3*n + 1], n_r[3*n + 2]);
635 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
636 n_xp[3*n], n_xp[3*n + 1], n_xp[3*n + 2]);
644 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
645 n_omega[3*n], n_omega[3*n + 1], n_omega[3*n + 2]);
652 fprintf(stdout,
"node #%d (%u):\n", n, n_labels[n]);
654 fprintf(stdout,
"node #%d:\n", n);
656 fprintf(stdout,
" x= %+16.8e %+16.8e %+16.8e\n",
657 n_x[3*n], n_x[3*n + 1], n_x[3*n + 2]);
662 fprintf(stdout,
" R= %+16.8e %+16.8e %+16.8e\n"
663 " %+16.8e %+16.8e %+16.8e\n"
664 " %+16.8e %+16.8e %+16.8e\n",
665 n_r[9*n], n_r[9*n + 3], n_r[9*n + 6],
666 n_r[9*n + 1], n_r[9*n + 4], n_r[9*n + 7],
667 n_r[9*n + 2], n_r[9*n + 5], n_r[9*n + 8]);
672 fprintf(stdout,
" theta= %+16.8e %+16.8e %+16.8e\n",
673 n_r[3*n], n_r[3*n + 1], n_r[3*n + 2]);
678 fprintf(stdout,
" euler123= %+16.8e %+16.8e %+16.8e\n",
679 n_r[3*n], n_r[3*n + 1], n_r[3*n + 2]);
683 fprintf(stdout,
" xp= %+16.8e %+16.8e %+16.8e\n",
684 n_xp[3*n], n_xp[3*n + 1], n_xp[3*n + 2]);
686 fprintf(stdout,
" omega= %+16.8e %+16.8e %+16.8e\n",
687 n_omega[3*n], n_omega[3*n + 1], n_omega[3*n + 2]);
702 if (fscanf(
inputfile,
"Step %u\n", &i) != 1) {
703 fprintf(stderr,
"Step: %u. Error while reading step"
704 " number from input file\n",
steps);
708 fprintf(stderr,
"Error wrong step number from input file,"
709 " is %u and shoul be %u\n", i,
steps);
713 if (fscanf(
inputfile,
"REF %lg %lg %lg %lg %lg %lg\n",
715 fprintf(stderr,
"Step: %u. Error while reading Reference Node"
716 " forces from input file\n",
steps);
726 if (fscanf(
inputfile,
"%lg %lg %lg %lg %lg %lg\n",
727 &
p0[size*n], &
p0[size*n +1], &
p0[size*n + 2],
728 &
p0[size*n + 3], &
p0[size*n +4], &
p0[size*n + 5]) != 6) {
729 fprintf(stderr,
"Step: %u. Error while reading Force & Moments"
730 " for Node %u from input file\n",
steps, n);
735 &
p0[size*n], &
p0[size*n + 1], &
p0[size*n + 2]) != 3) {
736 fprintf(stderr,
"Step: %u. Error while reading Forces for Node %u"
737 " from input file\n",
steps, n);
787 n_f[3*n] =
p0[size*n];
788 n_f[3*n + 1] =
p0[size*n + 1];
789 n_f[3*n + 2] =
p0[size*n + 2];
792 n_m[3*n] =
p0[size*n + 3];
793 n_m[3*n + 1] =
p0[size*n + 4];
794 n_m[3*n + 2] =
p0[size*n + 5];
799 for (n = 0; n < 3*
mbc->
nodes; n++) {
800 n_f[n] = (double)(n + 1);
802 n_m[n] = (double)(n + 1);
int mbc_nodal_get_motion(mbc_nodal_t *mbc)
Get nodal motion from peer.
#define MBC_N_D_LABELS(mbc)
static volatile sig_atomic_t keep_going
int mbc_nodal_put_forces(mbc_nodal_t *mbc, int last)
Put forces to peer.
#define MBC_R_K_LABEL(mbc)
#define MBC_R_EULER_123(mbc)
#define MBC_N_K_LABELS(mbc)
int mbc_nodal_destroy(mbc_nodal_t *mbc)
Destroy nodal data.
#define MBC_N_EULER_123(mbc)