| 1 |
tim |
1927 |
/* |
| 2 |
|
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
|
* |
| 4 |
|
|
* The University of Notre Dame grants you ("Licensee") a |
| 5 |
|
|
* non-exclusive, royalty free, license to use, modify and |
| 6 |
|
|
* redistribute this software in source and binary code form, provided |
| 7 |
|
|
* that the following conditions are met: |
| 8 |
|
|
* |
| 9 |
|
|
* 1. Acknowledgement of the program authors must be made in any |
| 10 |
|
|
* publication of scientific results based in part on use of the |
| 11 |
|
|
* program. An acceptable form of acknowledgement is citation of |
| 12 |
|
|
* the article in which the program was described (Matthew |
| 13 |
|
|
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
| 14 |
|
|
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
| 15 |
|
|
* Parallel Simulation Engine for Molecular Dynamics," |
| 16 |
|
|
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
| 17 |
|
|
* |
| 18 |
|
|
* 2. Redistributions of source code must retain the above copyright |
| 19 |
|
|
* notice, this list of conditions and the following disclaimer. |
| 20 |
|
|
* |
| 21 |
|
|
* 3. Redistributions in binary form must reproduce the above copyright |
| 22 |
|
|
* notice, this list of conditions and the following disclaimer in the |
| 23 |
|
|
* documentation and/or other materials provided with the |
| 24 |
|
|
* distribution. |
| 25 |
|
|
* |
| 26 |
|
|
* This software is provided "AS IS," without a warranty of any |
| 27 |
|
|
* kind. All express or implied conditions, representations and |
| 28 |
|
|
* warranties, including any implied warranty of merchantability, |
| 29 |
|
|
* fitness for a particular purpose or non-infringement, are hereby |
| 30 |
|
|
* excluded. The University of Notre Dame and its licensors shall not |
| 31 |
|
|
* be liable for any damages suffered by licensee as a result of |
| 32 |
|
|
* using, modifying or distributing the software or its |
| 33 |
|
|
* derivatives. In no event will the University of Notre Dame or its |
| 34 |
|
|
* licensors be liable for any lost revenue, profit or data, or for |
| 35 |
|
|
* direct, indirect, special, consequential, incidental or punitive |
| 36 |
|
|
* damages, however caused and regardless of the theory of liability, |
| 37 |
|
|
* arising out of the use of or inability to use software, even if the |
| 38 |
|
|
* University of Notre Dame has been advised of the possibility of |
| 39 |
|
|
* such damages. |
| 40 |
|
|
*/ |
| 41 |
|
|
|
| 42 |
gezelter |
1490 |
/* This is a fun little patch to do molecular restraints for |
| 43 |
|
|
thermodynamic integration of solids. Use only |
| 44 |
|
|
if you really know what you are doing. |
| 45 |
|
|
*/ |
| 46 |
|
|
|
| 47 |
|
|
#ifndef _RESTRAINTS_H_ |
| 48 |
|
|
#define _RESTRAINTS_H_ |
| 49 |
|
|
|
| 50 |
|
|
#include <stdlib.h> |
| 51 |
|
|
#include <iostream> |
| 52 |
|
|
#include <vector> |
| 53 |
|
|
|
| 54 |
tim |
1702 |
#include "primitives/StuntDouble.hpp" |
| 55 |
tim |
1492 |
#include "primitives/Atom.hpp" |
| 56 |
|
|
#include "brains/SimState.hpp" |
| 57 |
gezelter |
1490 |
|
| 58 |
tim |
1492 |
//#include "brains/SimInfo.hpp" |
| 59 |
|
|
//#include "io/ReadWrite.hpp" |
| 60 |
gezelter |
1490 |
|
| 61 |
|
|
class Restraints{ |
| 62 |
|
|
|
| 63 |
|
|
public: |
| 64 |
|
|
Restraints(double lambdaVal, double lambdaExp); |
| 65 |
|
|
~Restraints(); |
| 66 |
|
|
|
| 67 |
|
|
void Calc_rVal(double position[3], int currentMol); |
| 68 |
|
|
void Calc_body_thetaVal(double matrix[3][3], int currentMol); |
| 69 |
|
|
void Calc_body_omegaVal(double matrix[3][3], double zAngle); |
| 70 |
|
|
double Calc_Restraint_Forces(vector<StuntDouble*> vecParticles); |
| 71 |
|
|
void Store_Init_Info(vector<StuntDouble*> vecParticles); |
| 72 |
|
|
void Write_zAngle_File(vector<StuntDouble*> vecParticles); |
| 73 |
|
|
double getVharm(); |
| 74 |
|
|
|
| 75 |
|
|
private: |
| 76 |
|
|
char moleculeName[15]; |
| 77 |
|
|
|
| 78 |
|
|
int i, j; |
| 79 |
|
|
|
| 80 |
|
|
double scaleLam; |
| 81 |
|
|
double delRx, delRy, delRz; |
| 82 |
|
|
double theta, omega; |
| 83 |
|
|
double vProj0[3]; |
| 84 |
|
|
double vProjDist; |
| 85 |
|
|
double uTx, uTy, uTz, vTx, vTy, vTz; |
| 86 |
|
|
double ub0x, ub0y, ub0z, vb0x, vb0y, vb0z; |
| 87 |
|
|
double kTheta, kOmega, kDist; |
| 88 |
|
|
double restraintFrc[3]; |
| 89 |
|
|
double restraintTrq[3]; |
| 90 |
|
|
double normalize; |
| 91 |
|
|
double dVdrx, dVdry, dVdrz; |
| 92 |
|
|
double dVdux, dVduy, dVduz; |
| 93 |
|
|
double dVdvx, dVdvy, dVdvz; |
| 94 |
|
|
double harmPotent; |
| 95 |
|
|
double lambdaValue; |
| 96 |
|
|
double lambdaK; |
| 97 |
|
|
|
| 98 |
tim |
1826 |
std::vector<double> cofmPosX; |
| 99 |
|
|
std::vector<double> cofmPosY; |
| 100 |
|
|
std::vector<double> cofmPosZ; |
| 101 |
|
|
std::vector<double> ubX0; |
| 102 |
|
|
std::vector<double> uX0; |
| 103 |
|
|
std::vector<double> ubY0; |
| 104 |
|
|
std::vector<double> uY0; |
| 105 |
|
|
std::vector<double> ubZ0; |
| 106 |
|
|
std::vector<double> uZ0; |
| 107 |
|
|
std::vector<double> vbX0; |
| 108 |
|
|
std::vector<double> vX0; |
| 109 |
|
|
std::vector<double> vbY0; |
| 110 |
|
|
std::vector<double> vY0; |
| 111 |
|
|
std::vector<double> vbZ0; |
| 112 |
|
|
std::vector<double> vZ0; |
| 113 |
gezelter |
1490 |
|
| 114 |
|
|
// SimInfo *info; // all the info we'll ever need |
| 115 |
|
|
// Atom **atoms; /* array of atom pointers */ |
| 116 |
|
|
// DirectionalAtom* dAtom; |
| 117 |
|
|
// SimInfo *againInfo; // all the info we'll ever need |
| 118 |
|
|
|
| 119 |
|
|
char *token; |
| 120 |
|
|
char fileName[200]; |
| 121 |
|
|
char angleName[200]; |
| 122 |
|
|
char inLine[1000]; |
| 123 |
|
|
char inValue[200]; |
| 124 |
|
|
char springName[200]; |
| 125 |
|
|
}; |
| 126 |
|
|
|
| 127 |
|
|
#endif |