1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
34 * GROningen Mixture of Alchemy and Childrens' Stories
40 /* This file is completely threadsafe - please keep it that way! */
42 #include <thread_mpi.h>
55 int pr_indent(FILE *fp
,int n
)
59 for (i
=0; i
<n
; i
++) (void) fprintf(fp
," ");
63 int available(FILE *fp
,void *p
,int indent
,const char *title
)
68 (void) fprintf(fp
,"%s: not available\n",title
);
73 int pr_title(FILE *fp
,int indent
,const char *title
)
75 (void) pr_indent(fp
,indent
);
76 (void) fprintf(fp
,"%s:\n",title
);
77 return (indent
+INDENT
);
80 int pr_title_n(FILE *fp
,int indent
,const char *title
,int n
)
82 (void) pr_indent(fp
,indent
);
83 (void) fprintf(fp
,"%s (%d):\n",title
,n
);
84 return (indent
+INDENT
);
87 int pr_title_nxn(FILE *fp
,int indent
,const char *title
,int n1
,int n2
)
89 (void) pr_indent(fp
,indent
);
90 (void) fprintf(fp
,"%s (%dx%d):\n",title
,n1
,n2
);
91 return (indent
+INDENT
);
94 void pr_ivec(FILE *fp
,int indent
,const char *title
,int vec
[],int n
, gmx_bool bShowNumbers
)
98 if (available(fp
,vec
,indent
,title
))
100 indent
=pr_title_n(fp
,indent
,title
,n
);
103 (void) pr_indent(fp
,indent
);
104 (void) fprintf(fp
,"%s[%d]=%d\n",title
,bShowNumbers
?i
:-1,vec
[i
]);
109 void pr_ivec_block(FILE *fp
,int indent
,const char *title
,int vec
[],int n
, gmx_bool bShowNumbers
)
113 if (available(fp
,vec
,indent
,title
))
115 indent
=pr_title_n(fp
,indent
,title
,n
);
120 while (j
< n
&& vec
[j
] == vec
[j
-1]+1)
124 /* Print consecutive groups of 3 or more as blocks */
129 (void) pr_indent(fp
,indent
);
130 (void) fprintf(fp
,"%s[%d]=%d\n",
131 title
,bShowNumbers
?i
:-1,vec
[i
]);
137 (void) pr_indent(fp
,indent
);
138 (void) fprintf(fp
,"%s[%d,...,%d] = {%d,...,%d}\n",
149 void pr_bvec(FILE *fp
,int indent
,const char *title
,gmx_bool vec
[],int n
, gmx_bool bShowNumbers
)
153 if (available(fp
,vec
,indent
,title
))
155 indent
=pr_title_n(fp
,indent
,title
,n
);
158 (void) pr_indent(fp
,indent
);
159 (void) fprintf(fp
,"%s[%d]=%s\n",title
,bShowNumbers
?i
:-1,
165 void pr_ivecs(FILE *fp
,int indent
,const char *title
,ivec vec
[],int n
, gmx_bool bShowNumbers
)
169 if (available(fp
,vec
,indent
,title
))
171 indent
=pr_title_nxn(fp
,indent
,title
,n
,DIM
);
174 (void) pr_indent(fp
,indent
);
175 (void) fprintf(fp
,"%s[%d]={",title
,bShowNumbers
?i
:-1);
176 for (j
=0; j
<DIM
; j
++)
178 if (j
!=0) (void) fprintf(fp
,", ");
179 fprintf(fp
,"%d",vec
[i
][j
]);
181 (void) fprintf(fp
,"}\n");
186 void pr_rvec(FILE *fp
,int indent
,const char *title
,real vec
[],int n
, gmx_bool bShowNumbers
)
190 if (available(fp
,vec
,indent
,title
))
192 indent
=pr_title_n(fp
,indent
,title
,n
);
195 pr_indent(fp
,indent
);
196 fprintf(fp
,"%s[%d]=%12.5e\n",title
,bShowNumbers
?i
:-1,vec
[i
]);
201 void pr_dvec(FILE *fp
,int indent
,const char *title
,double vec
[],int n
, gmx_bool bShowNumbers
)
205 if (available(fp
,vec
,indent
,title
))
207 indent
=pr_title_n(fp
,indent
,title
,n
);
210 pr_indent(fp
,indent
);
211 fprintf(fp
,"%s[%d]=%12.5e\n",title
,bShowNumbers
?i
:-1,vec
[i
]);
218 void pr_mat(FILE *fp,int indent,char *title,matrix m)
222 if (available(fp,m,indent,title)) {
223 indent=pr_title_n(fp,indent,title,n);
225 pr_indent(fp,indent);
226 fprintf(fp,"%s[%d]=%12.5e %12.5e %12.5e\n",
227 title,bShowNumbers?i:-1,m[i][XX],m[i][YY],m[i][ZZ]);
233 void pr_rvecs_len(FILE *fp
,int indent
,const char *title
,rvec vec
[],int n
)
237 if (available(fp
,vec
,indent
,title
)) {
238 indent
=pr_title_nxn(fp
,indent
,title
,n
,DIM
);
239 for (i
=0; i
<n
; i
++) {
240 (void) pr_indent(fp
,indent
);
241 (void) fprintf(fp
,"%s[%5d]={",title
,i
);
242 for (j
=0; j
<DIM
; j
++) {
244 (void) fprintf(fp
,", ");
245 (void) fprintf(fp
,"%12.5e",vec
[i
][j
]);
247 (void) fprintf(fp
,"} len=%12.5e\n",norm(vec
[i
]));
252 void pr_rvecs(FILE *fp
,int indent
,const char *title
,rvec vec
[],int n
)
254 const char *fshort
= "%12.5e";
255 const char *flong
= "%15.8e";
259 if (getenv("LONGFORMAT") != NULL
)
264 if (available(fp
,vec
,indent
,title
)) {
265 indent
=pr_title_nxn(fp
,indent
,title
,n
,DIM
);
266 for (i
=0; i
<n
; i
++) {
267 (void) pr_indent(fp
,indent
);
268 (void) fprintf(fp
,"%s[%5d]={",title
,i
);
269 for (j
=0; j
<DIM
; j
++) {
271 (void) fprintf(fp
,", ");
272 (void) fprintf(fp
,format
,vec
[i
][j
]);
274 (void) fprintf(fp
,"}\n");
280 void pr_reals(FILE *fp
,int indent
,const char *title
,real
*vec
,int n
)
284 if (available(fp
,vec
,indent
,title
)) {
285 (void) pr_indent(fp
,indent
);
286 (void) fprintf(fp
,"%s:\t",title
);
288 fprintf(fp
," %10g",vec
[i
]);
289 (void) fprintf(fp
,"\n");
293 void pr_doubles(FILE *fp
,int indent
,const char *title
,double *vec
,int n
)
297 if (available(fp
,vec
,indent
,title
)) {
298 (void) pr_indent(fp
,indent
);
299 (void) fprintf(fp
,"%s:\t",title
);
301 fprintf(fp
," %10g",vec
[i
]);
302 (void) fprintf(fp
,"\n");
306 static void pr_int(FILE *fp
,int indent
,const char *title
,int i
)
308 pr_indent(fp
,indent
);
309 fprintf(fp
,"%-20s = %d\n",title
,i
);
312 static void pr_gmx_large_int(FILE *fp
,int indent
,const char *title
,gmx_large_int_t i
)
314 char buf
[STEPSTRSIZE
];
316 pr_indent(fp
,indent
);
317 fprintf(fp
,"%-20s = %s\n",title
,gmx_step_str(i
,buf
));
320 static void pr_real(FILE *fp
,int indent
,const char *title
,real r
)
322 pr_indent(fp
,indent
);
323 fprintf(fp
,"%-20s = %g\n",title
,r
);
326 static void pr_double(FILE *fp
,int indent
,const char *title
,double d
)
328 pr_indent(fp
,indent
);
329 fprintf(fp
,"%-20s = %g\n",title
,d
);
332 static void pr_str(FILE *fp
,int indent
,const char *title
,const char *s
)
334 pr_indent(fp
,indent
);
335 fprintf(fp
,"%-20s = %s\n",title
,s
);
338 void pr_qm_opts(FILE *fp
,int indent
,const char *title
,t_grpopts
*opts
)
342 fprintf(fp
,"%s:\n",title
);
344 pr_int(fp
,indent
,"ngQM",opts
->ngQM
);
345 if (opts
->ngQM
> 0) {
346 pr_ivec(fp
,indent
,"QMmethod",opts
->QMmethod
,opts
->ngQM
,FALSE
);
347 pr_ivec(fp
,indent
,"QMbasis",opts
->QMbasis
,opts
->ngQM
,FALSE
);
348 pr_ivec(fp
,indent
,"QMcharge",opts
->QMcharge
,opts
->ngQM
,FALSE
);
349 pr_ivec(fp
,indent
,"QMmult",opts
->QMmult
,opts
->ngQM
,FALSE
);
350 pr_bvec(fp
,indent
,"bSH",opts
->bSH
,opts
->ngQM
,FALSE
);
351 pr_ivec(fp
,indent
,"CASorbitals",opts
->CASorbitals
,opts
->ngQM
,FALSE
);
352 pr_ivec(fp
,indent
,"CASelectrons",opts
->CASelectrons
,opts
->ngQM
,FALSE
);
353 pr_rvec(fp
,indent
,"SAon",opts
->SAon
,opts
->ngQM
,FALSE
);
354 pr_rvec(fp
,indent
,"SAon",opts
->SAon
,opts
->ngQM
,FALSE
);
355 pr_ivec(fp
,indent
,"SAsteps",opts
->SAsteps
,opts
->ngQM
,FALSE
);
356 pr_bvec(fp
,indent
,"bOPT",opts
->bOPT
,opts
->ngQM
,FALSE
);
357 pr_bvec(fp
,indent
,"bTS",opts
->bTS
,opts
->ngQM
,FALSE
);
361 static void pr_grp_opts(FILE *out
,int indent
,const char *title
,t_grpopts
*opts
,
367 fprintf(out
,"%s:\n",title
);
369 pr_indent(out
,indent
);
370 fprintf(out
,"nrdf%s",bMDPformat
? " = " : ":");
371 for(i
=0; (i
<opts
->ngtc
); i
++)
372 fprintf(out
," %10g",opts
->nrdf
[i
]);
375 pr_indent(out
,indent
);
376 fprintf(out
,"ref_t%s",bMDPformat
? " = " : ":");
377 for(i
=0; (i
<opts
->ngtc
); i
++)
378 fprintf(out
," %10g",opts
->ref_t
[i
]);
381 pr_indent(out
,indent
);
382 fprintf(out
,"tau_t%s",bMDPformat
? " = " : ":");
383 for(i
=0; (i
<opts
->ngtc
); i
++)
384 fprintf(out
," %10g",opts
->tau_t
[i
]);
387 /* Pretty-print the simulated annealing info */
388 fprintf(out
,"anneal%s",bMDPformat
? " = " : ":");
389 for(i
=0; (i
<opts
->ngtc
); i
++)
390 fprintf(out
," %10s",EANNEAL(opts
->annealing
[i
]));
393 fprintf(out
,"ann_npoints%s",bMDPformat
? " = " : ":");
394 for(i
=0; (i
<opts
->ngtc
); i
++)
395 fprintf(out
," %10d",opts
->anneal_npoints
[i
]);
398 for(i
=0; (i
<opts
->ngtc
); i
++) {
399 if(opts
->anneal_npoints
[i
]>0) {
400 fprintf(out
,"ann. times [%d]:\t",i
);
401 for(j
=0; (j
<opts
->anneal_npoints
[i
]); j
++)
402 fprintf(out
," %10.1f",opts
->anneal_time
[i
][j
]);
404 fprintf(out
,"ann. temps [%d]:\t",i
);
405 for(j
=0; (j
<opts
->anneal_npoints
[i
]); j
++)
406 fprintf(out
," %10.1f",opts
->anneal_temp
[i
][j
]);
411 pr_indent(out
,indent
);
412 fprintf(out
,"acc:\t");
413 for(i
=0; (i
<opts
->ngacc
); i
++)
414 for(m
=0; (m
<DIM
); m
++)
415 fprintf(out
," %10g",opts
->acc
[i
][m
]);
418 pr_indent(out
,indent
);
419 fprintf(out
,"nfreeze:");
420 for(i
=0; (i
<opts
->ngfrz
); i
++)
421 for(m
=0; (m
<DIM
); m
++)
422 fprintf(out
," %10s",opts
->nFreeze
[i
][m
] ? "Y" : "N");
426 for(i
=0; (i
<opts
->ngener
); i
++) {
427 pr_indent(out
,indent
);
428 fprintf(out
,"energygrp_flags[%3d]:",i
);
429 for(m
=0; (m
<opts
->ngener
); m
++)
430 fprintf(out
," %d",opts
->egp_flags
[opts
->ngener
*i
+m
]);
437 static void pr_matrix(FILE *fp
,int indent
,const char *title
,rvec
*m
,
441 fprintf(fp
,"%-10s = %g %g %g %g %g %g\n",title
,
442 m
[XX
][XX
],m
[YY
][YY
],m
[ZZ
][ZZ
],m
[XX
][YY
],m
[XX
][ZZ
],m
[YY
][ZZ
]);
444 pr_rvecs(fp
,indent
,title
,m
,DIM
);
447 static void pr_cosine(FILE *fp
,int indent
,const char *title
,t_cosines
*cos
,
453 fprintf(fp
,"%s = %d\n",title
,cos
->n
);
456 indent
=pr_title(fp
,indent
,title
);
457 (void) pr_indent(fp
,indent
);
458 fprintf(fp
,"n = %d\n",cos
->n
);
460 (void) pr_indent(fp
,indent
+2);
462 for(j
=0; (j
<cos
->n
); j
++)
463 fprintf(fp
," %e",cos
->a
[j
]);
465 (void) pr_indent(fp
,indent
+2);
467 for(j
=0; (j
<cos
->n
); j
++)
468 fprintf(fp
," %e",cos
->phi
[j
]);
474 #define PS(t,s) pr_str(fp,indent,t,s)
475 #define PI(t,s) pr_int(fp,indent,t,s)
476 #define PSTEP(t,s) pr_gmx_large_int(fp,indent,t,s)
477 #define PR(t,s) pr_real(fp,indent,t,s)
478 #define PD(t,s) pr_double(fp,indent,t,s)
480 static void pr_pullgrp(FILE *fp
,int indent
,int g
,t_pullgrp
*pg
)
482 pr_indent(fp
,indent
);
483 fprintf(fp
,"pull_group %d:\n",g
);
485 pr_ivec_block(fp
,indent
,"atom",pg
->ind
,pg
->nat
,TRUE
);
486 pr_rvec(fp
,indent
,"weight",pg
->weight
,pg
->nweight
,TRUE
);
487 PI("pbcatom",pg
->pbcatom
);
488 pr_rvec(fp
,indent
,"vec",pg
->vec
,DIM
,TRUE
);
489 pr_rvec(fp
,indent
,"init",pg
->init
,DIM
,TRUE
);
495 static void pr_pull(FILE *fp
,int indent
,t_pull
*pull
)
499 PS("pull_geometry",EPULLGEOM(pull
->eGeom
));
500 pr_ivec(fp
,indent
,"pull_dim",pull
->dim
,DIM
,TRUE
);
501 PR("pull_r1",pull
->cyl_r1
);
502 PR("pull_r0",pull
->cyl_r0
);
503 PR("pull_constr_tol",pull
->constr_tol
);
504 PI("pull_nstxout",pull
->nstxout
);
505 PI("pull_nstfout",pull
->nstfout
);
506 PI("pull_ngrp",pull
->ngrp
);
507 for(g
=0; g
<pull
->ngrp
+1; g
++)
508 pr_pullgrp(fp
,indent
,g
,&pull
->grp
[g
]);
511 void pr_inputrec(FILE *fp
,int indent
,const char *title
,t_inputrec
*ir
,
514 const char *infbuf
="inf";
517 if (available(fp
,ir
,indent
,title
)) {
519 indent
=pr_title(fp
,indent
,title
);
520 PS("integrator",EI(ir
->eI
));
521 PSTEP("nsteps",ir
->nsteps
);
522 PSTEP("init_step",ir
->init_step
);
523 PS("ns_type",ENS(ir
->ns_type
));
524 PI("nstlist",ir
->nstlist
);
525 PI("ndelta",ir
->ndelta
);
526 PI("nstcomm",ir
->nstcomm
);
527 PS("comm_mode",ECOM(ir
->comm_mode
));
528 PI("nstlog",ir
->nstlog
);
529 PI("nstxout",ir
->nstxout
);
530 PI("nstvout",ir
->nstvout
);
531 PI("nstfout",ir
->nstfout
);
532 PI("nstcalcenergy",ir
->nstcalcenergy
);
533 PI("nstenergy",ir
->nstenergy
);
534 PI("nstxtcout",ir
->nstxtcout
);
535 PR("init_t",ir
->init_t
);
536 PR("delta_t",ir
->delta_t
);
538 PR("xtcprec",ir
->xtcprec
);
542 PI("pme_order",ir
->pme_order
);
543 PR("ewald_rtol",ir
->ewald_rtol
);
544 PR("ewald_geometry",ir
->ewald_geometry
);
545 PR("epsilon_surface",ir
->epsilon_surface
);
546 PS("optimize_fft",BOOL(ir
->bOptFFT
));
547 PS("ePBC",EPBC(ir
->ePBC
));
548 PS("bPeriodicMols",BOOL(ir
->bPeriodicMols
));
549 PS("bContinuation",BOOL(ir
->bContinuation
));
550 PS("bShakeSOR",BOOL(ir
->bShakeSOR
));
551 PS("etc",ETCOUPLTYPE(ir
->etc
));
552 PI("nsttcouple",ir
->nsttcouple
);
553 PS("epc",EPCOUPLTYPE(ir
->epc
));
554 PS("epctype",EPCOUPLTYPETYPE(ir
->epct
));
555 PI("nstpcouple",ir
->nstpcouple
);
556 PR("tau_p",ir
->tau_p
);
557 pr_matrix(fp
,indent
,"ref_p",ir
->ref_p
,bMDPformat
);
558 pr_matrix(fp
,indent
,"compress",ir
->compress
,bMDPformat
);
559 PS("refcoord_scaling",EREFSCALINGTYPE(ir
->refcoord_scaling
));
561 fprintf(fp
,"posres_com = %g %g %g\n",ir
->posres_com
[XX
],
562 ir
->posres_com
[YY
],ir
->posres_com
[ZZ
]);
564 pr_rvec(fp
,indent
,"posres_com",ir
->posres_com
,DIM
,TRUE
);
566 fprintf(fp
,"posres_comB = %g %g %g\n",ir
->posres_comB
[XX
],
567 ir
->posres_comB
[YY
],ir
->posres_comB
[ZZ
]);
569 pr_rvec(fp
,indent
,"posres_comB",ir
->posres_comB
,DIM
,TRUE
);
570 PI("andersen_seed",ir
->andersen_seed
);
571 PR("rlist",ir
->rlist
);
572 PR("rlistlong",ir
->rlistlong
);
574 PS("coulombtype",EELTYPE(ir
->coulombtype
));
575 PR("rcoulomb_switch",ir
->rcoulomb_switch
);
576 PR("rcoulomb",ir
->rcoulomb
);
577 PS("vdwtype",EVDWTYPE(ir
->vdwtype
));
578 PR("rvdw_switch",ir
->rvdw_switch
);
580 if (ir
->epsilon_r
!= 0)
581 PR("epsilon_r",ir
->epsilon_r
);
583 PS("epsilon_r",infbuf
);
584 if (ir
->epsilon_rf
!= 0)
585 PR("epsilon_rf",ir
->epsilon_rf
);
587 PS("epsilon_rf",infbuf
);
588 PR("tabext",ir
->tabext
);
589 PS("implicit_solvent",EIMPLICITSOL(ir
->implicit_solvent
));
590 PS("gb_algorithm",EGBALGORITHM(ir
->gb_algorithm
));
591 PR("gb_epsilon_solvent",ir
->gb_epsilon_solvent
);
592 PI("nstgbradii",ir
->nstgbradii
);
593 PR("rgbradii",ir
->rgbradii
);
594 PR("gb_saltconc",ir
->gb_saltconc
);
595 PR("gb_obc_alpha",ir
->gb_obc_alpha
);
596 PR("gb_obc_beta",ir
->gb_obc_beta
);
597 PR("gb_obc_gamma",ir
->gb_obc_gamma
);
598 PR("gb_dielectric_offset",ir
->gb_dielectric_offset
);
599 PS("sa_algorithm",ESAALGORITHM(ir
->gb_algorithm
));
600 PR("sa_surface_tension",ir
->sa_surface_tension
);
602 PS("DispCorr",EDISPCORR(ir
->eDispCorr
));
603 PS("free_energy",EFEPTYPE(ir
->efep
));
604 PR("init_lambda",ir
->init_lambda
);
605 PR("delta_lambda",ir
->delta_lambda
);
608 PI("n_foreign_lambda",ir
->n_flambda
);
610 if (ir
->n_flambda
> 0)
612 pr_indent(fp
,indent
);
613 fprintf(fp
,"foreign_lambda%s",bMDPformat
? " = " : ":");
614 for(i
=0; i
<ir
->n_flambda
; i
++)
616 fprintf(fp
," %10g",ir
->flambda
[i
]);
620 PR("sc_alpha",ir
->sc_alpha
);
621 PI("sc_power",ir
->sc_power
);
622 PR("sc_sigma",ir
->sc_sigma
);
623 PR("sc_sigma_min",ir
->sc_sigma_min
);
624 PI("nstdhdl", ir
->nstdhdl
);
625 PS("separate_dhdl_file", SEPDHDLFILETYPE(ir
->separate_dhdl_file
));
626 PS("dhdl_derivatives", DHDLDERIVATIVESTYPE(ir
->dhdl_derivatives
));
627 PI("dh_hist_size", ir
->dh_hist_size
);
628 PD("dh_hist_spacing", ir
->dh_hist_spacing
);
630 PI("nwall",ir
->nwall
);
631 PS("wall_type",EWALLTYPE(ir
->wall_type
));
632 PI("wall_atomtype[0]",ir
->wall_atomtype
[0]);
633 PI("wall_atomtype[1]",ir
->wall_atomtype
[1]);
634 PR("wall_density[0]",ir
->wall_density
[0]);
635 PR("wall_density[1]",ir
->wall_density
[1]);
636 PR("wall_ewald_zfac",ir
->wall_ewald_zfac
);
638 PS("pull",EPULLTYPE(ir
->ePull
));
639 if (ir
->ePull
!= epullNO
)
640 pr_pull(fp
,indent
,ir
->pull
);
642 PS("disre",EDISRETYPE(ir
->eDisre
));
643 PS("disre_weighting",EDISREWEIGHTING(ir
->eDisreWeighting
));
644 PS("disre_mixed",BOOL(ir
->bDisreMixed
));
645 PR("dr_fc",ir
->dr_fc
);
646 PR("dr_tau",ir
->dr_tau
);
647 PR("nstdisreout",ir
->nstdisreout
);
648 PR("orires_fc",ir
->orires_fc
);
649 PR("orires_tau",ir
->orires_tau
);
650 PR("nstorireout",ir
->nstorireout
);
652 PR("dihre-fc",ir
->dihre_fc
);
654 PR("em_stepsize",ir
->em_stepsize
);
655 PR("em_tol",ir
->em_tol
);
656 PI("niter",ir
->niter
);
657 PR("fc_stepsize",ir
->fc_stepsize
);
658 PI("nstcgsteep",ir
->nstcgsteep
);
659 PI("nbfgscorr",ir
->nbfgscorr
);
661 PS("ConstAlg",ECONSTRTYPE(ir
->eConstrAlg
));
662 PR("shake_tol",ir
->shake_tol
);
663 PI("lincs_order",ir
->nProjOrder
);
664 PR("lincs_warnangle",ir
->LincsWarnAngle
);
665 PI("lincs_iter",ir
->nLincsIter
);
666 PR("bd_fric",ir
->bd_fric
);
667 PI("ld_seed",ir
->ld_seed
);
668 PR("cos_accel",ir
->cos_accel
);
669 pr_matrix(fp
,indent
,"deform",ir
->deform
,bMDPformat
);
670 PI("userint1",ir
->userint1
);
671 PI("userint2",ir
->userint2
);
672 PI("userint3",ir
->userint3
);
673 PI("userint4",ir
->userint4
);
674 PR("userreal1",ir
->userreal1
);
675 PR("userreal2",ir
->userreal2
);
676 PR("userreal3",ir
->userreal3
);
677 PR("userreal4",ir
->userreal4
);
678 pr_grp_opts(fp
,indent
,"grpopts",&(ir
->opts
),bMDPformat
);
679 pr_cosine(fp
,indent
,"efield-x",&(ir
->ex
[XX
]),bMDPformat
);
680 pr_cosine(fp
,indent
,"efield-xt",&(ir
->et
[XX
]),bMDPformat
);
681 pr_cosine(fp
,indent
,"efield-y",&(ir
->ex
[YY
]),bMDPformat
);
682 pr_cosine(fp
,indent
,"efield-yt",&(ir
->et
[YY
]),bMDPformat
);
683 pr_cosine(fp
,indent
,"efield-z",&(ir
->ex
[ZZ
]),bMDPformat
);
684 pr_cosine(fp
,indent
,"efield-zt",&(ir
->et
[ZZ
]),bMDPformat
);
685 PS("bQMMM",BOOL(ir
->bQMMM
));
686 PI("QMconstraints",ir
->QMconstraints
);
687 PI("QMMMscheme",ir
->QMMMscheme
);
688 PR("scalefactor",ir
->scalefactor
);
689 pr_qm_opts(fp
,indent
,"qm_opts",&(ir
->opts
));
696 static void pr_harm(FILE *fp
,t_iparams
*iparams
,const char *r
,const char *kr
)
698 fprintf(fp
,"%sA=%12.5e, %sA=%12.5e, %sB=%12.5e, %sB=%12.5e\n",
699 r
,iparams
->harmonic
.rA
,kr
,iparams
->harmonic
.krA
,
700 r
,iparams
->harmonic
.rB
,kr
,iparams
->harmonic
.krB
);
703 void pr_iparams(FILE *fp
,t_functype ftype
,t_iparams
*iparams
)
706 real VA
[4],VB
[4],*rbcA
,*rbcB
;
711 pr_harm(fp
,iparams
,"th","ct");
713 case F_CROSS_BOND_BONDS
:
714 fprintf(fp
,"r1e=%15.8e, r2e=%15.8e, krr=%15.8e\n",
715 iparams
->cross_bb
.r1e
,iparams
->cross_bb
.r2e
,
716 iparams
->cross_bb
.krr
);
718 case F_CROSS_BOND_ANGLES
:
719 fprintf(fp
,"r1e=%15.8e, r1e=%15.8e, r3e=%15.8e, krt=%15.8e\n",
720 iparams
->cross_ba
.r1e
,iparams
->cross_ba
.r2e
,
721 iparams
->cross_ba
.r3e
,iparams
->cross_ba
.krt
);
724 fprintf(fp
,"theta=%15.8e, ktheta=%15.8e, r13=%15.8e, kUB=%15.8e\n",
725 iparams
->u_b
.theta
,iparams
->u_b
.ktheta
,iparams
->u_b
.r13
,iparams
->u_b
.kUB
);
727 case F_QUARTIC_ANGLES
:
728 fprintf(fp
,"theta=%15.8e",iparams
->qangle
.theta
);
730 fprintf(fp
,", c%c=%15.8e",'0'+i
,iparams
->qangle
.c
[i
]);
734 fprintf(fp
,"a=%15.8e, b=%15.8e, c=%15.8e\n",
735 iparams
->bham
.a
,iparams
->bham
.b
,iparams
->bham
.c
);
740 pr_harm(fp
,iparams
,"b0","cb");
743 pr_harm(fp
,iparams
,"xi","cx");
746 fprintf(fp
,"b0=%15.8e, cb=%15.8e, beta=%15.8e\n",
747 iparams
->morse
.b0
,iparams
->morse
.cb
,iparams
->morse
.beta
);
750 fprintf(fp
,"b0=%15.8e, kb=%15.8e, kcub=%15.8e\n",
751 iparams
->cubic
.b0
,iparams
->cubic
.kb
,iparams
->cubic
.kcub
);
757 fprintf(fp
,"bm=%15.8e, kb=%15.8e\n",iparams
->fene
.bm
,iparams
->fene
.kb
);
760 fprintf(fp
,"lowA=%15.8e, up1A=%15.8e, up2A=%15.8e, kA=%15.8e, lowB=%15.8e, up1B=%15.8e, up2B=%15.8e, kB=%15.8e,\n",
761 iparams
->restraint
.lowA
,iparams
->restraint
.up1A
,
762 iparams
->restraint
.up2A
,iparams
->restraint
.kA
,
763 iparams
->restraint
.lowB
,iparams
->restraint
.up1B
,
764 iparams
->restraint
.up2B
,iparams
->restraint
.kB
);
770 fprintf(fp
,"tab=%d, kA=%15.8e, kB=%15.8e\n",
771 iparams
->tab
.table
,iparams
->tab
.kA
,iparams
->tab
.kB
);
774 fprintf(fp
,"alpha=%15.8e\n",iparams
->polarize
.alpha
);
777 fprintf(fp
,"a=%15.8e, alpha1=%15.8e, alpha2=%15.8e, rfac=%15.8e\n",
778 iparams
->thole
.a
,iparams
->thole
.alpha1
,iparams
->thole
.alpha2
,
779 iparams
->thole
.rfac
);
782 fprintf(fp
,"al_x=%15.8e, al_y=%15.8e, al_z=%15.8e, rOH=%9.6f, rHH=%9.6f, rOD=%9.6f\n",
783 iparams
->wpol
.al_x
,iparams
->wpol
.al_y
,iparams
->wpol
.al_z
,
784 iparams
->wpol
.rOH
,iparams
->wpol
.rHH
,iparams
->wpol
.rOD
);
787 fprintf(fp
,"c6=%15.8e, c12=%15.8e\n",iparams
->lj
.c6
,iparams
->lj
.c12
);
790 fprintf(fp
,"c6A=%15.8e, c12A=%15.8e, c6B=%15.8e, c12B=%15.8e\n",
791 iparams
->lj14
.c6A
,iparams
->lj14
.c12A
,
792 iparams
->lj14
.c6B
,iparams
->lj14
.c12B
);
795 fprintf(fp
,"fqq=%15.8e, qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
797 iparams
->ljc14
.qi
,iparams
->ljc14
.qj
,
798 iparams
->ljc14
.c6
,iparams
->ljc14
.c12
);
801 fprintf(fp
,"qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
802 iparams
->ljcnb
.qi
,iparams
->ljcnb
.qj
,
803 iparams
->ljcnb
.c6
,iparams
->ljcnb
.c12
);
809 fprintf(fp
,"phiA=%15.8e, cpA=%15.8e, phiB=%15.8e, cpB=%15.8e, mult=%d\n",
810 iparams
->pdihs
.phiA
,iparams
->pdihs
.cpA
,
811 iparams
->pdihs
.phiB
,iparams
->pdihs
.cpB
,
812 iparams
->pdihs
.mult
);
815 fprintf(fp
,"label=%4d, type=%1d, low=%15.8e, up1=%15.8e, up2=%15.8e, fac=%15.8e)\n",
816 iparams
->disres
.label
,iparams
->disres
.type
,
817 iparams
->disres
.low
,iparams
->disres
.up1
,
818 iparams
->disres
.up2
,iparams
->disres
.kfac
);
821 fprintf(fp
,"ex=%4d, label=%d, power=%4d, c=%15.8e, obs=%15.8e, kfac=%15.8e)\n",
822 iparams
->orires
.ex
,iparams
->orires
.label
,iparams
->orires
.power
,
823 iparams
->orires
.c
,iparams
->orires
.obs
,iparams
->orires
.kfac
);
826 fprintf(fp
,"label=%d, power=%4d phi=%15.8e, dphi=%15.8e, kfac=%15.8e)\n",
827 iparams
->dihres
.label
,iparams
->dihres
.power
,
828 iparams
->dihres
.phi
,iparams
->dihres
.dphi
,iparams
->dihres
.kfac
);
831 fprintf(fp
,"pos0A=(%15.8e,%15.8e,%15.8e), fcA=(%15.8e,%15.8e,%15.8e), pos0B=(%15.8e,%15.8e,%15.8e), fcB=(%15.8e,%15.8e,%15.8e)\n",
832 iparams
->posres
.pos0A
[XX
],iparams
->posres
.pos0A
[YY
],
833 iparams
->posres
.pos0A
[ZZ
],iparams
->posres
.fcA
[XX
],
834 iparams
->posres
.fcA
[YY
],iparams
->posres
.fcA
[ZZ
],
835 iparams
->posres
.pos0B
[XX
],iparams
->posres
.pos0B
[YY
],
836 iparams
->posres
.pos0B
[ZZ
],iparams
->posres
.fcB
[XX
],
837 iparams
->posres
.fcB
[YY
],iparams
->posres
.fcB
[ZZ
]);
840 for (i
=0; i
<NR_RBDIHS
; i
++)
841 fprintf(fp
,"%srbcA[%d]=%15.8e",i
==0?"":", ",i
,iparams
->rbdihs
.rbcA
[i
]);
843 for (i
=0; i
<NR_RBDIHS
; i
++)
844 fprintf(fp
,"%srbcB[%d]=%15.8e",i
==0?"":", ",i
,iparams
->rbdihs
.rbcB
[i
]);
848 /* Use the OPLS -> Ryckaert-Bellemans formula backwards to get the
849 * OPLS potential constants back.
851 rbcA
= iparams
->rbdihs
.rbcA
;
852 rbcB
= iparams
->rbdihs
.rbcB
;
854 VA
[3] = -0.25*rbcA
[4];
855 VA
[2] = -0.5*rbcA
[3];
856 VA
[1] = 4.0*VA
[3]-rbcA
[2];
857 VA
[0] = 3.0*VA
[2]-2.0*rbcA
[1];
859 VB
[3] = -0.25*rbcB
[4];
860 VB
[2] = -0.5*rbcB
[3];
861 VB
[1] = 4.0*VB
[3]-rbcB
[2];
862 VB
[0] = 3.0*VB
[2]-2.0*rbcB
[1];
864 for (i
=0; i
<NR_FOURDIHS
; i
++)
865 fprintf(fp
,"%sFourA[%d]=%15.8e",i
==0?"":", ",i
,VA
[i
]);
867 for (i
=0; i
<NR_FOURDIHS
; i
++)
868 fprintf(fp
,"%sFourB[%d]=%15.8e",i
==0?"":", ",i
,VB
[i
]);
874 fprintf(fp
,"dA=%15.8e, dB=%15.8e\n",iparams
->constr
.dA
,iparams
->constr
.dB
);
877 fprintf(fp
,"doh=%15.8e, dhh=%15.8e\n",iparams
->settle
.doh
,
878 iparams
->settle
.dhh
);
881 fprintf(fp
,"a=%15.8e\n",iparams
->vsite
.a
);
886 fprintf(fp
,"a=%15.8e, b=%15.8e\n",iparams
->vsite
.a
,iparams
->vsite
.b
);
891 fprintf(fp
,"a=%15.8e, b=%15.8e, c=%15.8e\n",
892 iparams
->vsite
.a
,iparams
->vsite
.b
,iparams
->vsite
.c
);
895 fprintf(fp
,"n=%2d, a=%15.8e\n",iparams
->vsiten
.n
,iparams
->vsiten
.a
);
900 fprintf(fp
, "sar=%15.8e, st=%15.8e, pi=%15.8e, gbr=%15.8e, bmlt=%15.8e\n",iparams
->gb
.sar
,iparams
->gb
.st
,iparams
->gb
.pi
,iparams
->gb
.gbr
,iparams
->gb
.bmlt
);
903 fprintf(fp
, "cmapA=%1d, cmapB=%1d\n",iparams
->cmap
.cmapA
, iparams
->cmap
.cmapB
);
906 gmx_fatal(FARGS
,"unknown function type %d (%s) in %s line %d",
907 ftype
,interaction_function
[ftype
].name
,__FILE__
,__LINE__
);
911 void pr_ilist(FILE *fp
,int indent
,const char *title
,
912 t_functype
*functype
,t_ilist
*ilist
, gmx_bool bShowNumbers
)
914 int i
,j
,k
,type
,ftype
;
917 if (available(fp
,ilist
,indent
,title
) && ilist
->nr
> 0)
919 indent
=pr_title(fp
,indent
,title
);
920 (void) pr_indent(fp
,indent
);
921 fprintf(fp
,"nr: %d\n",ilist
->nr
);
923 (void) pr_indent(fp
,indent
);
924 fprintf(fp
,"iatoms:\n");
925 iatoms
=ilist
->iatoms
;
926 for (i
=j
=0; i
<ilist
->nr
;) {
928 (void) pr_indent(fp
,indent
+INDENT
);
930 ftype
=functype
[type
];
931 (void) fprintf(fp
,"%d type=%d (%s)",
932 bShowNumbers
?j
:-1,bShowNumbers
?type
:-1,
933 interaction_function
[ftype
].name
);
935 for (k
=0; k
<interaction_function
[ftype
].nratoms
; k
++)
936 (void) fprintf(fp
," %u",*(iatoms
++));
937 (void) fprintf(fp
,"\n");
938 i
+=1+interaction_function
[ftype
].nratoms
;
940 fprintf(fp
,"%5d%5d\n",i
,iatoms
[i
]);
948 static void pr_cmap(FILE *fp
, int indent
, const char *title
,
949 gmx_cmap_t
*cmap_grid
, gmx_bool bShowNumbers
)
954 dx
= 360.0 / cmap_grid
->grid_spacing
;
955 nelem
= cmap_grid
->grid_spacing
*cmap_grid
->grid_spacing
;
957 if(available(fp
,cmap_grid
,indent
,title
))
959 fprintf(fp
,"%s\n",title
);
961 for(i
=0;i
<cmap_grid
->ngrid
;i
++)
964 fprintf(fp
,"%8s %8s %8s %8s\n","V","dVdx","dVdy","d2dV");
966 fprintf(fp
,"grid[%3d]={\n",bShowNumbers
?i
:-1);
970 if( (j
%cmap_grid
->grid_spacing
)==0)
972 fprintf(fp
,"%8.1f\n",idx
);
976 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4]);
977 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4+1]);
978 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4+2]);
979 fprintf(fp
,"%8.3f\n",cmap_grid
->cmapdata
[i
].cmap
[j
*4+3]);
987 void pr_ffparams(FILE *fp
,int indent
,const char *title
,
988 gmx_ffparams_t
*ffparams
,
989 gmx_bool bShowNumbers
)
993 indent
=pr_title(fp
,indent
,title
);
994 (void) pr_indent(fp
,indent
);
995 (void) fprintf(fp
,"atnr=%d\n",ffparams
->atnr
);
996 (void) pr_indent(fp
,indent
);
997 (void) fprintf(fp
,"ntypes=%d\n",ffparams
->ntypes
);
998 for (i
=0; i
<ffparams
->ntypes
; i
++) {
999 (void) pr_indent(fp
,indent
+INDENT
);
1000 (void) fprintf(fp
,"functype[%d]=%s, ",
1002 interaction_function
[ffparams
->functype
[i
]].name
);
1003 pr_iparams(fp
,ffparams
->functype
[i
],&ffparams
->iparams
[i
]);
1005 (void) pr_double(fp
,indent
,"reppow",ffparams
->reppow
);
1006 (void) pr_real(fp
,indent
,"fudgeQQ",ffparams
->fudgeQQ
);
1007 pr_cmap(fp
,indent
,"cmap",&ffparams
->cmap_grid
,bShowNumbers
);
1010 void pr_idef(FILE *fp
,int indent
,const char *title
,t_idef
*idef
, gmx_bool bShowNumbers
)
1014 if (available(fp
,idef
,indent
,title
)) {
1015 indent
=pr_title(fp
,indent
,title
);
1016 (void) pr_indent(fp
,indent
);
1017 (void) fprintf(fp
,"atnr=%d\n",idef
->atnr
);
1018 (void) pr_indent(fp
,indent
);
1019 (void) fprintf(fp
,"ntypes=%d\n",idef
->ntypes
);
1020 for (i
=0; i
<idef
->ntypes
; i
++) {
1021 (void) pr_indent(fp
,indent
+INDENT
);
1022 (void) fprintf(fp
,"functype[%d]=%s, ",
1024 interaction_function
[idef
->functype
[i
]].name
);
1025 pr_iparams(fp
,idef
->functype
[i
],&idef
->iparams
[i
]);
1027 (void) pr_real(fp
,indent
,"fudgeQQ",idef
->fudgeQQ
);
1029 for(j
=0; (j
<F_NRE
); j
++)
1030 pr_ilist(fp
,indent
,interaction_function
[j
].longname
,
1031 idef
->functype
,&idef
->il
[j
],bShowNumbers
);
1035 static int pr_block_title(FILE *fp
,int indent
,const char *title
,t_block
*block
)
1039 if (available(fp
,block
,indent
,title
))
1041 indent
=pr_title(fp
,indent
,title
);
1042 (void) pr_indent(fp
,indent
);
1043 (void) fprintf(fp
,"nr=%d\n",block
->nr
);
1048 static int pr_blocka_title(FILE *fp
,int indent
,const char *title
,t_blocka
*block
)
1052 if (available(fp
,block
,indent
,title
))
1054 indent
=pr_title(fp
,indent
,title
);
1055 (void) pr_indent(fp
,indent
);
1056 (void) fprintf(fp
,"nr=%d\n",block
->nr
);
1057 (void) pr_indent(fp
,indent
);
1058 (void) fprintf(fp
,"nra=%d\n",block
->nra
);
1063 static void low_pr_block(FILE *fp
,int indent
,const char *title
,t_block
*block
, gmx_bool bShowNumbers
)
1067 if (available(fp
,block
,indent
,title
))
1069 indent
=pr_block_title(fp
,indent
,title
,block
);
1070 for (i
=0; i
<=block
->nr
; i
++)
1072 (void) pr_indent(fp
,indent
+INDENT
);
1073 (void) fprintf(fp
,"%s->index[%d]=%u\n",
1074 title
,bShowNumbers
?i
:-1,block
->index
[i
]);
1079 static void low_pr_blocka(FILE *fp
,int indent
,const char *title
,t_blocka
*block
, gmx_bool bShowNumbers
)
1083 if (available(fp
,block
,indent
,title
))
1085 indent
=pr_blocka_title(fp
,indent
,title
,block
);
1086 for (i
=0; i
<=block
->nr
; i
++)
1088 (void) pr_indent(fp
,indent
+INDENT
);
1089 (void) fprintf(fp
,"%s->index[%d]=%u\n",
1090 title
,bShowNumbers
?i
:-1,block
->index
[i
]);
1092 for (i
=0; i
<block
->nra
; i
++)
1094 (void) pr_indent(fp
,indent
+INDENT
);
1095 (void) fprintf(fp
,"%s->a[%d]=%u\n",
1096 title
,bShowNumbers
?i
:-1,block
->a
[i
]);
1101 void pr_block(FILE *fp
,int indent
,const char *title
,t_block
*block
,gmx_bool bShowNumbers
)
1103 int i
,j
,ok
,size
,start
,end
;
1105 if (available(fp
,block
,indent
,title
))
1107 indent
=pr_block_title(fp
,indent
,title
,block
);
1110 if ((ok
=(block
->index
[start
]==0))==0)
1111 (void) fprintf(fp
,"block->index[%d] should be 0\n",start
);
1113 for (i
=0; i
<block
->nr
; i
++)
1115 end
=block
->index
[i
+1];
1116 size
=pr_indent(fp
,indent
);
1118 size
+=fprintf(fp
,"%s[%d]={}\n",title
,i
);
1120 size
+=fprintf(fp
,"%s[%d]={%d..%d}\n",
1121 title
,bShowNumbers
?i
:-1,
1122 bShowNumbers
?start
:-1,bShowNumbers
?end
-1:-1);
1128 void pr_blocka(FILE *fp
,int indent
,const char *title
,t_blocka
*block
,gmx_bool bShowNumbers
)
1130 int i
,j
,ok
,size
,start
,end
;
1132 if (available(fp
,block
,indent
,title
))
1134 indent
=pr_blocka_title(fp
,indent
,title
,block
);
1137 if ((ok
=(block
->index
[start
]==0))==0)
1138 (void) fprintf(fp
,"block->index[%d] should be 0\n",start
);
1140 for (i
=0; i
<block
->nr
; i
++)
1142 end
=block
->index
[i
+1];
1143 size
=pr_indent(fp
,indent
);
1145 size
+=fprintf(fp
,"%s[%d]={",title
,i
);
1147 size
+=fprintf(fp
,"%s[%d][%d..%d]={",
1148 title
,bShowNumbers
?i
:-1,
1149 bShowNumbers
?start
:-1,bShowNumbers
?end
-1:-1);
1150 for (j
=start
; j
<end
; j
++)
1152 if (j
>start
) size
+=fprintf(fp
,", ");
1153 if ((size
)>(USE_WIDTH
))
1155 (void) fprintf(fp
,"\n");
1156 size
=pr_indent(fp
,indent
+INDENT
);
1158 size
+=fprintf(fp
,"%u",block
->a
[j
]);
1160 (void) fprintf(fp
,"}\n");
1163 if ((end
!=block
->nra
)||(!ok
))
1165 (void) pr_indent(fp
,indent
);
1166 (void) fprintf(fp
,"tables inconsistent, dumping complete tables:\n");
1167 low_pr_blocka(fp
,indent
,title
,block
,bShowNumbers
);
1172 static void pr_strings(FILE *fp
,int indent
,const char *title
,char ***nm
,int n
, gmx_bool bShowNumbers
)
1176 if (available(fp
,nm
,indent
,title
))
1178 indent
=pr_title_n(fp
,indent
,title
,n
);
1181 (void) pr_indent(fp
,indent
);
1182 (void) fprintf(fp
,"%s[%d]={name=\"%s\"}\n",
1183 title
,bShowNumbers
?i
:-1,*(nm
[i
]));
1188 static void pr_strings2(FILE *fp
,int indent
,const char *title
,
1189 char ***nm
,char ***nmB
,int n
, gmx_bool bShowNumbers
)
1193 if (available(fp
,nm
,indent
,title
))
1195 indent
=pr_title_n(fp
,indent
,title
,n
);
1198 (void) pr_indent(fp
,indent
);
1199 (void) fprintf(fp
,"%s[%d]={name=\"%s\",nameB=\"%s\"}\n",
1200 title
,bShowNumbers
?i
:-1,*(nm
[i
]),*(nmB
[i
]));
1205 static void pr_resinfo(FILE *fp
,int indent
,const char *title
,t_resinfo
*resinfo
,int n
, gmx_bool bShowNumbers
)
1209 if (available(fp
,resinfo
,indent
,title
))
1211 indent
=pr_title_n(fp
,indent
,title
,n
);
1214 (void) pr_indent(fp
,indent
);
1215 (void) fprintf(fp
,"%s[%d]={name=\"%s\", nr=%d, ic='%c'}\n",
1216 title
,bShowNumbers
?i
:-1,
1217 *(resinfo
[i
].name
),resinfo
[i
].nr
,
1218 (resinfo
[i
].ic
== '\0') ? ' ' : resinfo
[i
].ic
);
1223 static void pr_atom(FILE *fp
,int indent
,const char *title
,t_atom
*atom
,int n
)
1227 if (available(fp
,atom
,indent
,title
)) {
1228 indent
=pr_title_n(fp
,indent
,title
,n
);
1229 for (i
=0; i
<n
; i
++) {
1230 (void) pr_indent(fp
,indent
);
1231 fprintf(fp
,"%s[%6d]={type=%3d, typeB=%3d, ptype=%8s, m=%12.5e, "
1232 "q=%12.5e, mB=%12.5e, qB=%12.5e, resind=%5d, atomnumber=%3d}\n",
1233 title
,i
,atom
[i
].type
,atom
[i
].typeB
,ptype_str
[atom
[i
].ptype
],
1234 atom
[i
].m
,atom
[i
].q
,atom
[i
].mB
,atom
[i
].qB
,
1235 atom
[i
].resind
,atom
[i
].atomnumber
);
1240 static void pr_grps(FILE *fp
,int indent
,const char *title
,t_grps grps
[],
1241 char **grpname
[], gmx_bool bShowNumbers
)
1245 for(i
=0; (i
<egcNR
); i
++)
1247 fprintf(fp
,"%s[%-12s] nr=%d, name=[",title
,gtypes
[i
],grps
[i
].nr
);
1248 for(j
=0; (j
<grps
[i
].nr
); j
++)
1250 fprintf(fp
," %s",*(grpname
[grps
[i
].nm_ind
[j
]]));
1256 static void pr_groups(FILE *fp
,int indent
,const char *title
,
1257 gmx_groups_t
*groups
,
1258 gmx_bool bShowNumbers
)
1263 pr_grps(fp
,indent
,"grp",groups
->grps
,groups
->grpname
,bShowNumbers
);
1264 pr_strings(fp
,indent
,"grpname",groups
->grpname
,groups
->ngrpname
,bShowNumbers
);
1266 (void) pr_indent(fp
,indent
);
1267 fprintf(fp
,"groups ");
1268 for(g
=0; g
<egcNR
; g
++)
1270 printf(" %5.5s",gtypes
[g
]);
1274 (void) pr_indent(fp
,indent
);
1275 fprintf(fp
,"allocated ");
1277 for(g
=0; g
<egcNR
; g
++)
1279 printf(" %5d",groups
->ngrpnr
[g
]);
1280 nat_max
= max(nat_max
,groups
->ngrpnr
[g
]);
1286 (void) pr_indent(fp
,indent
);
1287 fprintf(fp
,"groupnr[%5s] =","*");
1288 for(g
=0; g
<egcNR
; g
++)
1290 fprintf(fp
," %3d ",0);
1296 for(i
=0; i
<nat_max
; i
++)
1298 (void) pr_indent(fp
,indent
);
1299 fprintf(fp
,"groupnr[%5d] =",i
);
1300 for(g
=0; g
<egcNR
; g
++)
1303 groups
->grpnr
[g
] ? groups
->grpnr
[g
][i
] : 0);
1310 void pr_atoms(FILE *fp
,int indent
,const char *title
,t_atoms
*atoms
,
1311 gmx_bool bShownumbers
)
1313 if (available(fp
,atoms
,indent
,title
))
1315 indent
=pr_title(fp
,indent
,title
);
1316 pr_atom(fp
,indent
,"atom",atoms
->atom
,atoms
->nr
);
1317 pr_strings(fp
,indent
,"atom",atoms
->atomname
,atoms
->nr
,bShownumbers
);
1318 pr_strings2(fp
,indent
,"type",atoms
->atomtype
,atoms
->atomtypeB
,atoms
->nr
,bShownumbers
);
1319 pr_resinfo(fp
,indent
,"residue",atoms
->resinfo
,atoms
->nres
,bShownumbers
);
1324 void pr_atomtypes(FILE *fp
,int indent
,const char *title
,t_atomtypes
*atomtypes
,
1325 gmx_bool bShowNumbers
)
1328 if (available(fp
,atomtypes
,indent
,title
))
1330 indent
=pr_title(fp
,indent
,title
);
1331 for(i
=0;i
<atomtypes
->nr
;i
++) {
1332 pr_indent(fp
,indent
);
1334 "atomtype[%3d]={radius=%12.5e, volume=%12.5e, gb_radius=%12.5e, surftens=%12.5e, atomnumber=%4d, S_hct=%12.5e)}\n",
1335 bShowNumbers
?i
:-1,atomtypes
->radius
[i
],atomtypes
->vol
[i
],
1336 atomtypes
->gb_radius
[i
],
1337 atomtypes
->surftens
[i
],atomtypes
->atomnumber
[i
],atomtypes
->S_hct
[i
]);
1342 static void pr_moltype(FILE *fp
,int indent
,const char *title
,
1343 gmx_moltype_t
*molt
,int n
,
1344 gmx_ffparams_t
*ffparams
,
1345 gmx_bool bShowNumbers
)
1349 indent
= pr_title_n(fp
,indent
,title
,n
);
1350 (void) pr_indent(fp
,indent
);
1351 (void) fprintf(fp
,"name=\"%s\"\n",*(molt
->name
));
1352 pr_atoms(fp
,indent
,"atoms",&(molt
->atoms
),bShowNumbers
);
1353 pr_block(fp
,indent
,"cgs",&molt
->cgs
, bShowNumbers
);
1354 pr_blocka(fp
,indent
,"excls",&molt
->excls
, bShowNumbers
);
1355 for(j
=0; (j
<F_NRE
); j
++) {
1356 pr_ilist(fp
,indent
,interaction_function
[j
].longname
,
1357 ffparams
->functype
,&molt
->ilist
[j
],bShowNumbers
);
1361 static void pr_molblock(FILE *fp
,int indent
,const char *title
,
1362 gmx_molblock_t
*molb
,int n
,
1363 gmx_moltype_t
*molt
,
1364 gmx_bool bShowNumbers
)
1366 indent
= pr_title_n(fp
,indent
,title
,n
);
1367 (void) pr_indent(fp
,indent
);
1368 (void) fprintf(fp
,"%-20s = %d \"%s\"\n",
1369 "moltype",molb
->type
,*(molt
[molb
->type
].name
));
1370 pr_int(fp
,indent
,"#molecules",molb
->nmol
);
1371 pr_int(fp
,indent
,"#atoms_mol",molb
->natoms_mol
);
1372 pr_int(fp
,indent
,"#posres_xA",molb
->nposres_xA
);
1373 if (molb
->nposres_xA
> 0) {
1374 pr_rvecs(fp
,indent
,"posres_xA",molb
->posres_xA
,molb
->nposres_xA
);
1376 pr_int(fp
,indent
,"#posres_xB",molb
->nposres_xB
);
1377 if (molb
->nposres_xB
> 0) {
1378 pr_rvecs(fp
,indent
,"posres_xB",molb
->posres_xB
,molb
->nposres_xB
);
1382 void pr_mtop(FILE *fp
,int indent
,const char *title
,gmx_mtop_t
*mtop
,
1383 gmx_bool bShowNumbers
)
1387 if (available(fp
,mtop
,indent
,title
)) {
1388 indent
=pr_title(fp
,indent
,title
);
1389 (void) pr_indent(fp
,indent
);
1390 (void) fprintf(fp
,"name=\"%s\"\n",*(mtop
->name
));
1391 pr_int(fp
,indent
,"#atoms",mtop
->natoms
);
1392 for(mb
=0; mb
<mtop
->nmolblock
; mb
++) {
1393 pr_molblock(fp
,indent
,"molblock",&mtop
->molblock
[mb
],mb
,
1394 mtop
->moltype
,bShowNumbers
);
1396 pr_ffparams(fp
,indent
,"ffparams",&(mtop
->ffparams
),bShowNumbers
);
1397 pr_atomtypes(fp
,indent
,"atomtypes",&(mtop
->atomtypes
),bShowNumbers
);
1398 for(mt
=0; mt
<mtop
->nmoltype
; mt
++) {
1399 pr_moltype(fp
,indent
,"moltype",&mtop
->moltype
[mt
],mt
,
1400 &mtop
->ffparams
,bShowNumbers
);
1402 pr_groups(fp
,indent
,"groups",&mtop
->groups
,bShowNumbers
);
1406 void pr_top(FILE *fp
,int indent
,const char *title
,t_topology
*top
, gmx_bool bShowNumbers
)
1408 if (available(fp
,top
,indent
,title
)) {
1409 indent
=pr_title(fp
,indent
,title
);
1410 (void) pr_indent(fp
,indent
);
1411 (void) fprintf(fp
,"name=\"%s\"\n",*(top
->name
));
1412 pr_atoms(fp
,indent
,"atoms",&(top
->atoms
),bShowNumbers
);
1413 pr_atomtypes(fp
,indent
,"atomtypes",&(top
->atomtypes
),bShowNumbers
);
1414 pr_block(fp
,indent
,"cgs",&top
->cgs
, bShowNumbers
);
1415 pr_block(fp
,indent
,"mols",&top
->mols
, bShowNumbers
);
1416 pr_blocka(fp
,indent
,"excls",&top
->excls
, bShowNumbers
);
1417 pr_idef(fp
,indent
,"idef",&top
->idef
,bShowNumbers
);
1421 void pr_header(FILE *fp
,int indent
,const char *title
,t_tpxheader
*sh
)
1425 if (available(fp
,sh
,indent
,title
))
1427 indent
=pr_title(fp
,indent
,title
);
1428 pr_indent(fp
,indent
);
1429 fprintf(fp
,"bIr = %spresent\n",sh
->bIr
?"":"not ");
1430 pr_indent(fp
,indent
);
1431 fprintf(fp
,"bBox = %spresent\n",sh
->bBox
?"":"not ");
1432 pr_indent(fp
,indent
);
1433 fprintf(fp
,"bTop = %spresent\n",sh
->bTop
?"":"not ");
1434 pr_indent(fp
,indent
);
1435 fprintf(fp
,"bX = %spresent\n",sh
->bX
?"":"not ");
1436 pr_indent(fp
,indent
);
1437 fprintf(fp
,"bV = %spresent\n",sh
->bV
?"":"not ");
1438 pr_indent(fp
,indent
);
1439 fprintf(fp
,"bF = %spresent\n",sh
->bF
?"":"not ");
1441 pr_indent(fp
,indent
);
1442 fprintf(fp
,"natoms = %d\n",sh
->natoms
);
1443 pr_indent(fp
,indent
);
1444 fprintf(fp
,"lambda = %e\n",sh
->lambda
);
1448 void pr_commrec(FILE *fp
,int indent
,t_commrec
*cr
)
1450 pr_indent(fp
,indent
);
1451 fprintf(fp
,"commrec:\n");
1453 pr_indent(fp
,indent
);
1454 fprintf(fp
,"nodeid = %d\n",cr
->nodeid
);
1455 pr_indent(fp
,indent
);
1456 fprintf(fp
,"nnodes = %d\n",cr
->nnodes
);
1457 pr_indent(fp
,indent
);
1458 fprintf(fp
,"npmenodes = %d\n",cr
->npmenodes
);
1460 pr_indent(fp,indent);
1461 fprintf(fp,"threadid = %d\n",cr->threadid);
1462 pr_indent(fp,indent);
1463 fprintf(fp,"nthreads = %d\n",cr->nthreads);