Skip to content

Commit

Permalink
Added userexpr.yml to plog
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlhicks committed Jun 5, 2023
1 parent 6f1337c commit 317ac6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
27 changes: 8 additions & 19 deletions q3d/printoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from firedrake.petsc import PETSc

import q3d.saves as saves
from q3d.loaddump import load_txt

# utility functions

Expand Down Expand Up @@ -146,26 +147,14 @@ def iter_info_verbose(*strings: str, i: int, j: int=None, b: str='()', spaced=Fa
# plogger functions

@plogger
def constants_info():
from q3d.config import constants as c
plog()
plog('CONSTANTS:',color='uline')
plog()
for key, val in c.as_dict().items():
plog(f'{key} = {val}')
plog()

@plogger
def settings_info():
from q3d.config import settings

plog('SETTINGS:',color='uline')
plog()
for key, val in settings.as_dict().items():
plog(f'{key}:')
for key, val in val.items():
plog(f' {key} : {val}')
def yml_info():
plog()
plog('CONSTANTS.YML:', color='uline', end='\n\n')
plog(load_txt(f'{saves.SavePath}/constants.yml'), end='\n\n')
plog('SETTINGS.YML:', color='uline', end='\n\n')
plog(load_txt(f'{saves.SavePath}/settings.yml'), end='\n\n')
plog('USEREXPR.YML:', color='uline', end='\n\n')
plog(load_txt(f'{saves.SavePath}/userexpr.yml'), end='\n\n')

@plogger
def pde_solve_info(**kwargs):
Expand Down
5 changes: 2 additions & 3 deletions scripts/qtensor3d
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ def run(path, *, overwrite=False, supersessions={}):
pr.fail(f'step size {dt} not allowed')
sys.exit()

# print info
pr.constants_info()
pr.settings_info()
# print contents of YML's
pr.yml_info()

# perform a check that will ensure the elastic constants are physical
check.elastic_constants(constants)
Expand Down

0 comments on commit 317ac6c

Please sign in to comment.