21 #include "COPSSImage.h"
43 #ifdef DEBUG_SNAPSHOT_
44 fprintf(stdout,
"Image method start runnning ... \n");
50 fprintf(stdout,
"check ids: ");
51 for (
size_t i = 0; i < nlocal_; i++)
53 fprintf(stdout,
"%d\n; ", ids[i]);
56 fprintf(stdout,
"check positions: ");
57 for (
size_t i=0; i< nlocal_; i++)
59 for (
size_t j=0; j<3; j++)
61 fprintf(stdout,
"%f; ", positions[i][j]);
65 fprintf(stdout,
"\ncheck forces: ");
66 for (
size_t i=0; i< nlocal_; i++)
68 for (
size_t j=0; j<3; j++)
70 fprintf(stdout,
"%f; ", forces[i][j]);
74 fprintf(stdout,
"\ncheck types: ");
75 for (
size_t i=0; i< nlocal_; i++)
77 fprintf(stdout,
"%d; ", types[i]);
80 fprintf(stdout,
"\ncheck charges: ");
81 for (
size_t i=0; i< nlocal_; i++)
83 fprintf(stdout,
"%f; ", charges[i]);
86 fprintf(stdout,
"\ncheck radius: ");
87 for (
size_t i=0; i< nlocal_; i++)
92 fprintf(stdout,
"\ncheck nlocal: %d\n", nlocal_);
93 fprintf(stdout,
"check eouter: %f\n",
eouter_);
94 fprintf(stdout,
"check qqrd2e: %f\n",
qqrd2e_);
95 fprintf(stdout,
"check einner: %f\n",
einner_);
104 for(
size_t i=0; i < nlocal_; i++)
if(i != j)
106 for(
size_t k=0; k < nlocal_; k++)
if (k != j)
152 Rxkj = positions_[kth][0] - positions_[jth][0];
153 Rykj = positions_[kth][1] - positions_[jth][1];
154 Rzkj = positions_[kth][2] - positions_[jth][2];
163 Rxij = positions_[ith][0] - positions_[jth][0];
164 Ryij = positions_[ith][1] - positions_[jth][1];
165 Rzij = positions_[ith][2] - positions_[jth][2];
185 std::vector<double> xg_(5);
188 for (
int ig = 0; ig <
ngauss; ++ig)
195 auxv_y_integ * auxv_y_integ +
196 auxv_z_integ * auxv_z_integ);
203 force_pol[0] *= ( 0.5 *
qqrd2e_ *
aux1 * charges_[ith] * charges_[kth] );
204 force_pol[1] *= ( 0.5 *
qqrd2e_ *
aux1 * charges_[ith] * charges_[kth] );
205 force_pol[2] *= ( 0.5 *
qqrd2e_ *
aux1 * charges_[ith] * charges_[kth] );
207 for (
size_t k = 0; k <3; ++k)
209 forces_[ith][k] += 2 * force_pol[k];
210 forces_[jth][k] -= 2 * force_pol[k];
void PostIntegration(Snapshot *snapshot, const CVList &) override
Post-integration hook.
double rij
Auxiliary variable r_ij.
const std::vector< double > & GetCharges() const
Access the atom charges.
int ion_type_start_
Where non polarizable particles start.
double Rykj
Auxiliary variable R_kj for image kernel functions (y component).
double wg0_[5]
Magic numbers for the weight.
unsigned GetNumAtoms() const
Get number of atoms in this snapshot.
double ukj
Auxiliary variable u_kj.
double eouter_
Dielectric constant of outside continuum.
std::vector< CollectiveVariable * > CVList
List of Collective Variables.
void PreSimulation(Snapshot *, const CVList &) override
Pre-simulation hook.
double xhi
Upper value for x.
double Rxij
Auxiliary variable R_ij (x component).
Class containing a snapshot of the current simulation in time.
double aux3Sqrt_delta
Auxiliary variable, square root of delta.
double auxv_x_integ
Auxiliary variable for integration (x component).
double wkj
Auxiliary variable w_kj.
double GetDielectric() const
Get dielectric constant.
double xlo
Lower value for x.
void force_pol(Snapshot *, size_t, size_t, size_t)
Image method kernel function, 1st order currently.
double aa
Auxiliary variable.
double vkj
Auxiliary variable v_kj.
double Getqqrd2e() const
Get qqrd2e value.
double Rxkj
Auxiliary variable R_kj for image kernel functions (x component).
double e_
Gauss integration auxiliary parameter e.
double aux3_integ
Auxiliary variable for integration.
double xg0_[5]
Magic numbers for x.
const Label & GetAtomTypes() const
Access the atom types.
double Rij2
Auxiliary variable R_ij squared.
double einner_
Dielectric constant of polarizable particles.
double auxv_y_delta
Auxiliary variable, delta (y component).
double rkj
Auxiliary variable r_kj.
double qqrd2e_
unit conversion constant.
double aux3_delta
Auxiliary variable, delta.
double aux1
Auxiliary variable.
double Rzij
Auxiliary variable R_ij (z component).
std::vector< double > atomTypeRadius_
List of radii for all atom types.
double Ryij
Auxiliary variable R_ij (y component).
double aux3Sqrt_integ
Auxiliary variable, square root of integration result.
double auxv_y_integ
Auxiliary variable for integration (y component).
int ngauss
Number of gaussian integrations.
double auxv_z_delta
Auxiliary variable, delta (z component).
double Rzkj
Auxiliary variable R_kj for image kernel functions (z component).
double auxv_x_delta
Auxiliary variable, delta (x component).
void PostSimulation(Snapshot *, const CVList &) override
Post-simulation hook.
double auxv_z_integ
Auxiliary variable for integration (z component).
double ginv_
Gauss integration auxiliary parameter g inverse.
double Rkj2
Auxiliary variable R_kj squared.
const std::vector< Vector3 > & GetForces() const
Access the per-particle forces.
const std::vector< Vector3 > & GetPositions() const
Access the particle positions.
double aux2
Yet another auxiliary variable.