chemicalbasis.h
1 #ifndef CHEMICALBASIS_H
2 #define CHEMICALBASIS_H
3 
4 #include <map>
5 #include <vector>
6 #include "biolcccexception.h"
7 #include "chemicalgroup.h"
8 
9 namespace BioLCCC
10 {
11 
14 {
15 public:
17  ChemicalBasisException(std::string message);
18 };
19 
21 
29 {
37  ROD,
38 
43 };
44 
46 
52 {
54 
60 
66 };
67 
69 
87 {
88 public:
90  ChemicalBasis();
91 
93  ChemicalBasis(PredefinedChemicalBasis predefinedChemicalBasisId);
94 
96 
99  std::map<std::string, ChemicalGroup> & chemicalGroups();
100 
102 
105  const std::map<std::string, ChemicalGroup> & chemicalGroups() const;
106 
108  const ChemicalGroup & defaultNTerminus() const
109  throw(ChemicalBasisException);
110 
112  const ChemicalGroup & defaultCTerminus() const
113  throw(ChemicalBasisException);
114 
116 
120  void addChemicalGroup(ChemicalGroup newChemicalGroup);
121 
123 
127  void removeChemicalGroup(std::string label)
128  throw(ChemicalBasisException);
129 
131  void clearChemicalGroups();
132 
135  // Throws ChemicalBasisException if the chemical group is not found.
136  // \param label The label of the chemical group to be modified.
137  // \param newBindEnergy The new value of the bind energy.
138  //*/
139  //void setChemicalGroupBindEnergy(std::string label, double newBindEnergy);
140 
142 
145  double secondSolventBindEnergy() const;
146 
148 
151  void setSecondSolventBindEnergy(double newEnergy);
152 
154  void setPolymerModel(PolymerModel newModel);
155 
157  const PolymerModel polymerModel() const;
158 
160 
166  double monomerLength() const;
167 
169 
175  void setMonomerLength(double newMonomerLength)
176  throw(ChemicalBasisException);
177 
179 
196  double kuhnLength() const;
197 
199 
216  void setKuhnLength(double newKuhnLength)
217  throw(ChemicalBasisException);
218 
220 
227  double adsorptionLayerWidth() const;
228 
230 
237  void setAdsorptionLayerWidth(double newAdsorptionLayerWidth)
238  throw(ChemicalBasisException);
239 
241 
255  const std::vector<double> & adsorptionLayerFactors() const;
256 
258 
273  std::vector<double> newAdsorptionLayerFactors);
274 
276 
281  bool snyderApproximation() const;
282 
284 
289  void setSnyderApproximation(bool flag);
290 
292  bool specialRodModel() const;
293 
295 
305  void setSpecialRodModel(bool flag);
306 
308  bool neglectPartiallyDesorbedStates() const;
309 
311 
323  void setNeglectPartiallyDesorbedStates(bool flag);
324 
326  double firstSolventDensity() const;
327 
329  void setFirstSolventDensity(double newFirstSolventDensity)
330  throw(ChemicalBasisException);
331 
333  double secondSolventDensity() const;
334 
336  void setSecondSolventDensity(double newSecondSolventDensity)
337  throw(ChemicalBasisException);
338 
340  double firstSolventAverageMass() const;
341 
343  void setFirstSolventAverageMass(double newFirstSolventAverageMass)
344  throw(ChemicalBasisException);
345 
347  double secondSolventAverageMass() const;
348 
350  void setSecondSolventAverageMass(double newSecondSolventAverageMass)
351  throw(ChemicalBasisException);
352 
355  PredefinedChemicalBasis predefinedChemicalBasisId);
356 
357 private:
358  std::map<std::string,ChemicalGroup> mChemicalGroups;
359  double mSecondSolventBindEnergy;
360  double mMonomerLength;
361  double mKuhnLength;
362  double mAdsorptionLayerWidth;
363  std::vector<double> mAdsorptionLayerFactors;
364  PolymerModel mPolymerModel;
365  double mFirstSolventDensity;
366  double mSecondSolventDensity;
367  double mFirstSolventAverageMass;
368  double mSecondSolventAverageMass;
369  bool mSnyderApproximation;
370  bool mSpecialRodModel;
371  bool mNeglectPartiallyDesorbedStates;
372 };
373 
374 }
375 
376 #endif
bool snyderApproximation() const
Returns true if the energy of binary solvent is linearly fitted.
An instance of ChemicalBasis contains a set of BioLCCC constants.
Definition: chemicalbasis.h:86
bool specialRodModel() const
Returns true if equations for the special case of rod model are used.
PredefinedChemicalBasis
This enum describes the predefined sets of physicochemical constants.
Definition: chemicalbasis.h:51
Apart from classes, BioLCCC contains calculation methods and constants.
Definition: auxiliary.h:4
void setNeglectPartiallyDesorbedStates(bool flag)
Excludes partially desorbed states from calculation. FOR MODEL STUDY ONLY.
void setKuhnLength(double newKuhnLength)
Sets the Kuhn length of a molecule in angstroms.
void clearChemicalGroups()
Removes all chemical groups in a ChemicalBasis.
Base class for all BioLCCC exceptions. Can be used by itself.
void setSecondSolventBindEnergy(double newEnergy)
Sets newEnergy as the bind energy of the second solvent.
This exception is raised when something goes wrong with a ChemicalBasis.
Definition: chemicalbasis.h:13
std::map< std::string, ChemicalGroup > & chemicalGroups()
Returns the map of all chemical groups. Non-constant version.
void setSpecialRodModel(bool flag)
Enables the usage of the special equation for the rod model.
double adsorptionLayerWidth() const
Returns the width of a solid phase adsorption layer in ROD model.
double kuhnLength() const
Returns the Kuhn length of a polymer molecule in angstroms.
const ChemicalGroup & defaultNTerminus() const
Returns the default N-terminal group.
Reversed phase, ACN, trifluoracetic acid, CHAIN model.
Definition: chemicalbasis.h:58
void setSnyderApproximation(bool flag)
Enables the linear approximation of the energy of binary solvent.
double secondSolventBindEnergy() const
Returns the bind energy of the second solvent.
double firstSolventDensity() const
Returns the density of the first solvent in kg/m^3.
Reversed phase, ACN, formic acid, ROD model.
Definition: chemicalbasis.h:65
double secondSolventAverageMass() const
Returns the molecular mass of the second solvent in g/mol.
void setAdsorptionLayerWidth(double newAdsorptionLayerWidth)
Sets the width of a solid phase adsorption layer in ROD model.
A ChemicalGroup instance contains the properties of a group of atoms.
Definition: chemicalgroup.h:20
bool neglectPartiallyDesorbedStates() const
Returns true if partially desorbed states are neglected.
void addChemicalGroup(ChemicalGroup newChemicalGroup)
Adds newChemicalGroup to the ChemicalBasis.
double firstSolventAverageMass() const
Returns the molecular mass of the first solvent in g/mol.
void setFirstSolventDensity(double newFirstSolventDensity)
Sets the density of the first solvent in kg/m^3.
const PolymerModel polymerModel() const
Returns the model of a polymer (CHAIN or ROD).
double monomerLength() const
Returns the length of a single monomer in a polymer chain in angstroms.
ChemicalBasisException(std::string message)
Constructs an instance of ChemicalBasisException with the given message.
void setFirstSolventAverageMass(double newFirstSolventAverageMass)
Sets the molecular mass of the first solvent in g/mol.
PolymerModel
The model of polymer being used in calculations.
Definition: chemicalbasis.h:28
const std::vector< double > & adsorptionLayerFactors() const
Returns the absorption factors of the near-wall layers in CHAIN model.
ChemicalBasis setPredefinedChemicalBasis(PredefinedChemicalBasis predefinedChemicalBasisId)
Sets one of predefined chemical basis.
void setSecondSolventDensity(double newSecondSolventDensity)
Sets the density of the second solvent in kg/m^3.
void setMonomerLength(double newMonomerLength)
Sets the length of a single monomer in a polymer chain in angstroms.
const ChemicalGroup & defaultCTerminus() const
Returns the default C-terminal group.
void removeChemicalGroup(std::string label)
Removes a chemical group with the given label;.
ChemicalBasis()
Constructs an empty ChemicalBasis instance.
void setAdsorptionLayerFactors(std::vector< double > newAdsorptionLayerFactors)
Sets the absorption factors of the near-wall layers in CHAIN model.
void setSecondSolventAverageMass(double newSecondSolventAverageMass)
Sets the molecular mass of the second solvent in g/mol.
void setPolymerModel(PolymerModel newModel)
Sets the model of a polymer (CHAIN or ROD).
double secondSolventDensity() const
Returns the density of the second solvent in kg/m^3.