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:
-
average_df_list
–compute average of list of DataFrame
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:
-
Obj
(LmpLogFile
) –LmpLogFile object
Methods:
-
read_log
–Read LAMMPS logfile
read_log(logfile)
¶
Read LAMMPS logfile Args: logfile (str): input LOG file
Returns:
-
Obj
(LmpLogFile
) –LmpLogFile object
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:
-
Obj
(LmpAveChunk
) –LmpAveChunk object
Examples:
Methods:
-
read_RDF
–Args:
-
compute_AveRDF
–compute average of RDF over all frames
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:
-
Obj
(LmpAveChunk
) –LmpAveChunk object
Examples:
Methods:
-
read_AveChunk
–Args:
-
compute_AveChunk
–compute average of RDF over all frames
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:
initiate object
Parameters:
-
file_name
(str
) –file_name
Returns:
-
Obj
(PlumHistogram
) –PlumHistogram object
Methods:
-
read_histogram
–Args:
-
compute_average_histogram
–compute average of histogram over all frames
-
areaHisto
– -
fit_std_gaussian
–Fit the average-histogarm to Standard Gaussian function
-
find_tail
–Find tail of distribution function
-
find_center
–Find tail of distribution function
read_histogram(file_name: str)
¶
Parameters:
-
file_name
(str
) –input HISTOGRAM file
Returns:
-
Obj
(PlumHistogram
) –update PlumHistogram object
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