46double RotatingBoundary :: give(
Dof *dof, ValueModeType mode,
double time)
53 if ( mode == VM_Total ) {
55 }
else if ( mode == VM_Velocity ) {
57 }
else if ( mode == VM_Acceleration ) {
60 OOFEM_ERROR(
"Should not be called for value mode type then total, velocity, or acceleration.");
63 if (
axis.giveSize() != 3 ) {
67 if (
center.giveSize() == 0 ) {
68 center.resize( coords.giveSize() );
72 if ( coords.giveSize() !=
center.giveSize() ) {
73 OOFEM_ERROR(
"Size of coordinate system different from center of rotation.");
76 double &nx =
axis.at(1);
77 double &ny =
axis.at(2);
78 double &nz =
axis.at(3);
80 if ( coords.giveSize() == 1 ) {
82 R.at(1, 1) = cos(theta) + nx * nx * ( 1 - cos(theta) );
84 if ( coords.giveSize() == 2 ) {
86 R.at(1, 1) = cos(theta) + nx * nx * ( 1 - cos(theta) );
87 R.at(1, 2) = nx * ny * ( 1 - cos(theta) ) - nz *sin(theta);
88 R.at(2, 1) = ny * nx * ( 1 - cos(theta) ) + nz *sin(theta);
89 R.at(2, 2) = cos(theta) + ny * ny * ( 1 - cos(theta) );
90 }
else if ( coords.giveSize() == 3 ) {
93 R.at(1, 1) = cos(theta) + nx * nx * ( 1 - cos(theta) );
94 R.at(1, 2) = nx * ny * ( 1 - cos(theta) ) - nz *sin(theta);
95 R.at(1, 3) = nx * nz * ( 1 - cos(theta) ) + ny *sin(theta);
97 R.at(2, 1) = ny * nx * ( 1 - cos(theta) ) + nz *sin(theta);
98 R.at(2, 2) = cos(theta) + ny * ny * ( 1 - cos(theta) );
99 R.at(2, 3) = ny * nz * ( 1 - cos(theta) ) - nx *sin(theta);
101 R.at(3, 1) = nz * nx * ( 1 - cos(theta) ) - ny *sin(theta);
102 R.at(3, 2) = nz * ny * ( 1 - cos(theta) ) + nx *sin(theta);
103 R.at(3, 3) = cos(theta) + nz * nz * ( 1 - cos(theta) );
105 OOFEM_ERROR(
"Size of coordinate system has to be 1, 2 or 3.");