Ising_OPV
v4.0.2
Generates and analyzes model bulk heterojunction morphologies in a parallel computing environment
|
This class contains a lattice representation of a materials blend with the ability to simulate phase separation and perform a variety of structural analyses. More...
#include <Morphology.h>
Public Member Functions | |
Morphology () | |
Default constructor that creates a Morphology object with the default parameters and an empty lattice. More... | |
Morphology (const Parameters ¶ms, const int id) | |
This constructor creates a Morphology object with a 3D lattice with a size defined by the input dimensions (length, width, height). More... | |
Morphology (const Lattice &input_lattice, const Parameters ¶ms, const int id) | |
This constructor creates a Morphology object with a 3D lattice defined by the input Lattice object. More... | |
virtual | ~Morphology () |
This is the default virtual destructor. More... | |
void | calculateAnisotropies () |
Calculates the domain size anisotropy of each phase. More... | |
void | calculateCorrelationDistances () |
Calculates the correlation length data and the domain size using the input parameter options. More... | |
void | calculateDepthDependentData () |
Calculates the lattice depth dependent (z-direction) characteristics of the morphology. More... | |
double | calculateInterfacialAreaVolumeRatio () const |
Calculates the interfacial area in units of lattice units squared. More... | |
void | calculateInterfacialDistanceHistogram () |
Calculates the interfacial distance histograms, which gives the fraction of sites at a specified distance from the interface. More... | |
double | calculateInterfacialVolumeFraction () const |
Calculates the fraction of sites adjacent to an interface. More... | |
void | calculateMixFractions () |
Calculates the volume fraction of each type site in the lattice to the total number of sites. More... | |
bool | calculateTortuosity (const char site_type, const bool enable_reduced_memory) |
Calculates the tortuosity histogram for the specified site type. More... | |
void | createBilayerMorphology () |
Creates a split bilayer morphology in the z-direction. More... | |
void | createCheckerboardMorphology () |
Creates a 3D checkerboard morphology. More... | |
void | createRandomMorphology (const std::vector< double > &mix_fractions) |
Creates a randomly mixed morphology with the specified blend ratios. More... | |
void | executeIsingSwapping (const int num_MCsteps, const double interaction_energy1, const double interaction_energy2, const bool enable_growth_pref, const int growth_direction, const double additional_interaction) |
Executes the Ising site swapping processes with the specified parameters for a given mumber of iterations. More... | |
void | executeMixing (const double interfacial_width, const double interfacial_conc) |
Executes interfacial mixing with a specified interfacial width and interfacial mixing concentration. More... | |
void | executeSmoothing (const double smoothing_threshold, const int rescale_factor) |
Executes a smoothing algorithm that smooths out rough domain interfaces and removes small islands and island sites. More... | |
std::vector< double > | getCorrelationData (const char site_type) const |
Returns a vector containing the pair-pair autocorrelation function data for the specified site type. More... | |
std::vector< double > | getDepthCompositionData (const char site_type) const |
Returns a vector containing the film depth dependent blend composition data in the z-direction. More... | |
std::vector< double > | getDepthDomainSizeData (const char site_type) const |
Returns a vector containing the film depth dependent domain size data in the z-direction. More... | |
std::vector< double > | getDepthIVData () const |
Returns a vector containing the film depth dependent interfacial volume fraction data in the z-direction. More... | |
double | getDomainSize (const char site_type) const |
Returns the domain size determined for the specified site type. More... | |
double | getDomainAnisotropy (const char site_type) const |
Returns the domain anisotropy determined for the specified site type. More... | |
int | getHeight () const |
Gets the height or z-direction size of the lattice. More... | |
int | getID () const |
Gets the ID number of the Morphology object. More... | |
std::vector< std::pair< double, int > > | getInterfacialDistanceHistogram (const char site_type) const |
Returns a vector containing the interfacial distance probability histogram data for the specified site type. More... | |
double | getIslandVolumeFraction (const char site_type) const |
Returns the island volume for the specified site type. More... | |
int | getLength () const |
Returns the length or x-direction size of the lattice. More... | |
double | getMixFraction (const char site_type) const |
Returns the mix fraction for the specified site type. More... | |
std::vector< double > | getTortuosityData (const char site_type) const |
Returns a vector containing the end-to-end tortuosity data for the specified site type. More... | |
double | getUnitSize () const |
Returns the lattice unit size in units of nm. More... | |
int | getWidth () const |
Returns the width or y-direction size of the lattice. More... | |
std::vector< Morphology > | importTomogramMorphologyFile () |
Imports the tomogram dataset specified in the parameter file. More... | |
bool | importMorphologyFile (std::ifstream &infile) |
Imports the Ising_OPV morphology text file given by the specified input filestream. More... | |
void | outputCompositionMaps (std::ofstream &outfile) const |
Outputs the areal composition map data to the specified output filestream. More... | |
void | outputCorrelationData (std::ofstream &outfile) const |
Outputs the domain autocorrelation function data to the specified output filestream. More... | |
void | outputDepthDependentData (std::ofstream &outfile) const |
Outputs the lattice depth dependent (z-direction) characteristics to the specified output filestream. More... | |
void | outputMorphologyFile (std::ofstream &outfile, const bool enable_export_compressed) const |
Outputs the morphology data to a file specified by the output filestream. More... | |
void | outputMorphologyCrossSection (std::ofstream &outfile) const |
Outputs a cross-section of the morphology at the x=Length/2 plane to the specified output filestream. More... | |
void | outputTortuosityMaps (std::ofstream &outfile) const |
Outputs the areal end-to-end tortuosity map data to the specified output filestream. More... | |
void | setParameters (const Parameters ¶ms) |
Sets the parameters of the Morphology class using the input Parameters object. More... | |
void | shrinkLattice (const int rescale_factor) |
Shrinks the existing lattice by a fraction of 1 over the integer rescale_factor value. More... | |
void | stretchLattice (const int rescale_factor) |
Stretches the existing lattice by a integer rescale_factor value. More... | |
This class contains a lattice representation of a materials blend with the ability to simulate phase separation and perform a variety of structural analyses.
The class makes use of the Lattice class to store the morphology data, and phase separation simulations are implemented using an Ising-based method. Morphological descriptors such as thh domain size, interfacial area, tortuosity, and more can be calculated for a given morphology.
Ising_OPV::Morphology::Morphology | ( | ) |
Default constructor that creates a Morphology object with the default parameters and an empty lattice.
Ising_OPV::Morphology::Morphology | ( | const Parameters & | params, |
const int | id | ||
) |
This constructor creates a Morphology object with a 3D lattice with a size defined by the input dimensions (length, width, height).
Two-dimensional periodic boundaries in the x- and y- directions are implemented by default, but periodic boundaries in the z-direction can also be enabled upon construction. Morphology objects are also tagged with an integer identification number.
params | is the Parameters object that contains all parameters needed by the Morphology class. |
id | is the input integer ID number that will be assigned to the Morphology object. |
Ising_OPV::Morphology::Morphology | ( | const Lattice & | input_lattice, |
const Parameters & | params, | ||
const int | id | ||
) |
This constructor creates a Morphology object with a 3D lattice defined by the input Lattice object.
input_lattice | is the input Lattice object that will be used to create the Morphology. |
params | is the Parameters object that contains all parameters needed by the Morphology class. |
id | is the input integer ID number that will be assigned to the Morphology object. |
|
virtual |
This is the default virtual destructor.
void Ising_OPV::Morphology::calculateAnisotropies | ( | ) |
Calculates the domain size anisotropy of each phase.
void Ising_OPV::Morphology::calculateCorrelationDistances | ( | ) |
Calculates the correlation length data and the domain size using the input parameter options.
void Ising_OPV::Morphology::calculateDepthDependentData | ( | ) |
Calculates the lattice depth dependent (z-direction) characteristics of the morphology.
Calculates the depth dependent composition, interfacial volume fraction, and domain size.
double Ising_OPV::Morphology::calculateInterfacialAreaVolumeRatio | ( | ) | const |
Calculates the interfacial area in units of lattice units squared.
void Ising_OPV::Morphology::calculateInterfacialDistanceHistogram | ( | ) |
Calculates the interfacial distance histograms, which gives the fraction of sites at a specified distance from the interface.
double Ising_OPV::Morphology::calculateInterfacialVolumeFraction | ( | ) | const |
Calculates the fraction of sites adjacent to an interface.
void Ising_OPV::Morphology::calculateMixFractions | ( | ) |
Calculates the volume fraction of each type site in the lattice to the total number of sites.
bool Ising_OPV::Morphology::calculateTortuosity | ( | const char | site_type, |
const bool | enable_reduced_memory | ||
) |
Calculates the tortuosity histogram for the specified site type.
For all type 1 sites, the shortest paths through other type 1 sites to the boundary at z=0 is calculated. For all type 2 sites, the shortest pathes through other type 2 sites to the boundary at z=Height-1 is calculated. The shortest paths are calculated using Dijkstra's algorithm.
site_type | specifies which site type to perform the tortuosity calculation on. |
enable_reduced_memory | allows users to choose to use a slower algorithm that uses less RAM. |
void Ising_OPV::Morphology::createBilayerMorphology | ( | ) |
Creates a split bilayer morphology in the z-direction.
void Ising_OPV::Morphology::createCheckerboardMorphology | ( | ) |
Creates a 3D checkerboard morphology.
void Ising_OPV::Morphology::createRandomMorphology | ( | const std::vector< double > & | mix_fractions | ) |
Creates a randomly mixed morphology with the specified blend ratios.
mix_fractions | is a vector that specifies the blend ratio of each site type. |
void Ising_OPV::Morphology::executeIsingSwapping | ( | const int | num_MCsteps, |
const double | interaction_energy1, | ||
const double | interaction_energy2, | ||
const bool | enable_growth_pref, | ||
const int | growth_direction, | ||
const double | additional_interaction | ||
) |
Executes the Ising site swapping processes with the specified parameters for a given mumber of iterations.
This function uses the bond formation algorithm to determine the energy change in the system that results from swapping two neighboring sites. Positive values for the interaction energies result in a driving force for phase separation.
num_MCsteps | is the number of Monte Carlo steps to execute, where the number of steps is defined by the total number of iterations divided by the total lattice volume. |
interaction_energy1 | defines the energetic difference between like-like and unlike-unlike interactions for type 1 sites in units of kT. |
interaction_energy2 | defines the energetic difference between like-like and unlike-unlike interactions for type 2 sites in units of kT. |
enable_growth_pref | is a boolean option that allows users to enable preferential interations in one of the pricipal lattice directions. |
growth_direction | is an integer used when directional interactions are enabled and specifies the direction with a modified interaction energy, with 1 = x-direction, 2 = y-direction, and 3 = z-direction. |
additional_interaction | is used when directional interactions are enabled and specifies the additional interaction energy with sites in the specified direction. |
void Ising_OPV::Morphology::executeMixing | ( | const double | interfacial_width, |
const double | interfacial_conc | ||
) |
Executes interfacial mixing with a specified interfacial width and interfacial mixing concentration.
Random swapping of type 1 and type 2 sites near the interface is done to produce an mixed interfaction region with a controlled width and blend ratio.
interfacial_width | specifies the desired width of the mixed interfacial region. |
interfacial_conc | specified the desired blend ratio of mixed interfacial region. |
void Ising_OPV::Morphology::executeSmoothing | ( | const double | smoothing_threshold, |
const int | rescale_factor | ||
) |
Executes a smoothing algorithm that smooths out rough domain interfaces and removes small islands and island sites.
Smoothing is done by determining a roughness factor for each site that is given by the fraction of surrounding sites that are a different type. Sites with a roughness factor is greater than the specified smoothing_threshold are switched to the opposite type. A rescale dependent smoothing process is executed when the rescale factor is greater than 2.
smoothing_threshold | is the numerical parameter used to adjust how aggressive the smoothing should be. |
rescale_factor | specifies whether the smoothing algorithm should be adjust to account for prior lattice rescaling by giving the rescaling factor used. |
vector< double > Ising_OPV::Morphology::getCorrelationData | ( | const char | site_type | ) | const |
Returns a vector containing the pair-pair autocorrelation function data for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
vector< double > Ising_OPV::Morphology::getDepthCompositionData | ( | const char | site_type | ) | const |
Returns a vector containing the film depth dependent blend composition data in the z-direction.
site_type | specifies for which site type the data should be retrieved. |
vector< double > Ising_OPV::Morphology::getDepthDomainSizeData | ( | const char | site_type | ) | const |
Returns a vector containing the film depth dependent domain size data in the z-direction.
site_type | specifies for which site type the data should be retrieved. |
vector< double > Ising_OPV::Morphology::getDepthIVData | ( | ) | const |
Returns a vector containing the film depth dependent interfacial volume fraction data in the z-direction.
double Ising_OPV::Morphology::getDomainAnisotropy | ( | const char | site_type | ) | const |
Returns the domain anisotropy determined for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
double Ising_OPV::Morphology::getDomainSize | ( | const char | site_type | ) | const |
Returns the domain size determined for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
int Ising_OPV::Morphology::getHeight | ( | ) | const |
Gets the height or z-direction size of the lattice.
int Ising_OPV::Morphology::getID | ( | ) | const |
Gets the ID number of the Morphology object.
vector< pair< double, int > > Ising_OPV::Morphology::getInterfacialDistanceHistogram | ( | const char | site_type | ) | const |
Returns a vector containing the interfacial distance probability histogram data for the specified site type.
The histogram bins are distances given by the vector index + 1 in lattice units.
site_type | specifies for which site type the data should be retrieved. |
double Ising_OPV::Morphology::getIslandVolumeFraction | ( | const char | site_type | ) | const |
Returns the island volume for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
int Ising_OPV::Morphology::getLength | ( | ) | const |
Returns the length or x-direction size of the lattice.
double Ising_OPV::Morphology::getMixFraction | ( | const char | site_type | ) | const |
Returns the mix fraction for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
vector< double > Ising_OPV::Morphology::getTortuosityData | ( | const char | site_type | ) | const |
Returns a vector containing the end-to-end tortuosity data for the specified site type.
site_type | specifies for which site type the data should be retrieved. |
double Ising_OPV::Morphology::getUnitSize | ( | ) | const |
Returns the lattice unit size in units of nm.
int Ising_OPV::Morphology::getWidth | ( | ) | const |
Returns the width or y-direction size of the lattice.
bool Ising_OPV::Morphology::importMorphologyFile | ( | std::ifstream & | infile | ) |
vector< Morphology > Ising_OPV::Morphology::importTomogramMorphologyFile | ( | ) |
Imports the tomogram dataset specified in the parameter file.
void Ising_OPV::Morphology::outputCompositionMaps | ( | std::ofstream & | outfile | ) | const |
Outputs the areal composition map data to the specified output filestream.
outfile | is the already open output filestream. |
void Ising_OPV::Morphology::outputCorrelationData | ( | std::ofstream & | outfile | ) | const |
Outputs the domain autocorrelation function data to the specified output filestream.
outfile | is the already open output filestream. |
void Ising_OPV::Morphology::outputDepthDependentData | ( | std::ofstream & | outfile | ) | const |
Outputs the lattice depth dependent (z-direction) characteristics to the specified output filestream.
Outputs the depth dependent composition, interfacial volume fraction, and domain size.
outfile | is the already open output filestream. |
void Ising_OPV::Morphology::outputMorphologyCrossSection | ( | std::ofstream & | outfile | ) | const |
Outputs a cross-section of the morphology at the x=Length/2 plane to the specified output filestream.
outfile | is the already open output filestream. |
void Ising_OPV::Morphology::outputMorphologyFile | ( | std::ofstream & | outfile, |
const bool | enable_export_compressed | ||
) | const |
Outputs the morphology data to a file specified by the output filestream.
The user can specify whether to use the compressed format or not.
outfile | is the already open output filestream. |
enable_export_compressed | is a boolean option that allows users to choose whether the output morphology file uses the compressed format or not. |
void Ising_OPV::Morphology::outputTortuosityMaps | ( | std::ofstream & | outfile | ) | const |
Outputs the areal end-to-end tortuosity map data to the specified output filestream.
outfile | is the already open output filestream. |
void Ising_OPV::Morphology::setParameters | ( | const Parameters & | params | ) |
Sets the parameters of the Morphology class using the input Parameters object.
params | is the Parameters object that contains all parameters needed by the Morphology class. |
void Ising_OPV::Morphology::shrinkLattice | ( | const int | rescale_factor | ) |
Shrinks the existing lattice by a fraction of 1 over the integer rescale_factor value.
Each of the original lattice dimensions must be divisible by the rescale factor. The original lattice is overwritten by the newly created smaller lattice.
void Ising_OPV::Morphology::stretchLattice | ( | const int | rescale_factor | ) |
Stretches the existing lattice by a integer rescale_factor value.
The original lattice is overwritten by the newly created larger lattice.