Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 : Copyright (c) 2017-2023 The plumed team
3 : (see the PEOPLE file at the root of the distribution for a list of names)
4 :
5 : See http://www.plumed.org for more information.
6 :
7 : This file is part of plumed, version 2.
8 :
9 : plumed is free software: you can redistribute it and/or modify
10 : it under the terms of the GNU Lesser General Public License as published by
11 : the Free Software Foundation, either version 3 of the License, or
12 : (at your option) any later version.
13 :
14 : plumed is distributed in the hope that it will be useful,
15 : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : GNU Lesser General Public License for more details.
18 :
19 : You should have received a copy of the GNU Lesser General Public License
20 : along with plumed. If not, see <http://www.gnu.org/licenses/>.
21 : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
22 : /*
23 : This class was originally written by Alexander Jussupow
24 : Arrayfire implementation by Alexander Jussupow and CC
25 : Extension for the middleman algorithm (now removed) by Max Muehlbauer
26 : Refactoring for hySAXS Martini beads structure factor for Nucleic Acids by Cristina Paissoni
27 : */
28 :
29 : #include "MetainferenceBase.h"
30 : #include "core/ActionRegister.h"
31 : #include "core/ActionSet.h"
32 : #include "core/GenericMolInfo.h"
33 : #include "tools/Communicator.h"
34 : #include "tools/Pbc.h"
35 :
36 : #include <map>
37 :
38 : #ifdef __PLUMED_HAS_ARRAYFIRE
39 : #include <arrayfire.h>
40 : #include <af/util.h>
41 : #endif
42 :
43 : #ifndef M_PI
44 : #define M_PI 3.14159265358979323846
45 : #endif
46 :
47 : namespace PLMD {
48 : namespace isdb {
49 :
50 : //+PLUMEDOC ISDB_COLVAR SAXS
51 : /*
52 : Calculates SAXS scattered intensity using either the Debye equation.
53 :
54 : Intensities are calculated for a set of scattering length set using QVALUE keywords that are numbered starting from 0.
55 : Structure factors can be either assigned using a polynomial expansion to any order using the PARAMETERS keywords;
56 : automatically assigned to atoms using the ATOMISTIC flag reading a PDB file, a correction for the water density is
57 : automatically added, with water density that by default is 0.334 but that can be set otherwise using WATERDENS;
58 : automatically assigned to Martini pseudo atoms using the MARTINI flag.
59 : The calculated intensities can be scaled using the SCALEINT keywords. This is applied by rescaling the structure factors.
60 : Experimental reference intensities can be added using the EXPINT keywords.
61 : By default SAXS is calculated using Debye on CPU, by adding the GPU flag it is possible to solve the equation on a GPU
62 : if the ARRAYFIRE libraries are installed and correctly linked.
63 : \ref METAINFERENCE can be activated using DOSCORE and the other relevant keywords.
64 :
65 : \par Examples
66 : in the following example the saxs intensities for a martini model are calculated. structure factors
67 : are obtained from the pdb file indicated in the MOLINFO.
68 :
69 : \plumedfile
70 : MOLINFO STRUCTURE=template.pdb
71 :
72 : SAXS ...
73 : LABEL=saxs
74 : ATOMS=1-355
75 : SCALEINT=3920000
76 : MARTINI
77 : QVALUE1=0.02 EXPINT1=1.0902
78 : QVALUE2=0.05 EXPINT2=0.790632
79 : QVALUE3=0.08 EXPINT3=0.453808
80 : QVALUE4=0.11 EXPINT4=0.254737
81 : QVALUE5=0.14 EXPINT5=0.154928
82 : QVALUE6=0.17 EXPINT6=0.0921503
83 : QVALUE7=0.2 EXPINT7=0.052633
84 : QVALUE8=0.23 EXPINT8=0.0276557
85 : QVALUE9=0.26 EXPINT9=0.0122775
86 : QVALUE10=0.29 EXPINT10=0.00880634
87 : QVALUE11=0.32 EXPINT11=0.0137301
88 : QVALUE12=0.35 EXPINT12=0.0180036
89 : QVALUE13=0.38 EXPINT13=0.0193374
90 : QVALUE14=0.41 EXPINT14=0.0210131
91 : QVALUE15=0.44 EXPINT15=0.0220506
92 : ... SAXS
93 :
94 : PRINT ARG=(saxs\.q-.*),(saxs\.exp-.*) FILE=colvar STRIDE=1
95 :
96 : \endplumedfile
97 :
98 : */
99 : //+ENDPLUMEDOC
100 :
101 : class SAXS :
102 : public MetainferenceBase
103 : {
104 : private:
105 : enum { H, C, N, O, P, S, NTT };
106 : enum { ALA_BB, ARG_BB, ARG_SC1, ARG_SC2, ASN_BB, ASN_SC1, ASP_BB, ASP_SC1, CYS_BB, CYS_SC1,
107 : GLN_BB, GLN_SC1, GLU_BB, GLU_SC1, GLY_BB, HIS_BB, HIS_SC1, HIS_SC2, HIS_SC3, ILE_BB,
108 : ILE_SC1, LEU_BB, LEU_SC1, LYS_BB, LYS_SC1, LYS_SC2, MET_BB, MET_SC1, PHE_BB, PHE_SC1,
109 : PHE_SC2, PHE_SC3, PRO_BB, PRO_SC1, SER_BB, SER_SC1, THR_BB, THR_SC1, TRP_BB, TRP_SC1,
110 : TRP_SC2, TRP_SC3, TRP_SC4, TYR_BB, TYR_SC1, TYR_SC2, TYR_SC3, VAL_BB, VAL_SC1, A_BB1,
111 : A_BB2, A_BB3, A_SC1, A_SC2, A_SC3, A_SC4, A_3TE, A_5TE, A_TE3, A_TE5, C_BB1, C_BB2,
112 : C_BB3, C_SC1, C_SC2, C_SC3, C_3TE, C_5TE, C_TE3, C_TE5, G_BB1, G_BB2, G_BB3, G_SC1,
113 : G_SC2, G_SC3, G_SC4, G_3TE, G_5TE, G_TE3, G_TE5, U_BB1, U_BB2, U_BB3, U_SC1, U_SC2,
114 : U_SC3, U_3TE, U_5TE, U_TE3, U_TE5, DA_BB1, DA_BB2, DA_BB3, DA_SC1, DA_SC2, DA_SC3,
115 : DA_SC4, DA_3TE, DA_5TE, DA_TE3, DA_TE5, DC_BB1, DC_BB2, DC_BB3, DC_SC1, DC_SC2, DC_SC3,
116 : DC_3TE, DC_5TE, DC_TE3, DC_TE5, DG_BB1, DG_BB2, DG_BB3, DG_SC1, DG_SC2, DG_SC3, DG_SC4,
117 : DG_3TE, DG_5TE, DG_TE3, DG_TE5, DT_BB1, DT_BB2, DT_BB3, DT_SC1, DT_SC2, DT_SC3, DT_3TE,
118 : DT_5TE, DT_TE3, DT_TE5, NMARTINI
119 : };
120 : bool pbc;
121 : bool serial;
122 : bool gpu;
123 : int deviceid;
124 : std::vector<unsigned> atoi;
125 : std::vector<double> q_list;
126 : std::vector<double> FF_rank;
127 : std::vector<std::vector<double> > FF_value;
128 : std::vector<std::vector<float> > FFf_value;
129 :
130 : void calculate_gpu(std::vector<Vector> &deriv);
131 : void calculate_cpu(std::vector<Vector> &deriv);
132 : void getMartiniSFparam(const std::vector<AtomNumber> &atoms, std::vector<std::vector<long double> > ¶meter);
133 : double calculateASF(const std::vector<AtomNumber> &atoms, std::vector<std::vector<long double> > &FF_tmp, const double rho);
134 :
135 : public:
136 : static void registerKeywords( Keywords& keys );
137 : explicit SAXS(const ActionOptions&);
138 : void calculate() override;
139 : void update() override;
140 : };
141 :
142 10447 : PLUMED_REGISTER_ACTION(SAXS,"SAXS")
143 :
144 15 : void SAXS::registerKeywords(Keywords& keys) {
145 15 : componentsAreNotOptional(keys);
146 15 : MetainferenceBase::registerKeywords(keys);
147 30 : keys.addFlag("NOPBC",false,"ignore the periodic boundary conditions when calculating distances");
148 30 : keys.addFlag("SERIAL",false,"Perform the calculation in serial - for debug purpose");
149 30 : keys.add("compulsory","DEVICEID","0","Identifier of the GPU to be used");
150 30 : keys.addFlag("GPU",false,"calculate SAXS using ARRAYFIRE on an accelerator device");
151 30 : keys.addFlag("ATOMISTIC",false,"calculate SAXS for an atomistic model");
152 30 : keys.addFlag("MARTINI",false,"calculate SAXS for a Martini model");
153 30 : keys.add("atoms","ATOMS","The atoms to be included in the calculation, e.g. the whole protein.");
154 30 : keys.add("numbered","QVALUE","Selected scattering lengths in Angstrom are given as QVALUE1, QVALUE2, ... .");
155 30 : keys.add("numbered","PARAMETERS","Used parameter Keywords like PARAMETERS1, PARAMETERS2. These are used to calculate the structure factor for the \\f$i\\f$th atom/bead.");
156 30 : keys.add("compulsory","WATERDENS","0.334","Density of the water to be used for the correction of atomistic structure factors.");
157 30 : keys.add("numbered","EXPINT","Add an experimental value for each q value.");
158 30 : keys.add("compulsory","SCALEINT","1.0","SCALING value of the calculated data. Useful to simplify the comparison.");
159 30 : keys.addOutputComponent("q","default","the # SAXS of q");
160 30 : keys.addOutputComponent("exp","EXPINT","the # experimental intensity");
161 15 : }
162 :
163 14 : SAXS::SAXS(const ActionOptions&ao):
164 : PLUMED_METAINF_INIT(ao),
165 14 : pbc(true),
166 14 : serial(false),
167 14 : gpu(false),
168 14 : deviceid(0)
169 : {
170 : std::vector<AtomNumber> atoms;
171 28 : parseAtomList("ATOMS",atoms);
172 14 : const unsigned size = atoms.size();
173 :
174 14 : parseFlag("SERIAL",serial);
175 :
176 14 : bool nopbc=!pbc;
177 14 : parseFlag("NOPBC",nopbc);
178 14 : pbc=!nopbc;
179 14 : if(pbc) log.printf(" using periodic boundary conditions\n");
180 2 : else log.printf(" without periodic boundary conditions\n");
181 :
182 14 : parseFlag("GPU",gpu);
183 : #ifndef __PLUMED_HAS_ARRAYFIRE
184 14 : if(gpu) error("To use the GPU mode PLUMED must be compiled with ARRAYFIRE");
185 : #endif
186 :
187 28 : parse("DEVICEID",deviceid);
188 : #ifdef __PLUMED_HAS_ARRAYFIRE
189 : if(gpu) {
190 : af::setDevice(deviceid);
191 : af::info();
192 : }
193 : #endif
194 :
195 : unsigned ntarget=0;
196 : for(unsigned i=0;; ++i) {
197 : double t_list;
198 328 : if( !parseNumbered( "QVALUE", i+1, t_list) ) break;
199 150 : if(t_list<=0.) error("QVALUE cannot be less or equal to zero!\n");
200 150 : q_list.push_back(t_list);
201 150 : ntarget++;
202 150 : }
203 : const unsigned numq = ntarget;
204 :
205 164 : for(unsigned i=0; i<numq; i++) {
206 150 : if(q_list[i]==0.) error("it is not possible to set q=0\n");
207 150 : if(i>0&&q_list[i]<q_list[i-1]) error("QVALUE must be in ascending order");
208 150 : log.printf(" my q: %lf \n",q_list[i]);
209 : }
210 :
211 14 : bool atomistic=false;
212 14 : parseFlag("ATOMISTIC",atomistic);
213 14 : bool martini=false;
214 14 : parseFlag("MARTINI",martini);
215 :
216 14 : if(martini&&atomistic) error("You cannot use MARTINI and ATOMISTIC at the same time");
217 :
218 14 : double rho = 0.334;
219 28 : parse("WATERDENS", rho);
220 :
221 : double Iq0=0;
222 : std::vector<std::vector<long double> > FF_tmp;
223 14 : atoi.resize(size);
224 14 : if(!atomistic&&!martini) {
225 : //read in parameter std::vector
226 : std::vector<std::vector<long double> > parameter;
227 4 : parameter.resize(size);
228 : ntarget=0;
229 36 : for(unsigned i=0; i<size; ++i) {
230 64 : if( !parseNumberedVector( "PARAMETERS", i+1, parameter[i]) ) break;
231 32 : ntarget++;
232 : }
233 4 : if( ntarget!=size ) error("found wrong number of parameter std::vectors");
234 4 : FF_tmp.resize(numq,std::vector<long double>(size));
235 36 : for(unsigned i=0; i<size; ++i) {
236 32 : atoi[i]=i;
237 128 : for(unsigned k=0; k<numq; ++k) {
238 480 : for(unsigned j=0; j<parameter[i].size(); ++j) {
239 384 : FF_tmp[k][i]+= parameter[i][j]*std::pow(static_cast<long double>(q_list[k]),j);
240 : }
241 : }
242 : }
243 36 : for(unsigned i=0; i<size; ++i) Iq0+=parameter[i][0];
244 14 : } else if(martini) {
245 : //read in parameter std::vector
246 16 : FF_tmp.resize(numq,std::vector<long double>(NMARTINI));
247 : std::vector<std::vector<long double> > parameter;
248 8 : parameter.resize(NMARTINI);
249 8 : getMartiniSFparam(atoms, parameter);
250 1072 : for(unsigned i=0; i<NMARTINI; ++i) {
251 17024 : for(unsigned k=0; k<numq; ++k) {
252 127680 : for(unsigned j=0; j<parameter[i].size(); ++j) {
253 111720 : FF_tmp[k][i]+= parameter[i][j]*std::pow(static_cast<long double>(q_list[k]),j);
254 : }
255 : }
256 : }
257 8400 : for(unsigned i=0; i<size; ++i) Iq0+=parameter[atoi[i]][0];
258 10 : } else if(atomistic) {
259 2 : FF_tmp.resize(numq,std::vector<long double>(NTT));
260 2 : Iq0=calculateASF(atoms, FF_tmp, rho);
261 : }
262 14 : double scale_int = Iq0*Iq0;
263 :
264 : std::vector<double> expint;
265 14 : expint.resize( numq );
266 : ntarget=0;
267 146 : for(unsigned i=0; i<numq; ++i) {
268 268 : if( !parseNumbered( "EXPINT", i+1, expint[i] ) ) break;
269 132 : ntarget++;
270 : }
271 : bool exp=false;
272 14 : if(ntarget!=numq && ntarget!=0) error("found wrong number of EXPINT values");
273 14 : if(ntarget==numq) exp=true;
274 14 : if(getDoScore()&&!exp) error("with DOSCORE you need to set the EXPINT values");
275 :
276 14 : double tmp_scale_int=1.;
277 14 : parse("SCALEINT",tmp_scale_int);
278 :
279 14 : if(tmp_scale_int!=1) scale_int /= tmp_scale_int;
280 : else {
281 14 : if(exp) scale_int /= expint[0];
282 : }
283 :
284 14 : if(!gpu) {
285 14 : FF_rank.resize(numq);
286 : unsigned n_atom_types=size;
287 14 : if(atomistic) n_atom_types=NTT;
288 12 : else if(martini) n_atom_types=NMARTINI;
289 14 : FF_value.resize(n_atom_types,std::vector<double>(numq));
290 164 : for(unsigned k=0; k<numq; ++k) {
291 16314 : for(unsigned i=0; i<n_atom_types; i++) FF_value[i][k] = static_cast<double>(FF_tmp[k][i])/std::sqrt(scale_int);
292 187524 : for(unsigned i=0; i<size; i++) FF_rank[k] += FF_value[atoi[i]][k]*FF_value[atoi[i]][k];
293 : }
294 : } else {
295 0 : FFf_value.resize(numq,std::vector<float>(size));
296 0 : for(unsigned k=0; k<numq; ++k) {
297 0 : for(unsigned i=0; i<size; i++) {
298 0 : FFf_value[k][i] = static_cast<float>(FF_tmp[k][atoi[i]])/std::sqrt(scale_int);
299 : }
300 : }
301 : }
302 :
303 14 : if(!getDoScore()) {
304 84 : for(unsigned i=0; i<numq; i++) {
305 78 : std::string num; Tools::convert(i,num);
306 78 : addComponentWithDerivatives("q-"+num);
307 156 : componentIsNotPeriodic("q-"+num);
308 : }
309 6 : if(exp) {
310 64 : for(unsigned i=0; i<numq; i++) {
311 60 : std::string num; Tools::convert(i,num);
312 60 : addComponent("exp-"+num);
313 60 : componentIsNotPeriodic("exp-"+num);
314 60 : Value* comp=getPntrToComponent("exp-"+num);
315 60 : comp->set(expint[i]);
316 : }
317 : }
318 : } else {
319 80 : for(unsigned i=0; i<numq; i++) {
320 72 : std::string num; Tools::convert(i,num);
321 72 : addComponent("q-"+num);
322 144 : componentIsNotPeriodic("q-"+num);
323 : }
324 80 : for(unsigned i=0; i<numq; i++) {
325 72 : std::string num; Tools::convert(i,num);
326 72 : addComponent("exp-"+num);
327 72 : componentIsNotPeriodic("exp-"+num);
328 72 : Value* comp=getPntrToComponent("exp-"+num);
329 72 : comp->set(expint[i]);
330 : }
331 : }
332 :
333 : // convert units to nm^-1
334 164 : for(unsigned i=0; i<numq; ++i) {
335 150 : q_list[i]=q_list[i]*10.0; //factor 10 to convert from A^-1 to nm^-1
336 : }
337 14 : log<<" Bibliography ";
338 14 : if(martini) {
339 16 : log<<plumed.cite("Niebling, Björling, Westenhoff, J Appl Crystallogr 47, 1190–1198 (2014).");
340 24 : log<<plumed.cite("Paissoni, Jussupow, Camilloni, J Appl Crystallogr 52, 394-402 (2019).");
341 : }
342 14 : if(atomistic) {
343 4 : log<<plumed.cite("Fraser, MacRae, Suzuki, J. Appl. Crystallogr., 11, 693–694 (1978).");
344 6 : log<<plumed.cite("Brown, Fox, Maslen, O'Keefe, Willis, International Tables for Crystallography C, 554–595 (International Union of Crystallography, 2006).");
345 : }
346 28 : log<< plumed.cite("Bonomi, Camilloni, Bioinformatics, 33, 3999 (2017)");
347 14 : log<<"\n";
348 :
349 14 : requestAtoms(atoms, false);
350 14 : if(getDoScore()) {
351 8 : setParameters(expint);
352 8 : Initialise(numq);
353 : }
354 14 : setDerivatives();
355 14 : checkRead();
356 28 : }
357 :
358 0 : void SAXS::calculate_gpu(std::vector<Vector> &deriv)
359 : {
360 : #ifdef __PLUMED_HAS_ARRAYFIRE
361 : const unsigned size = getNumberOfAtoms();
362 : const unsigned numq = q_list.size();
363 :
364 : std::vector<float> sum;
365 : sum.resize(numq);
366 :
367 : std::vector<float> dd;
368 : dd.resize(size*3*numq);
369 :
370 : // on gpu only the master rank run the calculation
371 : if(comm.Get_rank()==0) {
372 : std::vector<float> posi;
373 : posi.resize(3*size);
374 : #pragma omp parallel for num_threads(OpenMP::getNumThreads())
375 : for (unsigned i=0; i<size; i++) {
376 : const Vector tmp = getPosition(i);
377 : posi[3*i] = static_cast<float>(tmp[0]);
378 : posi[3*i+1] = static_cast<float>(tmp[1]);
379 : posi[3*i+2] = static_cast<float>(tmp[2]);
380 : }
381 :
382 : // create array a and b containing atomic coordinates
383 : af::setDevice(deviceid);
384 : // 3,size,1,1
385 : af::array pos_a = af::array(3, size, &posi.front());
386 : // size,3,1,1
387 : pos_a = af::moddims(pos_a.T(), size, 3, 1);
388 : // size,3,1,1
389 : af::array pos_b = pos_a(af::span, af::span);
390 : // size,1,3,1
391 : pos_a = af::moddims(pos_a, size, 1, 3);
392 : // 1,size,3,1
393 : pos_b = af::moddims(pos_b, 1, size, 3);
394 :
395 : // size,size,3,1
396 : af::array pos_a_t = af::tile(pos_a, 1, size, 1);
397 : // size,size,3,1: for some reason we need this
398 : pos_a_t = af::moddims(pos_a_t, size, size, 3);
399 : // size,size,3,1
400 : af::array pos_b_t = af::tile(pos_b, size, 1, 1);
401 : // size,size,3,1: for some reason we need this
402 : pos_b_t = af::moddims(pos_b_t, size, size, 3);
403 : // size,size,3,1
404 : af::array xyz_dist = pos_a_t - pos_b_t;
405 : // size,size,1,1
406 : af::array square = af::sum(xyz_dist*xyz_dist,2);
407 : // size,size,1,1
408 : af::array dist_sqrt = af::sqrt(square);
409 : // replace the zero of square with one to avoid nan in the derivatives (the number does not matter because this are multiplied by zero)
410 : af::replace(square,!(af::iszero(square)),1.);
411 : // size,size,3,1
412 : xyz_dist = xyz_dist / af::tile(square, 1, 1, 3);
413 : // numq,1,1,1
414 : af::array sum_device = af::constant(0, numq, f32);
415 : // numq,size,3,1
416 : af::array deriv_device = af::constant(0, numq, size, 3, f32);
417 :
418 : for (unsigned k=0; k<numq; k++) {
419 : // calculate FF matrix
420 : // size,1,1,1
421 : af::array AFF_value(size, &FFf_value[k].front());
422 : // size,size,1,1
423 : af::array FFdist_mod = af::tile(AFF_value(af::span), 1, size)*af::transpose(af::tile(AFF_value(af::span), 1, size));
424 :
425 : // get q
426 : const float qvalue = static_cast<float>(q_list[k]);
427 : // size,size,1,1
428 : af::array dist_q = qvalue*dist_sqrt;
429 : // size,size,1
430 : af::array dist_sin = af::sin(dist_q)/dist_q;
431 : af::replace(dist_sin,!(af::isNaN(dist_sin)),1.);
432 : // 1,1,1,1
433 : sum_device(k) = af::sum(af::flat(dist_sin)*af::flat(FFdist_mod));
434 :
435 : // size,size,1,1
436 : af::array tmp = FFdist_mod*(dist_sin - af::cos(dist_q));
437 : // size,size,3,1
438 : af::array dd_all = af::tile(tmp, 1, 1, 3)*xyz_dist;
439 : // it should become 1,size,3
440 : deriv_device(k, af::span, af::span) = af::sum(dd_all,0);
441 : }
442 :
443 : // read out results
444 : sum_device.host(&sum.front());
445 :
446 : deriv_device = af::reorder(deriv_device, 2, 1, 0);
447 : deriv_device = af::flat(deriv_device);
448 : deriv_device.host(&dd.front());
449 : }
450 :
451 : comm.Bcast(dd, 0);
452 : comm.Bcast(sum, 0);
453 :
454 : for(unsigned k=0; k<numq; k++) {
455 : std::string num; Tools::convert(k,num);
456 : Value* val=getPntrToComponent("q-"+num);
457 : val->set(sum[k]);
458 : if(getDoScore()) setCalcData(k, sum[k]);
459 : for(unsigned i=0; i<size; i++) {
460 : const unsigned di = k*size*3+i*3;
461 : deriv[k*size+i] = Vector(2.*dd[di+0],2.*dd[di+1],2.*dd[di+2]);
462 : }
463 : }
464 : #endif
465 0 : }
466 :
467 174 : void SAXS::calculate_cpu(std::vector<Vector> &deriv)
468 : {
469 : const unsigned size = getNumberOfAtoms();
470 174 : const unsigned numq = q_list.size();
471 :
472 174 : unsigned stride = comm.Get_size();
473 174 : unsigned rank = comm.Get_rank();
474 174 : if(serial) {
475 : stride = 1;
476 : rank = 0;
477 : }
478 :
479 174 : std::vector<double> sum(numq,0);
480 174 : unsigned nt=OpenMP::getNumThreads();
481 174 : #pragma omp parallel num_threads(nt)
482 : {
483 : std::vector<Vector> omp_deriv(deriv.size());
484 : std::vector<double> omp_sum(numq,0);
485 : #pragma omp for nowait
486 : for (unsigned i=rank; i<size-1; i+=stride) {
487 : Vector posi = getPosition(i);
488 : for (unsigned j=i+1; j<size ; j++) {
489 : Vector c_distances = delta(posi,getPosition(j));
490 : double m_distances = c_distances.modulo();
491 : c_distances = c_distances/m_distances/m_distances;
492 : for (unsigned k=0; k<numq; k++) {
493 : unsigned kdx=k*size;
494 : double qdist = q_list[k]*m_distances;
495 : double FFF = 2.*FF_value[atoi[i]][k]*FF_value[atoi[j]][k];
496 : double tsq = std::sin(qdist)/qdist;
497 : double tcq = std::cos(qdist);
498 : double tmp = FFF*(tcq-tsq);
499 : Vector dd = c_distances*tmp;
500 : if(nt>1) {
501 : omp_deriv[kdx+i] -=dd;
502 : omp_deriv[kdx+j] +=dd;
503 : omp_sum[k] += FFF*tsq;
504 : } else {
505 : deriv[kdx+i] -= dd;
506 : deriv[kdx+j] += dd;
507 : sum[k] += FFF*tsq;
508 : }
509 : }
510 : }
511 : }
512 : #pragma omp critical
513 : if(nt>1) {
514 : for(unsigned i=0; i<deriv.size(); i++) deriv[i]+=omp_deriv[i];
515 : for(unsigned k=0; k<numq; k++) sum[k]+=omp_sum[k];
516 : }
517 : }
518 :
519 174 : if(!serial) {
520 172 : comm.Sum(&deriv[0][0], 3*deriv.size());
521 172 : comm.Sum(&sum[0], numq);
522 : }
523 :
524 1764 : for (unsigned k=0; k<numq; k++) {
525 1590 : sum[k]+=FF_rank[k];
526 1590 : std::string num; Tools::convert(k,num);
527 1590 : Value* val=getPntrToComponent("q-"+num);
528 1590 : val->set(sum[k]);
529 1590 : if(getDoScore()) setCalcData(k, sum[k]);
530 : }
531 174 : }
532 :
533 174 : void SAXS::calculate()
534 : {
535 174 : if(pbc) makeWhole();
536 :
537 174 : const size_t size = getNumberOfAtoms();
538 : const size_t numq = q_list.size();
539 :
540 174 : std::vector<Vector> deriv(numq*size);
541 174 : if(gpu) calculate_gpu(deriv);
542 174 : else calculate_cpu(deriv);
543 :
544 174 : if(getDoScore()) {
545 : /* Metainference */
546 168 : double score = getScore();
547 : setScore(score);
548 : }
549 :
550 1764 : for (unsigned k=0; k<numq; k++) {
551 1590 : const unsigned kdx=k*size;
552 1590 : Tensor deriv_box;
553 : Value* val;
554 1590 : if(!getDoScore()) {
555 78 : std::string num; Tools::convert(k,num);
556 78 : val=getPntrToComponent("q-"+num);
557 166056 : for(unsigned i=0; i<size; i++) {
558 165978 : setAtomsDerivatives(val, i, deriv[kdx+i]);
559 165978 : deriv_box += Tensor(getPosition(i),deriv[kdx+i]);
560 : }
561 : } else {
562 1512 : val=getPntrToComponent("score");
563 450828 : for(unsigned i=0; i<size; i++) {
564 449316 : setAtomsDerivatives(val, i, deriv[kdx+i]*getMetaDer(k));
565 449316 : deriv_box += Tensor(getPosition(i),deriv[kdx+i]*getMetaDer(k));
566 : }
567 : }
568 1590 : setBoxDerivatives(val, -deriv_box);
569 : }
570 174 : }
571 :
572 174 : void SAXS::update() {
573 : // write status file
574 174 : if(getWstride()>0&& (getStep()%getWstride()==0 || getCPT()) ) writeStatus();
575 174 : }
576 :
577 8 : void SAXS::getMartiniSFparam(const std::vector<AtomNumber> &atoms, std::vector<std::vector<long double> > ¶meter)
578 : {
579 8 : parameter[ALA_BB].push_back(9.045);
580 8 : parameter[ALA_BB].push_back(-0.098114);
581 8 : parameter[ALA_BB].push_back(7.54281);
582 8 : parameter[ALA_BB].push_back(-1.97438);
583 8 : parameter[ALA_BB].push_back(-8.32689);
584 8 : parameter[ALA_BB].push_back(6.09318);
585 8 : parameter[ALA_BB].push_back(-1.18913);
586 :
587 8 : parameter[ARG_BB].push_back(10.729);
588 8 : parameter[ARG_BB].push_back(-0.0392574);
589 8 : parameter[ARG_BB].push_back(1.15382);
590 8 : parameter[ARG_BB].push_back(-0.155999);
591 8 : parameter[ARG_BB].push_back(-2.43619);
592 8 : parameter[ARG_BB].push_back(1.72922);
593 8 : parameter[ARG_BB].push_back(-0.33799);
594 :
595 8 : parameter[ARG_SC1].push_back(-2.796);
596 8 : parameter[ARG_SC1].push_back(0.472403);
597 8 : parameter[ARG_SC1].push_back(8.07424);
598 8 : parameter[ARG_SC1].push_back(4.37299);
599 8 : parameter[ARG_SC1].push_back(-10.7398);
600 8 : parameter[ARG_SC1].push_back(4.95677);
601 8 : parameter[ARG_SC1].push_back(-0.725797);
602 :
603 8 : parameter[ARG_SC2].push_back(15.396);
604 8 : parameter[ARG_SC2].push_back(0.0636736);
605 8 : parameter[ARG_SC2].push_back(-1.258);
606 8 : parameter[ARG_SC2].push_back(1.93135);
607 8 : parameter[ARG_SC2].push_back(-4.45031);
608 8 : parameter[ARG_SC2].push_back(2.49356);
609 8 : parameter[ARG_SC2].push_back(-0.410721);
610 :
611 8 : parameter[ASN_BB].push_back(10.738);
612 8 : parameter[ASN_BB].push_back(-0.0402162);
613 8 : parameter[ASN_BB].push_back(1.03007);
614 8 : parameter[ASN_BB].push_back(-0.254174);
615 8 : parameter[ASN_BB].push_back(-2.12015);
616 8 : parameter[ASN_BB].push_back(1.55535);
617 8 : parameter[ASN_BB].push_back(-0.30963);
618 :
619 8 : parameter[ASN_SC1].push_back(9.249);
620 8 : parameter[ASN_SC1].push_back(-0.0148678);
621 8 : parameter[ASN_SC1].push_back(5.52169);
622 8 : parameter[ASN_SC1].push_back(0.00853212);
623 8 : parameter[ASN_SC1].push_back(-6.71992);
624 8 : parameter[ASN_SC1].push_back(3.93622);
625 8 : parameter[ASN_SC1].push_back(-0.64973);
626 :
627 8 : parameter[ASP_BB].push_back(10.695);
628 8 : parameter[ASP_BB].push_back(-0.0410247);
629 8 : parameter[ASP_BB].push_back(1.03656);
630 8 : parameter[ASP_BB].push_back(-0.298558);
631 8 : parameter[ASP_BB].push_back(-2.06064);
632 8 : parameter[ASP_BB].push_back(1.53495);
633 8 : parameter[ASP_BB].push_back(-0.308365);
634 :
635 8 : parameter[ASP_SC1].push_back(9.476);
636 8 : parameter[ASP_SC1].push_back(-0.0254664);
637 8 : parameter[ASP_SC1].push_back(5.57899);
638 8 : parameter[ASP_SC1].push_back(-0.395027);
639 8 : parameter[ASP_SC1].push_back(-5.9407);
640 8 : parameter[ASP_SC1].push_back(3.48836);
641 8 : parameter[ASP_SC1].push_back(-0.569402);
642 :
643 8 : parameter[CYS_BB].push_back(10.698);
644 8 : parameter[CYS_BB].push_back(-0.0233493);
645 8 : parameter[CYS_BB].push_back(1.18257);
646 8 : parameter[CYS_BB].push_back(0.0684464);
647 8 : parameter[CYS_BB].push_back(-2.792);
648 8 : parameter[CYS_BB].push_back(1.88995);
649 8 : parameter[CYS_BB].push_back(-0.360229);
650 :
651 8 : parameter[CYS_SC1].push_back(8.199);
652 8 : parameter[CYS_SC1].push_back(-0.0261569);
653 8 : parameter[CYS_SC1].push_back(6.79677);
654 8 : parameter[CYS_SC1].push_back(-0.343845);
655 8 : parameter[CYS_SC1].push_back(-5.03578);
656 8 : parameter[CYS_SC1].push_back(2.7076);
657 8 : parameter[CYS_SC1].push_back(-0.420714);
658 :
659 8 : parameter[GLN_BB].push_back(10.728);
660 8 : parameter[GLN_BB].push_back(-0.0391984);
661 8 : parameter[GLN_BB].push_back(1.09264);
662 8 : parameter[GLN_BB].push_back(-0.261555);
663 8 : parameter[GLN_BB].push_back(-2.21245);
664 8 : parameter[GLN_BB].push_back(1.62071);
665 8 : parameter[GLN_BB].push_back(-0.322325);
666 :
667 8 : parameter[GLN_SC1].push_back(8.317);
668 8 : parameter[GLN_SC1].push_back(-0.229045);
669 8 : parameter[GLN_SC1].push_back(12.6338);
670 8 : parameter[GLN_SC1].push_back(-7.6719);
671 8 : parameter[GLN_SC1].push_back(-5.8376);
672 8 : parameter[GLN_SC1].push_back(5.53784);
673 8 : parameter[GLN_SC1].push_back(-1.12604);
674 :
675 8 : parameter[GLU_BB].push_back(10.694);
676 8 : parameter[GLU_BB].push_back(-0.0521961);
677 8 : parameter[GLU_BB].push_back(1.11153);
678 8 : parameter[GLU_BB].push_back(-0.491995);
679 8 : parameter[GLU_BB].push_back(-1.86236);
680 8 : parameter[GLU_BB].push_back(1.45332);
681 8 : parameter[GLU_BB].push_back(-0.29708);
682 :
683 8 : parameter[GLU_SC1].push_back(8.544);
684 8 : parameter[GLU_SC1].push_back(-0.249555);
685 8 : parameter[GLU_SC1].push_back(12.8031);
686 8 : parameter[GLU_SC1].push_back(-8.42696);
687 8 : parameter[GLU_SC1].push_back(-4.66486);
688 8 : parameter[GLU_SC1].push_back(4.90004);
689 8 : parameter[GLU_SC1].push_back(-1.01204);
690 :
691 8 : parameter[GLY_BB].push_back(9.977);
692 8 : parameter[GLY_BB].push_back(-0.0285799);
693 8 : parameter[GLY_BB].push_back(1.84236);
694 8 : parameter[GLY_BB].push_back(-0.0315192);
695 8 : parameter[GLY_BB].push_back(-2.88326);
696 8 : parameter[GLY_BB].push_back(1.87323);
697 8 : parameter[GLY_BB].push_back(-0.345773);
698 :
699 8 : parameter[HIS_BB].push_back(10.721);
700 8 : parameter[HIS_BB].push_back(-0.0379337);
701 8 : parameter[HIS_BB].push_back(1.06028);
702 8 : parameter[HIS_BB].push_back(-0.236143);
703 8 : parameter[HIS_BB].push_back(-2.17819);
704 8 : parameter[HIS_BB].push_back(1.58357);
705 8 : parameter[HIS_BB].push_back(-0.31345);
706 :
707 8 : parameter[HIS_SC1].push_back(-0.424);
708 8 : parameter[HIS_SC1].push_back(0.665176);
709 8 : parameter[HIS_SC1].push_back(3.4369);
710 8 : parameter[HIS_SC1].push_back(2.93795);
711 8 : parameter[HIS_SC1].push_back(-5.18288);
712 8 : parameter[HIS_SC1].push_back(2.12381);
713 8 : parameter[HIS_SC1].push_back(-0.284224);
714 :
715 8 : parameter[HIS_SC2].push_back(5.363);
716 8 : parameter[HIS_SC2].push_back(-0.0176945);
717 8 : parameter[HIS_SC2].push_back(2.9506);
718 8 : parameter[HIS_SC2].push_back(-0.387018);
719 8 : parameter[HIS_SC2].push_back(-1.83951);
720 8 : parameter[HIS_SC2].push_back(0.9703);
721 8 : parameter[HIS_SC2].push_back(-0.1458);
722 :
723 8 : parameter[HIS_SC3].push_back(5.784);
724 8 : parameter[HIS_SC3].push_back(-0.0293129);
725 8 : parameter[HIS_SC3].push_back(2.74167);
726 8 : parameter[HIS_SC3].push_back(-0.520875);
727 8 : parameter[HIS_SC3].push_back(-1.62949);
728 8 : parameter[HIS_SC3].push_back(0.902379);
729 8 : parameter[HIS_SC3].push_back(-0.139957);
730 :
731 8 : parameter[ILE_BB].push_back(10.699);
732 8 : parameter[ILE_BB].push_back(-0.0188962);
733 8 : parameter[ILE_BB].push_back(1.217);
734 8 : parameter[ILE_BB].push_back(0.242481);
735 8 : parameter[ILE_BB].push_back(-3.13898);
736 8 : parameter[ILE_BB].push_back(2.07916);
737 8 : parameter[ILE_BB].push_back(-0.392574);
738 :
739 8 : parameter[ILE_SC1].push_back(-4.448);
740 8 : parameter[ILE_SC1].push_back(1.20996);
741 8 : parameter[ILE_SC1].push_back(11.5141);
742 8 : parameter[ILE_SC1].push_back(6.98895);
743 8 : parameter[ILE_SC1].push_back(-19.1948);
744 8 : parameter[ILE_SC1].push_back(9.89207);
745 8 : parameter[ILE_SC1].push_back(-1.60877);
746 :
747 8 : parameter[LEU_BB].push_back(10.692);
748 8 : parameter[LEU_BB].push_back(-0.0414917);
749 8 : parameter[LEU_BB].push_back(1.1077);
750 8 : parameter[LEU_BB].push_back(-0.288062);
751 8 : parameter[LEU_BB].push_back(-2.17187);
752 8 : parameter[LEU_BB].push_back(1.59879);
753 8 : parameter[LEU_BB].push_back(-0.318545);
754 :
755 8 : parameter[LEU_SC1].push_back(-4.448);
756 8 : parameter[LEU_SC1].push_back(2.1063);
757 8 : parameter[LEU_SC1].push_back(6.72381);
758 8 : parameter[LEU_SC1].push_back(14.6954);
759 8 : parameter[LEU_SC1].push_back(-23.7197);
760 8 : parameter[LEU_SC1].push_back(10.7247);
761 8 : parameter[LEU_SC1].push_back(-1.59146);
762 :
763 8 : parameter[LYS_BB].push_back(10.706);
764 8 : parameter[LYS_BB].push_back(-0.0468629);
765 8 : parameter[LYS_BB].push_back(1.09477);
766 8 : parameter[LYS_BB].push_back(-0.432751);
767 8 : parameter[LYS_BB].push_back(-1.94335);
768 8 : parameter[LYS_BB].push_back(1.49109);
769 8 : parameter[LYS_BB].push_back(-0.302589);
770 :
771 8 : parameter[LYS_SC1].push_back(-2.796);
772 8 : parameter[LYS_SC1].push_back(0.508044);
773 8 : parameter[LYS_SC1].push_back(7.91436);
774 8 : parameter[LYS_SC1].push_back(4.54097);
775 8 : parameter[LYS_SC1].push_back(-10.8051);
776 8 : parameter[LYS_SC1].push_back(4.96204);
777 8 : parameter[LYS_SC1].push_back(-0.724414);
778 :
779 8 : parameter[LYS_SC2].push_back(3.070);
780 8 : parameter[LYS_SC2].push_back(-0.0101448);
781 8 : parameter[LYS_SC2].push_back(4.67994);
782 8 : parameter[LYS_SC2].push_back(-0.792529);
783 8 : parameter[LYS_SC2].push_back(-2.09142);
784 8 : parameter[LYS_SC2].push_back(1.02933);
785 8 : parameter[LYS_SC2].push_back(-0.137787);
786 :
787 8 : parameter[MET_BB].push_back(10.671);
788 8 : parameter[MET_BB].push_back(-0.0433724);
789 8 : parameter[MET_BB].push_back(1.13784);
790 8 : parameter[MET_BB].push_back(-0.40768);
791 8 : parameter[MET_BB].push_back(-2.00555);
792 8 : parameter[MET_BB].push_back(1.51673);
793 8 : parameter[MET_BB].push_back(-0.305547);
794 :
795 8 : parameter[MET_SC1].push_back(5.85);
796 8 : parameter[MET_SC1].push_back(-0.0485798);
797 8 : parameter[MET_SC1].push_back(17.0391);
798 8 : parameter[MET_SC1].push_back(-3.65327);
799 8 : parameter[MET_SC1].push_back(-13.174);
800 8 : parameter[MET_SC1].push_back(8.68286);
801 8 : parameter[MET_SC1].push_back(-1.56095);
802 :
803 8 : parameter[PHE_BB].push_back(10.741);
804 8 : parameter[PHE_BB].push_back(-0.0317275);
805 8 : parameter[PHE_BB].push_back(1.15599);
806 8 : parameter[PHE_BB].push_back(0.0276187);
807 8 : parameter[PHE_BB].push_back(-2.74757);
808 8 : parameter[PHE_BB].push_back(1.88783);
809 8 : parameter[PHE_BB].push_back(-0.363525);
810 :
811 8 : parameter[PHE_SC1].push_back(-0.636);
812 8 : parameter[PHE_SC1].push_back(0.527882);
813 8 : parameter[PHE_SC1].push_back(6.77612);
814 8 : parameter[PHE_SC1].push_back(3.18508);
815 8 : parameter[PHE_SC1].push_back(-8.92826);
816 8 : parameter[PHE_SC1].push_back(4.29752);
817 8 : parameter[PHE_SC1].push_back(-0.65187);
818 :
819 8 : parameter[PHE_SC2].push_back(-0.424);
820 8 : parameter[PHE_SC2].push_back(0.389174);
821 8 : parameter[PHE_SC2].push_back(4.11761);
822 8 : parameter[PHE_SC2].push_back(2.29527);
823 8 : parameter[PHE_SC2].push_back(-4.7652);
824 8 : parameter[PHE_SC2].push_back(1.97023);
825 8 : parameter[PHE_SC2].push_back(-0.262318);
826 :
827 8 : parameter[PHE_SC3].push_back(-0.424);
828 8 : parameter[PHE_SC3].push_back(0.38927);
829 8 : parameter[PHE_SC3].push_back(4.11708);
830 8 : parameter[PHE_SC3].push_back(2.29623);
831 8 : parameter[PHE_SC3].push_back(-4.76592);
832 8 : parameter[PHE_SC3].push_back(1.97055);
833 8 : parameter[PHE_SC3].push_back(-0.262381);
834 :
835 8 : parameter[PRO_BB].push_back(11.434);
836 8 : parameter[PRO_BB].push_back(-0.033323);
837 8 : parameter[PRO_BB].push_back(0.472014);
838 8 : parameter[PRO_BB].push_back(-0.290854);
839 8 : parameter[PRO_BB].push_back(-1.81409);
840 8 : parameter[PRO_BB].push_back(1.39751);
841 8 : parameter[PRO_BB].push_back(-0.280407);
842 :
843 8 : parameter[PRO_SC1].push_back(-2.796);
844 8 : parameter[PRO_SC1].push_back(0.95668);
845 8 : parameter[PRO_SC1].push_back(6.84197);
846 8 : parameter[PRO_SC1].push_back(6.43774);
847 8 : parameter[PRO_SC1].push_back(-12.5068);
848 8 : parameter[PRO_SC1].push_back(5.64597);
849 8 : parameter[PRO_SC1].push_back(-0.825206);
850 :
851 8 : parameter[SER_BB].push_back(10.699);
852 8 : parameter[SER_BB].push_back(-0.0325828);
853 8 : parameter[SER_BB].push_back(1.20329);
854 8 : parameter[SER_BB].push_back(-0.0674351);
855 8 : parameter[SER_BB].push_back(-2.60749);
856 8 : parameter[SER_BB].push_back(1.80318);
857 8 : parameter[SER_BB].push_back(-0.346803);
858 :
859 8 : parameter[SER_SC1].push_back(3.298);
860 8 : parameter[SER_SC1].push_back(-0.0366801);
861 8 : parameter[SER_SC1].push_back(5.11077);
862 8 : parameter[SER_SC1].push_back(-1.46774);
863 8 : parameter[SER_SC1].push_back(-1.48421);
864 8 : parameter[SER_SC1].push_back(0.800326);
865 8 : parameter[SER_SC1].push_back(-0.108314);
866 :
867 8 : parameter[THR_BB].push_back(10.697);
868 8 : parameter[THR_BB].push_back(-0.0242955);
869 8 : parameter[THR_BB].push_back(1.24671);
870 8 : parameter[THR_BB].push_back(0.146423);
871 8 : parameter[THR_BB].push_back(-2.97429);
872 8 : parameter[THR_BB].push_back(1.97513);
873 8 : parameter[THR_BB].push_back(-0.371479);
874 :
875 8 : parameter[THR_SC1].push_back(2.366);
876 8 : parameter[THR_SC1].push_back(0.0297604);
877 8 : parameter[THR_SC1].push_back(11.9216);
878 8 : parameter[THR_SC1].push_back(-9.32503);
879 8 : parameter[THR_SC1].push_back(1.9396);
880 8 : parameter[THR_SC1].push_back(0.0804861);
881 8 : parameter[THR_SC1].push_back(-0.0302721);
882 :
883 8 : parameter[TRP_BB].push_back(10.689);
884 8 : parameter[TRP_BB].push_back(-0.0265879);
885 8 : parameter[TRP_BB].push_back(1.17819);
886 8 : parameter[TRP_BB].push_back(0.0386457);
887 8 : parameter[TRP_BB].push_back(-2.75634);
888 8 : parameter[TRP_BB].push_back(1.88065);
889 8 : parameter[TRP_BB].push_back(-0.360217);
890 :
891 8 : parameter[TRP_SC1].push_back(0.084);
892 8 : parameter[TRP_SC1].push_back(0.752407);
893 8 : parameter[TRP_SC1].push_back(5.3802);
894 8 : parameter[TRP_SC1].push_back(4.09281);
895 8 : parameter[TRP_SC1].push_back(-9.28029);
896 8 : parameter[TRP_SC1].push_back(4.45923);
897 8 : parameter[TRP_SC1].push_back(-0.689008);
898 :
899 8 : parameter[TRP_SC2].push_back(5.739);
900 8 : parameter[TRP_SC2].push_back(0.0298492);
901 8 : parameter[TRP_SC2].push_back(4.60446);
902 8 : parameter[TRP_SC2].push_back(1.34463);
903 8 : parameter[TRP_SC2].push_back(-5.69968);
904 8 : parameter[TRP_SC2].push_back(2.84924);
905 8 : parameter[TRP_SC2].push_back(-0.433781);
906 :
907 8 : parameter[TRP_SC3].push_back(-0.424);
908 8 : parameter[TRP_SC3].push_back(0.388576);
909 8 : parameter[TRP_SC3].push_back(4.11859);
910 8 : parameter[TRP_SC3].push_back(2.29485);
911 8 : parameter[TRP_SC3].push_back(-4.76255);
912 8 : parameter[TRP_SC3].push_back(1.96849);
913 8 : parameter[TRP_SC3].push_back(-0.262015);
914 :
915 8 : parameter[TRP_SC4].push_back(-0.424);
916 8 : parameter[TRP_SC4].push_back(0.387685);
917 8 : parameter[TRP_SC4].push_back(4.12153);
918 8 : parameter[TRP_SC4].push_back(2.29144);
919 8 : parameter[TRP_SC4].push_back(-4.7589);
920 8 : parameter[TRP_SC4].push_back(1.96686);
921 8 : parameter[TRP_SC4].push_back(-0.261786);
922 :
923 8 : parameter[TYR_BB].push_back(10.689);
924 8 : parameter[TYR_BB].push_back(-0.0193526);
925 8 : parameter[TYR_BB].push_back(1.18241);
926 8 : parameter[TYR_BB].push_back(0.207318);
927 8 : parameter[TYR_BB].push_back(-3.0041);
928 8 : parameter[TYR_BB].push_back(1.99335);
929 8 : parameter[TYR_BB].push_back(-0.376482);
930 :
931 8 : parameter[TYR_SC1].push_back(-0.636);
932 8 : parameter[TYR_SC1].push_back(0.528902);
933 8 : parameter[TYR_SC1].push_back(6.78168);
934 8 : parameter[TYR_SC1].push_back(3.17769);
935 8 : parameter[TYR_SC1].push_back(-8.93667);
936 8 : parameter[TYR_SC1].push_back(4.30692);
937 8 : parameter[TYR_SC1].push_back(-0.653993);
938 :
939 8 : parameter[TYR_SC2].push_back(-0.424);
940 8 : parameter[TYR_SC2].push_back(0.388811);
941 8 : parameter[TYR_SC2].push_back(4.11851);
942 8 : parameter[TYR_SC2].push_back(2.29545);
943 8 : parameter[TYR_SC2].push_back(-4.7668);
944 8 : parameter[TYR_SC2].push_back(1.97131);
945 8 : parameter[TYR_SC2].push_back(-0.262534);
946 :
947 8 : parameter[TYR_SC3].push_back(4.526);
948 8 : parameter[TYR_SC3].push_back(-0.00381305);
949 8 : parameter[TYR_SC3].push_back(5.8567);
950 8 : parameter[TYR_SC3].push_back(-0.214086);
951 8 : parameter[TYR_SC3].push_back(-4.63649);
952 8 : parameter[TYR_SC3].push_back(2.52869);
953 8 : parameter[TYR_SC3].push_back(-0.39894);
954 :
955 8 : parameter[VAL_BB].push_back(10.691);
956 8 : parameter[VAL_BB].push_back(-0.0162929);
957 8 : parameter[VAL_BB].push_back(1.24446);
958 8 : parameter[VAL_BB].push_back(0.307914);
959 8 : parameter[VAL_BB].push_back(-3.27446);
960 8 : parameter[VAL_BB].push_back(2.14788);
961 8 : parameter[VAL_BB].push_back(-0.403259);
962 :
963 8 : parameter[VAL_SC1].push_back(-3.516);
964 8 : parameter[VAL_SC1].push_back(1.62307);
965 8 : parameter[VAL_SC1].push_back(5.43064);
966 8 : parameter[VAL_SC1].push_back(9.28809);
967 8 : parameter[VAL_SC1].push_back(-14.9927);
968 8 : parameter[VAL_SC1].push_back(6.6133);
969 8 : parameter[VAL_SC1].push_back(-0.964977);
970 :
971 8 : parameter[A_BB1].push_back(32.88500000);
972 8 : parameter[A_BB1].push_back(0.08339900);
973 8 : parameter[A_BB1].push_back(-7.36054400);
974 8 : parameter[A_BB1].push_back(2.19220300);
975 8 : parameter[A_BB1].push_back(-3.56523400);
976 8 : parameter[A_BB1].push_back(2.33326900);
977 8 : parameter[A_BB1].push_back(-0.39785500);
978 :
979 8 : parameter[A_BB2].push_back(3.80600000);
980 8 : parameter[A_BB2].push_back(-0.10727600);
981 8 : parameter[A_BB2].push_back(9.58854100);
982 8 : parameter[A_BB2].push_back(-6.23740500);
983 8 : parameter[A_BB2].push_back(-0.48267300);
984 8 : parameter[A_BB2].push_back(1.14119500);
985 8 : parameter[A_BB2].push_back(-0.21385600);
986 :
987 8 : parameter[A_BB3].push_back(3.59400000);
988 8 : parameter[A_BB3].push_back(0.04537300);
989 8 : parameter[A_BB3].push_back(9.59178900);
990 8 : parameter[A_BB3].push_back(-1.29202200);
991 8 : parameter[A_BB3].push_back(-7.10851000);
992 8 : parameter[A_BB3].push_back(4.05571200);
993 8 : parameter[A_BB3].push_back(-0.63372500);
994 :
995 8 : parameter[A_SC1].push_back(6.67100000);
996 8 : parameter[A_SC1].push_back(-0.00855300);
997 8 : parameter[A_SC1].push_back(1.63222400);
998 8 : parameter[A_SC1].push_back(-0.06466200);
999 8 : parameter[A_SC1].push_back(-1.48694200);
1000 8 : parameter[A_SC1].push_back(0.78544600);
1001 8 : parameter[A_SC1].push_back(-0.12083500);
1002 :
1003 8 : parameter[A_SC2].push_back(5.95100000);
1004 8 : parameter[A_SC2].push_back(-0.02606600);
1005 8 : parameter[A_SC2].push_back(2.54399900);
1006 8 : parameter[A_SC2].push_back(-0.48436900);
1007 8 : parameter[A_SC2].push_back(-1.55357400);
1008 8 : parameter[A_SC2].push_back(0.86466900);
1009 8 : parameter[A_SC2].push_back(-0.13509000);
1010 :
1011 8 : parameter[A_SC3].push_back(11.39400000);
1012 8 : parameter[A_SC3].push_back(0.00871300);
1013 8 : parameter[A_SC3].push_back(-0.23891300);
1014 8 : parameter[A_SC3].push_back(0.48919400);
1015 8 : parameter[A_SC3].push_back(-1.75289400);
1016 8 : parameter[A_SC3].push_back(0.99267500);
1017 8 : parameter[A_SC3].push_back(-0.16291300);
1018 :
1019 8 : parameter[A_SC4].push_back(6.45900000);
1020 8 : parameter[A_SC4].push_back(0.01990600);
1021 8 : parameter[A_SC4].push_back(4.17970400);
1022 8 : parameter[A_SC4].push_back(0.97629900);
1023 8 : parameter[A_SC4].push_back(-5.03297800);
1024 8 : parameter[A_SC4].push_back(2.55576700);
1025 8 : parameter[A_SC4].push_back(-0.39150500);
1026 :
1027 8 : parameter[A_3TE].push_back(4.23000000);
1028 8 : parameter[A_3TE].push_back(0.00064800);
1029 8 : parameter[A_3TE].push_back(0.92124600);
1030 8 : parameter[A_3TE].push_back(0.08064300);
1031 8 : parameter[A_3TE].push_back(-0.39054400);
1032 8 : parameter[A_3TE].push_back(0.12429100);
1033 8 : parameter[A_3TE].push_back(-0.01122700);
1034 :
1035 8 : parameter[A_5TE].push_back(4.23000000);
1036 8 : parameter[A_5TE].push_back(0.00039300);
1037 8 : parameter[A_5TE].push_back(0.92305100);
1038 8 : parameter[A_5TE].push_back(0.07747500);
1039 8 : parameter[A_5TE].push_back(-0.38792100);
1040 8 : parameter[A_5TE].push_back(0.12323800);
1041 8 : parameter[A_5TE].push_back(-0.01106600);
1042 :
1043 8 : parameter[A_TE3].push_back(7.82400000);
1044 8 : parameter[A_TE3].push_back(-0.04881000);
1045 8 : parameter[A_TE3].push_back(8.21557900);
1046 16 : parameter[A_TE3].push_back(-0.89491400);
1047 8 : parameter[A_TE3].push_back(-9.54293700);
1048 8 : parameter[A_TE3].push_back(6.33122200);
1049 8 : parameter[A_TE3].push_back(-1.16672900);
1050 :
1051 8 : parameter[A_TE5].push_back(8.03600000);
1052 8 : parameter[A_TE5].push_back(0.01641200);
1053 8 : parameter[A_TE5].push_back(5.14902200);
1054 8 : parameter[A_TE5].push_back(0.83419700);
1055 8 : parameter[A_TE5].push_back(-7.59068300);
1056 8 : parameter[A_TE5].push_back(4.52063200);
1057 8 : parameter[A_TE5].push_back(-0.78260800);
1058 :
1059 8 : parameter[C_BB1].push_back(32.88500000);
1060 8 : parameter[C_BB1].push_back(0.08311100);
1061 8 : parameter[C_BB1].push_back(-7.35432100);
1062 8 : parameter[C_BB1].push_back(2.18610000);
1063 8 : parameter[C_BB1].push_back(-3.55788300);
1064 8 : parameter[C_BB1].push_back(2.32918700);
1065 8 : parameter[C_BB1].push_back(-0.39720000);
1066 :
1067 8 : parameter[C_BB2].push_back(3.80600000);
1068 8 : parameter[C_BB2].push_back(-0.10808100);
1069 8 : parameter[C_BB2].push_back(9.61612600);
1070 8 : parameter[C_BB2].push_back(-6.28595400);
1071 8 : parameter[C_BB2].push_back(-0.45187000);
1072 8 : parameter[C_BB2].push_back(1.13326000);
1073 8 : parameter[C_BB2].push_back(-0.21320300);
1074 :
1075 8 : parameter[C_BB3].push_back(3.59400000);
1076 8 : parameter[C_BB3].push_back(0.04484200);
1077 8 : parameter[C_BB3].push_back(9.61919800);
1078 8 : parameter[C_BB3].push_back(-1.33582800);
1079 8 : parameter[C_BB3].push_back(-7.07200400);
1080 8 : parameter[C_BB3].push_back(4.03952900);
1081 8 : parameter[C_BB3].push_back(-0.63098200);
1082 :
1083 8 : parameter[C_SC1].push_back(5.95100000);
1084 8 : parameter[C_SC1].push_back(-0.02911300);
1085 8 : parameter[C_SC1].push_back(2.59700400);
1086 8 : parameter[C_SC1].push_back(-0.55507700);
1087 8 : parameter[C_SC1].push_back(-1.56344600);
1088 8 : parameter[C_SC1].push_back(0.88956200);
1089 8 : parameter[C_SC1].push_back(-0.14061300);
1090 :
1091 8 : parameter[C_SC2].push_back(11.62100000);
1092 8 : parameter[C_SC2].push_back(0.01366100);
1093 8 : parameter[C_SC2].push_back(-0.25959200);
1094 8 : parameter[C_SC2].push_back(0.48918300);
1095 8 : parameter[C_SC2].push_back(-1.52550500);
1096 8 : parameter[C_SC2].push_back(0.83644100);
1097 8 : parameter[C_SC2].push_back(-0.13407300);
1098 :
1099 8 : parameter[C_SC3].push_back(5.01900000);
1100 8 : parameter[C_SC3].push_back(-0.03276100);
1101 8 : parameter[C_SC3].push_back(5.53776900);
1102 8 : parameter[C_SC3].push_back(-0.95105000);
1103 8 : parameter[C_SC3].push_back(-3.71130800);
1104 8 : parameter[C_SC3].push_back(2.16146000);
1105 8 : parameter[C_SC3].push_back(-0.34918600);
1106 :
1107 8 : parameter[C_3TE].push_back(4.23000000);
1108 8 : parameter[C_3TE].push_back(0.00057300);
1109 8 : parameter[C_3TE].push_back(0.92174800);
1110 8 : parameter[C_3TE].push_back(0.07964500);
1111 8 : parameter[C_3TE].push_back(-0.38965700);
1112 8 : parameter[C_3TE].push_back(0.12392500);
1113 8 : parameter[C_3TE].push_back(-0.01117000);
1114 :
1115 8 : parameter[C_5TE].push_back(4.23000000);
1116 8 : parameter[C_5TE].push_back(0.00071000);
1117 8 : parameter[C_5TE].push_back(0.92082800);
1118 8 : parameter[C_5TE].push_back(0.08150600);
1119 8 : parameter[C_5TE].push_back(-0.39127000);
1120 8 : parameter[C_5TE].push_back(0.12455900);
1121 8 : parameter[C_5TE].push_back(-0.01126300);
1122 :
1123 8 : parameter[C_TE3].push_back(7.82400000);
1124 8 : parameter[C_TE3].push_back(-0.05848300);
1125 8 : parameter[C_TE3].push_back(8.29319900);
1126 8 : parameter[C_TE3].push_back(-1.12563800);
1127 8 : parameter[C_TE3].push_back(-9.42197600);
1128 8 : parameter[C_TE3].push_back(6.35441700);
1129 8 : parameter[C_TE3].push_back(-1.18356900);
1130 :
1131 8 : parameter[C_TE5].push_back(8.03600000);
1132 8 : parameter[C_TE5].push_back(0.00493500);
1133 8 : parameter[C_TE5].push_back(4.92622000);
1134 8 : parameter[C_TE5].push_back(0.64810700);
1135 8 : parameter[C_TE5].push_back(-7.05100000);
1136 8 : parameter[C_TE5].push_back(4.26064400);
1137 8 : parameter[C_TE5].push_back(-0.74819100);
1138 :
1139 8 : parameter[G_BB1].push_back(32.88500000);
1140 8 : parameter[G_BB1].push_back(0.08325400);
1141 8 : parameter[G_BB1].push_back(-7.35736000);
1142 8 : parameter[G_BB1].push_back(2.18914800);
1143 8 : parameter[G_BB1].push_back(-3.56154800);
1144 8 : parameter[G_BB1].push_back(2.33120600);
1145 8 : parameter[G_BB1].push_back(-0.39752300);
1146 :
1147 8 : parameter[G_BB2].push_back(3.80600000);
1148 8 : parameter[G_BB2].push_back(-0.10788300);
1149 8 : parameter[G_BB2].push_back(9.60930800);
1150 8 : parameter[G_BB2].push_back(-6.27402500);
1151 8 : parameter[G_BB2].push_back(-0.46192700);
1152 8 : parameter[G_BB2].push_back(1.13737000);
1153 8 : parameter[G_BB2].push_back(-0.21383100);
1154 :
1155 8 : parameter[G_BB3].push_back(3.59400000);
1156 8 : parameter[G_BB3].push_back(0.04514500);
1157 8 : parameter[G_BB3].push_back(9.61234700);
1158 8 : parameter[G_BB3].push_back(-1.31542100);
1159 8 : parameter[G_BB3].push_back(-7.09150500);
1160 8 : parameter[G_BB3].push_back(4.04706200);
1161 8 : parameter[G_BB3].push_back(-0.63201000);
1162 :
1163 8 : parameter[G_SC1].push_back(6.67100000);
1164 8 : parameter[G_SC1].push_back(-0.00863200);
1165 8 : parameter[G_SC1].push_back(1.63252300);
1166 8 : parameter[G_SC1].push_back(-0.06567200);
1167 8 : parameter[G_SC1].push_back(-1.48680500);
1168 8 : parameter[G_SC1].push_back(0.78565600);
1169 8 : parameter[G_SC1].push_back(-0.12088900);
1170 :
1171 8 : parameter[G_SC2].push_back(11.39400000);
1172 8 : parameter[G_SC2].push_back(0.00912200);
1173 8 : parameter[G_SC2].push_back(-0.22869000);
1174 8 : parameter[G_SC2].push_back(0.49616400);
1175 8 : parameter[G_SC2].push_back(-1.75039000);
1176 8 : parameter[G_SC2].push_back(0.98649200);
1177 8 : parameter[G_SC2].push_back(-0.16141600);
1178 :
1179 8 : parameter[G_SC3].push_back(10.90100000);
1180 8 : parameter[G_SC3].push_back(0.02208700);
1181 8 : parameter[G_SC3].push_back(0.17032800);
1182 8 : parameter[G_SC3].push_back(0.73280800);
1183 8 : parameter[G_SC3].push_back(-1.95292000);
1184 8 : parameter[G_SC3].push_back(0.98357600);
1185 8 : parameter[G_SC3].push_back(-0.14790900);
1186 :
1187 8 : parameter[G_SC4].push_back(6.45900000);
1188 8 : parameter[G_SC4].push_back(0.02023700);
1189 8 : parameter[G_SC4].push_back(4.17655400);
1190 8 : parameter[G_SC4].push_back(0.98731800);
1191 8 : parameter[G_SC4].push_back(-5.04352800);
1192 8 : parameter[G_SC4].push_back(2.56059400);
1193 8 : parameter[G_SC4].push_back(-0.39234300);
1194 :
1195 8 : parameter[G_3TE].push_back(4.23000000);
1196 8 : parameter[G_3TE].push_back(0.00066300);
1197 8 : parameter[G_3TE].push_back(0.92118800);
1198 8 : parameter[G_3TE].push_back(0.08062700);
1199 8 : parameter[G_3TE].push_back(-0.39041600);
1200 8 : parameter[G_3TE].push_back(0.12419400);
1201 8 : parameter[G_3TE].push_back(-0.01120500);
1202 :
1203 8 : parameter[G_5TE].push_back(4.23000000);
1204 16 : parameter[G_5TE].push_back(0.00062800);
1205 8 : parameter[G_5TE].push_back(0.92133500);
1206 8 : parameter[G_5TE].push_back(0.08029900);
1207 8 : parameter[G_5TE].push_back(-0.39015300);
1208 8 : parameter[G_5TE].push_back(0.12411600);
1209 8 : parameter[G_5TE].push_back(-0.01119900);
1210 :
1211 8 : parameter[G_TE3].push_back(7.82400000);
1212 8 : parameter[G_TE3].push_back(-0.05177400);
1213 8 : parameter[G_TE3].push_back(8.34606700);
1214 8 : parameter[G_TE3].push_back(-1.02936300);
1215 8 : parameter[G_TE3].push_back(-9.55211900);
1216 8 : parameter[G_TE3].push_back(6.37776600);
1217 8 : parameter[G_TE3].push_back(-1.17898000);
1218 :
1219 8 : parameter[G_TE5].push_back(8.03600000);
1220 8 : parameter[G_TE5].push_back(0.00525100);
1221 8 : parameter[G_TE5].push_back(4.71070600);
1222 8 : parameter[G_TE5].push_back(0.66746900);
1223 8 : parameter[G_TE5].push_back(-6.72538700);
1224 8 : parameter[G_TE5].push_back(4.03644100);
1225 8 : parameter[G_TE5].push_back(-0.70605700);
1226 :
1227 8 : parameter[U_BB1].push_back(32.88500000);
1228 8 : parameter[U_BB1].push_back(0.08321400);
1229 8 : parameter[U_BB1].push_back(-7.35634900);
1230 8 : parameter[U_BB1].push_back(2.18826800);
1231 8 : parameter[U_BB1].push_back(-3.56047400);
1232 8 : parameter[U_BB1].push_back(2.33064700);
1233 8 : parameter[U_BB1].push_back(-0.39744000);
1234 :
1235 8 : parameter[U_BB2].push_back(3.80600000);
1236 8 : parameter[U_BB2].push_back(-0.10773100);
1237 8 : parameter[U_BB2].push_back(9.60099900);
1238 8 : parameter[U_BB2].push_back(-6.26131900);
1239 8 : parameter[U_BB2].push_back(-0.46668300);
1240 8 : parameter[U_BB2].push_back(1.13698100);
1241 8 : parameter[U_BB2].push_back(-0.21351600);
1242 :
1243 8 : parameter[U_BB3].push_back(3.59400000);
1244 8 : parameter[U_BB3].push_back(0.04544300);
1245 8 : parameter[U_BB3].push_back(9.59625900);
1246 8 : parameter[U_BB3].push_back(-1.29222200);
1247 8 : parameter[U_BB3].push_back(-7.11143200);
1248 8 : parameter[U_BB3].push_back(4.05687700);
1249 8 : parameter[U_BB3].push_back(-0.63382800);
1250 :
1251 8 : parameter[U_SC1].push_back(5.95100000);
1252 8 : parameter[U_SC1].push_back(-0.02924500);
1253 8 : parameter[U_SC1].push_back(2.59668700);
1254 8 : parameter[U_SC1].push_back(-0.56118700);
1255 8 : parameter[U_SC1].push_back(-1.56477100);
1256 8 : parameter[U_SC1].push_back(0.89265100);
1257 8 : parameter[U_SC1].push_back(-0.14130800);
1258 :
1259 8 : parameter[U_SC2].push_back(10.90100000);
1260 8 : parameter[U_SC2].push_back(0.02178900);
1261 8 : parameter[U_SC2].push_back(0.18839000);
1262 8 : parameter[U_SC2].push_back(0.72223100);
1263 8 : parameter[U_SC2].push_back(-1.92581600);
1264 8 : parameter[U_SC2].push_back(0.96654300);
1265 8 : parameter[U_SC2].push_back(-0.14501300);
1266 :
1267 8 : parameter[U_SC3].push_back(5.24600000);
1268 8 : parameter[U_SC3].push_back(-0.04586500);
1269 8 : parameter[U_SC3].push_back(5.89978100);
1270 8 : parameter[U_SC3].push_back(-1.50664700);
1271 8 : parameter[U_SC3].push_back(-3.17054400);
1272 8 : parameter[U_SC3].push_back(1.93717100);
1273 8 : parameter[U_SC3].push_back(-0.31701000);
1274 :
1275 8 : parameter[U_3TE].push_back(4.23000000);
1276 8 : parameter[U_3TE].push_back(0.00067500);
1277 8 : parameter[U_3TE].push_back(0.92102300);
1278 8 : parameter[U_3TE].push_back(0.08100800);
1279 8 : parameter[U_3TE].push_back(-0.39084300);
1280 8 : parameter[U_3TE].push_back(0.12441900);
1281 8 : parameter[U_3TE].push_back(-0.01124900);
1282 :
1283 8 : parameter[U_5TE].push_back(4.23000000);
1284 8 : parameter[U_5TE].push_back(0.00059000);
1285 8 : parameter[U_5TE].push_back(0.92154600);
1286 8 : parameter[U_5TE].push_back(0.07968200);
1287 8 : parameter[U_5TE].push_back(-0.38950100);
1288 8 : parameter[U_5TE].push_back(0.12382500);
1289 8 : parameter[U_5TE].push_back(-0.01115100);
1290 :
1291 8 : parameter[U_TE3].push_back(7.82400000);
1292 8 : parameter[U_TE3].push_back(-0.02968100);
1293 8 : parameter[U_TE3].push_back(7.93783200);
1294 8 : parameter[U_TE3].push_back(-0.33078100);
1295 8 : parameter[U_TE3].push_back(-10.14120200);
1296 8 : parameter[U_TE3].push_back(6.63334700);
1297 8 : parameter[U_TE3].push_back(-1.22111200);
1298 :
1299 8 : parameter[U_TE5].push_back(8.03600000);
1300 8 : parameter[U_TE5].push_back(-0.00909700);
1301 8 : parameter[U_TE5].push_back(4.33193500);
1302 8 : parameter[U_TE5].push_back(0.43416500);
1303 8 : parameter[U_TE5].push_back(-5.80831400);
1304 8 : parameter[U_TE5].push_back(3.52438800);
1305 8 : parameter[U_TE5].push_back(-0.62382400);
1306 :
1307 8 : parameter[DA_BB1].push_back(32.88500000);
1308 8 : parameter[DA_BB1].push_back(0.08179900);
1309 8 : parameter[DA_BB1].push_back(-7.31735900);
1310 8 : parameter[DA_BB1].push_back(2.15614500);
1311 8 : parameter[DA_BB1].push_back(-3.52263200);
1312 8 : parameter[DA_BB1].push_back(2.30604700);
1313 8 : parameter[DA_BB1].push_back(-0.39270100);
1314 :
1315 8 : parameter[DA_BB2].push_back(3.80600000);
1316 8 : parameter[DA_BB2].push_back(-0.10597700);
1317 8 : parameter[DA_BB2].push_back(9.52537500);
1318 8 : parameter[DA_BB2].push_back(-6.12991000);
1319 8 : parameter[DA_BB2].push_back(-0.54092600);
1320 8 : parameter[DA_BB2].push_back(1.15429100);
1321 8 : parameter[DA_BB2].push_back(-0.21503500);
1322 :
1323 8 : parameter[DA_BB3].push_back(-1.35600000);
1324 8 : parameter[DA_BB3].push_back(0.58928300);
1325 8 : parameter[DA_BB3].push_back(6.71894100);
1326 8 : parameter[DA_BB3].push_back(4.14050900);
1327 8 : parameter[DA_BB3].push_back(-9.65859900);
1328 8 : parameter[DA_BB3].push_back(4.43185000);
1329 8 : parameter[DA_BB3].push_back(-0.64657300);
1330 :
1331 8 : parameter[DA_SC1].push_back(6.67100000);
1332 8 : parameter[DA_SC1].push_back(-0.00871400);
1333 8 : parameter[DA_SC1].push_back(1.63289100);
1334 8 : parameter[DA_SC1].push_back(-0.06637700);
1335 8 : parameter[DA_SC1].push_back(-1.48632900);
1336 8 : parameter[DA_SC1].push_back(0.78551800);
1337 8 : parameter[DA_SC1].push_back(-0.12087300);
1338 :
1339 8 : parameter[DA_SC2].push_back(5.95100000);
1340 8 : parameter[DA_SC2].push_back(-0.02634300);
1341 8 : parameter[DA_SC2].push_back(2.54864300);
1342 8 : parameter[DA_SC2].push_back(-0.49015800);
1343 8 : parameter[DA_SC2].push_back(-1.55386900);
1344 8 : parameter[DA_SC2].push_back(0.86630200);
1345 8 : parameter[DA_SC2].push_back(-0.13546200);
1346 :
1347 8 : parameter[DA_SC3].push_back(11.39400000);
1348 8 : parameter[DA_SC3].push_back(0.00859500);
1349 8 : parameter[DA_SC3].push_back(-0.25471400);
1350 8 : parameter[DA_SC3].push_back(0.48718800);
1351 8 : parameter[DA_SC3].push_back(-1.74520000);
1352 8 : parameter[DA_SC3].push_back(0.99246200);
1353 8 : parameter[DA_SC3].push_back(-0.16351900);
1354 :
1355 8 : parameter[DA_SC4].push_back(6.45900000);
1356 8 : parameter[DA_SC4].push_back(0.01991800);
1357 8 : parameter[DA_SC4].push_back(4.17962300);
1358 8 : parameter[DA_SC4].push_back(0.97469100);
1359 8 : parameter[DA_SC4].push_back(-5.02950400);
1360 8 : parameter[DA_SC4].push_back(2.55371800);
1361 8 : parameter[DA_SC4].push_back(-0.39113400);
1362 :
1363 8 : parameter[DA_3TE].push_back(4.23000000);
1364 8 : parameter[DA_3TE].push_back(0.00062600);
1365 8 : parameter[DA_3TE].push_back(0.92142000);
1366 8 : parameter[DA_3TE].push_back(0.08016400);
1367 8 : parameter[DA_3TE].push_back(-0.39000300);
1368 8 : parameter[DA_3TE].push_back(0.12402500);
1369 8 : parameter[DA_3TE].push_back(-0.01117900);
1370 :
1371 8 : parameter[DA_5TE].push_back(4.23000000);
1372 8 : parameter[DA_5TE].push_back(0.00055500);
1373 8 : parameter[DA_5TE].push_back(0.92183900);
1374 8 : parameter[DA_5TE].push_back(0.07907600);
1375 8 : parameter[DA_5TE].push_back(-0.38895100);
1376 8 : parameter[DA_5TE].push_back(0.12359600);
1377 8 : parameter[DA_5TE].push_back(-0.01111600);
1378 :
1379 8 : parameter[DA_TE3].push_back(2.87400000);
1380 8 : parameter[DA_TE3].push_back(0.00112900);
1381 8 : parameter[DA_TE3].push_back(12.51167200);
1382 8 : parameter[DA_TE3].push_back(-7.67548000);
1383 8 : parameter[DA_TE3].push_back(-2.02234000);
1384 8 : parameter[DA_TE3].push_back(2.50837100);
1385 8 : parameter[DA_TE3].push_back(-0.49458500);
1386 :
1387 8 : parameter[DA_TE5].push_back(8.03600000);
1388 8 : parameter[DA_TE5].push_back(0.00473100);
1389 8 : parameter[DA_TE5].push_back(4.65554400);
1390 8 : parameter[DA_TE5].push_back(0.66424100);
1391 8 : parameter[DA_TE5].push_back(-6.62131300);
1392 8 : parameter[DA_TE5].push_back(3.96107400);
1393 8 : parameter[DA_TE5].push_back(-0.69075800);
1394 :
1395 8 : parameter[DC_BB1].push_back(32.88500000);
1396 8 : parameter[DC_BB1].push_back(0.08189900);
1397 8 : parameter[DC_BB1].push_back(-7.32493500);
1398 8 : parameter[DC_BB1].push_back(2.15976900);
1399 8 : parameter[DC_BB1].push_back(-3.52612100);
1400 8 : parameter[DC_BB1].push_back(2.31058600);
1401 8 : parameter[DC_BB1].push_back(-0.39402700);
1402 :
1403 8 : parameter[DC_BB2].push_back(3.80600000);
1404 8 : parameter[DC_BB2].push_back(-0.10559800);
1405 8 : parameter[DC_BB2].push_back(9.52527700);
1406 8 : parameter[DC_BB2].push_back(-6.12131700);
1407 8 : parameter[DC_BB2].push_back(-0.54899400);
1408 8 : parameter[DC_BB2].push_back(1.15592900);
1409 8 : parameter[DC_BB2].push_back(-0.21494500);
1410 :
1411 8 : parameter[DC_BB3].push_back(-1.35600000);
1412 8 : parameter[DC_BB3].push_back(0.55525700);
1413 8 : parameter[DC_BB3].push_back(6.80305500);
1414 8 : parameter[DC_BB3].push_back(4.05924700);
1415 8 : parameter[DC_BB3].push_back(-9.61034700);
1416 8 : parameter[DC_BB3].push_back(4.41253800);
1417 8 : parameter[DC_BB3].push_back(-0.64315100);
1418 :
1419 8 : parameter[DC_SC1].push_back(5.95100000);
1420 8 : parameter[DC_SC1].push_back(-0.02899900);
1421 8 : parameter[DC_SC1].push_back(2.59587800);
1422 8 : parameter[DC_SC1].push_back(-0.55388300);
1423 8 : parameter[DC_SC1].push_back(-1.56395100);
1424 8 : parameter[DC_SC1].push_back(0.88967400);
1425 8 : parameter[DC_SC1].push_back(-0.14062500);
1426 :
1427 8 : parameter[DC_SC2].push_back(11.62100000);
1428 8 : parameter[DC_SC2].push_back(0.01358100);
1429 8 : parameter[DC_SC2].push_back(-0.24913000);
1430 8 : parameter[DC_SC2].push_back(0.48787200);
1431 8 : parameter[DC_SC2].push_back(-1.52867300);
1432 8 : parameter[DC_SC2].push_back(0.83694900);
1433 8 : parameter[DC_SC2].push_back(-0.13395300);
1434 :
1435 8 : parameter[DC_SC3].push_back(5.01900000);
1436 8 : parameter[DC_SC3].push_back(-0.03298400);
1437 8 : parameter[DC_SC3].push_back(5.54242800);
1438 8 : parameter[DC_SC3].push_back(-0.96081500);
1439 8 : parameter[DC_SC3].push_back(-3.71051600);
1440 8 : parameter[DC_SC3].push_back(2.16500200);
1441 8 : parameter[DC_SC3].push_back(-0.35023400);
1442 :
1443 8 : parameter[DC_3TE].push_back(4.23000000);
1444 8 : parameter[DC_3TE].push_back(0.00055700);
1445 8 : parameter[DC_3TE].push_back(0.92181400);
1446 8 : parameter[DC_3TE].push_back(0.07924000);
1447 8 : parameter[DC_3TE].push_back(-0.38916400);
1448 8 : parameter[DC_3TE].push_back(0.12369900);
1449 8 : parameter[DC_3TE].push_back(-0.01113300);
1450 :
1451 8 : parameter[DC_5TE].push_back(4.23000000);
1452 8 : parameter[DC_5TE].push_back(0.00066500);
1453 8 : parameter[DC_5TE].push_back(0.92103900);
1454 8 : parameter[DC_5TE].push_back(0.08064600);
1455 8 : parameter[DC_5TE].push_back(-0.39034900);
1456 8 : parameter[DC_5TE].push_back(0.12417600);
1457 8 : parameter[DC_5TE].push_back(-0.01120600);
1458 :
1459 8 : parameter[DC_TE3].push_back(2.87400000);
1460 8 : parameter[DC_TE3].push_back(-0.05235500);
1461 8 : parameter[DC_TE3].push_back(13.09201200);
1462 8 : parameter[DC_TE3].push_back(-9.48128200);
1463 8 : parameter[DC_TE3].push_back(-0.14958600);
1464 8 : parameter[DC_TE3].push_back(1.75537200);
1465 8 : parameter[DC_TE3].push_back(-0.39347500);
1466 :
1467 8 : parameter[DC_TE5].push_back(8.03600000);
1468 8 : parameter[DC_TE5].push_back(-0.00513600);
1469 8 : parameter[DC_TE5].push_back(4.67705700);
1470 8 : parameter[DC_TE5].push_back(0.48333300);
1471 8 : parameter[DC_TE5].push_back(-6.34511000);
1472 8 : parameter[DC_TE5].push_back(3.83388500);
1473 8 : parameter[DC_TE5].push_back(-0.67367800);
1474 :
1475 8 : parameter[DG_BB1].push_back(32.88500000);
1476 8 : parameter[DG_BB1].push_back(0.08182900);
1477 8 : parameter[DG_BB1].push_back(-7.32133900);
1478 8 : parameter[DG_BB1].push_back(2.15767900);
1479 8 : parameter[DG_BB1].push_back(-3.52369700);
1480 8 : parameter[DG_BB1].push_back(2.30839600);
1481 8 : parameter[DG_BB1].push_back(-0.39348300);
1482 :
1483 8 : parameter[DG_BB2].push_back(3.80600000);
1484 8 : parameter[DG_BB2].push_back(-0.10618100);
1485 8 : parameter[DG_BB2].push_back(9.54169000);
1486 8 : parameter[DG_BB2].push_back(-6.15177600);
1487 8 : parameter[DG_BB2].push_back(-0.53462400);
1488 8 : parameter[DG_BB2].push_back(1.15581300);
1489 8 : parameter[DG_BB2].push_back(-0.21567000);
1490 :
1491 8 : parameter[DG_BB3].push_back(-1.35600000);
1492 8 : parameter[DG_BB3].push_back(0.57489100);
1493 8 : parameter[DG_BB3].push_back(6.75164700);
1494 8 : parameter[DG_BB3].push_back(4.11300900);
1495 8 : parameter[DG_BB3].push_back(-9.63394600);
1496 8 : parameter[DG_BB3].push_back(4.41675400);
1497 8 : parameter[DG_BB3].push_back(-0.64339900);
1498 :
1499 8 : parameter[DG_SC1].push_back(6.67100000);
1500 8 : parameter[DG_SC1].push_back(-0.00886600);
1501 8 : parameter[DG_SC1].push_back(1.63333000);
1502 8 : parameter[DG_SC1].push_back(-0.06892100);
1503 8 : parameter[DG_SC1].push_back(-1.48683500);
1504 8 : parameter[DG_SC1].push_back(0.78670800);
1505 8 : parameter[DG_SC1].push_back(-0.12113900);
1506 :
1507 8 : parameter[DG_SC2].push_back(11.39400000);
1508 8 : parameter[DG_SC2].push_back(0.00907900);
1509 8 : parameter[DG_SC2].push_back(-0.22475500);
1510 8 : parameter[DG_SC2].push_back(0.49535100);
1511 8 : parameter[DG_SC2].push_back(-1.75324900);
1512 8 : parameter[DG_SC2].push_back(0.98767400);
1513 8 : parameter[DG_SC2].push_back(-0.16150800);
1514 :
1515 8 : parameter[DG_SC3].push_back(10.90100000);
1516 8 : parameter[DG_SC3].push_back(0.02207600);
1517 8 : parameter[DG_SC3].push_back(0.17932200);
1518 8 : parameter[DG_SC3].push_back(0.73253200);
1519 8 : parameter[DG_SC3].push_back(-1.95554900);
1520 8 : parameter[DG_SC3].push_back(0.98339900);
1521 8 : parameter[DG_SC3].push_back(-0.14763600);
1522 :
1523 8 : parameter[DG_SC4].push_back(6.45900000);
1524 8 : parameter[DG_SC4].push_back(0.02018400);
1525 8 : parameter[DG_SC4].push_back(4.17705400);
1526 8 : parameter[DG_SC4].push_back(0.98531700);
1527 8 : parameter[DG_SC4].push_back(-5.04354900);
1528 8 : parameter[DG_SC4].push_back(2.56123700);
1529 8 : parameter[DG_SC4].push_back(-0.39249300);
1530 :
1531 8 : parameter[DG_3TE].push_back(4.23000000);
1532 8 : parameter[DG_3TE].push_back(0.00061700);
1533 8 : parameter[DG_3TE].push_back(0.92140100);
1534 8 : parameter[DG_3TE].push_back(0.08016400);
1535 8 : parameter[DG_3TE].push_back(-0.39003500);
1536 8 : parameter[DG_3TE].push_back(0.12406900);
1537 8 : parameter[DG_3TE].push_back(-0.01119200);
1538 :
1539 8 : parameter[DG_5TE].push_back(4.23000000);
1540 8 : parameter[DG_5TE].push_back(0.00064900);
1541 8 : parameter[DG_5TE].push_back(0.92110500);
1542 8 : parameter[DG_5TE].push_back(0.08031500);
1543 8 : parameter[DG_5TE].push_back(-0.38997000);
1544 8 : parameter[DG_5TE].push_back(0.12401200);
1545 8 : parameter[DG_5TE].push_back(-0.01118100);
1546 :
1547 8 : parameter[DG_TE3].push_back(2.87400000);
1548 8 : parameter[DG_TE3].push_back(0.00182000);
1549 8 : parameter[DG_TE3].push_back(12.41507000);
1550 8 : parameter[DG_TE3].push_back(-7.47384800);
1551 8 : parameter[DG_TE3].push_back(-2.11864700);
1552 8 : parameter[DG_TE3].push_back(2.50112600);
1553 8 : parameter[DG_TE3].push_back(-0.48652200);
1554 :
1555 8 : parameter[DG_TE5].push_back(8.03600000);
1556 8 : parameter[DG_TE5].push_back(0.00676400);
1557 8 : parameter[DG_TE5].push_back(4.65989200);
1558 8 : parameter[DG_TE5].push_back(0.78482500);
1559 8 : parameter[DG_TE5].push_back(-6.86460600);
1560 8 : parameter[DG_TE5].push_back(4.11675400);
1561 8 : parameter[DG_TE5].push_back(-0.72249100);
1562 :
1563 8 : parameter[DT_BB1].push_back(32.88500000);
1564 8 : parameter[DT_BB1].push_back(0.08220100);
1565 8 : parameter[DT_BB1].push_back(-7.33006800);
1566 8 : parameter[DT_BB1].push_back(2.16636500);
1567 8 : parameter[DT_BB1].push_back(-3.53465700);
1568 8 : parameter[DT_BB1].push_back(2.31447600);
1569 8 : parameter[DT_BB1].push_back(-0.39445400);
1570 :
1571 8 : parameter[DT_BB2].push_back(3.80600000);
1572 8 : parameter[DT_BB2].push_back(-0.10723000);
1573 8 : parameter[DT_BB2].push_back(9.56675000);
1574 8 : parameter[DT_BB2].push_back(-6.20236100);
1575 8 : parameter[DT_BB2].push_back(-0.49550400);
1576 8 : parameter[DT_BB2].push_back(1.14300600);
1577 8 : parameter[DT_BB2].push_back(-0.21420000);
1578 :
1579 8 : parameter[DT_BB3].push_back(-1.35600000);
1580 8 : parameter[DT_BB3].push_back(0.56737900);
1581 8 : parameter[DT_BB3].push_back(6.76595400);
1582 8 : parameter[DT_BB3].push_back(4.08976100);
1583 8 : parameter[DT_BB3].push_back(-9.61512500);
1584 8 : parameter[DT_BB3].push_back(4.40975100);
1585 8 : parameter[DT_BB3].push_back(-0.64239800);
1586 :
1587 8 : parameter[DT_SC1].push_back(5.95100000);
1588 8 : parameter[DT_SC1].push_back(-0.02926500);
1589 8 : parameter[DT_SC1].push_back(2.59630300);
1590 8 : parameter[DT_SC1].push_back(-0.56152200);
1591 8 : parameter[DT_SC1].push_back(-1.56532600);
1592 8 : parameter[DT_SC1].push_back(0.89322800);
1593 8 : parameter[DT_SC1].push_back(-0.14142900);
1594 :
1595 8 : parameter[DT_SC2].push_back(10.90100000);
1596 8 : parameter[DT_SC2].push_back(0.02183400);
1597 8 : parameter[DT_SC2].push_back(0.19463000);
1598 8 : parameter[DT_SC2].push_back(0.72393000);
1599 8 : parameter[DT_SC2].push_back(-1.93199500);
1600 8 : parameter[DT_SC2].push_back(0.96856300);
1601 8 : parameter[DT_SC2].push_back(-0.14512600);
1602 :
1603 8 : parameter[DT_SC3].push_back(4.31400000);
1604 8 : parameter[DT_SC3].push_back(-0.07745600);
1605 8 : parameter[DT_SC3].push_back(12.49820300);
1606 8 : parameter[DT_SC3].push_back(-7.64994200);
1607 8 : parameter[DT_SC3].push_back(-3.00359600);
1608 8 : parameter[DT_SC3].push_back(3.26263300);
1609 8 : parameter[DT_SC3].push_back(-0.64498600);
1610 :
1611 8 : parameter[DT_3TE].push_back(4.23000000);
1612 8 : parameter[DT_3TE].push_back(0.00062000);
1613 8 : parameter[DT_3TE].push_back(0.92141100);
1614 8 : parameter[DT_3TE].push_back(0.08030900);
1615 8 : parameter[DT_3TE].push_back(-0.39021500);
1616 8 : parameter[DT_3TE].push_back(0.12414000);
1617 8 : parameter[DT_3TE].push_back(-0.01120100);
1618 :
1619 8 : parameter[DT_5TE].push_back(4.23000000);
1620 8 : parameter[DT_5TE].push_back(0.00063700);
1621 8 : parameter[DT_5TE].push_back(0.92130800);
1622 8 : parameter[DT_5TE].push_back(0.08026900);
1623 8 : parameter[DT_5TE].push_back(-0.39007500);
1624 8 : parameter[DT_5TE].push_back(0.12406600);
1625 8 : parameter[DT_5TE].push_back(-0.01118800);
1626 :
1627 8 : parameter[DT_TE3].push_back(2.87400000);
1628 8 : parameter[DT_TE3].push_back(-0.00251200);
1629 8 : parameter[DT_TE3].push_back(12.43576400);
1630 8 : parameter[DT_TE3].push_back(-7.55343800);
1631 8 : parameter[DT_TE3].push_back(-2.07363500);
1632 8 : parameter[DT_TE3].push_back(2.51279300);
1633 8 : parameter[DT_TE3].push_back(-0.49437100);
1634 :
1635 8 : parameter[DT_TE5].push_back(8.03600000);
1636 8 : parameter[DT_TE5].push_back(0.00119900);
1637 8 : parameter[DT_TE5].push_back(4.91762300);
1638 8 : parameter[DT_TE5].push_back(0.65637000);
1639 8 : parameter[DT_TE5].push_back(-7.23392500);
1640 8 : parameter[DT_TE5].push_back(4.44636600);
1641 8 : parameter[DT_TE5].push_back(-0.79467800);
1642 :
1643 8 : auto* moldat=plumed.getActionSet().selectLatest<GenericMolInfo*>(this);
1644 8 : if( moldat ) {
1645 8 : log<<" MOLINFO DATA found with label " <<moldat->getLabel()<<", using proper atom names\n";
1646 8400 : for(unsigned i=0; i<atoms.size(); ++i) {
1647 8392 : std::string Aname = moldat->getAtomName(atoms[i]);
1648 8392 : std::string Rname = moldat->getResidueName(atoms[i]);
1649 8392 : if(Rname=="ALA") {
1650 72 : if(Aname=="BB") {
1651 72 : atoi[i]=ALA_BB;
1652 0 : } else error("Atom name not known: "+Aname);
1653 8320 : } else if(Rname=="ARG") {
1654 420 : if(Aname=="BB") {
1655 140 : atoi[i]=ARG_BB;
1656 280 : } else if(Aname=="SC1") {
1657 140 : atoi[i]=ARG_SC1;
1658 140 : } else if(Aname=="SC2") {
1659 140 : atoi[i]=ARG_SC2;
1660 0 : } else error("Atom name not known: "+Aname);
1661 7900 : } else if(Rname=="ASN") {
1662 240 : if(Aname=="BB") {
1663 120 : atoi[i]=ASN_BB;
1664 120 : } else if(Aname=="SC1") {
1665 120 : atoi[i]=ASN_SC1;
1666 0 : } else error("Atom name not known: "+Aname);
1667 7660 : } else if(Rname=="ASP") {
1668 368 : if(Aname=="BB") {
1669 184 : atoi[i]=ASP_BB;
1670 184 : } else if(Aname=="SC1") {
1671 184 : atoi[i]=ASP_SC1;
1672 0 : } else error("Atom name not known: "+Aname);
1673 7292 : } else if(Rname=="CYS") {
1674 16 : if(Aname=="BB") {
1675 8 : atoi[i]=CYS_BB;
1676 8 : } else if(Aname=="SC1") {
1677 8 : atoi[i]=CYS_SC1;
1678 0 : } else error("Atom name not known: "+Aname);
1679 7276 : } else if(Rname=="GLN") {
1680 224 : if(Aname=="BB") {
1681 112 : atoi[i]=GLN_BB;
1682 112 : } else if(Aname=="SC1") {
1683 112 : atoi[i]=GLN_SC1;
1684 0 : } else error("Atom name not known: "+Aname);
1685 7052 : } else if(Rname=="GLU") {
1686 480 : if(Aname=="BB") {
1687 240 : atoi[i]=GLU_BB;
1688 240 : } else if(Aname=="SC1") {
1689 240 : atoi[i]=GLU_SC1;
1690 0 : } else error("Atom name not known: "+Aname);
1691 6572 : } else if(Rname=="GLY") {
1692 116 : if(Aname=="BB") {
1693 116 : atoi[i]=GLY_BB;
1694 0 : } else error("Atom name not known: "+Aname);
1695 6456 : } else if(Rname=="HIS") {
1696 576 : if(Aname=="BB") {
1697 144 : atoi[i]=HIS_BB;
1698 432 : } else if(Aname=="SC1") {
1699 144 : atoi[i]=HIS_SC1;
1700 288 : } else if(Aname=="SC2") {
1701 144 : atoi[i]=HIS_SC2;
1702 144 : } else if(Aname=="SC3") {
1703 144 : atoi[i]=HIS_SC3;
1704 0 : } else error("Atom name not known: "+Aname);
1705 5880 : } else if(Rname=="ILE") {
1706 584 : if(Aname=="BB") {
1707 292 : atoi[i]=ILE_BB;
1708 292 : } else if(Aname=="SC1") {
1709 292 : atoi[i]=ILE_SC1;
1710 0 : } else error("Atom name not known: "+Aname);
1711 5296 : } else if(Rname=="LEU") {
1712 448 : if(Aname=="BB") {
1713 224 : atoi[i]=LEU_BB;
1714 224 : } else if(Aname=="SC1") {
1715 224 : atoi[i]=LEU_SC1;
1716 0 : } else error("Atom name not known: "+Aname);
1717 4848 : } else if(Rname=="LYS") {
1718 792 : if(Aname=="BB") {
1719 264 : atoi[i]=LYS_BB;
1720 528 : } else if(Aname=="SC1") {
1721 264 : atoi[i]=LYS_SC1;
1722 264 : } else if(Aname=="SC2") {
1723 264 : atoi[i]=LYS_SC2;
1724 0 : } else error("Atom name not known: "+Aname);
1725 4056 : } else if(Rname=="MET") {
1726 80 : if(Aname=="BB") {
1727 40 : atoi[i]=MET_BB;
1728 40 : } else if(Aname=="SC1") {
1729 40 : atoi[i]=MET_SC1;
1730 0 : } else error("Atom name not known: "+Aname);
1731 3976 : } else if(Rname=="PHE") {
1732 512 : if(Aname=="BB") {
1733 128 : atoi[i]=PHE_BB;
1734 384 : } else if(Aname=="SC1") {
1735 128 : atoi[i]=PHE_SC1;
1736 256 : } else if(Aname=="SC2") {
1737 128 : atoi[i]=PHE_SC2;
1738 128 : } else if(Aname=="SC3") {
1739 128 : atoi[i]=PHE_SC3;
1740 0 : } else error("Atom name not known: "+Aname);
1741 3464 : } else if(Rname=="PRO") {
1742 128 : if(Aname=="BB") {
1743 64 : atoi[i]=PRO_BB;
1744 64 : } else if(Aname=="SC1") {
1745 64 : atoi[i]=PRO_SC1;
1746 0 : } else error("Atom name not known: "+Aname);
1747 3336 : } else if(Rname=="SER") {
1748 248 : if(Aname=="BB") {
1749 124 : atoi[i]=SER_BB;
1750 124 : } else if(Aname=="SC1") {
1751 124 : atoi[i]=SER_SC1;
1752 0 : } else error("Atom name not known: "+Aname);
1753 3088 : } else if(Rname=="THR") {
1754 288 : if(Aname=="BB") {
1755 144 : atoi[i]=THR_BB;
1756 144 : } else if(Aname=="SC1") {
1757 144 : atoi[i]=THR_SC1;
1758 0 : } else error("Atom name not known: "+Aname);
1759 2800 : } else if(Rname=="TRP") {
1760 0 : if(Aname=="BB") {
1761 0 : atoi[i]=TRP_BB;
1762 0 : } else if(Aname=="SC1") {
1763 0 : atoi[i]=TRP_SC1;
1764 0 : } else if(Aname=="SC2") {
1765 0 : atoi[i]=TRP_SC2;
1766 0 : } else if(Aname=="SC3") {
1767 0 : atoi[i]=TRP_SC3;
1768 0 : } else if(Aname=="SC4") {
1769 0 : atoi[i]=TRP_SC4;
1770 0 : } else error("Atom name not known: "+Aname);
1771 2800 : } else if(Rname=="TYR") {
1772 544 : if(Aname=="BB") {
1773 136 : atoi[i]=TYR_BB;
1774 408 : } else if(Aname=="SC1") {
1775 136 : atoi[i]=TYR_SC1;
1776 272 : } else if(Aname=="SC2") {
1777 136 : atoi[i]=TYR_SC2;
1778 136 : } else if(Aname=="SC3") {
1779 136 : atoi[i]=TYR_SC3;
1780 0 : } else error("Atom name not known: "+Aname);
1781 2256 : } else if(Rname=="VAL") {
1782 288 : if(Aname=="BB") {
1783 144 : atoi[i]=VAL_BB;
1784 144 : } else if(Aname=="SC1") {
1785 144 : atoi[i]=VAL_SC1;
1786 0 : } else error("Atom name not known: "+Aname);
1787 1968 : } else if(Rname==" A") {
1788 0 : if(Aname=="BB1") {
1789 0 : atoi[i]=A_BB1;
1790 0 : } else if(Aname=="BB2") {
1791 0 : atoi[i]=A_BB2;
1792 0 : } else if(Aname=="BB3") {
1793 0 : atoi[i]=A_BB3;
1794 0 : } else if(Aname=="SC1") {
1795 0 : atoi[i]=A_SC1;
1796 0 : } else if(Aname=="SC2") {
1797 0 : atoi[i]=A_SC2;
1798 0 : } else if(Aname=="SC3") {
1799 0 : atoi[i]=A_SC3;
1800 0 : } else if(Aname=="SC4") {
1801 0 : atoi[i]=A_SC4;
1802 0 : } else if(Aname=="3TE") {
1803 0 : atoi[i]=A_3TE;
1804 0 : } else if(Aname=="5TE") {
1805 0 : atoi[i]=A_5TE;
1806 0 : } else if(Aname=="TE3") {
1807 0 : atoi[i]=A_TE3;
1808 0 : } else if(Aname=="TE5") {
1809 0 : atoi[i]=A_TE5;
1810 0 : } else error("Atom name not known: "+Aname);
1811 1968 : } else if(Rname==" C") {
1812 0 : if(Aname=="BB1") {
1813 0 : atoi[i]=C_BB1;
1814 0 : } else if(Aname=="BB2") {
1815 0 : atoi[i]=C_BB2;
1816 0 : } else if(Aname=="BB3") {
1817 0 : atoi[i]=C_BB3;
1818 0 : } else if(Aname=="SC1") {
1819 0 : atoi[i]=C_SC1;
1820 0 : } else if(Aname=="SC2") {
1821 0 : atoi[i]=C_SC2;
1822 0 : } else if(Aname=="SC3") {
1823 0 : atoi[i]=C_SC3;
1824 0 : } else if(Aname=="3TE") {
1825 0 : atoi[i]=C_3TE;
1826 0 : } else if(Aname=="5TE") {
1827 0 : atoi[i]=C_5TE;
1828 0 : } else if(Aname=="TE3") {
1829 0 : atoi[i]=C_TE3;
1830 0 : } else if(Aname=="TE5") {
1831 0 : atoi[i]=C_TE5;
1832 0 : } else error("Atom name not known: "+Aname);
1833 1968 : } else if(Rname==" G") {
1834 0 : if(Aname=="BB1") {
1835 0 : atoi[i]=G_BB1;
1836 0 : } else if(Aname=="BB2") {
1837 0 : atoi[i]=G_BB2;
1838 0 : } else if(Aname=="BB3") {
1839 0 : atoi[i]=G_BB3;
1840 0 : } else if(Aname=="SC1") {
1841 0 : atoi[i]=G_SC1;
1842 0 : } else if(Aname=="SC2") {
1843 0 : atoi[i]=G_SC2;
1844 0 : } else if(Aname=="SC3") {
1845 0 : atoi[i]=G_SC3;
1846 0 : } else if(Aname=="SC4") {
1847 0 : atoi[i]=G_SC4;
1848 0 : } else if(Aname=="3TE") {
1849 0 : atoi[i]=G_3TE;
1850 0 : } else if(Aname=="5TE") {
1851 0 : atoi[i]=G_5TE;
1852 0 : } else if(Aname=="TE3") {
1853 0 : atoi[i]=G_TE3;
1854 0 : } else if(Aname=="TE5") {
1855 0 : atoi[i]=G_TE5;
1856 0 : } else error("Atom name not known: "+Aname);
1857 1968 : } else if(Rname==" U") {
1858 0 : if(Aname=="BB1") {
1859 0 : atoi[i]=U_BB1;
1860 0 : } else if(Aname=="BB2") {
1861 0 : atoi[i]=U_BB2;
1862 0 : } else if(Aname=="BB3") {
1863 0 : atoi[i]=U_BB3;
1864 0 : } else if(Aname=="SC1") {
1865 0 : atoi[i]=U_SC1;
1866 0 : } else if(Aname=="SC2") {
1867 0 : atoi[i]=U_SC2;
1868 0 : } else if(Aname=="SC3") {
1869 0 : atoi[i]=U_SC3;
1870 0 : } else if(Aname=="3TE") {
1871 0 : atoi[i]=U_3TE;
1872 0 : } else if(Aname=="5TE") {
1873 0 : atoi[i]=U_5TE;
1874 0 : } else if(Aname=="TE3") {
1875 0 : atoi[i]=U_TE3;
1876 0 : } else if(Aname=="TE5") {
1877 0 : atoi[i]=U_TE5;
1878 0 : } else error("Atom name not known: "+Aname);
1879 1968 : } else if(Rname==" DA") {
1880 696 : if(Aname=="BB1") {
1881 96 : atoi[i]=DA_BB1;
1882 600 : } else if(Aname=="BB2") {
1883 96 : atoi[i]=DA_BB2;
1884 504 : } else if(Aname=="BB3") {
1885 96 : atoi[i]=DA_BB3;
1886 408 : } else if(Aname=="SC1") {
1887 100 : atoi[i]=DA_SC1;
1888 308 : } else if(Aname=="SC2") {
1889 100 : atoi[i]=DA_SC2;
1890 208 : } else if(Aname=="SC3") {
1891 100 : atoi[i]=DA_SC3;
1892 108 : } else if(Aname=="SC4") {
1893 100 : atoi[i]=DA_SC4;
1894 8 : } else if(Aname=="3TE") {
1895 0 : atoi[i]=DA_3TE;
1896 8 : } else if(Aname=="5TE") {
1897 0 : atoi[i]=DA_5TE;
1898 8 : } else if(Aname=="TE3") {
1899 4 : atoi[i]=DA_TE3;
1900 4 : } else if(Aname=="TE5") {
1901 4 : atoi[i]=DA_TE5;
1902 0 : } else error("Atom name not known: "+Aname);
1903 1272 : } else if(Rname==" DC") {
1904 312 : if(Aname=="BB1") {
1905 52 : atoi[i]=DC_BB1;
1906 260 : } else if(Aname=="BB2") {
1907 52 : atoi[i]=DC_BB2;
1908 208 : } else if(Aname=="BB3") {
1909 52 : atoi[i]=DC_BB3;
1910 156 : } else if(Aname=="SC1") {
1911 52 : atoi[i]=DC_SC1;
1912 104 : } else if(Aname=="SC2") {
1913 52 : atoi[i]=DC_SC2;
1914 52 : } else if(Aname=="SC3") {
1915 52 : atoi[i]=DC_SC3;
1916 0 : } else if(Aname=="3TE") {
1917 0 : atoi[i]=DC_3TE;
1918 0 : } else if(Aname=="5TE") {
1919 0 : atoi[i]=DC_5TE;
1920 0 : } else if(Aname=="TE3") {
1921 0 : atoi[i]=DC_TE3;
1922 0 : } else if(Aname=="TE5") {
1923 0 : atoi[i]=DC_TE5;
1924 0 : } else error("Atom name not known: "+Aname);
1925 960 : } else if(Rname==" DG") {
1926 364 : if(Aname=="BB1") {
1927 52 : atoi[i]=DG_BB1;
1928 312 : } else if(Aname=="BB2") {
1929 52 : atoi[i]=DG_BB2;
1930 260 : } else if(Aname=="BB3") {
1931 52 : atoi[i]=DG_BB3;
1932 208 : } else if(Aname=="SC1") {
1933 52 : atoi[i]=DG_SC1;
1934 156 : } else if(Aname=="SC2") {
1935 52 : atoi[i]=DG_SC2;
1936 104 : } else if(Aname=="SC3") {
1937 52 : atoi[i]=DG_SC3;
1938 52 : } else if(Aname=="SC4") {
1939 52 : atoi[i]=DG_SC4;
1940 0 : } else if(Aname=="3TE") {
1941 0 : atoi[i]=DG_3TE;
1942 0 : } else if(Aname=="5TE") {
1943 0 : atoi[i]=DG_5TE;
1944 0 : } else if(Aname=="TE3") {
1945 0 : atoi[i]=DG_TE3;
1946 0 : } else if(Aname=="TE5") {
1947 0 : atoi[i]=DG_TE5;
1948 0 : } else error("Atom name not known: "+Aname);
1949 596 : } else if(Rname==" DT") {
1950 596 : if(Aname=="BB1") {
1951 96 : atoi[i]=DT_BB1;
1952 500 : } else if(Aname=="BB2") {
1953 96 : atoi[i]=DT_BB2;
1954 404 : } else if(Aname=="BB3") {
1955 96 : atoi[i]=DT_BB3;
1956 308 : } else if(Aname=="SC1") {
1957 100 : atoi[i]=DT_SC1;
1958 208 : } else if(Aname=="SC2") {
1959 100 : atoi[i]=DT_SC2;
1960 108 : } else if(Aname=="SC3") {
1961 100 : atoi[i]=DT_SC3;
1962 8 : } else if(Aname=="3TE") {
1963 0 : atoi[i]=DT_3TE;
1964 8 : } else if(Aname=="5TE") {
1965 0 : atoi[i]=DT_5TE;
1966 8 : } else if(Aname=="TE3") {
1967 4 : atoi[i]=DT_TE3;
1968 4 : } else if(Aname=="TE5") {
1969 4 : atoi[i]=DT_TE5;
1970 0 : } else error("Atom name not known: "+Aname);
1971 0 : } else error("Residue not known: "+Rname);
1972 : }
1973 : } else {
1974 0 : error("MOLINFO DATA not found\n");
1975 : }
1976 8 : }
1977 :
1978 2 : double SAXS::calculateASF(const std::vector<AtomNumber> &atoms, std::vector<std::vector<long double> > &FF_tmp, const double rho)
1979 : {
1980 : std::map<std::string, unsigned> AA_map;
1981 2 : AA_map["H"] = H;
1982 2 : AA_map["C"] = C;
1983 2 : AA_map["N"] = N;
1984 2 : AA_map["O"] = O;
1985 2 : AA_map["P"] = P;
1986 2 : AA_map["S"] = S;
1987 :
1988 : std::vector<std::vector<double> > param_a;
1989 : std::vector<std::vector<double> > param_b;
1990 : std::vector<double> param_c;
1991 : std::vector<double> param_v;
1992 :
1993 2 : param_a.resize(NTT, std::vector<double>(5));
1994 2 : param_b.resize(NTT, std::vector<double>(5));
1995 2 : param_c.resize(NTT);
1996 2 : param_v.resize(NTT);
1997 :
1998 2 : param_a[H][0] = 0.493002; param_b[H][0] = 10.5109; param_c[H] = 0.003038;
1999 2 : param_a[H][1] = 0.322912; param_b[H][1] = 26.1257; param_v[H] = 5.15;
2000 2 : param_a[H][2] = 0.140191; param_b[H][2] = 3.14236;
2001 2 : param_a[H][3] = 0.040810; param_b[H][3] = 57.7997;
2002 2 : param_a[H][4] = 0.0; param_b[H][4] = 1.0;
2003 :
2004 2 : param_a[C][0] = 2.31000; param_b[C][0] = 20.8439; param_c[C] = 0.215600;
2005 2 : param_a[C][1] = 1.02000; param_b[C][1] = 10.2075; param_v[C] = 16.44;
2006 2 : param_a[C][2] = 1.58860; param_b[C][2] = 0.56870;
2007 2 : param_a[C][3] = 0.86500; param_b[C][3] = 51.6512;
2008 2 : param_a[C][4] = 0.0; param_b[C][4] = 1.0;
2009 :
2010 2 : param_a[N][0] = 12.2126; param_b[N][0] = 0.00570; param_c[N] = -11.529;
2011 2 : param_a[N][1] = 3.13220; param_b[N][1] = 9.89330; param_v[N] = 2.49;
2012 2 : param_a[N][2] = 2.01250; param_b[N][2] = 28.9975;
2013 2 : param_a[N][3] = 1.16630; param_b[N][3] = 0.58260;
2014 2 : param_a[N][4] = 0.0; param_b[N][4] = 1.0;
2015 :
2016 2 : param_a[O][0] = 3.04850; param_b[O][0] = 13.2771; param_c[O] = 0.250800 ;
2017 2 : param_a[O][1] = 2.28680; param_b[O][1] = 5.70110; param_v[O] = 9.13;
2018 2 : param_a[O][2] = 1.54630; param_b[O][2] = 0.32390;
2019 2 : param_a[O][3] = 0.86700; param_b[O][3] = 32.9089;
2020 2 : param_a[O][4] = 0.0; param_b[O][4] = 1.0;
2021 :
2022 2 : param_a[P][0] = 6.43450; param_b[P][0] = 1.90670; param_c[P] = 1.11490;
2023 2 : param_a[P][1] = 4.17910; param_b[P][1] = 27.1570; param_v[P] = 5.73;
2024 2 : param_a[P][2] = 1.78000; param_b[P][2] = 0.52600;
2025 2 : param_a[P][3] = 1.49080; param_b[P][3] = 68.1645;
2026 2 : param_a[P][4] = 0.0; param_b[P][4] = 1.0;
2027 :
2028 2 : param_a[S][0] = 6.90530; param_b[S][0] = 1.46790; param_c[S] = 0.866900;
2029 2 : param_a[S][1] = 5.20340; param_b[S][1] = 22.2151; param_v[S] = 19.86;
2030 2 : param_a[S][2] = 1.43790; param_b[S][2] = 0.25360;
2031 2 : param_a[S][3] = 1.58630; param_b[S][3] = 56.1720;
2032 2 : param_a[S][4] = 0.0; param_b[S][4] = 1.0;
2033 :
2034 2 : auto* moldat=plumed.getActionSet().selectLatest<GenericMolInfo*>(this);
2035 :
2036 : double Iq0=0.;
2037 2 : if( moldat ) {
2038 2 : log<<" MOLINFO DATA found with label " <<moldat->getLabel()<<", using proper atom names\n";
2039 : // cycle over the atom types
2040 14 : for(unsigned i=0; i<NTT; i++) {
2041 12 : const double volr = std::pow(param_v[i], (2.0/3.0)) /(4. * M_PI);
2042 : // cycle over q
2043 120 : for(unsigned k=0; k<q_list.size(); ++k) {
2044 108 : const double q = q_list[k];
2045 108 : const double s = q / (4. * M_PI);
2046 108 : FF_tmp[k][i] = param_c[i];
2047 : // SUM [a_i * EXP( - b_i * (q/4pi)^2 )] Waasmaier and Kirfel (1995)
2048 540 : for(unsigned j=0; j<4; j++) {
2049 432 : FF_tmp[k][i] += param_a[i][j]*std::exp(-param_b[i][j]*s*s);
2050 : }
2051 : // subtract solvation: rho * v_i * EXP( (- v_i^(2/3) / (4pi)) * q^2 ) // since D in Fraser 1978 is 2*s
2052 108 : FF_tmp[k][i] -= rho*param_v[i]*std::exp(-volr*q*q);
2053 : }
2054 : }
2055 : // cycle over the atoms to assign the atom type and calculate I0
2056 6824 : for(unsigned i=0; i<atoms.size(); ++i) {
2057 : // get atom name
2058 6822 : std::string name = moldat->getAtomName(atoms[i]);
2059 : char type;
2060 : // get atom type
2061 6822 : char first = name.at(0);
2062 : // GOLDEN RULE: type is first letter, if not a number
2063 6822 : if (!isdigit(first)) {
2064 : type = first;
2065 : // otherwise is the second
2066 : } else {
2067 816 : type = name.at(1);
2068 : }
2069 6822 : std::string type_s = std::string(1,type);
2070 6822 : if(AA_map.find(type_s) != AA_map.end()) {
2071 6822 : const unsigned index=AA_map[type_s];
2072 6822 : atoi[i] = AA_map[type_s];
2073 34110 : for(unsigned j=0; j<4; j++) Iq0 += param_a[index][j];
2074 6822 : Iq0 = Iq0 -rho*param_v[index] + param_c[index];
2075 : } else {
2076 0 : error("Wrong atom type "+type_s+" from atom name "+name+"\n");
2077 : }
2078 : }
2079 : } else {
2080 0 : error("MOLINFO DATA not found\n");
2081 : }
2082 :
2083 2 : return Iq0;
2084 2 : }
2085 :
2086 : }
2087 : }
|