flory.common.phases

Module providing the Phases class, which captures information about phases.

Classes

Phases

Contains information about compositions and relative sizes of many phases.

class Phases(volumes, fractions)[source]

Bases: object

Contains information about compositions and relative sizes of many phases.

Parameters:
  • volumes (ndarray) – 1D array with shape \(N_\mathrm{P}\), containing the volume \(J_p\) of each phase.

  • fractions (ndarray) – 2D array with shape \(N_\mathrm{P} \times N_\mathrm{C}\), containing the volume fractions of the components in each phase \(\phi_{p,i}\). The first dimension must be the same as volumes.

Public Data Attributes:

num_phases

Number of phases \(N_\mathrm{P}\).

num_components

Number of components \(N_\mathrm{C}\).

mean_fractions

Mean fraction averaged over phases \(\bar{\phi}_i\)

Public Methods:

sort()

Sort the phases according to the index of most concentrated components.

get_clusters([dist])

Find clusters of compositions.


property num_phases: int

Number of phases \(N_\mathrm{P}\).

property num_components: int

Number of components \(N_\mathrm{C}\).

property mean_fractions: ndarray

Mean fraction averaged over phases \(\bar{\phi}_i\)

sort()[source]

Sort the phases according to the index of most concentrated components.

Returns:

The sorted phases.

Return type:

Phases

get_clusters(dist=0.01)[source]

Find clusters of compositions.

Find unique phases from compartments by clustering. The returning results are sorted according to the index of most concentrated components.

Parameters:

dist (float) – Cut-off distance for cluster analysis.

Returns:

The clustered and sorted phases.

Return type:

Phases