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 static void pr_rotgrp(FILE *fp
,int indent
,int g
,t_rotgrp
*rotg
)
513 pr_indent(fp
,indent
);
514 fprintf(fp
,"rotation_group %d:\n",g
);
516 PS("type",EROTGEOM(rotg
->eType
));
517 PS("massw",BOOL(rotg
->bMassW
));
518 pr_ivec_block(fp
,indent
,"atom",rotg
->ind
,rotg
->nat
,TRUE
);
519 pr_rvecs(fp
,indent
,"x_ref",rotg
->x_ref
,rotg
->nat
);
520 pr_rvec(fp
,indent
,"vec",rotg
->vec
,DIM
,TRUE
);
521 pr_rvec(fp
,indent
,"pivot",rotg
->pivot
,DIM
,TRUE
);
522 PR("rate",rotg
->rate
);
524 PR("slab_dist",rotg
->slab_dist
);
525 PR("min_gaussian",rotg
->min_gaussian
);
526 PR("epsilon",rotg
->eps
);
527 PS("fit_method",EROTFIT(rotg
->eFittype
));
530 static void pr_rot(FILE *fp
,int indent
,t_rot
*rot
)
534 PI("rot_nstrout",rot
->nstrout
);
535 PI("rot_nstsout",rot
->nstsout
);
536 PI("rot_ngrp",rot
->ngrp
);
537 for(g
=0; g
<rot
->ngrp
; g
++)
538 pr_rotgrp(fp
,indent
,g
,&rot
->grp
[g
]);
541 void pr_inputrec(FILE *fp
,int indent
,const char *title
,t_inputrec
*ir
,
544 const char *infbuf
="inf";
547 if (available(fp
,ir
,indent
,title
)) {
549 indent
=pr_title(fp
,indent
,title
);
550 PS("integrator",EI(ir
->eI
));
551 PSTEP("nsteps",ir
->nsteps
);
552 PSTEP("init_step",ir
->init_step
);
553 PS("ns_type",ENS(ir
->ns_type
));
554 PI("nstlist",ir
->nstlist
);
555 PI("ndelta",ir
->ndelta
);
556 PI("nstcomm",ir
->nstcomm
);
557 PS("comm_mode",ECOM(ir
->comm_mode
));
558 PI("nstlog",ir
->nstlog
);
559 PI("nstxout",ir
->nstxout
);
560 PI("nstvout",ir
->nstvout
);
561 PI("nstfout",ir
->nstfout
);
562 PI("nstcalcenergy",ir
->nstcalcenergy
);
563 PI("nstenergy",ir
->nstenergy
);
564 PI("nstxtcout",ir
->nstxtcout
);
565 PR("init_t",ir
->init_t
);
566 PR("delta_t",ir
->delta_t
);
568 PR("xtcprec",ir
->xtcprec
);
572 PI("pme_order",ir
->pme_order
);
573 PR("ewald_rtol",ir
->ewald_rtol
);
574 PR("ewald_geometry",ir
->ewald_geometry
);
575 PR("epsilon_surface",ir
->epsilon_surface
);
576 PS("optimize_fft",BOOL(ir
->bOptFFT
));
577 PS("ePBC",EPBC(ir
->ePBC
));
578 PS("bPeriodicMols",BOOL(ir
->bPeriodicMols
));
579 PS("bContinuation",BOOL(ir
->bContinuation
));
580 PS("bShakeSOR",BOOL(ir
->bShakeSOR
));
581 PS("etc",ETCOUPLTYPE(ir
->etc
));
582 PI("nsttcouple",ir
->nsttcouple
);
583 PS("epc",EPCOUPLTYPE(ir
->epc
));
584 PS("epctype",EPCOUPLTYPETYPE(ir
->epct
));
585 PI("nstpcouple",ir
->nstpcouple
);
586 PR("tau_p",ir
->tau_p
);
587 pr_matrix(fp
,indent
,"ref_p",ir
->ref_p
,bMDPformat
);
588 pr_matrix(fp
,indent
,"compress",ir
->compress
,bMDPformat
);
589 PS("refcoord_scaling",EREFSCALINGTYPE(ir
->refcoord_scaling
));
591 fprintf(fp
,"posres_com = %g %g %g\n",ir
->posres_com
[XX
],
592 ir
->posres_com
[YY
],ir
->posres_com
[ZZ
]);
594 pr_rvec(fp
,indent
,"posres_com",ir
->posres_com
,DIM
,TRUE
);
596 fprintf(fp
,"posres_comB = %g %g %g\n",ir
->posres_comB
[XX
],
597 ir
->posres_comB
[YY
],ir
->posres_comB
[ZZ
]);
599 pr_rvec(fp
,indent
,"posres_comB",ir
->posres_comB
,DIM
,TRUE
);
600 PI("andersen_seed",ir
->andersen_seed
);
601 PR("rlist",ir
->rlist
);
602 PR("rlistlong",ir
->rlistlong
);
604 PS("coulombtype",EELTYPE(ir
->coulombtype
));
605 PR("rcoulomb_switch",ir
->rcoulomb_switch
);
606 PR("rcoulomb",ir
->rcoulomb
);
607 PS("vdwtype",EVDWTYPE(ir
->vdwtype
));
608 PR("rvdw_switch",ir
->rvdw_switch
);
610 if (ir
->epsilon_r
!= 0)
611 PR("epsilon_r",ir
->epsilon_r
);
613 PS("epsilon_r",infbuf
);
614 if (ir
->epsilon_rf
!= 0)
615 PR("epsilon_rf",ir
->epsilon_rf
);
617 PS("epsilon_rf",infbuf
);
618 PR("tabext",ir
->tabext
);
619 PS("implicit_solvent",EIMPLICITSOL(ir
->implicit_solvent
));
620 PS("gb_algorithm",EGBALGORITHM(ir
->gb_algorithm
));
621 PR("gb_epsilon_solvent",ir
->gb_epsilon_solvent
);
622 PI("nstgbradii",ir
->nstgbradii
);
623 PR("rgbradii",ir
->rgbradii
);
624 PR("gb_saltconc",ir
->gb_saltconc
);
625 PR("gb_obc_alpha",ir
->gb_obc_alpha
);
626 PR("gb_obc_beta",ir
->gb_obc_beta
);
627 PR("gb_obc_gamma",ir
->gb_obc_gamma
);
628 PR("gb_dielectric_offset",ir
->gb_dielectric_offset
);
629 PS("sa_algorithm",ESAALGORITHM(ir
->gb_algorithm
));
630 PR("sa_surface_tension",ir
->sa_surface_tension
);
632 PS("DispCorr",EDISPCORR(ir
->eDispCorr
));
633 PS("free_energy",EFEPTYPE(ir
->efep
));
634 PR("init_lambda",ir
->init_lambda
);
635 PR("delta_lambda",ir
->delta_lambda
);
638 PI("n_foreign_lambda",ir
->n_flambda
);
640 if (ir
->n_flambda
> 0)
642 pr_indent(fp
,indent
);
643 fprintf(fp
,"foreign_lambda%s",bMDPformat
? " = " : ":");
644 for(i
=0; i
<ir
->n_flambda
; i
++)
646 fprintf(fp
," %10g",ir
->flambda
[i
]);
650 PR("sc_alpha",ir
->sc_alpha
);
651 PI("sc_power",ir
->sc_power
);
652 PR("sc_sigma",ir
->sc_sigma
);
653 PR("sc_sigma_min",ir
->sc_sigma_min
);
654 PI("nstdhdl", ir
->nstdhdl
);
655 PS("separate_dhdl_file", SEPDHDLFILETYPE(ir
->separate_dhdl_file
));
656 PS("dhdl_derivatives", DHDLDERIVATIVESTYPE(ir
->dhdl_derivatives
));
657 PI("dh_hist_size", ir
->dh_hist_size
);
658 PD("dh_hist_spacing", ir
->dh_hist_spacing
);
660 PI("nwall",ir
->nwall
);
661 PS("wall_type",EWALLTYPE(ir
->wall_type
));
662 PI("wall_atomtype[0]",ir
->wall_atomtype
[0]);
663 PI("wall_atomtype[1]",ir
->wall_atomtype
[1]);
664 PR("wall_density[0]",ir
->wall_density
[0]);
665 PR("wall_density[1]",ir
->wall_density
[1]);
666 PR("wall_ewald_zfac",ir
->wall_ewald_zfac
);
668 PS("pull",EPULLTYPE(ir
->ePull
));
669 if (ir
->ePull
!= epullNO
)
670 pr_pull(fp
,indent
,ir
->pull
);
672 PS("rotation",BOOL(ir
->bRot
));
674 pr_rot(fp
,indent
,ir
->rot
);
676 PS("disre",EDISRETYPE(ir
->eDisre
));
677 PS("disre_weighting",EDISREWEIGHTING(ir
->eDisreWeighting
));
678 PS("disre_mixed",BOOL(ir
->bDisreMixed
));
679 PR("dr_fc",ir
->dr_fc
);
680 PR("dr_tau",ir
->dr_tau
);
681 PR("nstdisreout",ir
->nstdisreout
);
682 PR("orires_fc",ir
->orires_fc
);
683 PR("orires_tau",ir
->orires_tau
);
684 PR("nstorireout",ir
->nstorireout
);
686 PR("dihre-fc",ir
->dihre_fc
);
688 PR("em_stepsize",ir
->em_stepsize
);
689 PR("em_tol",ir
->em_tol
);
690 PI("niter",ir
->niter
);
691 PR("fc_stepsize",ir
->fc_stepsize
);
692 PI("nstcgsteep",ir
->nstcgsteep
);
693 PI("nbfgscorr",ir
->nbfgscorr
);
695 PS("ConstAlg",ECONSTRTYPE(ir
->eConstrAlg
));
696 PR("shake_tol",ir
->shake_tol
);
697 PI("lincs_order",ir
->nProjOrder
);
698 PR("lincs_warnangle",ir
->LincsWarnAngle
);
699 PI("lincs_iter",ir
->nLincsIter
);
700 PR("bd_fric",ir
->bd_fric
);
701 PI("ld_seed",ir
->ld_seed
);
702 PR("cos_accel",ir
->cos_accel
);
703 pr_matrix(fp
,indent
,"deform",ir
->deform
,bMDPformat
);
705 PS("adress_type",EADRESSTYPE(ir
->adress_type
));
706 PR("adress_const_wf",ir
->adress_const_wf
);
707 PR("adress_ex_width",ir
->adress_ex_width
);
708 PR("adress_hy_width",ir
->adress_hy_width
);
709 PS("adress_interface_correction",EADRESSICTYPE(ir
->adress_icor
));
710 PS("adress_tf_full_box",BOOL(ir
->badress_tf_full_box
));
711 PS("adress_site",EADRESSSITETYPE(ir
->adress_site
));
712 PR("adress_ex_force_cap",ir
->adress_ex_forcecap
);
713 PS("adress_do_hybridpairs", BOOL(ir
->adress_do_hybridpairs
));
715 pr_rvecs(fp
,indent
,"adress_reference_coords",&(ir
->adress_refs
),bMDPformat
);
717 PI("userint1",ir
->userint1
);
718 PI("userint2",ir
->userint2
);
719 PI("userint3",ir
->userint3
);
720 PI("userint4",ir
->userint4
);
721 PR("userreal1",ir
->userreal1
);
722 PR("userreal2",ir
->userreal2
);
723 PR("userreal3",ir
->userreal3
);
724 PR("userreal4",ir
->userreal4
);
725 pr_grp_opts(fp
,indent
,"grpopts",&(ir
->opts
),bMDPformat
);
726 pr_cosine(fp
,indent
,"efield-x",&(ir
->ex
[XX
]),bMDPformat
);
727 pr_cosine(fp
,indent
,"efield-xt",&(ir
->et
[XX
]),bMDPformat
);
728 pr_cosine(fp
,indent
,"efield-y",&(ir
->ex
[YY
]),bMDPformat
);
729 pr_cosine(fp
,indent
,"efield-yt",&(ir
->et
[YY
]),bMDPformat
);
730 pr_cosine(fp
,indent
,"efield-z",&(ir
->ex
[ZZ
]),bMDPformat
);
731 pr_cosine(fp
,indent
,"efield-zt",&(ir
->et
[ZZ
]),bMDPformat
);
732 PS("bQMMM",BOOL(ir
->bQMMM
));
733 PI("QMconstraints",ir
->QMconstraints
);
734 PI("QMMMscheme",ir
->QMMMscheme
);
735 PR("scalefactor",ir
->scalefactor
);
736 pr_qm_opts(fp
,indent
,"qm_opts",&(ir
->opts
));
743 static void pr_harm(FILE *fp
,t_iparams
*iparams
,const char *r
,const char *kr
)
745 fprintf(fp
,"%sA=%12.5e, %sA=%12.5e, %sB=%12.5e, %sB=%12.5e\n",
746 r
,iparams
->harmonic
.rA
,kr
,iparams
->harmonic
.krA
,
747 r
,iparams
->harmonic
.rB
,kr
,iparams
->harmonic
.krB
);
750 void pr_iparams(FILE *fp
,t_functype ftype
,t_iparams
*iparams
)
753 real VA
[4],VB
[4],*rbcA
,*rbcB
;
758 pr_harm(fp
,iparams
,"th","ct");
760 case F_CROSS_BOND_BONDS
:
761 fprintf(fp
,"r1e=%15.8e, r2e=%15.8e, krr=%15.8e\n",
762 iparams
->cross_bb
.r1e
,iparams
->cross_bb
.r2e
,
763 iparams
->cross_bb
.krr
);
765 case F_CROSS_BOND_ANGLES
:
766 fprintf(fp
,"r1e=%15.8e, r1e=%15.8e, r3e=%15.8e, krt=%15.8e\n",
767 iparams
->cross_ba
.r1e
,iparams
->cross_ba
.r2e
,
768 iparams
->cross_ba
.r3e
,iparams
->cross_ba
.krt
);
771 fprintf(fp
,"theta=%15.8e, ktheta=%15.8e, r13=%15.8e, kUB=%15.8e\n",
772 iparams
->u_b
.theta
,iparams
->u_b
.ktheta
,iparams
->u_b
.r13
,iparams
->u_b
.kUB
);
774 case F_QUARTIC_ANGLES
:
775 fprintf(fp
,"theta=%15.8e",iparams
->qangle
.theta
);
777 fprintf(fp
,", c%c=%15.8e",'0'+i
,iparams
->qangle
.c
[i
]);
781 fprintf(fp
,"a=%15.8e, b=%15.8e, c=%15.8e\n",
782 iparams
->bham
.a
,iparams
->bham
.b
,iparams
->bham
.c
);
787 pr_harm(fp
,iparams
,"b0","cb");
790 pr_harm(fp
,iparams
,"xi","cx");
793 fprintf(fp
,"b0=%15.8e, cb=%15.8e, beta=%15.8e\n",
794 iparams
->morse
.b0
,iparams
->morse
.cb
,iparams
->morse
.beta
);
797 fprintf(fp
,"b0=%15.8e, kb=%15.8e, kcub=%15.8e\n",
798 iparams
->cubic
.b0
,iparams
->cubic
.kb
,iparams
->cubic
.kcub
);
804 fprintf(fp
,"bm=%15.8e, kb=%15.8e\n",iparams
->fene
.bm
,iparams
->fene
.kb
);
807 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",
808 iparams
->restraint
.lowA
,iparams
->restraint
.up1A
,
809 iparams
->restraint
.up2A
,iparams
->restraint
.kA
,
810 iparams
->restraint
.lowB
,iparams
->restraint
.up1B
,
811 iparams
->restraint
.up2B
,iparams
->restraint
.kB
);
817 fprintf(fp
,"tab=%d, kA=%15.8e, kB=%15.8e\n",
818 iparams
->tab
.table
,iparams
->tab
.kA
,iparams
->tab
.kB
);
821 fprintf(fp
,"alpha=%15.8e\n",iparams
->polarize
.alpha
);
824 fprintf(fp
,"a=%15.8e, alpha1=%15.8e, alpha2=%15.8e, rfac=%15.8e\n",
825 iparams
->thole
.a
,iparams
->thole
.alpha1
,iparams
->thole
.alpha2
,
826 iparams
->thole
.rfac
);
829 fprintf(fp
,"al_x=%15.8e, al_y=%15.8e, al_z=%15.8e, rOH=%9.6f, rHH=%9.6f, rOD=%9.6f\n",
830 iparams
->wpol
.al_x
,iparams
->wpol
.al_y
,iparams
->wpol
.al_z
,
831 iparams
->wpol
.rOH
,iparams
->wpol
.rHH
,iparams
->wpol
.rOD
);
834 fprintf(fp
,"c6=%15.8e, c12=%15.8e\n",iparams
->lj
.c6
,iparams
->lj
.c12
);
837 fprintf(fp
,"c6A=%15.8e, c12A=%15.8e, c6B=%15.8e, c12B=%15.8e\n",
838 iparams
->lj14
.c6A
,iparams
->lj14
.c12A
,
839 iparams
->lj14
.c6B
,iparams
->lj14
.c12B
);
842 fprintf(fp
,"fqq=%15.8e, qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
844 iparams
->ljc14
.qi
,iparams
->ljc14
.qj
,
845 iparams
->ljc14
.c6
,iparams
->ljc14
.c12
);
848 fprintf(fp
,"qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
849 iparams
->ljcnb
.qi
,iparams
->ljcnb
.qj
,
850 iparams
->ljcnb
.c6
,iparams
->ljcnb
.c12
);
856 fprintf(fp
,"phiA=%15.8e, cpA=%15.8e, phiB=%15.8e, cpB=%15.8e, mult=%d\n",
857 iparams
->pdihs
.phiA
,iparams
->pdihs
.cpA
,
858 iparams
->pdihs
.phiB
,iparams
->pdihs
.cpB
,
859 iparams
->pdihs
.mult
);
862 fprintf(fp
,"label=%4d, type=%1d, low=%15.8e, up1=%15.8e, up2=%15.8e, fac=%15.8e)\n",
863 iparams
->disres
.label
,iparams
->disres
.type
,
864 iparams
->disres
.low
,iparams
->disres
.up1
,
865 iparams
->disres
.up2
,iparams
->disres
.kfac
);
868 fprintf(fp
,"ex=%4d, label=%d, power=%4d, c=%15.8e, obs=%15.8e, kfac=%15.8e)\n",
869 iparams
->orires
.ex
,iparams
->orires
.label
,iparams
->orires
.power
,
870 iparams
->orires
.c
,iparams
->orires
.obs
,iparams
->orires
.kfac
);
873 fprintf(fp
,"label=%d, power=%4d phi=%15.8e, dphi=%15.8e, kfac=%15.8e)\n",
874 iparams
->dihres
.label
,iparams
->dihres
.power
,
875 iparams
->dihres
.phi
,iparams
->dihres
.dphi
,iparams
->dihres
.kfac
);
878 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",
879 iparams
->posres
.pos0A
[XX
],iparams
->posres
.pos0A
[YY
],
880 iparams
->posres
.pos0A
[ZZ
],iparams
->posres
.fcA
[XX
],
881 iparams
->posres
.fcA
[YY
],iparams
->posres
.fcA
[ZZ
],
882 iparams
->posres
.pos0B
[XX
],iparams
->posres
.pos0B
[YY
],
883 iparams
->posres
.pos0B
[ZZ
],iparams
->posres
.fcB
[XX
],
884 iparams
->posres
.fcB
[YY
],iparams
->posres
.fcB
[ZZ
]);
887 for (i
=0; i
<NR_RBDIHS
; i
++)
888 fprintf(fp
,"%srbcA[%d]=%15.8e",i
==0?"":", ",i
,iparams
->rbdihs
.rbcA
[i
]);
890 for (i
=0; i
<NR_RBDIHS
; i
++)
891 fprintf(fp
,"%srbcB[%d]=%15.8e",i
==0?"":", ",i
,iparams
->rbdihs
.rbcB
[i
]);
895 /* Use the OPLS -> Ryckaert-Bellemans formula backwards to get the
896 * OPLS potential constants back.
898 rbcA
= iparams
->rbdihs
.rbcA
;
899 rbcB
= iparams
->rbdihs
.rbcB
;
901 VA
[3] = -0.25*rbcA
[4];
902 VA
[2] = -0.5*rbcA
[3];
903 VA
[1] = 4.0*VA
[3]-rbcA
[2];
904 VA
[0] = 3.0*VA
[2]-2.0*rbcA
[1];
906 VB
[3] = -0.25*rbcB
[4];
907 VB
[2] = -0.5*rbcB
[3];
908 VB
[1] = 4.0*VB
[3]-rbcB
[2];
909 VB
[0] = 3.0*VB
[2]-2.0*rbcB
[1];
911 for (i
=0; i
<NR_FOURDIHS
; i
++)
912 fprintf(fp
,"%sFourA[%d]=%15.8e",i
==0?"":", ",i
,VA
[i
]);
914 for (i
=0; i
<NR_FOURDIHS
; i
++)
915 fprintf(fp
,"%sFourB[%d]=%15.8e",i
==0?"":", ",i
,VB
[i
]);
921 fprintf(fp
,"dA=%15.8e, dB=%15.8e\n",iparams
->constr
.dA
,iparams
->constr
.dB
);
924 fprintf(fp
,"doh=%15.8e, dhh=%15.8e\n",iparams
->settle
.doh
,
925 iparams
->settle
.dhh
);
928 fprintf(fp
,"a=%15.8e\n",iparams
->vsite
.a
);
933 fprintf(fp
,"a=%15.8e, b=%15.8e\n",iparams
->vsite
.a
,iparams
->vsite
.b
);
938 fprintf(fp
,"a=%15.8e, b=%15.8e, c=%15.8e\n",
939 iparams
->vsite
.a
,iparams
->vsite
.b
,iparams
->vsite
.c
);
942 fprintf(fp
,"n=%2d, a=%15.8e\n",iparams
->vsiten
.n
,iparams
->vsiten
.a
);
947 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
);
950 fprintf(fp
, "cmapA=%1d, cmapB=%1d\n",iparams
->cmap
.cmapA
, iparams
->cmap
.cmapB
);
953 gmx_fatal(FARGS
,"unknown function type %d (%s) in %s line %d",
954 ftype
,interaction_function
[ftype
].name
,__FILE__
,__LINE__
);
958 void pr_ilist(FILE *fp
,int indent
,const char *title
,
959 t_functype
*functype
,t_ilist
*ilist
, gmx_bool bShowNumbers
)
961 int i
,j
,k
,type
,ftype
;
964 if (available(fp
,ilist
,indent
,title
) && ilist
->nr
> 0)
966 indent
=pr_title(fp
,indent
,title
);
967 (void) pr_indent(fp
,indent
);
968 fprintf(fp
,"nr: %d\n",ilist
->nr
);
970 (void) pr_indent(fp
,indent
);
971 fprintf(fp
,"iatoms:\n");
972 iatoms
=ilist
->iatoms
;
973 for (i
=j
=0; i
<ilist
->nr
;) {
975 (void) pr_indent(fp
,indent
+INDENT
);
977 ftype
=functype
[type
];
978 (void) fprintf(fp
,"%d type=%d (%s)",
979 bShowNumbers
?j
:-1,bShowNumbers
?type
:-1,
980 interaction_function
[ftype
].name
);
982 for (k
=0; k
<interaction_function
[ftype
].nratoms
; k
++)
983 (void) fprintf(fp
," %u",*(iatoms
++));
984 (void) fprintf(fp
,"\n");
985 i
+=1+interaction_function
[ftype
].nratoms
;
987 fprintf(fp
,"%5d%5d\n",i
,iatoms
[i
]);
995 static void pr_cmap(FILE *fp
, int indent
, const char *title
,
996 gmx_cmap_t
*cmap_grid
, gmx_bool bShowNumbers
)
1001 dx
= 360.0 / cmap_grid
->grid_spacing
;
1002 nelem
= cmap_grid
->grid_spacing
*cmap_grid
->grid_spacing
;
1004 if(available(fp
,cmap_grid
,indent
,title
))
1006 fprintf(fp
,"%s\n",title
);
1008 for(i
=0;i
<cmap_grid
->ngrid
;i
++)
1011 fprintf(fp
,"%8s %8s %8s %8s\n","V","dVdx","dVdy","d2dV");
1013 fprintf(fp
,"grid[%3d]={\n",bShowNumbers
?i
:-1);
1015 for(j
=0;j
<nelem
;j
++)
1017 if( (j
%cmap_grid
->grid_spacing
)==0)
1019 fprintf(fp
,"%8.1f\n",idx
);
1023 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4]);
1024 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4+1]);
1025 fprintf(fp
,"%8.3f ",cmap_grid
->cmapdata
[i
].cmap
[j
*4+2]);
1026 fprintf(fp
,"%8.3f\n",cmap_grid
->cmapdata
[i
].cmap
[j
*4+3]);
1034 void pr_ffparams(FILE *fp
,int indent
,const char *title
,
1035 gmx_ffparams_t
*ffparams
,
1036 gmx_bool bShowNumbers
)
1040 indent
=pr_title(fp
,indent
,title
);
1041 (void) pr_indent(fp
,indent
);
1042 (void) fprintf(fp
,"atnr=%d\n",ffparams
->atnr
);
1043 (void) pr_indent(fp
,indent
);
1044 (void) fprintf(fp
,"ntypes=%d\n",ffparams
->ntypes
);
1045 for (i
=0; i
<ffparams
->ntypes
; i
++) {
1046 (void) pr_indent(fp
,indent
+INDENT
);
1047 (void) fprintf(fp
,"functype[%d]=%s, ",
1049 interaction_function
[ffparams
->functype
[i
]].name
);
1050 pr_iparams(fp
,ffparams
->functype
[i
],&ffparams
->iparams
[i
]);
1052 (void) pr_double(fp
,indent
,"reppow",ffparams
->reppow
);
1053 (void) pr_real(fp
,indent
,"fudgeQQ",ffparams
->fudgeQQ
);
1054 pr_cmap(fp
,indent
,"cmap",&ffparams
->cmap_grid
,bShowNumbers
);
1057 void pr_idef(FILE *fp
,int indent
,const char *title
,t_idef
*idef
, gmx_bool bShowNumbers
)
1061 if (available(fp
,idef
,indent
,title
)) {
1062 indent
=pr_title(fp
,indent
,title
);
1063 (void) pr_indent(fp
,indent
);
1064 (void) fprintf(fp
,"atnr=%d\n",idef
->atnr
);
1065 (void) pr_indent(fp
,indent
);
1066 (void) fprintf(fp
,"ntypes=%d\n",idef
->ntypes
);
1067 for (i
=0; i
<idef
->ntypes
; i
++) {
1068 (void) pr_indent(fp
,indent
+INDENT
);
1069 (void) fprintf(fp
,"functype[%d]=%s, ",
1071 interaction_function
[idef
->functype
[i
]].name
);
1072 pr_iparams(fp
,idef
->functype
[i
],&idef
->iparams
[i
]);
1074 (void) pr_real(fp
,indent
,"fudgeQQ",idef
->fudgeQQ
);
1076 for(j
=0; (j
<F_NRE
); j
++)
1077 pr_ilist(fp
,indent
,interaction_function
[j
].longname
,
1078 idef
->functype
,&idef
->il
[j
],bShowNumbers
);
1082 static int pr_block_title(FILE *fp
,int indent
,const char *title
,t_block
*block
)
1086 if (available(fp
,block
,indent
,title
))
1088 indent
=pr_title(fp
,indent
,title
);
1089 (void) pr_indent(fp
,indent
);
1090 (void) fprintf(fp
,"nr=%d\n",block
->nr
);
1095 static int pr_blocka_title(FILE *fp
,int indent
,const char *title
,t_blocka
*block
)
1099 if (available(fp
,block
,indent
,title
))
1101 indent
=pr_title(fp
,indent
,title
);
1102 (void) pr_indent(fp
,indent
);
1103 (void) fprintf(fp
,"nr=%d\n",block
->nr
);
1104 (void) pr_indent(fp
,indent
);
1105 (void) fprintf(fp
,"nra=%d\n",block
->nra
);
1110 static void low_pr_block(FILE *fp
,int indent
,const char *title
,t_block
*block
, gmx_bool bShowNumbers
)
1114 if (available(fp
,block
,indent
,title
))
1116 indent
=pr_block_title(fp
,indent
,title
,block
);
1117 for (i
=0; i
<=block
->nr
; i
++)
1119 (void) pr_indent(fp
,indent
+INDENT
);
1120 (void) fprintf(fp
,"%s->index[%d]=%u\n",
1121 title
,bShowNumbers
?i
:-1,block
->index
[i
]);
1126 static void low_pr_blocka(FILE *fp
,int indent
,const char *title
,t_blocka
*block
, gmx_bool bShowNumbers
)
1130 if (available(fp
,block
,indent
,title
))
1132 indent
=pr_blocka_title(fp
,indent
,title
,block
);
1133 for (i
=0; i
<=block
->nr
; i
++)
1135 (void) pr_indent(fp
,indent
+INDENT
);
1136 (void) fprintf(fp
,"%s->index[%d]=%u\n",
1137 title
,bShowNumbers
?i
:-1,block
->index
[i
]);
1139 for (i
=0; i
<block
->nra
; i
++)
1141 (void) pr_indent(fp
,indent
+INDENT
);
1142 (void) fprintf(fp
,"%s->a[%d]=%u\n",
1143 title
,bShowNumbers
?i
:-1,block
->a
[i
]);
1148 void pr_block(FILE *fp
,int indent
,const char *title
,t_block
*block
,gmx_bool bShowNumbers
)
1150 int i
,j
,ok
,size
,start
,end
;
1152 if (available(fp
,block
,indent
,title
))
1154 indent
=pr_block_title(fp
,indent
,title
,block
);
1157 if ((ok
=(block
->index
[start
]==0))==0)
1158 (void) fprintf(fp
,"block->index[%d] should be 0\n",start
);
1160 for (i
=0; i
<block
->nr
; i
++)
1162 end
=block
->index
[i
+1];
1163 size
=pr_indent(fp
,indent
);
1165 size
+=fprintf(fp
,"%s[%d]={}\n",title
,i
);
1167 size
+=fprintf(fp
,"%s[%d]={%d..%d}\n",
1168 title
,bShowNumbers
?i
:-1,
1169 bShowNumbers
?start
:-1,bShowNumbers
?end
-1:-1);
1175 void pr_blocka(FILE *fp
,int indent
,const char *title
,t_blocka
*block
,gmx_bool bShowNumbers
)
1177 int i
,j
,ok
,size
,start
,end
;
1179 if (available(fp
,block
,indent
,title
))
1181 indent
=pr_blocka_title(fp
,indent
,title
,block
);
1184 if ((ok
=(block
->index
[start
]==0))==0)
1185 (void) fprintf(fp
,"block->index[%d] should be 0\n",start
);
1187 for (i
=0; i
<block
->nr
; i
++)
1189 end
=block
->index
[i
+1];
1190 size
=pr_indent(fp
,indent
);
1192 size
+=fprintf(fp
,"%s[%d]={",title
,i
);
1194 size
+=fprintf(fp
,"%s[%d][%d..%d]={",
1195 title
,bShowNumbers
?i
:-1,
1196 bShowNumbers
?start
:-1,bShowNumbers
?end
-1:-1);
1197 for (j
=start
; j
<end
; j
++)
1199 if (j
>start
) size
+=fprintf(fp
,", ");
1200 if ((size
)>(USE_WIDTH
))
1202 (void) fprintf(fp
,"\n");
1203 size
=pr_indent(fp
,indent
+INDENT
);
1205 size
+=fprintf(fp
,"%u",block
->a
[j
]);
1207 (void) fprintf(fp
,"}\n");
1210 if ((end
!=block
->nra
)||(!ok
))
1212 (void) pr_indent(fp
,indent
);
1213 (void) fprintf(fp
,"tables inconsistent, dumping complete tables:\n");
1214 low_pr_blocka(fp
,indent
,title
,block
,bShowNumbers
);
1219 static void pr_strings(FILE *fp
,int indent
,const char *title
,char ***nm
,int n
, gmx_bool bShowNumbers
)
1223 if (available(fp
,nm
,indent
,title
))
1225 indent
=pr_title_n(fp
,indent
,title
,n
);
1228 (void) pr_indent(fp
,indent
);
1229 (void) fprintf(fp
,"%s[%d]={name=\"%s\"}\n",
1230 title
,bShowNumbers
?i
:-1,*(nm
[i
]));
1235 static void pr_strings2(FILE *fp
,int indent
,const char *title
,
1236 char ***nm
,char ***nmB
,int n
, gmx_bool bShowNumbers
)
1240 if (available(fp
,nm
,indent
,title
))
1242 indent
=pr_title_n(fp
,indent
,title
,n
);
1245 (void) pr_indent(fp
,indent
);
1246 (void) fprintf(fp
,"%s[%d]={name=\"%s\",nameB=\"%s\"}\n",
1247 title
,bShowNumbers
?i
:-1,*(nm
[i
]),*(nmB
[i
]));
1252 static void pr_resinfo(FILE *fp
,int indent
,const char *title
,t_resinfo
*resinfo
,int n
, gmx_bool bShowNumbers
)
1256 if (available(fp
,resinfo
,indent
,title
))
1258 indent
=pr_title_n(fp
,indent
,title
,n
);
1261 (void) pr_indent(fp
,indent
);
1262 (void) fprintf(fp
,"%s[%d]={name=\"%s\", nr=%d, ic='%c'}\n",
1263 title
,bShowNumbers
?i
:-1,
1264 *(resinfo
[i
].name
),resinfo
[i
].nr
,
1265 (resinfo
[i
].ic
== '\0') ? ' ' : resinfo
[i
].ic
);
1270 static void pr_atom(FILE *fp
,int indent
,const char *title
,t_atom
*atom
,int n
)
1274 if (available(fp
,atom
,indent
,title
)) {
1275 indent
=pr_title_n(fp
,indent
,title
,n
);
1276 for (i
=0; i
<n
; i
++) {
1277 (void) pr_indent(fp
,indent
);
1278 fprintf(fp
,"%s[%6d]={type=%3d, typeB=%3d, ptype=%8s, m=%12.5e, "
1279 "q=%12.5e, mB=%12.5e, qB=%12.5e, resind=%5d, atomnumber=%3d}\n",
1280 title
,i
,atom
[i
].type
,atom
[i
].typeB
,ptype_str
[atom
[i
].ptype
],
1281 atom
[i
].m
,atom
[i
].q
,atom
[i
].mB
,atom
[i
].qB
,
1282 atom
[i
].resind
,atom
[i
].atomnumber
);
1287 static void pr_grps(FILE *fp
,int indent
,const char *title
,t_grps grps
[],
1288 char **grpname
[], gmx_bool bShowNumbers
)
1292 for(i
=0; (i
<egcNR
); i
++)
1294 fprintf(fp
,"%s[%-12s] nr=%d, name=[",title
,gtypes
[i
],grps
[i
].nr
);
1295 for(j
=0; (j
<grps
[i
].nr
); j
++)
1297 fprintf(fp
," %s",*(grpname
[grps
[i
].nm_ind
[j
]]));
1303 static void pr_groups(FILE *fp
,int indent
,const char *title
,
1304 gmx_groups_t
*groups
,
1305 gmx_bool bShowNumbers
)
1310 pr_grps(fp
,indent
,"grp",groups
->grps
,groups
->grpname
,bShowNumbers
);
1311 pr_strings(fp
,indent
,"grpname",groups
->grpname
,groups
->ngrpname
,bShowNumbers
);
1313 (void) pr_indent(fp
,indent
);
1314 fprintf(fp
,"groups ");
1315 for(g
=0; g
<egcNR
; g
++)
1317 printf(" %5.5s",gtypes
[g
]);
1321 (void) pr_indent(fp
,indent
);
1322 fprintf(fp
,"allocated ");
1324 for(g
=0; g
<egcNR
; g
++)
1326 printf(" %5d",groups
->ngrpnr
[g
]);
1327 nat_max
= max(nat_max
,groups
->ngrpnr
[g
]);
1333 (void) pr_indent(fp
,indent
);
1334 fprintf(fp
,"groupnr[%5s] =","*");
1335 for(g
=0; g
<egcNR
; g
++)
1337 fprintf(fp
," %3d ",0);
1343 for(i
=0; i
<nat_max
; i
++)
1345 (void) pr_indent(fp
,indent
);
1346 fprintf(fp
,"groupnr[%5d] =",i
);
1347 for(g
=0; g
<egcNR
; g
++)
1350 groups
->grpnr
[g
] ? groups
->grpnr
[g
][i
] : 0);
1357 void pr_atoms(FILE *fp
,int indent
,const char *title
,t_atoms
*atoms
,
1358 gmx_bool bShownumbers
)
1360 if (available(fp
,atoms
,indent
,title
))
1362 indent
=pr_title(fp
,indent
,title
);
1363 pr_atom(fp
,indent
,"atom",atoms
->atom
,atoms
->nr
);
1364 pr_strings(fp
,indent
,"atom",atoms
->atomname
,atoms
->nr
,bShownumbers
);
1365 pr_strings2(fp
,indent
,"type",atoms
->atomtype
,atoms
->atomtypeB
,atoms
->nr
,bShownumbers
);
1366 pr_resinfo(fp
,indent
,"residue",atoms
->resinfo
,atoms
->nres
,bShownumbers
);
1371 void pr_atomtypes(FILE *fp
,int indent
,const char *title
,t_atomtypes
*atomtypes
,
1372 gmx_bool bShowNumbers
)
1375 if (available(fp
,atomtypes
,indent
,title
))
1377 indent
=pr_title(fp
,indent
,title
);
1378 for(i
=0;i
<atomtypes
->nr
;i
++) {
1379 pr_indent(fp
,indent
);
1381 "atomtype[%3d]={radius=%12.5e, volume=%12.5e, gb_radius=%12.5e, surftens=%12.5e, atomnumber=%4d, S_hct=%12.5e)}\n",
1382 bShowNumbers
?i
:-1,atomtypes
->radius
[i
],atomtypes
->vol
[i
],
1383 atomtypes
->gb_radius
[i
],
1384 atomtypes
->surftens
[i
],atomtypes
->atomnumber
[i
],atomtypes
->S_hct
[i
]);
1389 static void pr_moltype(FILE *fp
,int indent
,const char *title
,
1390 gmx_moltype_t
*molt
,int n
,
1391 gmx_ffparams_t
*ffparams
,
1392 gmx_bool bShowNumbers
)
1396 indent
= pr_title_n(fp
,indent
,title
,n
);
1397 (void) pr_indent(fp
,indent
);
1398 (void) fprintf(fp
,"name=\"%s\"\n",*(molt
->name
));
1399 pr_atoms(fp
,indent
,"atoms",&(molt
->atoms
),bShowNumbers
);
1400 pr_block(fp
,indent
,"cgs",&molt
->cgs
, bShowNumbers
);
1401 pr_blocka(fp
,indent
,"excls",&molt
->excls
, bShowNumbers
);
1402 for(j
=0; (j
<F_NRE
); j
++) {
1403 pr_ilist(fp
,indent
,interaction_function
[j
].longname
,
1404 ffparams
->functype
,&molt
->ilist
[j
],bShowNumbers
);
1408 static void pr_molblock(FILE *fp
,int indent
,const char *title
,
1409 gmx_molblock_t
*molb
,int n
,
1410 gmx_moltype_t
*molt
,
1411 gmx_bool bShowNumbers
)
1413 indent
= pr_title_n(fp
,indent
,title
,n
);
1414 (void) pr_indent(fp
,indent
);
1415 (void) fprintf(fp
,"%-20s = %d \"%s\"\n",
1416 "moltype",molb
->type
,*(molt
[molb
->type
].name
));
1417 pr_int(fp
,indent
,"#molecules",molb
->nmol
);
1418 pr_int(fp
,indent
,"#atoms_mol",molb
->natoms_mol
);
1419 pr_int(fp
,indent
,"#posres_xA",molb
->nposres_xA
);
1420 if (molb
->nposres_xA
> 0) {
1421 pr_rvecs(fp
,indent
,"posres_xA",molb
->posres_xA
,molb
->nposres_xA
);
1423 pr_int(fp
,indent
,"#posres_xB",molb
->nposres_xB
);
1424 if (molb
->nposres_xB
> 0) {
1425 pr_rvecs(fp
,indent
,"posres_xB",molb
->posres_xB
,molb
->nposres_xB
);
1429 void pr_mtop(FILE *fp
,int indent
,const char *title
,gmx_mtop_t
*mtop
,
1430 gmx_bool bShowNumbers
)
1434 if (available(fp
,mtop
,indent
,title
)) {
1435 indent
=pr_title(fp
,indent
,title
);
1436 (void) pr_indent(fp
,indent
);
1437 (void) fprintf(fp
,"name=\"%s\"\n",*(mtop
->name
));
1438 pr_int(fp
,indent
,"#atoms",mtop
->natoms
);
1439 for(mb
=0; mb
<mtop
->nmolblock
; mb
++) {
1440 pr_molblock(fp
,indent
,"molblock",&mtop
->molblock
[mb
],mb
,
1441 mtop
->moltype
,bShowNumbers
);
1443 pr_ffparams(fp
,indent
,"ffparams",&(mtop
->ffparams
),bShowNumbers
);
1444 pr_atomtypes(fp
,indent
,"atomtypes",&(mtop
->atomtypes
),bShowNumbers
);
1445 for(mt
=0; mt
<mtop
->nmoltype
; mt
++) {
1446 pr_moltype(fp
,indent
,"moltype",&mtop
->moltype
[mt
],mt
,
1447 &mtop
->ffparams
,bShowNumbers
);
1449 pr_groups(fp
,indent
,"groups",&mtop
->groups
,bShowNumbers
);
1453 void pr_top(FILE *fp
,int indent
,const char *title
,t_topology
*top
, gmx_bool bShowNumbers
)
1455 if (available(fp
,top
,indent
,title
)) {
1456 indent
=pr_title(fp
,indent
,title
);
1457 (void) pr_indent(fp
,indent
);
1458 (void) fprintf(fp
,"name=\"%s\"\n",*(top
->name
));
1459 pr_atoms(fp
,indent
,"atoms",&(top
->atoms
),bShowNumbers
);
1460 pr_atomtypes(fp
,indent
,"atomtypes",&(top
->atomtypes
),bShowNumbers
);
1461 pr_block(fp
,indent
,"cgs",&top
->cgs
, bShowNumbers
);
1462 pr_block(fp
,indent
,"mols",&top
->mols
, bShowNumbers
);
1463 pr_blocka(fp
,indent
,"excls",&top
->excls
, bShowNumbers
);
1464 pr_idef(fp
,indent
,"idef",&top
->idef
,bShowNumbers
);
1468 void pr_header(FILE *fp
,int indent
,const char *title
,t_tpxheader
*sh
)
1472 if (available(fp
,sh
,indent
,title
))
1474 indent
=pr_title(fp
,indent
,title
);
1475 pr_indent(fp
,indent
);
1476 fprintf(fp
,"bIr = %spresent\n",sh
->bIr
?"":"not ");
1477 pr_indent(fp
,indent
);
1478 fprintf(fp
,"bBox = %spresent\n",sh
->bBox
?"":"not ");
1479 pr_indent(fp
,indent
);
1480 fprintf(fp
,"bTop = %spresent\n",sh
->bTop
?"":"not ");
1481 pr_indent(fp
,indent
);
1482 fprintf(fp
,"bX = %spresent\n",sh
->bX
?"":"not ");
1483 pr_indent(fp
,indent
);
1484 fprintf(fp
,"bV = %spresent\n",sh
->bV
?"":"not ");
1485 pr_indent(fp
,indent
);
1486 fprintf(fp
,"bF = %spresent\n",sh
->bF
?"":"not ");
1488 pr_indent(fp
,indent
);
1489 fprintf(fp
,"natoms = %d\n",sh
->natoms
);
1490 pr_indent(fp
,indent
);
1491 fprintf(fp
,"lambda = %e\n",sh
->lambda
);
1495 void pr_commrec(FILE *fp
,int indent
,t_commrec
*cr
)
1497 pr_indent(fp
,indent
);
1498 fprintf(fp
,"commrec:\n");
1500 pr_indent(fp
,indent
);
1501 fprintf(fp
,"nodeid = %d\n",cr
->nodeid
);
1502 pr_indent(fp
,indent
);
1503 fprintf(fp
,"nnodes = %d\n",cr
->nnodes
);
1504 pr_indent(fp
,indent
);
1505 fprintf(fp
,"npmenodes = %d\n",cr
->npmenodes
);
1507 pr_indent(fp,indent);
1508 fprintf(fp,"threadid = %d\n",cr->threadid);
1509 pr_indent(fp,indent);
1510 fprintf(fp,"nthreads = %d\n",cr->nthreads);