MDStressLab++
Loading...
Searching...
No Matches
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
12
InteratomicForces::InteratomicForces
(
NeighList
* _nl_ptr)
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
34
InteratomicForces::~InteratomicForces
() {
35
// TODO Auto-generated destructor stub
36
}
37
InteratomicForces.h
InteratomicForces::nlOne_ptr
const NeighListOne * nlOne_ptr
Definition
InteratomicForces.h:16
InteratomicForces::~InteratomicForces
virtual ~InteratomicForces()
Definition
InteratomicForces.cpp:34
InteratomicForces::fij
std::vector< double > fij
Definition
InteratomicForces.h:17
InteratomicForces::InteratomicForces
InteratomicForces(NeighList *)
Definition
InteratomicForces.cpp:12
NeighListOne::Nneighbors
int * Nneighbors
Definition
neighbor_list.h:18
NeighListOne::cutoff
double cutoff
Definition
neighbor_list.h:17
NeighListOne::numberOfParticles
int numberOfParticles
Definition
neighbor_list.h:16
NeighList
Definition
neighbor_list.h:25
NeighList::lists
NeighListOne * lists
Definition
neighbor_list.h:27
NeighList::numberOfNeighborLists
int numberOfNeighborLists
Definition
neighbor_list.h:26
src
InteratomicForces.cpp
Generated by
1.9.8