kawin.precipitation (TTP)

kawin.kawin.precipitation.StoppingConditions

Inequality (Enum)

PrecipitationStoppingCondition

class PrecipitationStoppingCondition(self, condition, value, phase = None, element = None):

Parameters
----------
condition : Inequality enum
    GREATER_THAN -> result > value
    LESS_THAN -> result < value
value : double
phase : str
element : el

def PrecipitationStoppingCondition.reset(self):

Resets condition to being not yet satisfied

def PrecipitationStoppingCondition._getData(self, model):

def PrecipitationStoppingCondition._poll(self, model, n):

Gets current value of attribute at iteration n for phase p

Parameters
----------
model : PrecipitateModel
n : int
    Iteration number

Returns value (float) of attribute at n,p

def PrecipitationStoppingCondition._testCondition(self, model):

Private function only testing if stopping condition is satisfied based off current state of model

Parameters
----------
model : PrecipitateModel

Returns bool for whether condition is satisfied or not

def PrecipitationStoppingCondition.testCondition(self, model):

Tests if condition is satisfied, if so, then interpolate to find time when it was satisfied

Parameters
----------
model : PrecipitateModel

def PrecipitationStoppingCondition.isSatisfied(self):

Returns whether condition is satisfied

def PrecipitationStoppingCondition.satisfiedTime(self):

Returns time when condition was satisfied

VolumeFractionCondition (PrecipitationStoppingCondition)

class VolumeFractionCondition (self, condition, value, phase = None):

def VolumeFractionCondition ._getData(self, model):

AverageRadiusCondition (PrecipitationStoppingCondition)

class AverageRadiusCondition (self, condition, value, phase = None):

def AverageRadiusCondition ._getData(self, model):

DrivingForceCondition (PrecipitationStoppingCondition)

class DrivingForceCondition (self, condition, value, phase = None):

def DrivingForceCondition ._getData(self, model):

NucleationRateCondition (PrecipitationStoppingCondition)

class NucleationRateCondition (self, condition, value, phase = None):

def NucleationRateCondition ._getData(self, model):

PrecipitateDensityCondition (PrecipitationStoppingCondition)

class PrecipitateDensityCondition (self, condition, value, phase = None):

def PrecipitateDensityCondition ._getData(self, model):

CompositionCondition (PrecipitationStoppingCondition)

class CompositionCondition (self, condition, value, element = None):

def CompositionCondition ._poll(self, model, n):

kawin.kawin.precipitation.TimeTemperaturePrecipitation

TTPCalculator

class TTPCalculator(self, model : PrecipitateModel, stopConds : list[PrecipitationStoppingCondition]):

Time-temperature-precipitation

Parameters
----------
model : PrecipitateModel
stopConds : list of PrecipitateStoppingConditions
    Stopping conditions to store times when these conditions are reached
    Model will continue to solve until the max time is reached or all conditions are satisfied

def TTPCalculator._getStopTime(self, T):

Internal function to get times for each stopping conditions at a single temperature

Parameters
----------
T : float
    Temperature

def TTPCalculator.calculateTTP(self, Tlow, Thigh, Tsteps, maxTime, pool = None):

Calculates TTP diagram between Tlow and Thigh

Parameters
----------
Tlow : float
    Lower temperature range
Thigh : float
    Upper temperature range
Tsteps : int
    Number of temperatures between Tlow and Thigh to evaluate
maxTime : float
    Maximum simulation time
    If the model reaches the max time before all stopping conditions are met, it will stop prematurely
        and any unsatisfied stopping conditions will be recorded as -1
pool : None or multiprocessing pool
    If None, each temperature will be evaluated in serial
    If a pool, must have a map function
        Possible options: 
            multiprocessing.Pool - (mac and unix only)
            pathos.multiprocessing.ProcessingPool - (windows, mac and unix)
            dask.Client - (windows, mac and unix)

def plotTTP(ttp: TTPCalculator, ax=None, *args, **kwargs):

Plots TTP diagram

Parameters
----------
ax : Matplotlib axes object
labels : list of str
    Labels for each stopping condition
xlim : list of float
    x-axis limits
    Plotting will be set on log scale, so lower limits will be set to be non-zero