29 #include <numeric/constants.hh>
30 #include <numeric/xyz.functions.hh>
33 #include <utility/exit.hh>
34 #include <utility/vector1.hh>
49 namespace kinematics {
58 Size const start_atom_index
62 Atom_::dfs( changeset, res_change_list, start_atom_index );
68 while ( (*iter)() !=
this ) { ++iter; assert( iter !=
parent_->atoms_end() );}
70 while ( iter !=
parent_->atoms_end() ) {
71 (*iter)->dfs( changeset, res_change_list, start_atom_index );
99 if ( local_dof_change_propagates_to_younger_siblings ) {
105 while ( iter !=
parent_->atoms_end() ) {
106 (*iter)->update_xyz_coords( stub );
124 using numeric::x_rotation_matrix_radians;
125 using numeric::z_rotation_matrix_radians;
126 using numeric::constants::d::pi;
130 stub.
M *= x_rotation_matrix_radians(
phi_ );
132 Stub new_stub( stub.
M * z_rotation_matrix_radians(
theta_ ), stub.
v );
134 if ( std::abs(
theta_ - pi ) < 1e-6 ) {
137 new_stub.
M *= x_rotation_matrix_radians( pi );
141 new_stub.
v +=
d_ * new_stub.
M.col_x();
146 it != it_end; ++it ) {
147 (*it)->update_xyz_coords( new_stub );
168 using numeric::x_rotation_matrix_radians;
169 using numeric::z_rotation_matrix_radians;
170 using numeric::constants::d::pi;
178 bool flip_stub(
false );
189 Real const x( dot( w, stub.
M.col_x() ) );
190 Real const y( dot( w, stub.
M.col_y() ) );
191 Real const z( dot( w, stub.
M.col_z() ) );
193 Real const tol( 1e-6 );
194 if ( x < -1.0 + tol ) {
205 }
else if ( x > 1.0 - tol ) {
216 phi_ = std::atan2( z, y );
220 stub.
M *= x_rotation_matrix_radians(
phi_ );
229 new_stub.
M *= x_rotation_matrix_radians( pi );
233 it != it_end; ++it ) {
234 (*it)->update_internal_coords( new_stub );
247 stub.
M *= numeric::x_rotation_matrix_radians(
phi_ );
260 }
else if ( type ==
THETA ) {
262 }
else if ( type ==
D ) {
265 std::cout <<
"bad torsion type for Atom: " << type << std::endl;
292 }
else if ( type ==
THETA ) {
294 }
else if ( type ==
D ) {
297 std::cout <<
"bad torsion type for Atom: " << type << std::endl;
312 new_me->set_weak_ptr_to_self( new_me() );
314 atom_pointer[
id() ] = new_me;
317 new_me->parent( parent_in );
322 new_me->set_dof(
D,
dof(
D ) );
332 new_me->append_atom( (*a)->clone( new_me() , atom_pointer ) );
364 DOF_ID last_torsion_local( last_torsion );
367 min_map.
add_torsion( theta_torsion, last_torsion_local );
368 last_torsion_local = theta_torsion;
372 min_map.
add_torsion( d_torsion, last_torsion_local );
373 last_torsion_local = d_torsion;
377 min_map.
add_atom(
id(), last_torsion_local );
380 it != it_end; ++it ) {
381 (*it)->setup_min_map( last_torsion_local, allow_move, min_map );
411 end_pos = input_stub.
v;
412 axis = input_stub.
M.col(1);
413 }
else if ( type ==
THETA ) {
414 end_pos = input_stub.
v;
415 axis = my_stub.
M.col(3);
416 }
else if ( type ==
D ) {
417 axis = my_stub.
M.col(1);
419 std::cout <<
"Bad torsion type for Atom" << type << std::endl;
439 }
else if ( type ==
THETA ) {
441 }
else if ( type ==
PHI ) {
449 std::cout <<
"BondedAtom::keep_dof_fixed: BAD_TYPE: " <<type <<
478 it != it_end; ++it, ++i ) {
479 (*it)->copy_coords( *(src.
child(i)) );