Skip to content

Commit

Permalink
1013
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Tian authored and Su Tian committed Oct 13, 2020
1 parent 4075928 commit 55f8e02
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Binary file modified __pycache__/analysis.cpython-37.pyc
Binary file not shown.
Binary file modified __pycache__/presg.cpython-37.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import msgpi.io.iovabs as miovabs


def solve(sg_xml, analysis, solver, scrnout=True):
def solve(sg_xml, analysis, ppcmd, solver, scrnout=True):
"""Solve
Parameters
Expand All @@ -24,14 +24,16 @@ def solve(sg_xml, analysis, solver, scrnout=True):
* f - initial failure strength
* fe - initial failure envelope
* fi - initial failure indices and strength ratios
ppcmd : str
Preprocessor command.
solver : str
Format of the generated input file ('vabs' or 'swiftcomp').
scrnout : bool, default True
Switch of printing solver messages.
"""

# Preprocess
sg_in, smdim = psg.preSG(sg_xml, analysis, solver)
sg_in, smdim = psg.preSG(sg_xml, analysis, ppcmd, solver)

# Solve
run(sg_in, analysis, solver, smdim, scrnout)
Expand Down
Binary file modified ms/__pycache__/iogebt.cpython-37.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions presg.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def preSG1D(xr_sg, smdim):
return sg


def preSG(sg_xml, analysis, solver='swiftcomp', write_input=True, scrnout=True):
def preSG(sg_xml, analysis, ppcmd='prevabs', solver='swiftcomp', write_input=True, scrnout=True):
""" Preprocessor of a structure gene.
Parameters
Expand All @@ -294,6 +294,8 @@ def preSG(sg_xml, analysis, solver='swiftcomp', write_input=True, scrnout=True):
* f - initial failure strength
* fe - initial failure envelope
* fi - initial failure indices and strength ratios
ppcmd : str, default 'prevabs'
Preprocessor command.
solver : str, default 'swiftcomp'
Format of the generated input file ('vabs' or 'swiftcomp')
write_input : bool
Expand All @@ -319,7 +321,7 @@ def preSG(sg_xml, analysis, solver='swiftcomp', write_input=True, scrnout=True):

if xr_sg.tag == 'cross_section':
smdim = 1
cmd = ['prevabs', '-i', sg_xml]
cmd = [ppcmd, '-i', sg_xml]
if 'vabs' in solver:
cmd.append('-vabs')
elif 'swiftcomp' in solver:
Expand Down

0 comments on commit 55f8e02

Please sign in to comment.