Skip to content

Commit

Permalink
add stress-strain curve calculation method
Browse files Browse the repository at this point in the history
  • Loading branch information
haidi-ustc committed Sep 9, 2021
1 parent c98f32d commit c735779
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ test*
*/_version.py
*/_date.py
check
tmp
2 changes: 1 addition & 1 deletion mech2d/calculation/runtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run_elastic(args):
raise RuntimeError('ERROR: %s file not exits')
with open(os.path.join(workdir,felastic),'r') as f:
elatic2d=json.loads(f.read())
structures=glob(os.path.join(elatic2d['workdir'],'Def_?','Def_?_???','Def_*vasp'))
structures=glob(os.path.join(elatic2d['workdir'],'Def_*','Def_*','Def_*vasp'))
runtask=RunTasks(rootdir,structures,code)
runtask.preprocess()
runtask.run(tasks,machine,resources)
Expand Down
3 changes: 2 additions & 1 deletion mech2d/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def main():
parser_init.add_argument('-m','--maxs', type=float, default=0.05, help="For elastic constant calculation, it stands for the maximum Lagrangian strain, suggested value is [0.030, 0.150] for Energy approach, [0.0010, 0.0050] for Stress approach; for stress strain cuver calcuation, this value has no above limitation")
parser_init.add_argument('-n','--number', type=int, default=5, help="The number of the deformed structures [odd number > 4].")
#parser_init.add_argument('-o','--outdir', type=str, default=None, help="The output directory for the deformed structures.")
parser_init.add_argument('-d','--direction', type=str, default='x', choices=['xx','yy','bi','xy'], help="The direction used for stress strain curve, default value: 'xx'. 'xx' for 'x' direction; 'yy' for 'y' direction; 'bi' for bi-Axis strain and 'xy' for shear strain.")
parser_init.add_argument('-d','--direction', type=str, default=['xx'],nargs='+', choices=['xx','yy','bi','xy'], help="The direction used for stress strain curve, default value: 'xx'. 'xx' for 'x' direction; 'yy' for 'y' direction; 'bi' for bi-Axis strain and 'xy' for shear strain.")
parser_init.add_argument('-r','--ranges', type=float, default=None, nargs='+', help="The Lagrangian strain range used for stress-strain curve calculation. e.g. 0.0 0.2 ")
parser_init.add_argument('-p','--properties', type=str, default='elc', choices=['elc', 'ssc'], help="What do you want to calcuation? elastic constant or stress strain curve? default value: 'elc'.")
parser_init.add_argument('-v','--verbose', action="store_true", help="print verbose information or not.")
parser_init.add_argument('-b','--back', action="store_true" , help="Whether back the old folder? default value: False.")
Expand Down
Loading

0 comments on commit c735779

Please sign in to comment.