61 lines
2.0 KiB
Python
61 lines
2.0 KiB
Python
from pydantic import BaseModel, ConfigDict, Field
|
|
from typing_extensions import Literal
|
|
|
|
import random
|
|
from pathlib import Path
|
|
|
|
|
|
class DiceConfig(BaseModel):
|
|
"""
|
|
Data Transfer Object for the Dice configuration.
|
|
"""
|
|
|
|
model_config = ConfigDict(
|
|
frozen=True,
|
|
)
|
|
nprocs: int = Field(
|
|
..., description="Number of processes to use for the DICE simulations"
|
|
)
|
|
|
|
ljname: Path = Field(..., description="Name of the Lennard-Jones potential file")
|
|
outname: str = Field(
|
|
..., description="Name of the output file for the simulation results"
|
|
)
|
|
dens: float = Field(..., description="Density of the system")
|
|
nmol: list[int] = Field(
|
|
..., description="List of the number of molecules for each component"
|
|
)
|
|
nstep: list[int] = Field(
|
|
...,
|
|
description="List of the number of steps for each component",
|
|
min_length=2,
|
|
max_length=3,
|
|
)
|
|
|
|
upbuf: int = Field(
|
|
360, description="Buffer size for the potential energy calculations"
|
|
)
|
|
irdf: int = Field(
|
|
0,
|
|
description="Controls the interval of Monte Carlo steps at which configurations are used at computation of radial distribution functions",
|
|
)
|
|
vstep: int = Field(
|
|
5000, description="Frequency of volume change moves in NPT simulations"
|
|
)
|
|
combrule: Literal["+", "*"] = Field(
|
|
"*", description="Combination rule for the Lennard-Jones potential"
|
|
)
|
|
isave: int = Field(1000, description="Frequency of saving the simulation results")
|
|
press: float = Field(1.0, description="Pressure of the system")
|
|
temp: float = Field(300.0, description="Temperature of the system")
|
|
progname: str = Field(
|
|
"dice", description="Name of the program to run the simulation"
|
|
)
|
|
randominit: str = Field(
|
|
"first", description="Method for initializing the random number generator"
|
|
)
|
|
seed: int = Field(
|
|
default_factory=lambda: int(1e6 * random.random()),
|
|
description="Seed for the random number generator",
|
|
)
|