Definition at line 496 of file test_strext_socket_lib_cxx.cc.
References MBCBase::bLabels(), MBCBase::bVerbose(), done, MBCNodal::DynamicsLabel(), MBCNodal::Euler123(), MBCBase::EULER_123, MBCNodal::F(), f0, MBCNodal::GetMotion(), MBCNodal::GetNodes(), MBCBase::GetRefNodeRot(), MBCBase::GetRot(), inputfile, iters, MBCNodal::KinematicsLabel(), MBCNodal::M(), mbc, mbc_nodal_t::mbc, MBC_F_ROT, MBC_N_D_LABELS, MBC_N_EULER_123, MBC_N_F, MBC_N_K_LABELS, MBC_N_M, MBC_N_OMEGA, MBC_N_R, MBC_N_THETA, MBC_N_X, MBC_N_XP, mbc_nodal_destroy(), mbc_nodal_get_motion(), mbc_nodal_put_forces(), MBC_R_EULER_123, MBC_R_F, MBC_R_K_LABEL, MBC_R_M, MBC_R_OMEGA, MBC_R_R, MBC_R_THETA, MBC_R_X, MBC_R_XP, MBC_ROT_EULER_123, MBC_ROT_THETA, mbc_nodal_t::nodes, MBCNodal::Omega(), outputfile, p0, MBCNodal::PutForces(), R, MBCNodal::R(), steps, MBCBase::THETA, MBCNodal::Theta(), mbc_t::verbose, MBCNodal::X(), and MBCNodal::XP().
503 niters = rand() %
iters + 1;
504 printf(
" iterations within this iter: %d\n", niters);
510 for (iter = 0; iter < niters; iter++) {
531 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
536 fprintf(
outputfile,
"R %+16.8e %+16.8e %+16.8e",
538 fprintf(
outputfile,
" %+16.8e %+16.8e %+16.8e",
540 fprintf(
outputfile,
" %+16.8e %+16.8e %+16.8e\n",
544 fprintf(
outputfile,
"T %+16.8e %+16.8e %+16.8e\n",
549 fprintf(
outputfile,
"E %+16.8e %+16.8e %+16.8e\n",
554 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
556 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n\n",
564 fprintf(stdout,
"reference node:\n");
566 fprintf(stdout,
"x={%+16.8e,%+16.8e,%+16.8e}\n",
570 fprintf(stdout,
"R={{%+16.8e,%+16.8e,%+16.8e};\n",
572 fprintf(stdout,
" {%+16.8e,%+16.8e,%+16.8e};\n",
574 fprintf(stdout,
" {%+16.8e,%+16.8e,%+16.8e}}\n",
578 fprintf(stdout,
" theta={%+16.8e,%+16.8e,%+16.8e\n}",
583 fprintf(stdout,
"euler123={%+16.8e,%+16.8e,%+16.8e}\n",
587 fprintf(stdout,
"v={%+16.8e,%+16.8e,%+16.8e}\n",
589 fprintf(stdout,
"w={%+16.8e,%+16.8e,%+16.8e}\n",
600 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
612 "%+16.8e %+16.8e %+16.8e "
613 "%+16.8e %+16.8e %+16.8e "
614 "%+16.8e %+16.8e %+16.8e\n",
621 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
626 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
637 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
646 fprintf(
outputfile,
"%+16.8e %+16.8e %+16.8e\n",
656 fprintf(stdout,
"node #%d:\n", n - 1);
658 fprintf(stdout,
" x= %+16.8e %+16.8e %+16.8e\n",
663 fprintf(stdout,
" R= %+16.8e %+16.8e %+16.8e\n"
664 " %+16.8e %+16.8e %+16.8e\n"
665 " %+16.8e %+16.8e %+16.8e\n",
672 fprintf(stdout,
" theta= %+16.8e %+16.8e %+16.8e\n",
677 fprintf(stdout,
" euler123= %+16.8e %+16.8e %+16.8e\n",
682 fprintf(stdout,
" xp= %+16.8e %+16.8e %+16.8e\n",
685 fprintf(stdout,
" omega= %+16.8e %+16.8e %+16.8e\n",
700 if (fscanf(
inputfile,
"Step %u\n", &i) != 1) {
701 fprintf(stderr,
"Step: %u. Error while reading step"
702 " number from input file\n",
steps);
706 fprintf(stderr,
"Error wrong step number from input file,"
707 " is %u and shoul be %u\n", i,
steps);
711 if (fscanf(
inputfile,
"REF %lg %lg %lg %lg %lg %lg\n",
713 fprintf(stderr,
"Step: %u. Error while reading Reference Node"
714 " forces from input file\n",
steps);
724 if (fscanf(
inputfile,
"%lg %lg %lg %lg %lg %lg\n",
725 &
p0[size*n], &
p0[size*n +1], &
p0[size*n + 2],
726 &
p0[size*n + 3], &
p0[size*n +4], &
p0[size*n + 5]) != 6) {
727 fprintf(stderr,
"Step: %u. Error while reading Force & Moments"
728 " for Node %u from input file\n",
steps, n);
733 &
p0[size*n], &
p0[size*n + 1], &
p0[size*n + 2]) != 3) {
734 fprintf(stderr,
"Step: %u. Error while reading Forces for Node %u"
735 " from input file\n",
steps, n);
775 mbc->
F(n, 1) =
p0[size*(n - 1)];
776 mbc->
F(n, 2) =
p0[size*(n - 1) + 1];
777 mbc->
F(n, 3) =
p0[size*(n - 1) + 2];
780 mbc->
M(n, 1) =
p0[size*(n - 1) + 3];
781 mbc->
M(n, 2) =
p0[size*(n - 1) + 4];
782 mbc->
M(n, 3) =
p0[size*(n - 1) + 5];
787 for (
unsigned n = 1; n <= 3*
mbc->
GetNodes(); n++) {
788 mbc->
F((n - 1)/3 + 1, (n - 1)%3 + 1) = (double)n;
790 mbc->
M((n - 1)/3 + 1, (n - 1)%3 + 1) = (double)n;
const double & Theta(uint8_t idx) const
static volatile sig_atomic_t keep_going
uint32_t KinematicsLabel(void) const
const double & X(uint8_t idx) const
bool bVerbose(void) const
const double & R(uint8_t ir, uint8_t ic) const
const double & XP(uint8_t idx) const
uint32_t GetNodes(void) const
MBCBase::Rot GetRot(void) const
const uint32_t & DynamicsLabel(void) const
MBCBase::Rot GetRefNodeRot(void) const
const double & Omega(uint8_t idx) const
const double & M(uint8_t idx) const
const double & F(uint8_t idx) const
virtual int GetMotion(void) const
virtual int PutForces(bool bConverged) const
const double & Euler123(uint8_t idx) const