-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parm parse getter query for selected types (int, bool, Real) (#158)
* adding wrappers for parmparse get and query for selected types with tests Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Axel Huebl <axelhuebl@lbl.gov> * initialize-finalize called once for all tests Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * add dir for input file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleaning * Cleaning * Fix typo --------- Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: Axel Huebl <axelhuebl@lbl.gov> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b63a9e6
commit 494ad40
Showing
3 changed files
with
57 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
param.dt = 1.e-5 | ||
param.ncell = 100 | ||
param.do_pml = 1 |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
import amrex.space3d as amr | ||
|
||
|
||
def test_parmparse(): | ||
pp = amr.ParmParse("") | ||
dir_name = os.path.dirname(__file__) | ||
pp.addfile(os.path.join(dir_name, "parmparse_inputs")) | ||
pp_param = amr.ParmParse("param") | ||
_, ncell = pp_param.query_int("ncell") | ||
dt = pp_param.get_real("dt") | ||
dopml = pp_param.get_bool("do_pml") | ||
|
||
assert dopml == True | ||
assert dt == 1.0e-5 | ||
assert ncell == 100 |