Skip to content

Commit

Permalink
delete text Deformed_Paramters
Browse files Browse the repository at this point in the history
  • Loading branch information
haidi-ustc committed Sep 9, 2021
1 parent a1c8d66 commit 3f72e1c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions mech2d/mechanics.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ def get_deformed_structure(self,numb_points,max_lag_strain,direction='xx',back=T

cell_old= cell.copy()
create_path(self.workdir,back=back)
fdis = open(os.path.join(self.workdir,'Deformed_Parameters'),'w')
def_params={}

cont1= 0
for i in self.lagrangian_strain_list:
Ls_list= Ls_Dic[i]
Expand All @@ -663,11 +663,7 @@ def get_deformed_structure(self,numb_points,max_lag_strain,direction='xx',back=T
def_key = 'Def_'+def_fmt1%cont1
Defn = os.path.join(pwd, self.workdir,'Def_'+def_fmt1%cont1)


create_path(Defn,back=back)
#os.chdir(Defn)

print(Defn+', Lagrangian strain = ' + Ls_str[i],file=fdis)

cont2 = 0

Expand Down Expand Up @@ -723,14 +719,11 @@ def get_deformed_structure(self,numb_points,max_lag_strain,direction='xx',back=T
cont2 = cont2 + 1
Defn_cont2 = os.path.join(Defn, Defn.split('/')[-1]+'_'+def_fmt2%cont2)

print(Defn_cont2 + ', eta = ' + str(r),file=fdis)
def_structs_dict['Path'] = Defn_cont2
def_structs_dict['eta'] = r
def_structs_dict['Cell'] = cell_new.tolist()
def_structs_list.append(def_structs_dict)
for j in range(3):
print('V'+str(j+1)+' --=>', '%15.10f'%(cell_new[j,0]), '%15.10f'%(cell_new[j,1]), '%15.10f'%(cell_new[j,2]),file=fdis)
print('\n',file=fdis)

#--- Writing the structure file -----------------------------------------------------------
create_path(Defn_cont2,back=False)
new_struct=Structure(cell_new,self.structure.species,self.structure.frac_coords)
Expand All @@ -739,7 +732,6 @@ def get_deformed_structure(self,numb_points,max_lag_strain,direction='xx',back=T
#--------------------------------------------------------------------------------------------------
dumpfn(def_params,os.path.join(self.workdir,'Deformed_Parameters.json'),indent=4)
#os.chdir(pwd)
fdis.close()
self.to(os.path.join(self.workdir,felastic),option={"numb_points":numb_points,"max_lag_strain":max_lag_strain,"V0":V0})

#--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 3f72e1c

Please sign in to comment.