| 1 |
< |
/* |
| 1 |
> |
/* |
| 2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
* |
| 4 |
|
* The University of Notre Dame grants you ("Licensee") a |
| 38 |
|
* University of Notre Dame has been advised of the possibility of |
| 39 |
|
* such damages. |
| 40 |
|
*/ |
| 41 |
< |
|
| 41 |
> |
|
| 42 |
|
#include "primitives/Atom.hpp" |
| 43 |
|
namespace oopse { |
| 44 |
+ |
|
| 45 |
+ |
Atom::Atom(AtomType* at) : StuntDouble(otAtom, &Snapshot::atomData), |
| 46 |
+ |
atomType_(at) { |
| 47 |
+ |
mass_ = at->getMass(); |
| 48 |
+ |
} |
| 49 |
|
|
| 50 |
< |
Atom::Atom(AtomType* at) : StuntDouble(otAtom, &Snapshot::atomData) ,atomType_(at) { |
| 46 |
< |
mass_ = at->getMass(); |
| 47 |
< |
} |
| 48 |
< |
|
| 49 |
< |
Mat3x3d Atom::getI() { |
| 50 |
> |
Mat3x3d Atom::getI() { |
| 51 |
|
return Mat3x3d::identity(); |
| 52 |
< |
} |
| 53 |
< |
|
| 54 |
< |
std::vector<double> Atom::getGrad() { |
| 55 |
< |
std::vector<double> grad(3); |
| 52 |
> |
} |
| 53 |
> |
|
| 54 |
> |
std::vector<RealType> Atom::getGrad() { |
| 55 |
> |
std::vector<RealType> grad(3); |
| 56 |
|
Vector3d force= getFrc(); |
| 57 |
< |
|
| 57 |
> |
|
| 58 |
|
grad[0] = -force[0]; |
| 59 |
|
grad[1] = -force[1]; |
| 60 |
|
grad[2] = -force[2]; |
| 61 |
|
|
| 62 |
|
return grad; |
| 63 |
< |
} |
| 64 |
< |
|
| 65 |
< |
void Atom::accept(BaseVisitor* v) { |
| 63 |
> |
} |
| 64 |
> |
|
| 65 |
> |
void Atom::accept(BaseVisitor* v) { |
| 66 |
|
v->visit(this); |
| 67 |
< |
} |
| 67 |
< |
|
| 67 |
> |
} |
| 68 |
|
} |