Skip to content

Io read block

thmd.io.read_block

Classes:

  • LmpLogFile

    Create an Object of LOG file.

  • LmpRDF

    class to read Radial Distribution Fuction (RDF) file from Lammps compute

  • LmpAveChunk

    class to read Radial Distribution Fuction (RDF) file from Lammps compute

  • PlumHistogram

    Create an Object of DUMP file

Functions:

LmpLogFile(logfile=None)

Create an Object of LOG file.

Notes
  • run 0 without data
Udpate
  • 2024-10-10: use Polars DataFrame instead of Pandas Series

Parameters:

  • logfile (str, default: None ) –

    file_name of LOG file

Returns:

Methods:

read_log(logfile)

Read LAMMPS logfile Args: logfile (str): input LOG file

Returns:

LmpRDF(file_name: str)

class to read Radial Distribution Fuction (RDF) file from Lammps compute

Attributes:

  • file_name (str) –

    file name

  • frame (DataFrame) –

    3d pandas Frame (multi-row-index DataFrame)

Methods:

  • ReadRDF

    read RDF file

  • AverageRDF

    the Average RDF

initiate object

Parameters:

  • file_name (str) –

    file_name

Returns:

Examples:

RDF = LmpAveChunk('rdf.txt')

Methods:

read_RDF(file_name: str)

Parameters:

  • file_name (str) –

    input RDF file

Returns:

  • Obj ( LmpRDF ) –

    LmpRDF object

compute_AveRDF()

compute average of RDF over all frames

Returns:

  • df ( DataFrame ) –

    Average of RDF

LmpAveChunk(file_name)

class to read Radial Distribution Fuction (RDF) file from Lammps compute

Attributes:

  • file_name (str) –

    file name.

  • frame (DataFrame) –

    3d pandas Frame (multi-row-index DataFrame).

Methods:

  • ReadRDF

    read RDF file

  • AverageRDF

    the Average RDF

initiate object

Parameters:

  • file_name (str) –

    file_name

Returns:

Examples:

RDF = LmpAveChunk('LmpAveChunk.txt')

Methods:

read_AveChunk(file_name)

Parameters:

  • file_name (str) –

    input RDF file

Returns:

compute_AveChunk()

compute average of RDF over all frames

Returns:

  • df ( DataFrame ) –

    Average of RDF

PlumHistogram(file_name)

Create an Object of DUMP file

Methods:

  • read_histogram

    read Histogram file

  • average_histogram

    the Average Histogram

  • AreaHisto

    Area under pdf curve

  • find_tail

    find limit of histogram

  • find_center

    find center of histogram

Examples:

from thmd.io.read_block import PlumHistogram
RDF = PlumHistogram(file_name='myRDF.txt')

initiate object

Parameters:

  • file_name (str) –

    file_name

Returns:

Methods:

read_histogram(file_name: str)

Parameters:

  • file_name (str) –

    input HISTOGRAM file

Returns:

compute_average_histogram()

compute average of histogram over all frames

Returns:

  • df ( DataFrame ) –

    DataFrame of avergave histogram

areaHisto()

fit_std_gaussian()

Fit the average-histogarm to Standard Gaussian function

Returns:

  • amp, miu, sigma) (tuple

    parameters of Gaussian function

find_tail(tol=0.0001, gridSize=1e-06)

Find tail of distribution function

Parameters:

  • tol (float, default: 0.0001 ) –

    tolerance

  • gridSize (float, default: 1e-06 ) –

    size of grid

Returns:

  • left_tail ( float ) –

    limit on the left side

  • right_tail ( float ) –

    limit on the right side

find_center(gridSize=1e-06)

Find tail of distribution function

Parameters:

  • gridSize (float, default: 1e-06 ) –

    size of grid

Returns:

  • Xcenter ( float ) –

    center of the distribution function

average_df_list(list_df: list[pl.DataFrame]) -> pl.DataFrame

compute average of list of DataFrame

Parameters:

  • list_df (list) –

    list of DataFrame

Returns:

  • df ( DataFrame ) –

    Average of list of DataFrame