MDStressLab++
InteratomicForces.cpp
Go to the documentation of this file.
1 /*
2  * InteratomicForces.cpp
3  *
4  * Created on: Nov 21, 2019
5  * Author: Nikhil
6  */
7 
8 #include "InteratomicForces.h"
9 #include<iostream>
10 
11 // Instantiate interatomic forces from neighbor list
13 {
14  int numberOfNeighborLists= _nl_ptr->numberOfNeighborLists;
15  double maxCutoff= 0.0;
16  int chosenListIndex= 0;
17  for(int i=0; i<numberOfNeighborLists; i++)
18  {
19  double cutoff= _nl_ptr->lists[i].cutoff;
20  if ( cutoff > maxCutoff)
21  {
22  maxCutoff= cutoff;
23  chosenListIndex= i;
24  }
25  }
26 
27  int size=0;
28  int numberOfParticles= _nl_ptr->lists[chosenListIndex].numberOfParticles;
29  for(int i=0; i<numberOfParticles;i++) size+= _nl_ptr->lists[chosenListIndex].Nneighbors[i];
30  fij.resize(size,0.0);
31  nlOne_ptr= _nl_ptr->lists+chosenListIndex;
32 }
33 
35  // TODO Auto-generated destructor stub
36 }
37 
int numberOfNeighborLists
Definition: neighbor_list.h:26
int numberOfParticles
Definition: neighbor_list.h:16
NeighListOne * lists
Definition: neighbor_list.h:27
InteratomicForces(NeighList *)
std::vector< double > fij
const NeighListOne * nlOne_ptr
int * Nneighbors
Definition: neighbor_list.h:18