1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mdejagnu-cpu=power8 -O3 -funroll-loops" } */
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
typedef long unsigned int size_t;
typedef struct _IO_FILE FILE;
typedef float real;
typedef real rvec[3];
typedef real matrix[3][3];
typedef real tensor[3][3];
enum
{
F_BONDS, F_G96BONDS, F_MORSE, F_CUBICBONDS, F_CONNBONDS, F_HARMONIC,
F_ANGLES, F_G96ANGLES, F_PDIHS, F_RBDIHS, F_IDIHS, F_LJ14, F_COUL14, F_LJ,
F_BHAM, F_LJLR, F_DISPCORR, F_SR, F_LR, F_WPOL, F_POSRES, F_DISRES,
F_DISRESVIOL, F_ORIRES, F_ORIRESDEV, F_ANGRES, F_ANGRESZ, F_SHAKE,
F_SHAKENC, F_SETTLE, F_DUMMY2, F_DUMMY3, F_DUMMY3FD, F_DUMMY3FAD,
F_DUMMY3OUT, F_DUMMY4FD, F_EQM, F_EPOT, F_EKIN, F_ETOT, F_TEMP, F_PRES,
F_DVDL, F_DVDLKIN, F_NRE
};
typedef union
{
struct
{
}
bham;
struct
{
real rA, krA, rB, krB;
}
harmonic;
}
t_iparams;
typedef struct
{
t_iparams *iparams;
}
t_idef;
typedef struct
{
}
t_inputrec;
typedef struct
{
}
t_commrec;
typedef struct
{
}
t_forcerec;
typedef struct
{
}
t_mdatoms;
typedef struct
{
}
t_filenm;
enum
{
eoPres, eoEpot, eoVir, eoDist, eoMu, eoForce, eoFx, eoFy, eoFz, eoPx, eoPy,
eoPz, eoPolarizability, eoDipole, eoObsNR, eoMemory =
eoObsNR, eoInter, eoUseVirial, eoNR
};
extern char *eoNames[eoNR];
typedef struct
{
int bPrint;
}
t_coupl_LJ;
typedef struct
{
int eObs;
t_iparams xi;
}
t_coupl_iparams;
typedef struct
{
real act_value[eoObsNR];
real av_value[eoObsNR];
real ref_value[eoObsNR];
int bObsUsed[eoObsNR];
int nLJ, nBU, nQ, nIP;
t_coupl_LJ *tcLJ;
}
t_coupl_rec;
void xvgr_legend ();
real calc_deviation ();
void pr_dev ();
static void
pr_ff (t_coupl_rec * tcr, real time, t_idef * idef, t_commrec * cr, int nfile,
t_filenm fnm[])
{
static FILE *prop;
static FILE **out = ((void *) 0);
static FILE **qq = ((void *) 0);
static FILE **ip = ((void *) 0);
char buf[256];
char *leg[] = {
"C12", "C6"
};
char **raleg;
int i, j, index;
if ((prop == ((void *) 0)) && (out == ((void *) 0)) && (qq == ((void *) 0))
&& (ip == ((void *) 0)))
{
for (i = j = 0; (i < eoObsNR); i++)
{
if (tcr->bObsUsed[i])
{
raleg[j++] =
(__extension__
(__builtin_constant_p (eoNames[i])
&& ((size_t) (const void *) ((eoNames[i]) + 1) -
(size_t) (const void *) (eoNames[i]) ==
1) ? (((const char *) (eoNames[i]))[0] ==
'\0' ? (char *) calloc ((size_t) 1,
(size_t) 1) : (
{
size_t
__len
=
strlen
(eoNames
[i])
+
1;
char
*__retval
=
(char
*)
malloc
(__len);
__retval;}
)): strdup (eoNames[i])));
raleg[j++] =
(__extension__
(__builtin_constant_p (buf)
&& ((size_t) (const void *) ((buf) + 1) -
(size_t) (const void *) (buf) ==
1) ? (((const char *) (buf))[0] ==
'\0' ? (char *) calloc ((size_t) 1,
(size_t) 1) : (
{
size_t
__len
=
strlen
(buf)
+
1;
char
*__retval
=
(char
*)
malloc
(__len);
__retval;}
)): strdup (buf)));
}
}
if (tcr->nLJ)
{
for (i = 0; (i < tcr->nLJ); i++)
{
if (tcr->tcLJ[i].bPrint)
{
xvgr_legend (out[i], (sizeof (leg) / sizeof ((leg)[0])),
leg);
}
}
}
}
}
void
do_coupling (FILE * log, int nfile, t_filenm fnm[], t_coupl_rec * tcr, real t,
int step, real ener[], t_forcerec * fr, t_inputrec * ir,
int bMaster, t_mdatoms * md, t_idef * idef, real mu_aver,
int nmols, t_commrec * cr, matrix box, tensor virial,
tensor pres, rvec mu_tot, rvec x[], rvec f[], int bDoIt)
{
int i, j, ati, atj, atnr2, type, ftype;
real deviation[eoObsNR], prdev[eoObsNR], epot0, dist, rmsf;
real ff6, ff12, ffa, ffb, ffc, ffq, factor, dt, mu_ind;
int bTest, bPrint;
t_coupl_iparams *tip;
if (bPrint)
{
pr_ff (tcr, t, idef, cr, nfile, fnm);
}
for (i = 0; (i < eoObsNR); i++)
{
deviation[i] =
calc_deviation (tcr->av_value[i], tcr->act_value[i],
tcr->ref_value[i]);
prdev[i] = tcr->ref_value[i] - tcr->act_value[i];
}
if (bPrint)
pr_dev (tcr, t, prdev, cr, nfile, fnm);
for (i = 0; (i < atnr2); i++)
{
factor = dt * deviation[tip->eObs];
switch (ftype)
{
case F_BONDS:
if (fabs (tip->xi.harmonic.krA) > 1.2e-38)
idef->iparams[type].harmonic.krA *=
(1 + factor / tip->xi.harmonic.krA);
}
}
}
|