-
Notifications
You must be signed in to change notification settings - Fork 0
/
trajectory.jl
52 lines (45 loc) · 2.11 KB
/
trajectory.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include("parse.jl")
parsed_args, flags = parse_commandline()
@info "Starting $(parsed_args["procs"]) processes."
using Distributed
addprocs(parsed_args["procs"])
@everywhere push!(LOAD_PATH, "./Fields")
@everywhere push!(LOAD_PATH, "./TrajSolver")
@everywhere push!(LOAD_PATH, "./TrajAnalyzer")
using Fields
using TrajSolver
using TrajAnalyzer
include("fileio.jl")
include("job_manage.jl")
function prepare()
config_file,input_file,output_file = parsed_args["config"],parsed_args["infile"],parsed_args["outfile"]
fields_config,trajsolver_config,job_config,material_config = parse_config(config_file,parsed_args)
#info("building field $([k for k in keys(fields_config)][1])...")
#@info "building field $name"
#fname = ascii([k for k in keys(fields_config)][1])
#sfn = Fields.buildAndAlign(fields_config["field"],0,name=fname)
fname = map(ascii,[k for k in keys(fields_config)])
sfn_arr = map(x->Fields.buildAndAlign(fields_config[x],0,name=x), fname)
# Fields.save_field(sfn)
#probe_sfn = Fields.buildAndAlign(job_config["probe"]["field"],0,name=ascii([k for k in keys(job_config["probe"])][1]))
mat_sfn = Fields.buildAndAlign(material_config["material"],0,name=ascii([k for k in keys(material_config)][1]))
return sfn_arr,mat_sfn,input_file,output_file,job_config,trajsolver_config
end
function main()
sfn_arr,mat_sfn,input_file,output_file,job_config,trajsolver_config = prepare()
@info "initializing TrajSolver..."
TrajSolver.init_parallel(trajsolver_config)
Fields.init_parallel!(sfn_arr, mat_sfn)
@info "Start calculating trajectories..."
if job_config["type"] == "single-scan-scaling"
@info "job type: single-scan-scaling"
single_scan_scaling(trajsolver_config,job_config,sfn_arr,input_file,output_file,flags)
#elseif job_config["type"] == "double-scan-scaling"
# @info "job type: double-scan-scaling"
# double_scan_scaling(trajsolver_config,job_config,sfn,input_file,output_file,flags)
# elseif job_config["type"] == "optimization"
# @info "job type: optimization"
# optimize_ngamma1d(job_config,sfn)
end
end
main()