-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
EXECUTABLE poly_eval.py |
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,16 @@ | ||
QUEUE_SYSTEM LOCAL | ||
QUEUE_OPTION LOCAL MAX_RUNNING 10 | ||
|
||
RUNPATH poly_out/realization-<IENS>/iter-<ITER> | ||
|
||
REALIZATION_MEMORY 50mb | ||
|
||
NUM_REALIZATIONS 10 | ||
MIN_REALIZATIONS 1 | ||
|
||
GEN_DATA POLY_RES RESULT_FILE:poly.out | ||
|
||
DESIGN_MATRIX poly_design.xlsx DESIGN_SHEET:DesignSheet01 DEFAULT_SHEET:DefaultSheet | ||
|
||
INSTALL_JOB poly_eval POLY_EVAL | ||
FORWARD_MODEL poly_eval |
Binary file not shown.
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,18 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
|
||
|
||
def _load_coeffs(filename): | ||
with open(filename, encoding="utf-8") as f: | ||
return json.load(f)["DESIGN_MATRIX"] | ||
|
||
|
||
def _evaluate(coeffs, x): | ||
return coeffs["a"] * x**2 + coeffs["b"] * x + coeffs["c"] | ||
|
||
|
||
if __name__ == "__main__": | ||
coeffs = _load_coeffs("parameters.json") | ||
output = [_evaluate(coeffs, x) for x in range(10)] | ||
with open("poly.out", "w", encoding="utf-8") as f: | ||
f.write("\n".join(map(str, output))) |