 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
30 if ( shift.
length() < 1e-30 )
return 0;
37 cout <<
"Shifting coordinates: " << shift << endl;
39 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
40 for( res = mol->
res; res; res = res->
next ) {
41 for ( atom = res->
atom; atom; atom = atom->
next ) {
58 if ( shift.
length() < 1e-30 )
return 0;
64 cout <<
"Shifting coordinates: " << shift << endl;
66 for( res = mol->
res; res; res = res->
next ) {
67 for ( atom = res->
atom; atom; atom = atom->
next ) {
98 cout << endl <<
"Rotating and translating coordinates:" << endl;
99 cout <<
"Rotation axis and angle: " << t.
axis <<
" " << t.
angle*180.0/
M_PI << endl;
100 cout <<
"Rotation origin: " << t.
origin << endl;
101 cout <<
"Rotation matrix:" << endl;
103 cout <<
"Determinant: " << mat.
determinant() << endl;
104 cout <<
"Translation: " << t.
trans << endl << endl;
108 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
109 for( res = mol->
res; res; res = res->
next ) {
110 for ( atom = res->
atom; atom; atom = atom->
next ) {
134 cout <<
"DEBUG mol_coor_rotate: t.angle=" << t.
angle << endl;
136 if ( t.
angle < 1e-20 )
return 0;
146 cout << endl <<
"Rotating and translating coordinates:" << endl;
147 cout <<
"Rotation axis and angle: " << t.
axis <<
" " << t.
angle*180.0/
M_PI << endl;
148 cout <<
"Rotation origin: " << t.
origin << endl;
149 cout <<
"Rotation matrix:" << endl;
151 cout <<
"Determinant: " << mat.
determinant() << endl;
152 cout <<
"Translation: " << t.
trans << endl << endl;
156 for( res = mol->
res; res; res = res->
next ) {
157 for ( atom = res->
atom; atom; atom = atom->
next ) {
183 cout <<
"Rotating and translating coordinates:" << endl;
184 cout <<
"Rotation to view: " << view << endl;
206 cout <<
"Rotating and translating coordinates:" << endl;
207 cout <<
"Rotation from view: " << view << endl;
227 cout <<
"Origin: " << origin << endl;
228 cout <<
"Rotation matrix:" << endl;
230 cout <<
"Determinant: " << mat.
determinant() << endl;
231 cout <<
"Translation: " << trans << endl << endl;
234 for ( mol = mol_rot->
mol; mol; mol = mol->
next ) {
235 for( res = mol->
res; res; res = res->
next ) {
236 for ( atom = res->
atom; atom; atom = atom->
next ) {
261 cout <<
"Rotating and translating coordinates:" << endl;
262 cout <<
"Rotation to view: " << view << endl;
284 cout <<
"Rotating and translating coordinates:" << endl;
285 cout <<
"Rotation from view: " << view << endl;
304 cout <<
"Origin: " << origin << endl;
305 cout <<
"Rotation matrix:" << endl;
307 cout <<
"Determinant: " << mat.
determinant() << endl;
308 cout <<
"Translation: " << trans << endl << endl;
311 for( res = mol_rot->
res; res; res = res->
next ) {
312 for ( atom = res->
atom; atom; atom = atom->
next ) {
341 cout <<
"Transforming coordinates:" << endl;
342 cout <<
"Rotation axis and angle: " << t.
axis <<
" " << t.
angle*180.0/
M_PI << endl;
343 cout <<
"Rotation origin: " << t.
origin << endl;
344 cout <<
"Rotation matrix:" << endl;
346 cout <<
"Determinant: " << mat.
determinant() << endl;
347 cout <<
"Translation: " << t.
trans << endl;
348 cout <<
"Scale: " << t.
scale << endl << endl;
355 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
356 for( res = mol->
res; res; res = res->
next ) {
357 for ( atom = res->
atom; atom; atom = atom->
next ) {
386 cout <<
"Transforming and translating coordinates:" << endl;
387 cout <<
"Rotation axis and angle: " << t.
axis <<
" " << t.
angle*180.0/
M_PI << endl;
388 cout <<
"Rotation origin: " << t.
origin << endl;
389 cout <<
"Rotation matrix:" << endl;
391 cout <<
"Determinant: " << mat.
determinant() << endl;
392 cout <<
"Translation: " << t.
trans << endl;
393 cout <<
"Scale: " << t.
scale << endl << endl;
400 for( res = mol->
res; res; res = res->
next ) {
401 for ( atom = res->
atom; atom; atom = atom->
next ) {
426 cout <<
"Inverting coordinates: " << point << endl;
428 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
429 for( res = mol->
res; res; res = res->
next ) {
430 for ( atom = res->
atom; atom; atom = atom->
next ) {
460 cout <<
"Resolving periodic box coordinates:" << endl;
461 cout <<
"Box: " << molgroup->
box << endl << endl;
464 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
467 for( res = mol->
res; res; res = res->
next ) {
468 for ( atom = res->
atom; atom; atom = atom->
next ) {
469 if ( summass == 0 ) {
472 shift = csum / summass;
474 csum += shift * atom->
mass;
476 summass += atom->
mass;
479 if ( summass ) csum /= summass;
480 if ( csum[0] < 0 ) csum[0] += box[0];
481 if ( csum[1] < 0 ) csum[1] += box[1];
482 if ( csum[2] < 0 ) csum[2] += box[2];
483 if ( csum[0] > molgroup->
box[0] ) csum[0] -= box[0];
484 if ( csum[1] > molgroup->
box[1] ) csum[1] -= box[1];
485 if ( csum[2] > molgroup->
box[2] ) csum[2] -= box[2];
487 cout <<
"COM for molecule " << mol->
id <<
", mass " << summass <<
": " << csum << endl;
488 for( res = mol->
res; res; res = res->
next ) {
489 for ( atom = res->
atom; atom; atom = atom->
next ) {
490 shift = atom->
coord - csum;
491 if ( 2*shift[0] > box[0] ) shift[0] = -box[0];
492 else if ( 2*shift[0] < -box[0] ) shift[0] = box[0];
494 if ( 2*shift[1] > box[1] ) shift[1] = -box[1];
495 else if ( 2*shift[1] < -box[1] ) shift[1] = box[1];
497 if ( 2*shift[2] > box[2] ) shift[2] = -box[2];
498 else if ( 2*shift[2] < -box[2] ) shift[2] = box[2];
520 cout <<
"Wrapping coordinates within a periodic box:" << endl;
521 cout <<
"Box: " << molgroup->
box << endl << endl;
524 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
525 for( res = mol->
res; res; res = res->
next ) {
526 for ( atom = res->
atom; atom; atom = atom->
next ) {
546 if ( shift.
length2() < 1e-30 )
return 0;
553 cout <<
"Shifting coordinates: " << shift << endl;
554 cout <<
"Wrapping within box: " << molgroup->
box << endl;
557 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
558 for( res = mol->
res; res; res = res->
next ) {
559 for ( atom = res->
atom; atom; atom = atom->
next ) {
584 if ( shift.
length2() < 1e-30 )
return 0;
591 cout << endl <<
"Rotating and translating coordinates:" << endl;
592 cout <<
"Rotation origin: " << origin << endl;
593 cout <<
"Rotation matrix:" << endl;
595 cout <<
"Determinant: " << mat.
determinant() << endl;
596 cout <<
"Translation after rotation: " << shift << endl;
597 cout <<
"Wrapping within box: " << molgroup->
box << endl << endl;
602 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
603 for( res = mol->
res; res; res = res->
next ) {
604 for ( atom = res->
atom; atom; atom = atom->
next ) {
Vector3< T1 > vector3_difference_PBC(Vector3< T1 > &v1, Vector3< T1 > &v2, Vector3< T2 > &box)
Vector3< double > mol_center_of_mass(Bmolecule *mol)
Calculates the center of mass of a molecule.
Matrix3 transpose() const
Header file for reading reflection files.
Vector3< T1 > vector3_set_PBC(Vector3< T1 > coord, Vector3< T2 > box)
Header file for general utilities.
Vector3< double > molgroup_center_of_mass(Bmolgroup *molgroup)
Calculates the center of mass of a molecule group.
Header file for generalized linked list functions.
Bmolgroup * molgroup_copy(Bmolgroup *molgroup)
Copies a molecule group.
Bmolecule * molecule_copy(Bmolecule *mol)
Copies a molecule.
Library routines used for atomic coordinates.