-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_pde.py
More file actions
27 lines (25 loc) · 1.04 KB
/
generate_pde.py
File metadata and controls
27 lines (25 loc) · 1.04 KB
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
import yaml
from argparse import ArgumentParser
from scripts.generate_ccs2d_acc import generate_ccs2d
from scripts.generate_ccs2d_mp_single import generate_multi_channel_batch
from scripts.generate_ccs2d_refactored import generate_ccs2d_batch
if __name__ == "__main__":
parser = ArgumentParser(description='Generate CCS2D solutions')
parser.add_argument('--config', type=str, help='Path to config file')
options = parser.parse_args()
config_path = options.config
with open(config_path, 'r') as f:
config = yaml.load(f, Loader=yaml.FullLoader)
name = config['data']['name']
if name == 'CCS2D':
print('Solving CCS2D equation...')
generate_ccs2d(config)
elif name == 'CCS2D-MP':
print('Solving CCS2D equation [multi-channels]...')
generate_multi_channel_batch(config)
elif name == 'CCS2D-RF':
print('Solving CCS2D equation [refactored]...')
generate_ccs2d_batch(config)
else:
print(f'Unknown data name: {name}. Supported: CCS2D, CCS2D-MP, CCS2D-RF')
exit(1)