diff --git a/CHANGELOG.md b/CHANGELOG.md
index 547f6e9..ee3fa60 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@
* only documentation of principal version changes in CHANGELOG
LeMonADE 1.0
-* bare copy of LeMonADE library from ITP (Leibniz-Institute for Polymer Research IPF) with basic functinonalities
+* bare copy of LeMonADE library from ITP (Leibniz-Institute of Polymer Research Dresden IPF) with basic functionalities
LeMonADE 2.0
* adding abstract system setup Updater: UpdaterAbstractCreate
@@ -25,3 +25,7 @@ LeMonADE 2.2
* add analyzers for the calculation of the mean-square displacement
* add various features and moves to enable reactive and reversible bonds
+LeMonADE 2.2.2
+* HotFix for default R250 values
+* ColdFix for implementation of RNG Mersenne Twister
+* ColdFix for ResultFormattingTools
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ee0fe0..24abd6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,10 +31,10 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
PROJECT (LeMonADE)
SET (APPLICATION_NAME "LeMonADE")
SET (APPLICATION_CODENAME "${PROJECT_NAME}")
-SET (APPLICATION_COPYRIGHT_YEARS "2013-2020")
+SET (APPLICATION_COPYRIGHT_YEARS "2013-2021")
SET (APPLICATION_VERSION_MAJOR "2")
SET (APPLICATION_VERSION_MINOR "2")
-SET (APPLICATION_VERSION_PATCH "1")
+SET (APPLICATION_VERSION_PATCH "2")
#
diff --git a/README.md b/README.md
index 0fd4126..7e7daad 100644
--- a/README.md
+++ b/README.md
@@ -103,6 +103,8 @@ Find the information about active developers, former contributors, and people wh
## References
This library has been used in the following publications (without guarantee for completeness)
+* *"Multimolecular Structure Formation with Linear Dendritic Copolymers"*; M. Wengenmayr, R. Dockhorn, J.-U. Sommer; [Macromolecules XX, XXXX-XXXX (2021)](https://doi.org/10.1021/acs.macromol.1c00226)
+* *"Analysis of the Gel Point of Polymer Model Networks by Computer Simulations"*; M. Lang, T. Müller; [Macromolecules 53, 498-512 (2020)](https://doi.org/10.1021/acs.macromol.9b02217)
* *"Polyolefins Formed by Chain Walking Catalysis—A Matter of Branching Density Only?"*; R. Dockhorn, L. Plüschke, M. Geisler, J. Zessin, P. Lindner, R. Mundil, J. Merna, J.-U. Sommer, A. Lederer; [J. Am. Chem. Soc. 141, 15586–15596 (2019)](https://pubs.acs.org/doi/10.1021/jacs.9b06785)
* *"Tendomers – force sensitive bis-rotaxanes with jump-like deformation behavior"*; T. Müller, J.-U. Sommer, M. Lang; [Soft Matter, 15, 3671-3679 (2019)](https://doi.org/10.1039/C9SM00292H)
* *"Dendrimers in Solution of Linear Polymers: Crowding Effects"*; M. Wengenmayr, R. Dockhorn, J.-U. Sommer; [Macromolecules 52, 2616–2626 (2019)](https://doi.org/10.1021/acs.macromol.9b00010)
diff --git a/include/LeMonADE/Version.h b/include/LeMonADE/Version.h
index 3723ddd..48683c8 100644
--- a/include/LeMonADE/Version.h
+++ b/include/LeMonADE/Version.h
@@ -37,12 +37,12 @@ along with LeMonADE. If not, see .
#define APPLICATION_NAME "LeMonADE"
#define APPLICATION_CODENAME "LeMonADE"
-#define APPLICATION_COPYRIGHT_YEARS "2013-2020"
+#define APPLICATION_COPYRIGHT_YEARS "2013-2021"
#define APPLICATION_VERSION_MAJOR 2
#define APPLICATION_VERSION_MINOR 2
-#define APPLICATION_VERSION_PATCH 1
+#define APPLICATION_VERSION_PATCH 2
#define APPLICATION_VERSION_TYPE "Release"
-#define APPLICATION_VERSION_STRING "2.2.1-(C)2013-2020-Release"
+#define APPLICATION_VERSION_STRING "2.2.2-(C)2013-2021-Release"
#define APPLICATION_ID "LeMonADE.LeMonADE"
#ifndef APPLICATION_VERSION_MAJOR
diff --git a/include/LeMonADE/analyzer/AnalyzerAbstractDump.h b/include/LeMonADE/analyzer/AnalyzerAbstractDump.h
index 8979a1e..5c56d36 100644
--- a/include/LeMonADE/analyzer/AnalyzerAbstractDump.h
+++ b/include/LeMonADE/analyzer/AnalyzerAbstractDump.h
@@ -15,8 +15,6 @@
#include
#include
#include
-#include
-#include
/*************************************************************************
* definition of AnalyzerAbstractDump class
@@ -98,8 +96,12 @@ template < class IngredientsType , class T > class AnalyzerAbstractDump : public
uint32_t getNumberOfColumns(){ return NColumns; }
//! set the buffer size for dumping data
void setBufferSize(uint32_t bufferSize_){ bufferSize=bufferSize_;}
- //! get the buffer size
- uint32_t getBufferSize(){return bufferSize;}
+ //! get the buffer size
+ uint32_t getBufferSize(){return bufferSize;}
+ //! get the variable isFirstFileDump
+ bool getIsFirstFileDump() const { return isFirstFileDump; }
+ //! reset the variable isFirstFileDump to false (could be used if the filename changes in between data dumpings)
+ void resetIsFirstFileDump() {isFirstFileDump=true;}
};
/*************************************************************************
diff --git a/include/LeMonADE/analyzer/AnalyzerWriteBfmFile.h b/include/LeMonADE/analyzer/AnalyzerWriteBfmFile.h
index 06d6d7f..4529359 100644
--- a/include/LeMonADE/analyzer/AnalyzerWriteBfmFile.h
+++ b/include/LeMonADE/analyzer/AnalyzerWriteBfmFile.h
@@ -134,6 +134,11 @@ class AnalyzerWriteBfmFile: public AbstractAnalyzer
*
**/
virtual void cleanup(){};
+protected:
+
+ //! set the name of the file for output which only works for the overwrite case
+ void setFilename(std::string filename){_filename=filename;}
+
private:
//! Write Writes that only need to be in the header
void writeHeader();
diff --git a/include/LeMonADE/core/Molecules.h b/include/LeMonADE/core/Molecules.h
index d3de749..4967c48 100644
--- a/include/LeMonADE/core/Molecules.h
+++ b/include/LeMonADE/core/Molecules.h
@@ -133,7 +133,7 @@ template < class Vertex, uint max_connectivity = 7, class Edge = int > class Mol
*
* @return The actual time in the graph.
*/
- const uint64_t getAge() const {return myAge;}
+ uint64_t getAge() const {return myAge;}
/**
diff --git a/include/LeMonADE/feature/FeatureBondset.h b/include/LeMonADE/feature/FeatureBondset.h
index 3ae213e..0bc8e64 100644
--- a/include/LeMonADE/feature/FeatureBondset.h
+++ b/include/LeMonADE/feature/FeatureBondset.h
@@ -223,17 +223,15 @@ class FeatureBondset : public Feature
template
bool checkMove(const IngredientsType& ingredients, const MoveLabelBase& move) const
{
-
- //get the number of bond partners of the particle to be moved
- int32_t MonID=move.getIndex()+move.getDir();
- if ( MonID == -1 ) return false;
- uint32_t ID=move.getConnectedLabel();
- const typename IngredientsType::molecules_type& molecules=ingredients.getMolecules();
- if (ID == 0 ) return true;
- ID--;
- auto bond(molecules[MonID].getVector3D()-molecules[ID].getVector3D());
- if (!bondset.isValidStrongCheck( bond ) ) return false;
- if ( bond.getLength()>3.) return false; // otherwise I could get xtraps
+ //get the number of bond partners of the particle to be moved
+ int32_t MonID=move.getIndex()+move.getDir();
+ if ( MonID == -1 ) return false;
+ uint32_t ID=move.getConnectedLabel();
+ const typename IngredientsType::molecules_type& molecules=ingredients.getMolecules();
+ if (ID == 0 ) return true;
+ ID--;
+ auto bond(molecules[MonID].getVector3D()-molecules[ID].getVector3D());
+ if (!bondset.isValidStrongCheck( bond ) ) return false;
return true;
}
diff --git a/include/LeMonADE/feature/FeatureLabel.h b/include/LeMonADE/feature/FeatureLabel.h
index 7eece62..976ec6f 100644
--- a/include/LeMonADE/feature/FeatureLabel.h
+++ b/include/LeMonADE/feature/FeatureLabel.h
@@ -55,7 +55,7 @@ class MonomerLabel
MonomerLabel():label(0){}
//! is labeled
- const uint32_t getLabel() const {return label;}
+ uint32_t getLabel() const {return label;}
//! set label on/off
void setLabel(uint32_t label_){ label=label_;}
diff --git a/include/LeMonADE/feature/FeatureLinearForce.h b/include/LeMonADE/feature/FeatureLinearForce.h
new file mode 100644
index 0000000..4b8e8a6
--- /dev/null
+++ b/include/LeMonADE/feature/FeatureLinearForce.h
@@ -0,0 +1,317 @@
+/*--------------------------------------------------------------------------------
+ ooo L attice-based |
+ o\.|./o e xtensible | LeMonADE: An Open Source Implementation of the
+ o\.\|/./o Mon te-Carlo | Bond-Fluctuation-Model for Polymers
+oo---0---oo A lgorithm and |
+ o/./|\.\o D evelopment | Copyright (C) 2013-2015 by
+ o/.|.\o E nvironment | LeMonADE Principal Developers (see AUTHORS)
+ ooo |
+----------------------------------------------------------------------------------
+
+This file is part of LeMonADE.
+
+LeMonADE is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+LeMonADE is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with LeMonADE. If not, see .
+
+--------------------------------------------------------------------------------*/
+
+#ifndef LEMONADE_LINEARFORCE_H
+#define LEMONADE_LINEARFORCE_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*****************************************************************************/
+/**
+ * @file
+ * @date 2021/03/18
+ * @author Toni & Bodonki
+ *
+ * @class FeatureLinearForce
+ * @brief This Feature applies a force on certain monomers.
+ * @todo Substitute the FeatureAttributes<> by appropriate monomer extension
+ * */
+/*****************************************************************************/
+
+
+
+
+class FeatureLinearForce:public Feature
+{
+public:
+
+ FeatureLinearForce(): ForceOn(false){};
+ virtual ~FeatureLinearForce(){};
+
+ //the FeatureBoltzmann: adds a probability for the move
+ //the FeatureAttributes<>: labels the monomers for beeing force sensitive
+ typedef LOKI_TYPELIST_2(FeatureBoltzmann,FeatureAttributes<>) required_features_back;
+
+ //! For all unknown moves: this does nothing
+ template
+ bool checkMove(const IngredientsType& ingredients,const MoveBase& move) const{return true;};
+
+ //! check for a MoveLocalSc
+ template
+ bool checkMove(const IngredientsType& ingredients,MoveLocalSc& move) const;
+
+ //! check for a MoveLocalScDiag
+ template
+ bool checkMove(const IngredientsType& ingredients,MoveLocalScDiag& move) const;
+
+ //! set the strength of the force
+ void setAmplitudeForce(double amplitudeForce){
+ Amplitude_Force = amplitudeForce;
+ prob=exp(-Amplitude_Force);
+ }
+
+ //! set force on or off
+ void setForceOn(bool forceOn){ForceOn = forceOn;}
+
+ //! get strength of the force
+ double getAmplitudeForce() const {return Amplitude_Force;}
+
+ //! applies a force on the monomers or not
+ bool isForceOn() const {return ForceOn;}
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportRead(FileImport & fileReader);
+
+ //! Export the relevant functionality for writing bfm-files to the responsible writer object
+ template
+ void exportWrite(AnalyzerWriteBfmFile & fileWriter) const;
+private:
+
+ //! Force is On (True) or Off (False)
+ bool ForceOn;
+ //! force in x direction
+ double Amplitude_Force;
+ //!probability
+ double prob;
+
+};
+////////////////////////////////////////////////////////////////////////////////
+//////////define member functions //////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+template
+bool FeatureLinearForce::checkMove(const IngredientsType& ingredients, MoveLocalSc& move) const
+{
+ if(ForceOn){
+
+ const uint32_t monoIndex(move.getIndex());
+ const int32_t tag(ingredients.getMolecules()[monoIndex].getAttributeTag());
+ const int32_t dx(move.getDir().getX());
+ //Metropolis: zeta = exp (-dV)
+ //dV=f*dr
+ // positive force applied on attribute 4 and negative force on attribute 5
+ if( ( tag == 4 ) && ( dx == 1 ) ){
+ move.multiplyProbability(prob);
+ return true;
+ }
+ if( ( tag == 5 ) && ( dx == -1 ) ){
+ move.multiplyProbability(prob);
+ return true;
+ }
+ }
+ return true;
+}
+template
+bool FeatureLinearForce::checkMove(const IngredientsType& ingredients, MoveLocalScDiag& move) const
+{
+ if(ForceOn){
+ const uint32_t monoIndex(move.getIndex());
+ const int32_t tag(ingredients.getMolecules()[monoIndex].getAttributeTag());
+ const int32_t dx(move.getDir().getX());
+ //Metropolis: zeta = exp (-dV)
+ //dV=f*dr
+ // positive force applied on attribute 4 and negative force on attribute 5
+ if( ( tag == 4 ) && ( dx == 1 ) ){
+ move.multiplyProbability(prob);
+ return true;
+ }
+ if( ( tag == 5 ) && ( dx == -1 ) ){
+ move.multiplyProbability(prob);
+ return true;
+ }
+ }
+ return true;
+}
+
+/*****************************************************************/
+/**
+ * @class ReadForceFieldOn
+ *
+ * @brief Handles BFM-File-Reads \b #!force_field_on
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadForceFieldOn: public ReadToDestination
+{
+public:
+ ReadForceFieldOn(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadForceFieldOn(){}
+ virtual void execute();
+};
+
+template
+void ReadForceFieldOn::execute()
+{
+ std::cout<<"reading FieldIsOn...";
+
+ bool fieldIsOn = false;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ fieldIsOn = atoi(line.c_str());
+ std::cout << "#!force_field_on=" << (fieldIsOn? "True" : " False" ) << std::endl;
+
+ ingredients.setForceOn(fieldIsOn);
+}
+
+/*****************************************************************/
+/**
+ * @class WriteForceFieldOn
+ *
+ * @brief Handles BFM-File-Write \b #!force_field_on
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriteForceFieldOn:public AbstractWrite
+{
+public:
+ WriteForceFieldOn(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(false);}
+
+ virtual ~WriteForceFieldOn(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriteForceFieldOn::writeStream(std::ostream& stream)
+{
+ stream<<"#!force_field_on=" << (this->getSource().isForceOn() ? "1" : "0") << std::endl<< std::endl;
+}
+
+
+/*****************************************************************/
+/**
+ * @class ReadAmplitudeForce
+ *
+ * @brief Handles BFM-File-Reads \b #!force_amplitude
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadAmplitudeForce: public ReadToDestination
+{
+public:
+ ReadAmplitudeForce(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadAmplitudeForce(){}
+ virtual void execute();
+};
+
+template
+void ReadAmplitudeForce::execute()
+{
+ std::cout<<"reading AmplitudeForce...";
+
+ double amplitudeForce = 0.0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ amplitudeForce = atof(line.c_str());
+ std::cout << "#!force_amplitude=" << (amplitudeForce) << std::endl;
+
+ ingredients.setAmplitudeForce(amplitudeForce);
+}
+
+
+/*****************************************************************/
+/**
+ * @class WriteAmplitudeForce
+ *
+ * @brief Handles BFM-File-Write \b #!force_amplitude
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriteAmplitudeForce:public AbstractWrite
+{
+public:
+ WriteAmplitudeForce(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(false);}
+
+ virtual ~WriteAmplitudeForce(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriteAmplitudeForce::writeStream(std::ostream& stream)
+{
+ stream<<"#!force_amplitude=" << (this->getSource().getAmplitudeForce()) << std::endl<< std::endl;
+}
+
+
+
+/**
+ * @details The function is called by the Ingredients class when an object of type Ingredients
+ * is associated with an object of type FileImport. The export of the Reads is thus
+ * taken care automatically when it becomes necessary.\n
+ * Registered Read-In Commands:
+ * * #!shear_field_on
+ * * #!force_amplitude
+ *
+ * @param fileReader File importer for the bfm-file
+ * @param destination List of Feature to write-in from the read values.
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+void FeatureLinearForce::exportRead(FileImport< IngredientsType >& fileReader)
+{
+ fileReader.registerRead("#!force_field_on", new ReadForceFieldOn(*this));
+ fileReader.registerRead("#!force_amplitude", new ReadAmplitudeForce(*this));
+
+}
+
+/**
+ * The function is called by the Ingredients class when an object of type Ingredients
+ * is associated with an object of type AnalyzerWriteBfmFile. The export of the Writes is thus
+ * taken care automatically when it becomes necessary.\n
+ * Registered Write-Out Commands:
+ * * #!shear_field_on
+ * * #!force_amplitude
+ *
+ * @param fileWriter File writer for the bfm-file.
+ */
+template
+void FeatureLinearForce::exportWrite(AnalyzerWriteBfmFile< IngredientsType >& fileWriter) const
+{
+ fileWriter.registerWrite("#!force_field_on",new WriteForceFieldOn(*this));
+ fileWriter.registerWrite("#!force_amplitude", new WriteAmplitudeForce(*this));
+
+}
+
+
+
+
+#endif /*FEATURE_LINEARFORCE_H*/
diff --git a/include/LeMonADE/feature/FeatureReactiveBonds.h b/include/LeMonADE/feature/FeatureReactiveBonds.h
index d501a2a..80570e5 100644
--- a/include/LeMonADE/feature/FeatureReactiveBonds.h
+++ b/include/LeMonADE/feature/FeatureReactiveBonds.h
@@ -60,10 +60,10 @@ class MonomerReactivity
MonomerReactivity():reactivity(false),numMaxLinks(0){}
//! Getting the reactivity of the monomer.
- const bool isReactive() const {return reactivity;}
+ bool isReactive() const {return reactivity;}
//! Getting the number of maximum possible bonds for the monomer.
- const uint32_t getNumMaxLinks() const {return numMaxLinks;};
+ uint32_t getNumMaxLinks() const {return numMaxLinks;};
MonomerReactivity& operator= (const MonomerReactivity source)
{
@@ -79,13 +79,13 @@ class MonomerReactivity
numMaxLinks = react.getNumMaxLinks();
/// \todo There should be a check in the function to test against the "default" maximum connectivity for consistency reason.
}
- const bool operator == (const MonomerReactivity &react) const
+ bool operator == (const MonomerReactivity &react) const
{
if ( react.getNumMaxLinks() != numMaxLinks ) return false;
if ( react.isReactive() != reactivity ) return false;
return true;
}
- const bool operator!= (const MonomerReactivity &react) const
+ bool operator!= (const MonomerReactivity &react) const
{
return !(*this == react);
}
@@ -205,103 +205,113 @@ class WriteReactivity:public AbstractWrite
///////////////////////////////////////////////////////////////////////////////
class FeatureReactiveBonds : public Feature {
- typedef std::pair < uint32_t, uint32_t > BondPair;
- typedef uint32_t edge_type;
+ typedef std::pair < uint32_t, uint32_t > BondPair;
+ typedef uint32_t edge_type;
public:
- //! This Feature requires a monomer_extensions.
- typedef LOKI_TYPELIST_1(MonomerReactivity) monomer_extensions;
- typedef LOKI_TYPELIST_2(FeatureBreak, FeatureConnectionSc) required_features_back;
+ //! This Feature requires a monomer_extensions.
+ typedef LOKI_TYPELIST_1(MonomerReactivity) monomer_extensions;
+ typedef LOKI_TYPELIST_2(FeatureBreak, FeatureConnectionSc) required_features_back;
+
+ FeatureReactiveBonds():nReactedBonds(0),nReactiveSites(0){};
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportRead(FileImport& fileReader);
+
+ //! Export the relevant functionality for writing bfm-files to the responsible writer object
+ template
+ void exportWrite(AnalyzerWriteBfmFile& fileWriter) const;
- FeatureReactiveBonds():nReactedBonds(0),nReactiveSites(0){};
+ //! check base move - always true
+ template
+ bool checkMove(const IngredientsType& ingredients, const MoveBase& move) const{return true;};
+
+ //! check base connection move
+ template
+ bool checkMove(const IngredientsType& ingredients, const MoveConnectBase& move) const;
+
+ //! check base break move
+ template
+ bool checkMove(const IngredientsType& ingredients, const MoveBreakBase& move) const ;
+
+ //! check movebreakreactive
+ template
+ bool checkMove(const IngredientsType& ingredients, const MoveBreakReactive& move) const {return true;};
+
+ //!apply move for the connection moves
+ template
+ void applyMove(IngredientsType& ing, const MoveBase& move){};
+
+ //!apply move for the connection moves
+ template
+ void applyMove(IngredientsType& ing, const MoveConnectBase& move);
+
+ //!apply move for the breaking moves
+ template
+ void applyMove(IngredientsType& ing, const MoveBreakBase& move);
+
+ //! Synchronize, count the number of reactive sites and reacted bonds
+ template
+ void synchronize(IngredientsType& ingredients);
- //! Export the relevant functionality for reading bfm-files to the responsible reader object
- template
- void exportRead(FileImport& fileReader);
+ //!returns the number of bond made of two reactive monomers
+ uint32_t getNReactedBonds() const { return BondedReactiveMonomers.size(); };
- //! Export the relevant functionality for writing bfm-files to the responsible writer object
- template
- void exportWrite(AnalyzerWriteBfmFile& fileWriter) const;
-
- //! check base move - always true
- template
- bool checkMove(const IngredientsType& ingredients, const MoveBase& move) const{return true;};
-
- //! check base connection move
- template
- bool checkMove(const IngredientsType& ingredients, const MoveConnectBase& move) const;
-
- //! check base break move
- template
- bool checkMove(const IngredientsType& ingredients, const MoveBreakBase& move) const ;
-
- //! check movebreakreactive
- template
- bool checkMove(const IngredientsType& ingredients, const MoveBreakReactive& move) const ;
-
- //!apply move for the connection moves
- template
- void applyMove(IngredientsType& ing, const MoveBase& move){};
-
- //!apply move for the connection moves
- template
- void applyMove(IngredientsType& ing, const MoveConnectBase& move);
-
- //!apply move for the breaking moves
- template
- void applyMove(IngredientsType& ing, const MoveBreakBase& move);
-
- //! Synchronize, count the number of reactive sites and reacted bonds
- template
- void synchronize(IngredientsType& ingredients);
-
- uint32_t getNReactedBonds() const {
-// return nReactedBonds;
- return BondedReactiveMonomers.size();
- };
+ //!returns the total number of reactive monomers capable to form a bond
uint32_t getNReactiveSites() const {return nReactiveSites;};
+
//!returns the bond table of the reacted reactive monomers.
- std::map getBondedMonomers()const {return BondedReactiveMonomers;};
+ const std::map& getBondedMonomers()const {return BondedReactiveMonomers;};
+
//! returns false if the bond does not exist
bool checkReactiveBondExists(uint32_t Mon1, uint32_t Mon2) const
{
BondPair edge_key(std::min(Mon1,Mon2),std::max(Mon1,Mon2));
return (BondedReactiveMonomers.find(edge_key) != BondedReactiveMonomers.end());
}
- //!
- std::map getUnreactiveMonomers() const {return UnbondedReactiveMonomers;};
- //!
+
+ //! returns the map of unreacted monomers
+ const std::map& getUnreactiveMonomers() const {return UnbondedReactiveMonomers;};
+
+ //!returns the number of reactive monomers capable to form a bond
uint32_t getNUnreactedMonomers()const{return UnbondedReactiveMonomers.size();}
- //!
+
+ //!returns true if the monomer can be connected to another monomer
bool checkCapableFormingBonds(uint32_t MonID )const { return (UnbondedReactiveMonomers.find(MonID) != UnbondedReactiveMonomers.end()); }
+
//!get extent of reaction
double getConversion() const {return (double(nReactedBonds*2))/(double(nReactiveSites));}
private:
- uint32_t nReactedBonds, nReactiveSites;
- //! holds all bonded reactive monomers during simulation
- std::map BondedReactiveMonomers;
- //! holds the ids of all reactive monomers which can have another bonds
- std::map UnbondedReactiveMonomers;
- //!
-// void addReactiveMonomer(uint32_t MonID, uint32_t value=0){UnbondedReactiveMonomers.emplace(MonID,value);} // adds a new entry if the
- void addReactiveMonomer(uint32_t MonID, uint32_t value=0){UnbondedReactiveMonomers[MonID]=value;} // adds a new entry if the
- //!
- void eraseReactiveMonomer(uint32_t MonID, uint32_t value=0){UnbondedReactiveMonomers.erase(UnbondedReactiveMonomers.find(MonID));}
- //!add a bond to the container BondedReactiveMonomers
- void addBondedPair(uint32_t Monomer1, uint32_t Monomer2, uint32_t attribute=0){
- BondPair edge_key(std::min(Monomer1,Monomer2),std::max(Monomer1,Monomer2));
- BondedReactiveMonomers[edge_key]=attribute;
- }
- //!erase a bond from the container BondedReactiveMonomers
- void eraseBondedPair(uint32_t Monomer1, uint32_t Monomer2, uint32_t attribute=0){
- BondPair edge_key(std::min(Monomer1,Monomer2),std::max(Monomer1,Monomer2));
- typename std::map::iterator it;
- it=BondedReactiveMonomers.find(edge_key);
- BondedReactiveMonomers.erase(it);
- }
-
-};
+ //!number of bonds from reactive monomers and the total number of reactive monomers
+ uint32_t nReactedBonds, nReactiveSites;
+
+ //! holds all bonded reactive monomers during simulation
+ std::map BondedReactiveMonomers;
+
+ //! holds the ids of all reactive monomers which can have another bonds
+ std::map UnbondedReactiveMonomers;
+
+ //! adds the monomer to the map of unreacted monomers
+ void addReactiveMonomer(uint32_t MonID, uint32_t value=0){UnbondedReactiveMonomers[MonID]=value;} // adds a new entry if the
+ //! erase the monomer ID from the map of unreacted monomers
+ void eraseReactiveMonomer(uint32_t MonID, uint32_t value=0){UnbondedReactiveMonomers.erase(UnbondedReactiveMonomers.find(MonID));}
+
+ //!add a bond to the container BondedReactiveMonomers
+ void addBondedPair(uint32_t Monomer1, uint32_t Monomer2, uint32_t attribute=0){
+ BondPair edge_key(std::min(Monomer1,Monomer2),std::max(Monomer1,Monomer2));
+ BondedReactiveMonomers[edge_key]=attribute;
+ }
+
+ //!erase a bond from the container BondedReactiveMonomers
+ void eraseBondedPair(uint32_t Monomer1, uint32_t Monomer2, uint32_t attribute=0){
+ BondPair edge_key(std::min(Monomer1,Monomer2),std::max(Monomer1,Monomer2));
+ typename std::map::iterator it;
+ it=BondedReactiveMonomers.find(edge_key);
+ BondedReactiveMonomers.erase(it);
+ }
+};
///////////////////////////////////////////////////////////////////////////////
////////////////////////// member definitions /////////////////////////////////
/**
@@ -310,15 +320,13 @@ class FeatureReactiveBonds : public Feature {
* taken care automatically when it becomes necessary.\n
* Registered Read-In Commands:
* * !reactivity
- *
* @param fileReader File importer for the bfm-file
* @param destination List of Feature to write-in from the read values.
* @tparam IngredientsType Features used in the system. See Ingredients.
**/
template
-void FeatureReactiveBonds::exportRead(FileImport< IngredientsType >& fileReader)
-{
- fileReader.registerRead("!reactivity",new ReadReactivity(fileReader.getDestination()));
+void FeatureReactiveBonds::exportRead(FileImport< IngredientsType >& fileReader) {
+ fileReader.registerRead("!reactivity",new ReadReactivity(fileReader.getDestination()));
}
/**
* The function is called by the Ingredients class when an object of type Ingredients
@@ -326,13 +334,11 @@ void FeatureReactiveBonds::exportRead(FileImport< IngredientsType >& fileReader)
* taken care automatically when it becomes necessary.\n
* Registered Write-Out Commands:
* * !reactivity
- *
* @param fileWriter File writer for the bfm-file.
*/
template
-void FeatureReactiveBonds::exportWrite(AnalyzerWriteBfmFile< IngredientsType >& fileWriter) const
-{
- fileWriter.registerWrite("!reactivity",new WriteReactivity(fileWriter.getIngredients_()));
+void FeatureReactiveBonds::exportWrite(AnalyzerWriteBfmFile< IngredientsType >& fileWriter) const{
+ fileWriter.registerWrite("!reactivity",new WriteReactivity(fileWriter.getIngredients_()));
}
/******************************************************************************/
/**
@@ -346,24 +352,18 @@ void FeatureReactiveBonds::exportWrite(AnalyzerWriteBfmFile< IngredientsType >&
*/
/******************************************************************************/
template
-bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveConnectBase& move) const
-{
- uint32_t ID(move.getIndex());
- const typename IngredientsType::molecules_type& molecules=ingredients.getMolecules();
-
- //check for maximum number of bonds for the first monomer
- if ( molecules.getNumLinks(ID) >= molecules[ID].getNumMaxLinks()) return false;
-
- uint32_t Neighbor(move.getPartner());
-
- //check if neighbor is reactive
- if ( !molecules[Neighbor].isReactive() ) return false;
-
- //check for maximum number of bonds for the second monomer
- if ( molecules.getNumLinks(Neighbor) >= molecules[Neighbor].getNumMaxLinks() ) return false;
-
- //if still here, then the two monomers are allowed to connect
- return true;
+bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveConnectBase& move) const {
+ uint32_t ID(move.getIndex());
+ const typename IngredientsType::molecules_type& molecules=ingredients.getMolecules();
+ //check for maximum number of bonds for the first monomer
+ if ( molecules.getNumLinks(ID) >= molecules[ID].getNumMaxLinks()) return false;
+ uint32_t Neighbor(move.getPartner());
+ //check if neighbor is reactive
+ if ( !molecules[Neighbor].isReactive() ) return false;
+ //check for maximum number of bonds for the second monomer
+ if ( molecules.getNumLinks(Neighbor) >= molecules[Neighbor].getNumMaxLinks() ) return false;
+ //if still here, then the two monomers are allowed to connect
+ return true;
}
/******************************************************************************/
/**
@@ -377,33 +377,16 @@ bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const
*/
/******************************************************************************/
template
-bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveBreakBase& move) const
-{
+bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveBreakBase& move) const {
const typename IngredientsType::molecules_type& molecules=ingredients.getMolecules();
//check if neighbor is reactive
- uint32_t ID(move.getIndex());
- if ( !molecules[ID].isReactive() ) return false;
+ uint32_t ID(move.getIndex());
+ if ( !molecules[ID].isReactive() ) return false;
//check if neighbor is reactive
uint32_t Neighbor(move.getPartner());
- if ( !molecules[Neighbor].isReactive() ) return false;
- //if still here, then the two monomers are allowed to connect
- return true;
-}
-/******************************************************************************/
-/**
- * @fn bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveBreakBase& move) const
- * @brief Returns true for all moves other than the ones that have specialized versions of this function.
- * This dummy function is implemented for generality.
- * @details it might make a difference for the speed if the order of statements is switched for different systems parameters
- * @param [in] ingredients A reference to the IngredientsType - mainly the system
- * @param [in] move MoveBreakReactive chooses only reactie monomers
- * @return true Always!
- */
-/******************************************************************************/
-template
-bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const MoveBreakReactive& move) const
-{
- return true;
+ if ( !molecules[Neighbor].isReactive() ) return false;
+ //if still here, then the two monomers are allowed to connect
+ return true;
}
/******************************************************************************/
/**
@@ -415,17 +398,15 @@ bool FeatureReactiveBonds ::checkMove(const IngredientsType& ingredients, const
*/
/******************************************************************************/
template
-void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveConnectBase& move)
-{
- nReactedBonds++;
- auto MonID(move.getIndex());
- auto Partner(move.getPartner());
- addBondedPair(MonID,Partner,ing.getMolecules().getAge());
- if (ing.getMolecules()[MonID].getNumMaxLinks()==ing.getMolecules().getNumLinks(MonID) )
- eraseReactiveMonomer(MonID);
- if (ing.getMolecules()[Partner].getNumMaxLinks()==ing.getMolecules().getNumLinks(Partner) )
- eraseReactiveMonomer(Partner);
-
+void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveConnectBase& move) {
+ nReactedBonds++;
+ auto MonID(move.getIndex());
+ auto Partner(move.getPartner());
+ addBondedPair(MonID,Partner,ing.getMolecules().getAge());
+ if (ing.getMolecules()[MonID].getNumMaxLinks()==ing.getMolecules().getNumLinks(MonID) )
+ eraseReactiveMonomer(MonID);
+ if (ing.getMolecules()[Partner].getNumMaxLinks()==ing.getMolecules().getNumLinks(Partner) )
+ eraseReactiveMonomer(Partner);
}
/******************************************************************************/
/**
@@ -437,14 +418,13 @@ void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveConnectBas
*/
/******************************************************************************/
template
-void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveBreakBase& move)
-{
- nReactedBonds--;
- auto MonID(move.getIndex());
- auto Partner(move.getPartner());
- eraseBondedPair(MonID,Partner);
- addReactiveMonomer(MonID,ing.getMolecules().getAge());
- addReactiveMonomer(Partner,ing.getMolecules().getAge());
+void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveBreakBase& move) {
+ nReactedBonds--;
+ auto MonID(move.getIndex());
+ auto Partner(move.getPartner());
+ eraseBondedPair(MonID,Partner);
+ addReactiveMonomer(MonID,ing.getMolecules().getAge());
+ addReactiveMonomer(Partner,ing.getMolecules().getAge());
}
/******************************************************************************/
@@ -456,54 +436,44 @@ void FeatureReactiveBonds ::applyMove(IngredientsType& ing, const MoveBreakBase<
*/
/******************************************************************************/
template
-void FeatureReactiveBonds::synchronize(IngredientsType& ingredients)
-{
- std::cout << "FeatureReactiveBonds::synchronizing ...\n";
+void FeatureReactiveBonds::synchronize(IngredientsType& ingredients){
+ BondedReactiveMonomers.clear();
+ UnbondedReactiveMonomers.clear();
+ std::cout << "FeatureReactiveBonds::synchronizing ...\n";
nReactedBonds=0;
nReactiveSites=0;
- for(size_t i = 0 ; i < ingredients.getMolecules().size(); i++ )
- {
- if ( ingredients.getMolecules()[i].isReactive() )
- {
- addReactiveMonomer(i,ingredients.getMolecules().getAge());
+ for(size_t i = 0 ; i < ingredients.getMolecules().size(); i++ ){
+ if ( ingredients.getMolecules()[i].isReactive() ){
uint32_t NLinks(ingredients.getMolecules().getNumLinks(i));
uint32_t nIrreversibleBonds=0;
- for (uint32_t n = 0 ; n < NLinks ;n++)
- {
+ for (uint32_t n = 0 ; n < NLinks ;n++){
uint32_t neighbor(ingredients.getMolecules().getNeighborIdx(i,n));
if( ingredients.getMolecules()[neighbor].isReactive() )
nReactedBonds++;
else
- nIrreversibleBonds++;
+ nIrreversibleBonds++;
}
if(ingredients.getMolecules()[i].getNumMaxLinks()-ingredients.getMolecules().getNumLinks(i) != 0)
- addReactiveMonomer(i,ingredients.getMolecules().getAge());
+ addReactiveMonomer(i,ingredients.getMolecules().getAge());
nReactiveSites+=(ingredients.getMolecules()[i].getNumMaxLinks()-nIrreversibleBonds);
- }
- }
- nReactedBonds/=2; // they are counted twice: each monomer counts the bond, but essentially there is only one bond.
- std::cout << "Number of reactive bonds: " << nReactedBonds <<"\n"
- << "Number of reactive sites: " << nReactiveSites<<"\n"
- << "Extent of reaction : " << getConversion()
- <first.first);
- auto MonID2(it->first.second);
- if(ingredients.getMolecules()[MonID1].isReactive() && ingredients.getMolecules()[MonID2].isReactive())
- addBondedPair(MonID1,MonID2,ingredients.getMolecules().getAge());
- }
+ }
}
- std::cout << "done\n";
+ nReactedBonds/=2; // they are counted twice: each monomer counts the bond, but essentially there is only one bond.
+ std::cout << "Number of reactive bonds: " << nReactedBonds <<"\n"
+ << "Number of reactive sites: " << nReactiveSites<<"\n"
+ << "Extent of reaction : " << getConversion()
+ <first.first);
+ auto MonID2(it->first.second);
+ if(ingredients.getMolecules()[MonID1].isReactive() && ingredients.getMolecules()[MonID2].isReactive())
+ addBondedPair(MonID1,MonID2,ingredients.getMolecules().getAge());
+ }
+ }
+ std::cout << "done\n";
}
///////////////////////////////////////////////////////////////////////////////
///////////////////// member definitions for output ///////////////////////////
@@ -517,155 +487,126 @@ void FeatureReactiveBonds::synchronize(IngredientsType& ingredients)
template < class IngredientsType >
void ReadReactivity::execute()
{
- //some variables used during reading
- //counts the number of reactivity lines in the file
- int nReactiveBlocks=0;
- int startIndex,stopIndex;
- MonomerReactivity reactivity;
- //contains the latest line read from file
- std::string line;
- //used to reset the position of the get pointer after processing the command
- std::streampos previous;
- //for convenience: get the input stream
- std::istream& source=this->getInputStream();
- //for convenience: get the set of monomers
- typename IngredientsType::molecules_type& molecules=this->getDestination().modifyMolecules();
-
- //go to next line and save the position of the get pointer into streampos previous
- getline(source,line);
- previous=(source).tellg();
-
- //read and process the lines containing the bond vector definition
- getline(source,line);
-
- while(!line.empty() && !((source).fail())){
-
- //stop at next Read and set the get-pointer to the position before the Read
- if(this->detectRead(line)){
- (source).seekg(previous);
- break;
- }
-
- //initialize stringstream with content for ease of processing
- std::stringstream stream(line);
-
- //read vector components
- stream>>startIndex;
-
- //throw exception, if extraction fails
- if(stream.fail()){
- std::stringstream messagestream;
- messagestream<<"ReadReactivity::execute()\n"
- <<"Could not read first index in reactivity line "<findSeparator(stream,'-')){
-
- std::stringstream messagestream;
- messagestream<<"ReadReactivity::execute()\n"
- <<"Wrong definition of reactivity\nCould not find separator \"-\" "
- <<"in reactivity definition no "<>stopIndex;
-
- //throw exception, if extraction fails
- if(stream.fail()){
- std::stringstream messagestream;
- messagestream<<"ReadReactivity::execute()\n"
- <<"Could not read second index in reactivity line "<findSeparator(stream,':')){
-
- std::stringstream messagestream;
- messagestream<<"ReadReactivity::execute()\n"
- <<"Wrong definition of reactivity\nCould not find separator \":\" "
- <<"in reactivity definition no "<>reactivity;
- //if extraction worked, save the attributes
- if(!stream.fail()){
-
- //save attributes
- for(int n=startIndex;n<=stopIndex;n++)
- {
- //check if the number of maximum bonds is consistent with the maximum number of bonds given for ingredients
- if ( this->getDestination().getMolecules().getMaxConnectivity() >= reactivity.getNumMaxLinks() )
- {
- //use n-1 as index, because bfm-files start counting indices at 1 (not 0)
- molecules[n-1].setMonomerReactivity(reactivity);
-// std::cout << "idx" << n-1 << " reactivity: " << reactivity.isReactive() << " numMaxBonds" << reactivity.getNumMaxLinks() << std::endl;
- }else
- {
- std::stringstream messagestream;
- messagestream<<"ReadReactivity::execute()\n"
- <<"the numMaxBonds for the current monomer is exceeding the max number \n"
- <<"of allowed connectivity for ingredients in "<getInputStream();
+ //for convenience: get the set of monomers
+ typename IngredientsType::molecules_type& molecules=this->getDestination().modifyMolecules();
+ //go to next line and save the position of the get pointer into streampos previous
+ getline(source,line);
+ previous=(source).tellg();
+ //read and process the lines containing the bond vector definition
+ getline(source,line);
+
+ while(!line.empty() && !((source).fail())){
+ //stop at next Read and set the get-pointer to the position before the Read
+ if(this->detectRead(line)){
+ (source).seekg(previous);
+ break;
+ }
+ //initialize stringstream with content for ease of processing
+ std::stringstream stream(line);
+ //read vector components
+ stream>>startIndex;
+ //throw exception, if extraction fails
+ if(stream.fail()){
+ std::stringstream messagestream;
+ messagestream<<"ReadReactivity::execute()\n"
+ <<"Could not read first index in reactivity line "<findSeparator(stream,'-')){
+ std::stringstream messagestream;
+ messagestream<<"ReadReactivity::execute()\n"
+ <<"Wrong definition of reactivity\nCould not find separator \"-\" "
+ <<"in reactivity definition no "<>stopIndex;
+ //throw exception, if extraction fails
+ if(stream.fail()){
+ std::stringstream messagestream;
+ messagestream<<"ReadReactivity::execute()\n"
+ <<"Could not read second index in reactivity line "<findSeparator(stream,':')){
+ std::stringstream messagestream;
+ messagestream<<"ReadReactivity::execute()\n"
+ <<"Wrong definition of reactivity\nCould not find separator \":\" "
+ <<"in reactivity definition no "<>reactivity;
+ //if extraction worked, save the attributes
+ if(!stream.fail()){
+ //save attributes
+ for(int n=startIndex;n<=stopIndex;n++){
+ //check if the number of maximum bonds is consistent with the maximum number of bonds given for ingredients
+ if ( this->getDestination().getMolecules().getMaxConnectivity() >= reactivity.getNumMaxLinks() ) {
+ //use n-1 as index, because bfm-files start counting indices at 1 (not 0)
+ molecules[n-1].setMonomerReactivity(reactivity);
+ }else{
+ std::stringstream messagestream;
+ messagestream<<"ReadReactivity::execute()\n"
+ <<"the numMaxBonds for the current monomer is exceeding the max number \n"
+ <<"of allowed connectivity for ingredients in "<::execute()\n"
+ <<"could not read reactivity information in reactivity definition no "<::execute()\n"
- <<"could not read reactivity information in reactivity definition no "<
-void WriteReactivity::writeStream(std::ostream& strm)
-{
- //for all output the indices are increased by one, because the file-format
- //starts counting indices at 1 (not 0)
-
- //write bfm command
- strm<<"!reactivity\n";
- //get reference to monomers
- const typename IngredientsType::molecules_type& molecules=this->getSource().getMolecules();
-
- size_t nMonomers=molecules.size();
- //reactivity blocks begin with startIndex
- size_t startIndex=0;
- //counter variable
- size_t n=0;
- //reactivity to be written (updated in loop below)
- MonomerReactivity reactivity=molecules[0].getMonomerReactivity();
-
- //write reactivity (blockwise)
- while(n::writeStream(std::ostream& strm){
+ //for all output the indices are increased by one, because the file-format
+ //starts counting indices at 1 (not 0)
+ //write bfm command
+ strm<<"!reactivity\n";
+ //get reference to monomers
+ const typename IngredientsType::molecules_type& molecules=this->getSource().getMolecules();
+
+ size_t nMonomers=molecules.size();
+ //reactivity blocks begin with startIndex
+ size_t startIndex=0;
+ //counter variable
+ size_t n=0;
+ //reactivity to be written (updated in loop below)
+ MonomerReactivity reactivity=molecules[0].getMonomerReactivity();
+
+ //write reactivity (blockwise)
+ while(n.
+
+--------------------------------------------------------------------------------*/
+
+#ifndef FEATURE_SYSTEM_INFORMATION_TENDOMER_H
+#define FEATURE_SYSTEM_INFORMATION_TENDOMER_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+class FeatureSystemInformationDendrimer:public Feature
+{
+public:
+
+ FeatureSystemInformationDendrimer(): generation(0), spacerLength(0), coreFunctionality(0), branchingPointFunctionality(0){};
+
+ virtual ~FeatureSystemInformationDendrimer(){};
+
+ //! For all unknown moves: this does nothing
+ template
+ bool checkMove(const IngredientsType& ingredientsngredients,const MoveBase& move) const {return true; }
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportRead(FileImport & fileReader);
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportWrite(AnalyzerWriteBfmFile & filewriter) const;
+
+ //! getter function for dendrimer generation
+ uint32_t getGeneration() const {return generation;}
+ //! setter function for dendrimer generation
+ void setGeneration(uint32_t generation_){generation=generation_;}
+
+ //! getter function for dendrimer spacer length
+ uint32_t getSpacerLength() const { return spacerLength;}
+ //! setter function for dendrimer spacer length
+ void setSpacerLength(uint32_t spacerLength_){spacerLength=spacerLength_;}
+
+ //! getter function for the functionality of branching of the dendrimer focal point
+ uint32_t getCoreFunctionality() const { return coreFunctionality;}
+ //! setter function for the functionality of branching of the dendrimer focal point
+ void setCoreFunctionality(uint32_t coreFunctionality_){coreFunctionality=coreFunctionality_;}
+
+ //! getter function for the branching functionality of the dendrimer branching points except the focal point
+ uint32_t getBranchingPointFunctionality() const { return branchingPointFunctionality;}
+ //! setter function for the branching functionality of the dendrimer branching points except the focal point
+ void setBranchingPointFunctionality(uint32_t branchingPointFunctionality_){branchingPointFunctionality=branchingPointFunctionality_;}
+
+protected:
+ uint32_t generation;
+ uint32_t spacerLength;
+ uint32_t coreFunctionality;
+ uint32_t branchingPointFunctionality;
+
+};
+
+/*****************************************************************/
+/**
+ * @class ReadDendrimerGeneration
+ *
+ * @brief Handles BFM-File-Reads \b #!dendrimer_generation
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadDendrimerGeneration: public ReadToDestination
+{
+public:
+ ReadDendrimerGeneration(IngredientsType& ingredients):ReadToDestination(ingredients){}
+ virtual ~ReadDendrimerGeneration(){}
+ virtual void execute();
+};
+
+template
+void ReadDendrimerGeneration::execute()
+{
+ std::cout<<"reading dendrimer generation...";
+
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ uint32_t dGeneration(std::stoi(line));
+ std::cout << "#!dendrimer_generation=" << (dGeneration) << std::endl;
+
+ ingredients.setGeneration(dGeneration);
+
+}
+/*****************************************************************/
+/**
+ * @class ReadDendrimerSpacerLength
+ *
+ * @brief Handles BFM-File-Reads \b #!dendrimer_spacer_length
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadDendrimerSpacerLength: public ReadToDestination
+{
+public:
+ ReadDendrimerSpacerLength(IngredientsType& ingredients):ReadToDestination(ingredients){}
+ virtual ~ReadDendrimerSpacerLength(){}
+ virtual void execute();
+};
+
+template
+void ReadDendrimerSpacerLength::execute()
+{
+ std::cout<<"reading dendrimer spacer length...";
+
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ uint32_t dSpacerLength(std::stoi(line));
+ std::cout << "#!dendrimer_spacer_length=" << (dSpacerLength) << std::endl;
+
+ ingredients.setSpacerLength(dSpacerLength);
+}
+/*****************************************************************/
+/**
+ * @class ReadDendrimerCoreFunctionality
+ *
+ * @brief Handles BFM-File-Reads \b #!dendrimer_core_functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadDendrimerCoreFunctionality: public ReadToDestination
+{
+public:
+ ReadDendrimerCoreFunctionality(IngredientsType& ingredients):ReadToDestination(ingredients){}
+ virtual ~ReadDendrimerCoreFunctionality(){}
+ virtual void execute();
+};
+
+template
+void ReadDendrimerCoreFunctionality::execute()
+{
+ std::cout<<"reading dendrimer core functionality...";
+
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ uint32_t dCoreFunct(std::stoi(line));
+ std::cout << "#!dendrimer_core_functionality=" << (dCoreFunct) << std::endl;
+
+ ingredients.setCoreFunctionality(dCoreFunct);
+}
+/*****************************************************************/
+/**
+ * @class ReadDendrimerBranchingPointFunctionality
+ *
+ * @brief Handles BFM-File-Reads \b #!dendrimer_branching_point_functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadDendrimerBranchingPointFunctionality: public ReadToDestination
+{
+public:
+ ReadDendrimerBranchingPointFunctionality(IngredientsType& ingredients):ReadToDestination(ingredients){}
+ virtual ~ReadDendrimerBranchingPointFunctionality(){}
+ virtual void execute();
+};
+
+template
+void ReadDendrimerBranchingPointFunctionality::execute()
+{
+ std::cout<<"reading dendrimer branching point functionality...";
+
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ uint32_t dBraPoFunct(std::stoi(line));
+ std::cout << "#!dendrimer_branching_point_functionality=" << (dBraPoFunct) << std::endl;
+
+ ingredients.setBranchingPointFunctionality(dBraPoFunct);
+}
+
+/**
+ * @details The function is called by the Ingredients class when an object of type Ingredients
+ * is associated with an object of type FileImport. The export of the Reads is thus
+ * taken care automatically when it becomes necessary.\n
+ * Registered Read-In Commands:
+ * * #!dendrimer_generation
+ * * #!dendrimer_spacer_length
+ * * #!dendrimer_core_functionality
+ * * #!dendrimer_branching_point_functionality
+ *
+ * @param fileReader File importer for the bfm-file
+ * @param destination List of Feature to write-in from the read values.
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+void FeatureSystemInformationDendrimer::exportRead(FileImport< IngredientsType >& fileReader)
+{
+ fileReader.registerRead("#!dendrimer_generation", new ReadDendrimerGeneration(fileReader.getDestination()));
+ fileReader.registerRead("#!dendrimer_spacer_length", new ReadDendrimerSpacerLength(fileReader.getDestination()));
+ fileReader.registerRead("#!dendrimer_core_functionality", new ReadDendrimerCoreFunctionality(fileReader.getDestination()));
+ fileReader.registerRead("#!dendrimer_branching_point_functionality", new ReadDendrimerBranchingPointFunctionality(fileReader.getDestination()));
+}
+
+/*****************************************************************/
+/**
+ * @class WriterDendrimerGeneration
+ *
+ * @brief Handles BFM-File-Write \b #!dendrimer_generation
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterDendrimerGeneration:public AbstractWrite
+{
+public:
+ WriterDendrimerGeneration(const IngredientsType& ingredients)
+ :AbstractWrite(ingredients){this->setHeaderOnly(true);}
+
+ virtual ~WriterDendrimerGeneration(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterDendrimerGeneration::writeStream(std::ostream& stream)
+{
+ //get reference to molecules
+ stream<<"#!dendrimer_generation=" << (this->getSource().getGeneration()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterDendrimerSpacerLength
+ *
+ * @brief Handles BFM-File-Write \b #!dendrimer_spacer_length
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterDendrimerSpacerLength:public AbstractWrite
+{
+public:
+ WriterDendrimerSpacerLength(const IngredientsType& ingredients)
+ :AbstractWrite(ingredients){this->setHeaderOnly(true);}
+
+ virtual ~WriterDendrimerSpacerLength(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterDendrimerSpacerLength::writeStream(std::ostream& stream)
+{
+ stream<<"#!dendrimer_spacer_length=" << (this->getSource().getSpacerLength()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterDendrimerCoreFunctionality
+ *
+ * @brief Handles BFM-File-Write \b #!dendrimer_core_functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterDendrimerCoreFunctionality:public AbstractWrite
+{
+public:
+ WriterDendrimerCoreFunctionality(const IngredientsType& ingredients)
+ :AbstractWrite(ingredients){this->setHeaderOnly(true);}
+
+ virtual ~WriterDendrimerCoreFunctionality(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterDendrimerCoreFunctionality::writeStream(std::ostream& stream)
+{
+ stream<<"#!dendrimer_core_functionality=" << (this->getSource().getCoreFunctionality()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterDendrimerBranchingPointFunctionality
+ *
+ * @brief Handles BFM-File-Write \b #!dendrimer_branching_point_functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterDendrimerBranchingPointFunctionality:public AbstractWrite
+{
+public:
+ WriterDendrimerBranchingPointFunctionality(const IngredientsType& ingredients)
+ :AbstractWrite(ingredients){this->setHeaderOnly(true);}
+
+ virtual ~WriterDendrimerBranchingPointFunctionality(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterDendrimerBranchingPointFunctionality::writeStream(std::ostream& stream)
+{
+ stream<<"#!dendrimer_branching_point_functionality=" << (this->getSource().getBranchingPointFunctionality()) << std::endl<< std::endl;
+}
+/**
+ * @details The function is called by the Ingredients class when an object of type Ingredients
+ * is associated with an object of type AnalyzerWriteBfmFile. The export of the Writes is thus
+ * taken care automatically when it becomes necessary.\n
+ * Registered Read-In Commands:
+ * * #!dendrimer_generation
+ * * #!dendrimer_spacer_length
+ * * #!dendrimer_core_functionality
+ * * #!dendrimer_branching_point_functionality
+ *
+ * @param fileReader File importer for the bfm-file
+ * @param destination List of Feature to write-in from the read values.
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+void FeatureSystemInformationDendrimer::exportWrite(AnalyzerWriteBfmFile< IngredientsType >& filewriter) const
+{
+ const IngredientsType& source=filewriter.getIngredients_();
+ filewriter.registerWrite("#!dendrimer_generation", new WriterDendrimerGeneration(source));
+ filewriter.registerWrite("#!dendrimer_spacer_length", new WriterDendrimerSpacerLength(source));
+ filewriter.registerWrite("#!dendrimer_core_functionality", new WriterDendrimerCoreFunctionality(source));
+ filewriter.registerWrite("#!dendrimer_branching_point_functionality", new WriterDendrimerBranchingPointFunctionality(source));
+
+}
+
+#endif /*FEATURE_SYSTEM_INFORMATION_TENDOMER_H*/
diff --git a/include/LeMonADE/feature/FeatureSystemInformationLinearMeltWithCrosslinker.h b/include/LeMonADE/feature/FeatureSystemInformationLinearMeltWithCrosslinker.h
new file mode 100644
index 0000000..09ff3fd
--- /dev/null
+++ b/include/LeMonADE/feature/FeatureSystemInformationLinearMeltWithCrosslinker.h
@@ -0,0 +1,442 @@
+/*--------------------------------------------------------------------------------
+ ooo L attice-based |
+ o\.|./o e xtensible | LeMonADE: An Open Source Implementation of the
+ o\.\|/./o Mon te-Carlo | Bond-Fluctuation-Model for Polymers
+oo---0---oo A lgorithm and |
+ o/./|\.\o D evelopment | Copyright (C) 2013-2015 by
+ o/.|.\o E nvironment | LeMonADE Principal Developers
+ ooo |
+----------------------------------------------------------------------------------
+
+This file is part of LeMonADE.
+
+LeMonADE is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+LeMonADE is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with LeMonADE. If not, see .
+
+--------------------------------------------------------------------------------*/
+
+#ifndef FEATURE_SYSTEM_INFORMATION_LINEAR_MELT_WITH_CROSSLINKERH
+#define FEATURE_SYSTEM_INFORMATION_LINEAR_MELT_WITH_CROSSLINKERH
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+class FeatureSystemInformationLinearMeltWithCrosslinker:public Feature
+{
+public:
+
+ FeatureSystemInformationLinearMeltWithCrosslinker(){
+ nChains=0;
+ nCrossLinkers=0;
+ chainLength=0;
+ functionality=0;
+ nMonomersPerCrossLink=0;
+ };
+ virtual ~FeatureSystemInformationLinearMeltWithCrosslinker(){};
+
+ //! For all unknown moves: this does nothing
+ template
+ bool checkMove(const IngredientsType& ingredients,const MoveBase& move) const {return true; }
+
+ //! Overloaded for moves of type MoveScMonomer to check for sinusoidal movement
+ template
+ bool checkMove(const IngredientsType& ingredients,MoveLocalSc& move) const {return true; }
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportRead(FileImport & fileReader);
+
+ //! Export the relevant functionality for reading bfm-files to the responsible reader object
+ template
+ void exportWrite(AnalyzerWriteBfmFile & filewriter) const;
+
+ //!return the number of chains
+ uint32_t getNumberofChains() const { return nChains; }
+
+ //!set the number of chains
+ void setNumberofChains(uint32_t nChains_){nChains=nChains_;}
+
+ //! return the number of cross linkers
+ uint32_t getNumberofCrossLinkers() const { return nCrossLinkers; }
+
+ //!set the number of cross linekrs
+ void setNumberofCrossLinkers(uint32_t nCrossLinkers_){nCrossLinkers=nCrossLinkers_;}
+
+ //! returns the chain lenght
+ const uint32_t getChainLength() const {return chainLength; }
+
+ //!set the chain length
+ void setChainLength(uint32_t chainLength_){chainLength=chainLength_;}
+
+ //! get the functionality of the cross linker
+ uint32_t getFunctionality() const {return functionality;}
+
+ //!set the functionality of cross linker
+ void setFunctionality(uint32_t functionality_){functionality=functionality_;}
+
+ //!get the number of monomres per cross link
+ uint32_t getNMonomersPerCrossLink() const { return nMonomersPerCrossLink;}
+
+ //!set the number of monomers per cross linker
+ void setNMonomersPerCrossLink(uint32_t nMonomersPerCrossLink_){nMonomersPerCrossLink=nMonomersPerCrossLink_;}
+
+private:
+ uint32_t nChains;
+ uint32_t nCrossLinkers;
+ uint32_t chainLength;
+ uint32_t functionality;
+ uint32_t nMonomersPerCrossLink;
+
+};
+
+/*****************************************************************/
+/**
+ * @class ReadLinearChains
+ *
+ * @brief Handles BFM-File-Reads \b #!number_of_linear_chains
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadLinearChains: public ReadToDestination
+{
+public:
+ ReadLinearChains(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadLinearChains(){}
+ virtual void execute();
+};
+
+template
+void ReadLinearChains::execute()
+{
+ std::cout<<"reading number of Chains...";
+
+ uint32_t Chains = 0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ Chains = atof(line.c_str());
+ std::cout << "#!number_of_linear_chains=" << (Chains) << std::endl;
+
+ ingredients.setNumberofChains(Chains);
+}
+/*****************************************************************/
+/**
+ * @class ReadCrossLinkerNumber
+ *
+ * @brief Handles BFM-File-Reads \b #!number_of_crosslinkers
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadCrossLinkerNumber: public ReadToDestination
+{
+public:
+ ReadCrossLinkerNumber(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadCrossLinkerNumber(){}
+ virtual void execute();
+};
+
+template
+void ReadCrossLinkerNumber::execute()
+{
+ std::cout<<"reading number of Crosslinkers...";
+
+ uint32_t CrossLinkers = 0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ CrossLinkers = atof(line.c_str());
+ std::cout << "#!number_of_crosslinkers=" << (CrossLinkers) << std::endl;
+
+ ingredients.setNumberofCrossLinkers(CrossLinkers);
+}
+/*****************************************************************/
+/**
+ * @class ReadChainLength
+ *
+ * @brief Handles BFM-File-Reads \b #!chainLength
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadChainLength: public ReadToDestination
+{
+public:
+ ReadChainLength(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadChainLength(){}
+ virtual void execute();
+};
+
+template
+void ReadChainLength::execute()
+{
+ std::cout<<"reading chain length...";
+
+ uint32_t chainLength = 0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ chainLength = atof(line.c_str());
+ std::cout << "#!chainLength=" << (chainLength) << std::endl;
+
+ ingredients.setChainLength(chainLength);
+}
+
+/*****************************************************************/
+/**
+ * @class ReadFunctionality
+ *
+ * @brief Handles BFM-File-Reads \b #!functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadFunctionality: public ReadToDestination
+{
+public:
+ ReadFunctionality(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadFunctionality(){}
+ virtual void execute();
+};
+
+template
+void ReadFunctionality::execute()
+{
+ std::cout<<"reading functionality...";
+
+ uint32_t func = 0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ func = atof(line.c_str());
+ std::cout << "#!functionality=" << (func) << std::endl;
+
+ ingredients.setFunctionality(func);
+}
+
+/*****************************************************************/
+/**
+ * @class ReadNMonomersPerCrossLink
+ *
+ * @brief Handles BFM-File-Reads \b #!nMonomersPerCrossLink
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template < class IngredientsType>
+class ReadNMonomersPerCrossLink: public ReadToDestination
+{
+public:
+ ReadNMonomersPerCrossLink(IngredientsType& i):ReadToDestination(i){}
+ virtual ~ReadNMonomersPerCrossLink(){}
+ virtual void execute();
+};
+
+template
+void ReadNMonomersPerCrossLink::execute()
+{
+ std::cout<<"reading number of monomers per cross link...";
+
+ uint32_t crosslinkweight = 0;
+ IngredientsType& ingredients=this->getDestination();
+ std::istream& source=this->getInputStream();
+
+ std::string line;
+ getline(source,line);
+ crosslinkweight = atof(line.c_str());
+ std::cout << "#!nMonomersPerCrossLink=" << (crosslinkweight) << std::endl;
+
+ ingredients.setNMonomersPerCrossLink(crosslinkweight);
+}
+
+/**
+ * @details The function is called by the Ingredients class when an object of type Ingredients
+ * is associated with an object of type FileImport. The export of the Reads is thus
+ * taken care automatically when it becomes necessary.\n
+ * Registered Read-In Commands:
+ * * #!number_of_linear_chains
+ * * #!number_of_crosslinkers
+ * * #!chainLength
+ * * #!functionality
+ * * #!nMonomersPerCrossLink
+ *
+ * @param fileReader File importer for the bfm-file
+ * @param destination List of Feature to write-in from the read values.
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+void FeatureSystemInformationLinearMeltWithCrosslinker::exportRead(FileImport< IngredientsType >& fileReader)
+{
+ fileReader.registerRead("#!number_of_linear_chains", new ReadLinearChains(fileReader.getDestination()));
+ fileReader.registerRead("#!number_of_crosslinkers", new ReadCrossLinkerNumber(fileReader.getDestination()));
+ fileReader.registerRead("#!chainLength", new ReadChainLength(fileReader.getDestination()));
+ fileReader.registerRead("#!functionality", new ReadFunctionality(fileReader.getDestination()));
+ fileReader.registerRead("#!nMonomersPerCrossLink", new ReadNMonomersPerCrossLink(fileReader.getDestination()));
+}
+
+/*****************************************************************/
+/**
+ * @class WriterLinearChains
+ *
+ * @brief Handles BFM-File-Write \b #!number_of_linear_chains
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterLinearChains:public AbstractWrite
+{
+public:
+ WriterLinearChains(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(true);}
+ // WriteBonds(const IngredientsType& src):AbstractWrite(src){this->setHeaderOnly(true);}
+
+ virtual ~WriterLinearChains(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterLinearChains::writeStream(std::ostream& stream)
+{
+ //get reference to molecules
+
+ stream<<"#!number_of_linear_chains=" << (this->getSource().getNumberofChains()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterCrossLinkerNumber
+ *
+ * @brief Handles BFM-File-Write \b #!number_of_linear_chains
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterCrossLinkerNumber:public AbstractWrite
+{
+public:
+ WriterCrossLinkerNumber(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(true);}
+
+ virtual ~WriterCrossLinkerNumber(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterCrossLinkerNumber::writeStream(std::ostream& stream)
+{
+ stream<<"#!number_of_crosslinkers=" << (this->getSource().getNumberofCrossLinkers()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterChainLength
+ *
+ * @brief Handles BFM-File-Write \b #!chainLength
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterChainLength:public AbstractWrite
+{
+public:
+ WriterChainLength(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(true);}
+
+ virtual ~WriterChainLength(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterChainLength::writeStream(std::ostream& stream)
+{
+ stream<<"#!chainLength=" << (this->getSource().getChainLength()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterFunctionality
+ *
+ * @brief Handles BFM-File-Write \b #!functionality
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterFunctionality:public AbstractWrite
+{
+public:
+ WriterFunctionality(const IngredientsType& i)
+ :AbstractWrite(i){this->setHeaderOnly(true);}
+
+ virtual ~WriterFunctionality(){}
+
+ virtual void writeStream(std::ostream& strm);
+};
+
+template
+void WriterFunctionality::writeStream(std::ostream& stream)
+{
+ stream<<"#!functionality=" << (this->getSource().getFunctionality()) << std::endl<< std::endl;
+}
+/*****************************************************************/
+/**
+ * @class WriterNMonomersPerCrossLink
+ *
+ * @brief Handles BFM-File-Write \b #!nMonomersPerCrossLink
+ * @tparam IngredientsType Ingredients class storing all system information.
+ **/
+template
+class WriterNMonomersPerCrossLink:public AbstractWrite