3 """ @package ForceBalance 5 Executable script for starting ForceBalance. """ 6 from __future__
import print_function
8 from builtins
import range
17 numpy.seterr(all=
'raise')
20 """ Create instances of ForceBalance components and run the optimizer. 22 The triumvirate, trifecta, or trinity of components are: 24 - The objective function 26 Cipher: "All I gotta do here is pull this plug... and there you have to watch Apoc die" 27 Apoc: "TRINITY" *chunk* 29 The force field is a class defined in forcefield.py. 30 The objective function is a combination of target classes and a penalty function class. 31 The optimizer is a class defined in this file. 37 if continue_: options[
'continue'] =
True 39 forcefield = FF(options)
41 objective = Objective(options, tgt_opts, forcefield)
43 optimizer = Optimizer(options, objective, forcefield)
57 Answer =
"\x1b[44m" +
" ".join([
'' for i
in range(len(word)+1)]) +
"\x1b[0m" 59 Answer =
"\x1b[43m" +
" ".join([
'' for i
in range(len(word)+1)]) +
"\x1b[0m" 63 printcool(
"Welcome to ForceBalance version 1.7.4! =D\nForce Field Optimization System\n\nAuthors:\nLee-Ping Wang\nYudong Qiu, Keri A. McKiernan\nJeffrey R. Wagner, Hyesu Jang, Simon Boothroyd\nArthur Vigil, Erik G. Brandt, Johnny Israeli", ansi=
"1", bold=
True, minwidth=64)
68 '+++++' `'++++ `,::::,,` 69 `;+++++: ,+++++'. `.:::::,` 70 `++++++, :+++++'` .,::::,` 71 .+++++'. ;+++++' `,,:::,` 72 :+++++'` `;+++++: `,::::,.` 73 ++++;` `++++++: `.:+@@###@' `,,::::.` 74 : ,++++++. ,;'+###############. .,::, 75 :++++++` +################':` . 78 ,,,, ##### ###### +++ +++ 79 ,::, ###' ####' :#####' +++ +++ 80 ,::, :####@ ####. ,####' +++ +++ 81 ,::, ###### #### +###+ +++ +++ 82 ,::, ##### #### ###; +++ +++ 83 ,::, :## #### ++` +++ +++ 84 ,::, ####``..:;+##############+` +++ +++ 85 ,::, .,:;;'++##################################` +++ +++ 86 ,::, `############################++++''';;;;;;;;;;;''; +++ +++ 87 ,::, ,########':,.`` #### +++ +++ 98 ++++, :+++++'` #### `,:::::. 99 .'+++++, :++++++. ### `,::::,.` 100 `'+++++; .++++++, +` .,::::,` 101 ;+++++'` `++++++: .,:::,,` 102 :+++++'. `;+++++;` `.:::::,` 103 ,++++++` '++++++ `,::::,,` 104 .'+++++: ,+; `,:::::. 112 colorlist = [[],[b],[b,g],[b,b,g],[b,b,g],[b,b,g],[b,b,g],[b,b,g],
113 [b,b,g],[b,b,k,g],[b,b,k,g],[b,k,g],[b,k],[k,k,b,b],
114 [g,k,k,b,b],[g,k,k,k,b,b],[g,k,k,k,b,b],[g,k,k,k,b,b],
115 [g,k,k,k,b,b],[g,k,k,k,b,b],[g,k,b,b],[g,k,b,b],[g,k,b,b],
116 [g,k,k,b,b],[g,k,b,b],[g,k,b,b],[g,k,b,b],[g,k,b,b],[g,k,b,b],
117 [g,k,b,b],[g,k,b,b],[b,k],[b,k],[b,b,k,g],[b,b,k,g],[b,b,k,g],
118 [b,b,k,g],[b,b,g],[b,b,g],[b,b,g],[b,b,g],[b,g],[b,g],[b],[]]
120 words = [l.split()
for l
in logostr.split(
'\n')]
121 for ln, line
in enumerate(logostr.split(
'\n')):
124 whites = re.findall(
'[ ]+',line)
128 if len(line) > 0
and line[0] ==
' ':
129 while i < max(len(words), len(whites)):
134 newline +=
process(words[i], colorlist[ln][i])
138 while i < max(len(words), len(whites)):
140 newline +=
process(words[i], colorlist[ln][i])
148 parser = argparse.ArgumentParser(description=
"Force Field Optimization System")
149 parser.add_argument(
"-c",
"--continue", action=
"store_true", help=
"Continue from a previous run")
150 parser.add_argument(
"-d",
"--debug", action=
"store_true", help=
"Run interactive debugger on program crash")
151 parser.add_argument(
"input", help=
"Forcebalance input file")
153 args = parser.parse_args()
154 continue_ = getattr(args,
'continue')
158 if __name__ ==
"__main__":
Nifty functions, intended to be imported by any module within ForceBalance.
Input file parser for ForceBalance jobs.
ForceBalance objective function.
def Run_ForceBalance(input_file, debug=False, continue_=False)
Create instances of ForceBalance components and run the optimizer.
def parse_inputs(input_file=None)
Parse through the input file and read all user-supplied options.
def printcool(text, sym="#", bold=False, color=2, ansi=None, bottom='-', minwidth=50, center=True, sym2="=")
Cool-looking printout for slick formatting of output.