Skip to content

Commit

Permalink
Core: Removed analyze ..._mol
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfWeeber committed Nov 21, 2017
1 parent c7edcd8 commit 87879b9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 364 deletions.
1 change: 0 additions & 1 deletion src/core/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "statistics_chain.hpp"
#include "statistics_cluster.hpp"
#include "statistics_fluid.hpp"
#include "statistics_molecule.hpp"
#include "utils.hpp"
#include "utils/NoOp.hpp"
#include "virtual_sites.hpp"
Expand Down
115 changes: 0 additions & 115 deletions src/core/statistics_molecule.cpp

This file was deleted.

53 changes: 0 additions & 53 deletions src/core/statistics_molecule.hpp

This file was deleted.

180 changes: 0 additions & 180 deletions src/core/virtual_sites_com.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,185 +233,5 @@ Particle *get_mol_com_particle(Particle *calling_p){
return calling_p;
}

double get_mol_dist(Particle *p1,Particle *p2){
Particle *p1_com,*p2_com;
double dist[3],dist2;
p1_com=get_mol_com_particle(p1);
p2_com=get_mol_com_particle(p2);
#ifdef VIRTUAL_SITES_DEBUG
if (p1_com==nullptr){
runtimeErrorMsg() <<"COM Particle not found for particle in get_mol_dist id= " << p1->p.identity << "\n";
dist[0]=dist[1]=dist[2]=0.0;
}
if (p2_com==nullptr){
runtimeErrorMsg() <<"COM Particle not found for particle in get_mol_dist id= " << p2->p.identity << "\n";
dist[0]=dist[1]=dist[2]=0.0;
}
#endif
get_mi_vector(dist,p1_com->r.p, p2_com->r.p);
dist2=SQR(dist[0])+SQR(dist[1])+SQR(dist[2]);
return sqrt(dist2);
}

/** \name Statistic Functions */
/** \name Private Functions */
void calc_force_between_mol(int mol_id1,int mol_id2,double force[3]);
#ifdef ELECTROSTATICS
void calc_dipole_of_molecule(int mol_id,double dipole[4]);
#endif

Particle const&get_mol_com_particle_from_molid_cfg(int mol_id);
void get_mol_dist_vector_from_molid_cfg(int mol_id1,int mol_id2,double dist[3]);

double calc_pressure_mol(int type1,int type2){
double force[3], com_dist[3],psum=0;
int i,j,k,l,start;
for (i=0;i<n_molecules;i++){
if (topology[i].type == type1){
if (type1==type2){
start=i+1;
} else {
start=0;
}
for (j=start;j<n_molecules;j++){
for(l=0;l<3;l++)
force[l]=0;
if (topology[j].type == type2){
get_mol_dist_vector_from_molid_cfg(i,j,com_dist);
calc_force_between_mol(i,j,force);

for (k=0;k<3;k++){
psum+=force[k]*com_dist[k];
}

}
}
}
}
psum/=3.0;
return psum;
}

void calc_force_between_mol(int mol_id1,int mol_id2,double force[3]){
double vec12[3],dist2,dist;
auto & part_cfg = partCfg();
force[0]=force[1]=force[2]=0.0;
for (int i=0;i<topology[mol_id1].part.n;i++){
auto const& p1= part_cfg[topology[mol_id1].part.e[i]];
for (int j=0;j<topology[mol_id2].part.n;j++){
auto const& p2= part_cfg[topology[mol_id2].part.e[j]];

get_mi_vector(vec12,p1.r.p, p2.r.p);
dist2=sqrlen(vec12);
dist=sqrt(dist2);
#ifdef EXCLUSIONS
if(do_nonbonded(&p1,&p2))
#endif
calc_non_bonded_pair_force_from_partcfg_simple(&p1,&p2,vec12,dist,dist2,force);
}
}

}

double calc_energy_kinetic_mol(int type){
double E_kin=0;
for (int i=0;i<n_molecules;i++){
if (topology[i].type == type){
auto const&p_com=get_mol_com_particle_from_molid_cfg(i);
#ifdef VIRTUAL_SITES_DEBUG
if (!ifParticleIsVirtual(p_com)){
return -(i);
}
#endif
E_kin+=p_com.p.mass*sqrlen(p_com.m.v);
}
}
E_kin*=0.5/time_step/time_step;
return E_kin;
}

#ifdef ELECTROSTATICS
void calc_absolute_dipolmoment_mol(int type,double average_dipole[2]){
int i,j,count=0;
double dipole[4],tmp;
average_dipole[0]=average_dipole[1]=0.0;
for (i=0;i<n_molecules;i++){
if (topology[i].type == type){
count++;
calc_dipole_of_molecule(i,dipole);
tmp=0.0;
for (j=0;j<3;j++){
tmp+=dipole[j]*dipole[j];
}
average_dipole[0]+=tmp;
average_dipole[1]+=dipole[3];
}
}
average_dipole[0]/=count;
average_dipole[1]/=count;
}

void calc_total_dipolmoment_mol(int type,double total_dipole[4]){
int i,j;
double dipole[4];
total_dipole[0]=total_dipole[1]=total_dipole[2]=total_dipole[3]=0.0;
for (i=0;i<n_molecules;i++){
if (topology[i].type == type){
calc_dipole_of_molecule(i,dipole);
for (j=0;j<4;j++){
total_dipole[j]+=dipole[j];
}
}
}
}

void calc_dipole_of_molecule(int mol_id,double dipole[4]){
int j,k;
Particle *p,*p_first=nullptr;
double vec12[3];
dipole[0]=dipole[1]=dipole[2]=dipole[3]=0.0;
for (j=0;j<topology[mol_id].part.n;j++){
p=&partCfg[topology[mol_id].part.e[j]];
if (ifParticleIsVirtual(p)) continue;
if (p_first==nullptr){
p_first=p;
}
else
{
get_mi_vector(vec12,p->r.p, p_first->r.p);
for (k=0;k<3;k++){
dipole[k] += p->p.q*vec12[k];
}
}
dipole[3]+=p->p.q;
}
}
#endif

Particle const&get_mol_com_particle_from_molid_cfg(int mol_id){
for (int i=0;i<topology[mol_id].part.n;i++){
auto const&p= partCfg()[topology[mol_id].part.e[i]];
if (ifParticleIsVirtual(p)){
return p;
}
}
}

double get_mol_dist_partcfg(Particle *p1,Particle *p2){
double dist[3],dist2;
int mol_id1,mol_id2;
mol_id1=p1->p.mol_id;
mol_id2=p2->p.mol_id;
get_mol_dist_vector_from_molid_cfg(mol_id1,mol_id2,dist);
dist2=SQR(dist[0])+SQR(dist[1])+SQR(dist[2]);
return sqrt(dist2);
}

void get_mol_dist_vector_from_molid_cfg(int mol_id1,int mol_id2,double dist[3]){
auto const& p1_com=get_mol_com_particle_from_molid_cfg(mol_id1);
auto const& p2_com=get_mol_com_particle_from_molid_cfg(mol_id2);

get_mi_vector(dist,p1_com.r.p, p2_com.r.p);
}

#endif
15 changes: 0 additions & 15 deletions src/core/virtual_sites_com.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ void distribute_mol_force();
// particle
Particle *get_mol_com_particle(Particle *calling_p);

// Gets the (first) virtual particles in the molecules of the given particles
// and returns their distance
double get_mol_dist(Particle *p1, Particle *p2);

// Distance between molecules in the partcfg data structure
double get_mol_dist_partcfg(Particle *p1, Particle *p2);

double calc_pressure_mol(int type1, int type2);
double calc_energy_kinetic_mol(int type);

#ifdef ELECTROSTATICS
void calc_total_dipolmoment_mol(int type, double total_dipole[4]);
void calc_absolute_dipolmoment_mol(int type, double total_dipole[2]);
#endif

#endif

#endif

0 comments on commit 87879b9

Please sign in to comment.