Ising_OPV  v4.0.2
Generates and analyzes model bulk heterojunction morphologies in a parallel computing environment
Ising_OPV::Morphology Class Reference

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 &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). More...
 
 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. 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< MorphologyimportTomogramMorphologyFile ()
 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 &params)
 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...
 

Detailed Description

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.

Author
Michael C. Heiber
Date
2014-2019

Constructor & Destructor Documentation

◆ Morphology() [1/3]

Ising_OPV::Morphology::Morphology ( )

Default constructor that creates a Morphology object with the default parameters and an empty lattice.

Warning
An empty Morphology object should not be used without defining a lattice.

◆ Morphology() [2/3]

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.

Parameters
paramsis the Parameters object that contains all parameters needed by the Morphology class.
idis the input integer ID number that will be assigned to the Morphology object.

◆ Morphology() [3/3]

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.

Parameters
input_latticeis the input Lattice object that will be used to create the Morphology.
paramsis the Parameters object that contains all parameters needed by the Morphology class.
idis the input integer ID number that will be assigned to the Morphology object.

◆ ~Morphology()

Ising_OPV::Morphology::~Morphology ( )
virtual

This is the default virtual destructor.

Member Function Documentation

◆ calculateAnisotropies()

void Ising_OPV::Morphology::calculateAnisotropies ( )

Calculates the domain size anisotropy of each phase.

◆ calculateCorrelationDistances()

void Ising_OPV::Morphology::calculateCorrelationDistances ( )

Calculates the correlation length data and the domain size using the input parameter options.

◆ calculateDepthDependentData()

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.

◆ calculateInterfacialAreaVolumeRatio()

double Ising_OPV::Morphology::calculateInterfacialAreaVolumeRatio ( ) const

Calculates the interfacial area in units of lattice units squared.

◆ calculateInterfacialDistanceHistogram()

void Ising_OPV::Morphology::calculateInterfacialDistanceHistogram ( )

Calculates the interfacial distance histograms, which gives the fraction of sites at a specified distance from the interface.

◆ calculateInterfacialVolumeFraction()

double Ising_OPV::Morphology::calculateInterfacialVolumeFraction ( ) const

Calculates the fraction of sites adjacent to an interface.

◆ calculateMixFractions()

void Ising_OPV::Morphology::calculateMixFractions ( )

Calculates the volume fraction of each type site in the lattice to the total number of sites.

◆ calculateTortuosity()

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.

Parameters
site_typespecifies which site type to perform the tortuosity calculation on.
enable_reduced_memoryallows users to choose to use a slower algorithm that uses less RAM.

◆ createBilayerMorphology()

void Ising_OPV::Morphology::createBilayerMorphology ( )

Creates a split bilayer morphology in the z-direction.

◆ createCheckerboardMorphology()

void Ising_OPV::Morphology::createCheckerboardMorphology ( )

Creates a 3D checkerboard morphology.

◆ createRandomMorphology()

void Ising_OPV::Morphology::createRandomMorphology ( const std::vector< double > &  mix_fractions)

Creates a randomly mixed morphology with the specified blend ratios.

Parameters
mix_fractionsis a vector that specifies the blend ratio of each site type.

◆ executeIsingSwapping()

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.

Parameters
num_MCstepsis 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_energy1defines the energetic difference between like-like and unlike-unlike interactions for type 1 sites in units of kT.
interaction_energy2defines the energetic difference between like-like and unlike-unlike interactions for type 2 sites in units of kT.
enable_growth_prefis a boolean option that allows users to enable preferential interations in one of the pricipal lattice directions.
growth_directionis 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_interactionis used when directional interactions are enabled and specifies the additional interaction energy with sites in the specified direction.

◆ executeMixing()

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.

Parameters
interfacial_widthspecifies the desired width of the mixed interfacial region.
interfacial_concspecified the desired blend ratio of mixed interfacial region.

◆ executeSmoothing()

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.

Parameters
smoothing_thresholdis the numerical parameter used to adjust how aggressive the smoothing should be.
rescale_factorspecifies whether the smoothing algorithm should be adjust to account for prior lattice rescaling by giving the rescaling factor used.

◆ getCorrelationData()

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.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
a copy of the data vector.

◆ getDepthCompositionData()

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.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
a copy of the data vector.

◆ getDepthDomainSizeData()

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.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
a copy of the data vector.

◆ getDepthIVData()

vector< double > Ising_OPV::Morphology::getDepthIVData ( ) const

Returns a vector containing the film depth dependent interfacial volume fraction data in the z-direction.

Returns
a copy of the data vector.

◆ getDomainAnisotropy()

double Ising_OPV::Morphology::getDomainAnisotropy ( const char  site_type) const

Returns the domain anisotropy determined for the specified site type.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
zero if the calculateAnisotropy function has not been called.
the domain anisotropy calculated from the direction dependent correlation function data.

◆ getDomainSize()

double Ising_OPV::Morphology::getDomainSize ( const char  site_type) const

Returns the domain size determined for the specified site type.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
-1 if the calculateCorrelationDistance function has not been called.
the domain size calculated from the correlation function data.

◆ getHeight()

int Ising_OPV::Morphology::getHeight ( ) const

Gets the height or z-direction size of the lattice.

Returns
an integer representing the height or z-direction size of the lattice.

◆ getID()

int Ising_OPV::Morphology::getID ( ) const

Gets the ID number of the Morphology object.

Returns
the integer ID number.

◆ getInterfacialDistanceHistogram()

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.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
a copy of the data vector.

◆ getIslandVolumeFraction()

double Ising_OPV::Morphology::getIslandVolumeFraction ( const char  site_type) const

Returns the island volume for the specified site type.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
-1 if the calculateTortuosity function has not been called.
the volume fraction of island sites not connected to the top or bottom surface (z-dimension).

◆ getLength()

int Ising_OPV::Morphology::getLength ( ) const

Returns the length or x-direction size of the lattice.

Returns
an integer representing the length or x-direction size of the lattice.

◆ getMixFraction()

double Ising_OPV::Morphology::getMixFraction ( const char  site_type) const

Returns the mix fraction for the specified site type.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
-1 if the calculateMixFractions function has not been called.
the volumetric blend ratio of the specified site type.

◆ getTortuosityData()

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.

Parameters
site_typespecifies for which site type the data should be retrieved.
Returns
a copy of the data vector.

◆ getUnitSize()

double Ising_OPV::Morphology::getUnitSize ( ) const

Returns the lattice unit size in units of nm.

◆ getWidth()

int Ising_OPV::Morphology::getWidth ( ) const

Returns the width or y-direction size of the lattice.

Returns
an integer representing the width or y-direction size of the lattice.

◆ importMorphologyFile()

bool Ising_OPV::Morphology::importMorphologyFile ( std::ifstream &  infile)

Imports the Ising_OPV morphology text file given by the specified input filestream.

Parameters
infileis the already open input filestream pointing to an Ising_OPV morphology file.
Returns
false if there is an error during file import.
true if morphology file import is sucessful.

◆ importTomogramMorphologyFile()

vector< Morphology > Ising_OPV::Morphology::importTomogramMorphologyFile ( )

Imports the tomogram dataset specified in the parameter file.

Returns
a vector of Morphology objects that consists of a series of subsections of the original tomogram data.

◆ outputCompositionMaps()

void Ising_OPV::Morphology::outputCompositionMaps ( std::ofstream &  outfile) const

Outputs the areal composition map data to the specified output filestream.

Parameters
outfileis the already open output filestream.

◆ outputCorrelationData()

void Ising_OPV::Morphology::outputCorrelationData ( std::ofstream &  outfile) const

Outputs the domain autocorrelation function data to the specified output filestream.

Parameters
outfileis the already open output filestream.

◆ outputDepthDependentData()

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.

Parameters
outfileis the already open output filestream.

◆ outputMorphologyCrossSection()

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.

Parameters
outfileis the already open output filestream.

◆ outputMorphologyFile()

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.

Parameters
outfileis the already open output filestream.
enable_export_compressedis a boolean option that allows users to choose whether the output morphology file uses the compressed format or not.

◆ outputTortuosityMaps()

void Ising_OPV::Morphology::outputTortuosityMaps ( std::ofstream &  outfile) const

Outputs the areal end-to-end tortuosity map data to the specified output filestream.

Parameters
outfileis the already open output filestream.

◆ setParameters()

void Ising_OPV::Morphology::setParameters ( const Parameters params)

Sets the parameters of the Morphology class using the input Parameters object.

Parameters
paramsis the Parameters object that contains all parameters needed by the Morphology class.

◆ shrinkLattice()

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.

◆ stretchLattice()

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.


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