Skip to content
Snippets Groups Projects
Commit 58b0c231 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Added function to select parameters for DG scheme.

parent aa33f1d3
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,8 @@ Urgent: ...@@ -25,7 +25,8 @@ Urgent:
TODO: Build package for DG scheme -> Done TODO: Build package for DG scheme -> Done
TODO: Move scripts into separate directory -> Done TODO: Move scripts into separate directory -> Done
TODO: Move TODOs to Snakefile -> Done TODO: Move TODOs to Snakefile -> Done
TODO: Outsource run commands in SM rules into separate files TODO: Outsource run commands in SM rules into separate files -> Done
TODO: Add function to select parameters for DG schemes -> Done
TODO: Move plot_approximation_results() into plotting script TODO: Move plot_approximation_results() into plotting script
TODO: Introduce env files for each SM rule TODO: Introduce env files for each SM rule
...@@ -53,6 +54,7 @@ TODO: Add a default model state ...@@ -53,6 +54,7 @@ TODO: Add a default model state
TODO: Look into validators for variable checks TODO: Look into validators for variable checks
Not feasible yet or doc-related: Not feasible yet or doc-related:
TODO: Enforce SM conventions (no direct access to config, order in rule, etc.)
TODO: Replace pop() with get() for dictionary access TODO: Replace pop() with get() for dictionary access
TODO: Induce shift in IC class TODO: Induce shift in IC class
TODO: Force input_size for each ANN model to be stencil length TODO: Force input_size for each ANN model to be stencil length
......
...@@ -20,13 +20,17 @@ def get_ANN_model(wildcards): ...@@ -20,13 +20,17 @@ def get_ANN_model(wildcards):
return [] return []
def get_DG_params(wildcards):
return config['schemes'][wildcards.scheme]
rule approximate_solution: rule approximate_solution:
input: input:
get_ANN_model get_ANN_model
output: output:
DIR+'/fig/{scheme}.json' DIR+'/fig/{scheme}.json'
params: params:
dg_params = lambda wildcards: config['schemes'][wildcards.scheme], dg_params = get_DG_params,
plot_dir = DIR + '/fig' plot_dir = DIR + '/fig'
log: log:
DIR+'/log/approximate_solution/{scheme}.log' DIR+'/log/approximate_solution/{scheme}.log'
...@@ -40,7 +44,7 @@ rule plot_approximation_results: ...@@ -40,7 +44,7 @@ rule plot_approximation_results:
output: output:
expand(DIR + '/fig/{plot}/{{scheme}}.pdf', plot=PLOTS) expand(DIR + '/fig/{plot}/{{scheme}}.pdf', plot=PLOTS)
params: params:
dg_params=lambda wildcards: config['schemes'][wildcards.scheme], dg_params = get_DG_params,
plot_dir = DIR + '/fig', plot_dir = DIR + '/fig',
directory = DIR directory = DIR
log: log:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment