-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved robustness of the Python driver. Separated pre and post-processing steps more thoroughly so that dedicated scripts can be written to do those tasks independently
- Loading branch information
Showing
8 changed files
with
156 additions
and
62 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
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,6 @@ | ||
| """ | ||
| Deletes all output generated by a previous simulation | ||
| """ | ||
| import ctem | ||
| sim = ctem.Simulation(isnew=False) | ||
| sim.cleanup() |
7 changes: 7 additions & 0 deletions
7
python/ctem/tests/run_and_reprocess/ctem_compute_one_interval.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,7 @@ | ||
| """ | ||
| This is an example of a standalone script. Files must be generated by a preprocessing script (this is an atypical useage | ||
| and is only here for testing purposes). | ||
| """ | ||
| import ctem | ||
| sim = ctem.Simulation(isnew=False) | ||
| sim.compute_one_interval() |
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 |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| """ | ||
| This is an example of a standard "driver" script. This will read in the input files, pre-process them for the main | ||
| Fortran code and post-process them. | ||
| """ | ||
| import ctem | ||
| sim = ctem.Simulation() | ||
| sim.run() |
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,10 @@ | ||
| """ | ||
| This is an example of a post-processing script. This will read in the input and output files and process them like as in | ||
| a typical CTEM simulation | ||
| """ | ||
| import ctem | ||
| sim = ctem.Simulation(isnew=False) | ||
| sim.read_output() | ||
| sim.user['ncount'] += 1 | ||
| sim.process_output() |
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,5 @@ | ||
| """ | ||
| This is an example of a pre-processing script. This will read in the input files, but won't execute a simulation. | ||
| """ | ||
| import ctem | ||
| sim = ctem.Simulation() |