-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from ICAMS/min_mode
Min mode
- Loading branch information
Showing
13 changed files
with
638 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import os | ||
import numpy as np | ||
import shutil | ||
import argparse as ap | ||
import subprocess | ||
import yaml | ||
import time | ||
import datetime | ||
|
||
from calphy.input import read_inputfile, load_job, save_job | ||
from calphy.liquid import Liquid | ||
from calphy.solid import Solid | ||
from calphy.alchemy import Alchemy | ||
|
||
def _generate_job(calc, simfolder): | ||
if calc.mode == "alchemy" or calc.mode == "composition_scaling": | ||
job = Alchemy(calculation=calc, simfolder=simfolder) | ||
return job | ||
else: | ||
if calc.reference_phase == "liquid": | ||
job = Liquid(calculation=calc, simfolder=simfolder) | ||
return job | ||
else: | ||
job = Solid(calculation=calc, simfolder=simfolder) | ||
return job | ||
|
||
|
||
def run_averaging(): | ||
arg = ap.ArgumentParser() | ||
arg.add_argument("-i", "--input", required=True, type=str, | ||
help="name of the input file") | ||
arg.add_argument("-k", "--kernel", required=True, type=int, | ||
help="kernel number of the calculation to be run.") | ||
args = vars(arg.parse_args()) | ||
kernel = args["kernel"] | ||
calculations = read_inputfile(args["input"]) | ||
calc = calculations[kernel] | ||
|
||
simfolder = calc.create_folders() | ||
job = _generate_job(calc, simfolder) | ||
os.chdir(simfolder) | ||
|
||
|
||
job.run_averaging() | ||
save_job(job) | ||
|
||
|
||
def process_averaging(): | ||
arg = ap.ArgumentParser() | ||
arg.add_argument("-i", "--input", required=True, type=str, | ||
help="name of the input file") | ||
arg.add_argument("-k", "--kernel", required=True, type=int, | ||
help="kernel number of the calculation to be run.") | ||
args = vars(arg.parse_args()) | ||
kernel = args["kernel"] | ||
calculations = read_inputfile(args["input"]) | ||
calc = calculations[kernel] | ||
|
||
job = load_job(calc.savefile) | ||
job.process_averaging_results() | ||
save_job(job) | ||
|
||
def run_integration(): | ||
arg = ap.ArgumentParser() | ||
arg.add_argument("-i", "--input", required=True, type=str, | ||
help="name of the input file") | ||
arg.add_argument("-k", "--kernel", required=True, type=int, | ||
help="kernel number of the calculation to be run.") | ||
args = vars(arg.parse_args()) | ||
kernel = args["kernel"] | ||
calculations = read_inputfile(args["input"]) | ||
calc = calculations[kernel] | ||
|
||
job = load_job(calc.savefile) | ||
job.run_integration() | ||
save_job(job) | ||
|
||
def process_integration(): | ||
arg = ap.ArgumentParser() | ||
arg.add_argument("-i", "--input", required=True, type=str, | ||
help="name of the input file") | ||
arg.add_argument("-k", "--kernel", required=True, type=int, | ||
help="kernel number of the calculation to be run.") | ||
args = vars(arg.parse_args()) | ||
kernel = args["kernel"] | ||
calculations = read_inputfile(args["input"]) | ||
calc = calculations[kernel] | ||
|
||
job = load_job(calc.savefile) | ||
job.thermodynamic_integration() | ||
job.submit_report() | ||
save_job(job) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.