[bcf653] | 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 |
|
---|
[6b919f8] | 8 | /*
|
---|
| 9 | * atom_bondedparticleinfo.cpp
|
---|
| 10 | *
|
---|
| 11 | * Created on: Oct 19, 2009
|
---|
| 12 | * Author: heber
|
---|
| 13 | */
|
---|
| 14 |
|
---|
[bf3817] | 15 | // include config.h
|
---|
| 16 | #ifdef HAVE_CONFIG_H
|
---|
| 17 | #include <config.h>
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
[ad011c] | 20 | #include "CodePatterns/MemDebug.hpp"
|
---|
[112b09] | 21 |
|
---|
[9d83b6] | 22 | #include "CodePatterns/Assert.hpp"
|
---|
| 23 |
|
---|
| 24 | #include "WorldTime.hpp"
|
---|
| 25 |
|
---|
[6b919f8] | 26 | #include "atom_bondedparticleinfo.hpp"
|
---|
| 27 |
|
---|
| 28 | /** Constructor of class BondedParticleInfo.
|
---|
| 29 | */
|
---|
[97b825] | 30 | BondedParticleInfo::BondedParticleInfo() :
|
---|
| 31 | AdaptiveOrder(0),
|
---|
| 32 | MaxOrder(false)
|
---|
[9d83b6] | 33 | {}
|
---|
[6b919f8] | 34 |
|
---|
| 35 | /** Destructor of class BondedParticleInfo.
|
---|
| 36 | */
|
---|
| 37 | BondedParticleInfo::~BondedParticleInfo()
|
---|
[9d83b6] | 38 | {}
|
---|
| 39 |
|
---|
| 40 | const BondList& BondedParticleInfo::getListOfBonds() const
|
---|
| 41 | {
|
---|
| 42 | ASSERT(WorldTime::getTime() < ListOfBonds.size(),
|
---|
| 43 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
| 44 | +toString(WorldTime::getTime())
|
---|
| 45 | +" not in [0,"+toString(ListOfBonds.size())+").");
|
---|
| 46 | return ListOfBonds[WorldTime::getTime()];
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | BondList& BondedParticleInfo::getListOfBonds()
|
---|
| 50 | {
|
---|
| 51 | const unsigned int size = ListOfBonds.size();
|
---|
| 52 | ASSERT(WorldTime::getTime() <= size,
|
---|
| 53 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
| 54 | +toString(WorldTime::getTime())
|
---|
| 55 | +" not in [0,"+toString(size)+"].");
|
---|
| 56 | if (WorldTime::getTime() == size) {
|
---|
| 57 | ListOfBonds.push_back(BondList());
|
---|
| 58 | }
|
---|
| 59 | return ListOfBonds[WorldTime::getTime()];
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | const BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) const
|
---|
[6b919f8] | 63 | {
|
---|
[9d83b6] | 64 | ASSERT(_step < ListOfBonds.size(),
|
---|
| 65 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
| 66 | +toString(WorldTime::getTime())
|
---|
| 67 | +" not in [0,"+toString(ListOfBonds.size())+").");
|
---|
| 68 | return ListOfBonds[_step];
|
---|
| 69 | }
|
---|
[6b919f8] | 70 |
|
---|
[9d83b6] | 71 | BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step)
|
---|
| 72 | {
|
---|
| 73 | const unsigned int size = ListOfBonds.size();
|
---|
| 74 | ASSERT(_step <= size,
|
---|
| 75 | "BondedParticleInfo::getBondsAtStep() - Access out of range: "
|
---|
| 76 | +toString(_step)
|
---|
| 77 | +" not in [0,"+toString(size)+"].");
|
---|
| 78 | if (_step == size) {
|
---|
| 79 | ListOfBonds.push_back(BondList());
|
---|
| 80 | }
|
---|
| 81 | return ListOfBonds[_step];
|
---|
| 82 | }
|
---|