Loading...
Searching...
No Matches
cosineTorsion.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_MOLMEC_PARAMETER_COSINETORSION_H
#define BALL_MOLMEC_PARAMETER_COSINETORSION_H
#ifndef BALL_FORMAT_PARAMETERSECTION_H
# include <BALL/FORMAT/parameterSection.h>
#endif
#ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
# include <BALL/MOLMEC/PARAMETER/atomTypes.h>
#endif
namespace BALL
{
class BALL_EXPORT CosineTorsion
: public ParameterSection
{
public:
enum
{
UNKNOWN
};
struct SingleValues
{
float phase;
float V;
float f;
float n;
SingleValues(const SingleValues& v)
: phase(v.phase),
V(v.V),
f(v.f),
n(v.n)
{
}
SingleValues()
: phase(0),
V(0),
f(0),
n(0)
{
}
bool operator == (const SingleValues& rhs) const
{
return ((phase == rhs.phase) && (V == rhs.V)
&& (f == rhs.f) && (n == rhs.n));
}
};
struct BALL_EXPORT Values
{
Size n;
SingleValues* values;
Values()
: n(0),
values(0)
{
}
Values(Size number)
: n((unsigned char)number),
values(new SingleValues[number])
{
}
Values(const Values& v)
{
n = v.n;
values = new SingleValues[n];
for (Position i = 0; i < n; i++)
{
values[i].phase = v.values[i].phase;
values[i].V = v.values[i].V;
values[i].f = v.values[i].f;
values[i].n = v.values[i].n;
}
}
void set(const Values& v)
{
delete [] values;
n = v.n;
values = new SingleValues[n];
for (Position i = 0; i < n; i++)
{
values[i] = v.values[i];
}
}
~Values()
{
delete [] values;
}
bool operator == (const Values& rhs) const
{
if (n != rhs.n)
{
return false;
}
for (Position i = 0; i < n; ++i)
{
if (!(values[i] == rhs.values[i]))
{
return false;
}
}
return true;
}
bool operator != (const Values& rhs) const
{
return ! operator == (rhs);
}
};
struct BALL_EXPORT Data
{
Atom* atom1;
Atom* atom2;
Atom* atom3;
Atom* atom4;
Values values;
};
struct BALL_EXPORT SingleData
{
Atom* atom1;
Atom* atom2;
Atom* atom3;
Atom* atom4;
SingleValues values;
};
CosineTorsion();
CosineTorsion(const CosineTorsion& cosine_torsion);
virtual ~CosineTorsion() ;
virtual void clear() ;
virtual bool extractSection(ForceFieldParameters& parameters, const String& section_name);
virtual bool extractSection(Parameters& parameters, const String& section_name);
bool hasParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const;
CosineTorsion::Values getParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const;
bool assignParameters(CosineTorsion::Values& parameters, Atom::Type I,
Atom::Type J, Atom::Type K, Atom::Type L) const;
CosineTorsion& operator = (const CosineTorsion& cosine_torsion);
bool operator == (const CosineTorsion& cosine_torsion) const;
protected:
Size number_of_atom_types_;
vector<Values> torsions_;
HashMap<Size, Size> torsion_hash_map_;
};
} // namespace BALL
#endif // BALL_MOLMEC_PARAMETER_COSINETORSION_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atomTypes.h
BALL::Atom
Definition atom.h:90
BALL::Atom::Type
short Type
Definition atom.h:103
BALL::CosineTorsion::~CosineTorsion
virtual ~CosineTorsion()
BALL::CosineTorsion::torsions_
vector< Values > torsions_
Definition cosineTorsion.h:233
BALL::CosineTorsion::hasParameters
bool hasParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
BALL::CosineTorsion::getParameters
CosineTorsion::Values getParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
BALL::CosineTorsion::extractSection
virtual bool extractSection(ForceFieldParameters &parameters, const String &section_name)
BALL::CosineTorsion::clear
virtual void clear()
BALL::CosineTorsion::CosineTorsion
CosineTorsion(const CosineTorsion &cosine_torsion)
BALL::CosineTorsion::assignParameters
bool assignParameters(CosineTorsion::Values &parameters, Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
BALL::CosineTorsion::torsion_hash_map_
HashMap< Size, Size > torsion_hash_map_
Definition cosineTorsion.h:235
BALL::CosineTorsion::extractSection
virtual bool extractSection(Parameters &parameters, const String &section_name)
BALL::CosineTorsion::UNKNOWN
@ UNKNOWN
Definition cosineTorsion.h:32
BALL::CosineTorsion::number_of_atom_types_
Size number_of_atom_types_
Definition cosineTorsion.h:231
BALL::CosineTorsion::CosineTorsion
CosineTorsion()
BALL::ForceFieldParameters
Definition forceFieldParameters.h:31
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::ParameterSection::ParameterSection
ParameterSection()
BALL::Parameters
Definition parameters.h:25
BALL::String
Definition string.h:57
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
parameterSection.h
BALL::CosineTorsion::Data
Definition cosineTorsion.h:137
BALL::CosineTorsion::Data::atom1
Atom * atom1
Definition cosineTorsion.h:138
BALL::CosineTorsion::Data::values
Values values
Definition cosineTorsion.h:143
BALL::CosineTorsion::Data::atom2
Atom * atom2
Definition cosineTorsion.h:139
BALL::CosineTorsion::Data::atom4
Atom * atom4
Definition cosineTorsion.h:141
BALL::CosineTorsion::Data::atom3
Atom * atom3
Definition cosineTorsion.h:140
BALL::CosineTorsion::SingleData
Definition cosineTorsion.h:147
BALL::CosineTorsion::SingleData::atom1
Atom * atom1
Definition cosineTorsion.h:148
BALL::CosineTorsion::SingleData::values
SingleValues values
Definition cosineTorsion.h:153
BALL::CosineTorsion::SingleData::atom2
Atom * atom2
Definition cosineTorsion.h:149
BALL::CosineTorsion::SingleData::atom3
Atom * atom3
Definition cosineTorsion.h:150
BALL::CosineTorsion::SingleData::atom4
Atom * atom4
Definition cosineTorsion.h:151
BALL::CosineTorsion::SingleValues
Definition cosineTorsion.h:36
BALL::CosineTorsion::SingleValues::n
float n
Definition cosineTorsion.h:40
BALL::CosineTorsion::SingleValues::SingleValues
SingleValues()
Definition cosineTorsion.h:50
BALL::CosineTorsion::SingleValues::f
float f
Definition cosineTorsion.h:39
BALL::CosineTorsion::SingleValues::phase
float phase
Definition cosineTorsion.h:37
BALL::CosineTorsion::SingleValues::SingleValues
SingleValues(const SingleValues &v)
Definition cosineTorsion.h:42
BALL::CosineTorsion::SingleValues::V
float V
Definition cosineTorsion.h:38
BALL::CosineTorsion::Values
Definition cosineTorsion.h:66
BALL::CosineTorsion::Values::~Values
~Values()
Definition cosineTorsion.h:109
BALL::CosineTorsion::Values::n
Size n
Definition cosineTorsion.h:68
BALL::CosineTorsion::Values::Values
Values()
Definition cosineTorsion.h:72
BALL::CosineTorsion::Values::set
void set(const Values &v)
Definition cosineTorsion.h:97
BALL::CosineTorsion::Values::values
SingleValues * values
Definition cosineTorsion.h:70
BALL::CosineTorsion::Values::Values
Values(const Values &v)
Definition cosineTorsion.h:84
BALL::CosineTorsion::Values::Values
Values(Size number)
Definition cosineTorsion.h:78