Beispiel #1
0
from gridData import Grid
import numpy as np
import sys

sys.path.append("/home/abdullah/Code/Python/SFED/")
from gridcollector import GridCollector
from SFED_routines import sfed_kh_3drism, integrate_sfed
from pathlib import Path

base_path = Path(__file__).parent
data_path = file_path = (base_path / "../data/DATA/KH/").resolve()

gc3methbut1e = GridCollector("3methbut1e", str(data_path) + "/3methbut1e/3")
gc3methbut1ol = GridCollector("3methbut1ol", str(data_path) + "/3methbut1ol/3")
gc24dimepen = GridCollector("24dimepen", str(data_path) + "/24dimepen/3")
gcethene = GridCollector("ethene", str(data_path) + "/ethene/3")
gcethylbenzene = GridCollector("ethylbenzene",
                               str(data_path) + "/ethylbenzene/3")
gcn_decane = GridCollector("n_decane", str(data_path) + "/n_decane/3")
gcn_hexane = GridCollector("n_hexane", str(data_path) + "/n_hexane/3")
gcphenol = GridCollector("phenol", str(data_path) + "/phenol/3")
gcnhexylbenzene = GridCollector("nhexylbenzene",
                                str(data_path) + "/nhexylbenzene/3")

prec = 4


def test_3methbut1e():
    sfed_o = sfed_kh_3drism(gc3methbut1e.grids["HO"].grid,
                            gc3methbut1e.grids["CO"].grid,
                            gc3methbut1e.grids["HH1"].grid,
Beispiel #2
0
Datei: sfed.py Projekt: 2AUK/SFED
                    required=False)
args = parser.parse_args()


def epilogue(output_sfed, sample_grid, fname):
    print("SFE (integrated SFED):\n",
          integrate_sfed(output_sfed, np.prod(sample_grid.delta)))
    writedx(output_sfed, sample_grid, fname)
    print("SFED written to " + fname + ".dx")


if __name__ == "__main__":
    data_path = args.directory
    mol_name = args.input
    #suffixes = args.tags
    grids = GridCollector(mol_name, data_path)

    if args.closure == "KH":
        output_sfed = sfed_kh_3drism(grids.grids["HO"].grid,
                                     grids.grids["CO"].grid,
                                     grids.grids["HH1"].grid,
                                     grids.grids["CH1"].grid,
                                     rho=args.density,
                                     T=args.temperature)
        epilogue(output_sfed, grids.grids["HO"], args.output)
    elif args.closure == "GF":
        output_sfed = sfed_gf_3drism(grids.grids["HO"].grid,
                                     grids.grids["CO"].grid,
                                     grids.grids["HH1"].grid,
                                     grids.grids["CH1"].grid,
                                     rho=args.density,