1 | /*
|
---|
2 | * Project: MoleCuilder
|
---|
3 | * Description: creates and alters molecular systems
|
---|
4 | * Copyright (C) 2010 University of Bonn. All rights reserved.
|
---|
5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * atom_bondedparticleinfo.cpp
|
---|
10 | *
|
---|
11 | * Created on: Oct 19, 2009
|
---|
12 | * Author: heber
|
---|
13 | */
|
---|
14 |
|
---|
15 | // include config.h
|
---|
16 | #ifdef HAVE_CONFIG_H
|
---|
17 | #include <config.h>
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #include "CodePatterns/MemDebug.hpp"
|
---|
21 |
|
---|
22 | #include "CodePatterns/Assert.hpp"
|
---|
23 |
|
---|
24 | #include "WorldTime.hpp"
|
---|
25 |
|
---|
26 | #include "atom_bondedparticleinfo.hpp"
|
---|
27 |
|
---|
28 | /** Constructor of class BondedParticleInfo.
|
---|
29 | */
|
---|
30 | BondedParticleInfo::BondedParticleInfo() :
|
---|
31 | AdaptiveOrder(0),
|
---|
32 | MaxOrder(false)
|
---|
33 | {}
|
---|
34 |
|
---|
35 | /** Destructor of class BondedParticleInfo.
|
---|
36 | */
|
---|
37 | BondedParticleInfo::~BondedParticleInfo()
|
---|
38 | {}
|
---|
39 |
|
---|
40 | void BondedParticleInfo::AppendTrajectoryStep()
|
---|
41 | {
|
---|
42 | ListOfBonds.push_back(BondList());
|
---|
43 | }
|
---|
44 |
|
---|
45 | const BondList& BondedParticleInfo::getListOfBonds() const
|
---|
46 | {
|
---|
47 | ASSERT(WorldTime::getTime() < ListOfBonds.size(),
|
---|
48 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
49 | +toString(WorldTime::getTime())
|
---|
50 | +" not in [0,"+toString(ListOfBonds.size())+").");
|
---|
51 | return ListOfBonds[WorldTime::getTime()];
|
---|
52 | }
|
---|
53 |
|
---|
54 | BondList& BondedParticleInfo::getListOfBonds()
|
---|
55 | {
|
---|
56 | const unsigned int size = ListOfBonds.size();
|
---|
57 | ASSERT(WorldTime::getTime() <= size,
|
---|
58 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
59 | +toString(WorldTime::getTime())
|
---|
60 | +" not in [0,"+toString(size)+"].");
|
---|
61 | if (WorldTime::getTime() == size) {
|
---|
62 | UpdateSteps();
|
---|
63 | }
|
---|
64 | return ListOfBonds[WorldTime::getTime()];
|
---|
65 | }
|
---|
66 |
|
---|
67 | const BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) const
|
---|
68 | {
|
---|
69 | ASSERT(_step < ListOfBonds.size(),
|
---|
70 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
71 | +toString(_step)
|
---|
72 | +" not in [0,"+toString(ListOfBonds.size())+").");
|
---|
73 | return ListOfBonds[_step];
|
---|
74 | }
|
---|
75 |
|
---|
76 | BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step)
|
---|
77 | {
|
---|
78 | const unsigned int size = ListOfBonds.size();
|
---|
79 | ASSERT(_step <= size,
|
---|
80 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
81 | +toString(_step)
|
---|
82 | +" not in [0,"+toString(size)+"].");
|
---|
83 | if (_step == size) {
|
---|
84 | UpdateSteps();
|
---|
85 | }
|
---|
86 | return ListOfBonds[_step];
|
---|
87 | }
|
---|