PSCF v1.4.0
Pscf::Correlation::Polymer< WT > Class Template Reference

Intramolecular correlation analysis for one polymer Species. More...

#include <Polymer.h>

Public Member Functions

 Polymer ()
 Default constructor.
 Polymer (PolymerSpecies< WT > const &polymer)
 Constructor (creates association with a PolymerSpecies).
 ~Polymer ()
 Destructor.
void associate (PolymerSpecies< WT > const &polymer)
 Create association with a PolymerSpecies.
void allocate (int nMonomer)
 Allocate memory and initialize immutable data.
void setup (Array< double > const &kuhn)
 Set private mutable data.
double computeOmega (int ia, int ib, double prefactor, double kSq) const
 Compute intramolecular correlation function for a pair of blocks.
void computeOmega (int ia, int ib, double prefactor, Array< double > const &kSq, Array< double > &correlation) const
 Compute intramolecular correlation function for a pair of blocks.
void computeOmegaTotal (double prefactor, Array< double > const &kSq, Array< double > &correlations) const
 Compute total intramolecular correlation function.
double phi () const
 Return the volume fraction of this polymer species.
double totalLength () const
 Return the sum of lengths of all blocks in this polymer species.
int nBlock () const
 Get the number of blocks in the associated polymer species.
GArray< int > const & blockIds (int i) const
 Get a GArray of block ids for all blocks of one monomer type.
double length (int i) const
 Get the length of each block.
double rSq (int i, int j) const
 Get the mean-squared length of path between blocks i and j.

Detailed Description

template<typename WT>
class Pscf::Correlation::Polymer< WT >

Intramolecular correlation analysis for one polymer Species.

Definition at line 32 of file pscf/correlation/Polymer.h.

Constructor & Destructor Documentation

◆ Polymer() [1/2]

template<typename WT>
Pscf::Correlation::Polymer< WT >::Polymer ( )

Default constructor.

Definition at line 31 of file pscf/correlation/Polymer.tpp.

◆ Polymer() [2/2]

template<typename WT>
Pscf::Correlation::Polymer< WT >::Polymer ( PolymerSpecies< WT > const & polymer)

Constructor (creates association with a PolymerSpecies).

Parameters
polymerassociated PolymerSpecies object

Definition at line 42 of file pscf/correlation/Polymer.tpp.

◆ ~Polymer()

template<typename WT>
Pscf::Correlation::Polymer< WT >::~Polymer ( )

Destructor.

Definition at line 53 of file pscf/correlation/Polymer.tpp.

Member Function Documentation

◆ associate()

template<typename WT>
void Pscf::Correlation::Polymer< WT >::associate ( PolymerSpecies< WT > const & polymer)

Create association with a PolymerSpecies.

Parameters
polymerassociated PolymerSpecies object

Definition at line 60 of file pscf/correlation/Polymer.tpp.

◆ allocate()

template<typename WT>
void Pscf::Correlation::Polymer< WT >::allocate ( int nMonomer)

Allocate memory and initialize immutable data.

This function must be called exactly once, at any time after the Mixture block of the parameter file has been processes. It performs memory allocation and initialization operations that require knowlege of the number of monomer types in the mixture, as well as the number of blocks and the monomer type index of each block in the associated polymer species.

Precondition
An association with a PolymerSpecies must exist.
Parameters
nMonomernumber of monomer types in the mixture

Definition at line 67 of file pscf/correlation/Polymer.tpp.

References UTIL_CHECK.

◆ setup()

template<typename WT>
void Pscf::Correlation::Polymer< WT >::setup ( Array< double > const & kuhn)

Set private mutable data.

This function must be called after allocate and before performing any computations of correlation functions. It sets internal variables that depend on the polymer volume fraction phi, block lengths and statistical segment lengths. These variables are all mutable insofar as they may all change during a SCFT sweep or FTS ramp, and phi may change in an open statistical ensemble. This function may be called multiple times.

Precondition
The allocate function must have been called previously.
Parameters
kuhnarray of kuhn lengths, indexed by monomer type id

Definition at line 94 of file pscf/correlation/Polymer.tpp.

References Util::Array< Data >::capacity(), Pscf::PolymerModel::isThread(), Pscf::Edge::length(), Pscf::Edge::monomerId(), Pscf::Edge::nBead(), and UTIL_CHECK.

◆ computeOmega() [1/2]

template<typename WT>
double Pscf::Correlation::Polymer< WT >::computeOmega ( int ia,
int ib,
double prefactor,
double kSq ) const

Compute intramolecular correlation function for a pair of blocks.

This function evaluates and returns the intramolecular correlation function Omega(k) for a pair of blocks with block indices ia and ib at a value of the squared wavenumber given by parameter "kSq". Monomer type indexes ia and ib may be either equal or unequal. The return value is given by the product of a dimensionless single-chain correlation function omega(k) and the input parameter "prefactor". To obtain the contribution of this function to a correlation function for a homogeneous ideal gas mixture, set the prefactor parameter equal to the species chain concentration, prefactor = phi/(v*totalLength), where v is the monomer reference volume.

Precondition
The setup member function must have been called previously.
Array parameters kSq and correlations must be allocated with equal nonzero capacities.
Parameters
iablock index of first block
ibblock index of second block
prefactorprefactor multiplying omega(k)
kSqsquared wavenumber value
Returns
calculated value of Omega_{ia,ib}(k)

Definition at line 184 of file pscf/correlation/Polymer.tpp.

◆ computeOmega() [2/2]

template<typename WT>
void Pscf::Correlation::Polymer< WT >::computeOmega ( int ia,
int ib,
double prefactor,
Array< double > const & kSq,
Array< double > & correlation ) const

Compute intramolecular correlation function for a pair of blocks.

This function evaluates the intramolecular correlation function Omega for a pair of blocks with block indices ia and ib at a list of values for the squared wavenumber given by values of elements of input array parameter "kSq". Results are added to corresponding elements of array "correlations". The value for each wavenumber is given by the product of a dimensionless single-chain correlation function omega(k) and the input parameter "prefactor". To obtain the contribution of this species to a correlation function for an ideal gas mixture, set prefactor = phi/(v*totalLength), where v is the monomer reference volume.

Resulting values of Omega are added to prior values of elements of the array correlation. This is done to simplify calculations in which results of multiple polymer species are added to obtain a correlation function for a mixture. All elements of the array correlations should thus be set to zero at the beginning any such calculation.

Precondition
The setup member function must have been called previously.
Array parameters kSq and correlations must be allocated with equal nonzero capacities.
Parameters
iablock index of first block
ibblock index of second block
prefactorprefactor multiplying omega(q)
kSqarray of squared wavenumbers (in)
correlationarray of correlation function values (out)

Definition at line 227 of file pscf/correlation/Polymer.tpp.

References Util::Array< Data >::capacity(), Pscf::Correlation::db(), Pscf::Correlation::dt(), Pscf::Correlation::eb(), Pscf::Correlation::et(), Pscf::PolymerModel::isThread(), and UTIL_CHECK.

◆ computeOmegaTotal()

template<typename WT>
void Pscf::Correlation::Polymer< WT >::computeOmegaTotal ( double prefactor,
Array< double > const & kSq,
Array< double > & correlations ) const

Compute total intramolecular correlation function.

This function computes the a total density-density correlation function for a list of values for the squared wavenumber given as elements of input array parameter "kSq". Results are added to corresponding elements of array parameter "correlations". On entry, the arrays kSq and correlations must be allocated and equal capacities.

Each computed value is given by the product of a dimensionless single-chain correlation function omega(k) and the "prefactor" input parameter. To obtain the contribution of this species to the total density-density correlation function for an ideal gas mixture, set prefactor = phi/(v*totalLength), where v is the monomer reference volume. The zero wavenumber limiting value is given by prefactor*totalLength*totalLength.

Resulting values of Omega are added to elements of output array correlation, as for the function computeOmega.

Precondition
The setup member function must have been called previously.
Array parameters kSq and correlations must be allocated with equal nonzero capacities.
Parameters
prefactorprefactor of single-chain correlation functions
kSqarray of squared wavenumbers (in)
correlationsarray of correlation function values (out)

Definition at line 285 of file pscf/correlation/Polymer.tpp.

References Util::Array< Data >::capacity(), Pscf::Correlation::db(), Pscf::Correlation::dt(), Pscf::Correlation::eb(), Pscf::Correlation::et(), Pscf::PolymerModel::isThread(), and UTIL_CHECK.

◆ phi()

template<typename WT>
double Pscf::Correlation::Polymer< WT >::phi ( ) const
inline

Return the volume fraction of this polymer species.

Definition at line 316 of file pscf/correlation/Polymer.h.

◆ totalLength()

template<typename WT>
double Pscf::Correlation::Polymer< WT >::totalLength ( ) const
inline

Return the sum of lengths of all blocks in this polymer species.

Definition at line 321 of file pscf/correlation/Polymer.h.

◆ nBlock()

template<typename WT>
int Pscf::Correlation::Polymer< WT >::nBlock ( ) const
inline

Get the number of blocks in the associated polymer species.

Definition at line 326 of file pscf/correlation/Polymer.h.

◆ blockIds()

template<typename WT>
GArray< int > const & Pscf::Correlation::Polymer< WT >::blockIds ( int i) const
inline

Get a GArray of block ids for all blocks of one monomer type.

This function returns a GArray<int> container that contains a list of block indices for all blocks of the specified monomer type i. The number of blocks of a monomer type i is given by the return value of the "size()" member function of this container. If this polymer species does not contain any blocks of monomer type i, this size will be zero.

Parameters
imonomer type index

Definition at line 331 of file pscf/correlation/Polymer.h.

◆ length()

template<typename WT>
double Pscf::Correlation::Polymer< WT >::length ( int i) const
inline

Get the length of each block.

This function returns the length of block i for the thread model, or the floating point representation of nBead for the the bead model.

Parameters
iblock index

Definition at line 336 of file pscf/correlation/Polymer.h.

◆ rSq()

template<typename WT>
double Pscf::Correlation::Polymer< WT >::rSq ( int i,
int j ) const
inline

Get the mean-squared length of path between blocks i and j.

This function returns the sum of the mean-squared end-to-end lengths of all of the blocks (for the thread model) or bonds (for the bead model) along the path connecting the two blocks with block indices i and j. For the bead model, this includes the two "half bonds" that connect adjacent bonds along this path to each shared vertex.

Parameters
iblock index of 1st block.
jblock index of 2nd block.

Definition at line 341 of file pscf/correlation/Polymer.h.


The documentation for this class was generated from the following files: