Skip to content

Commit

Permalink
Merge branch 'adaptivecont' into ParallelNCFlex
Browse files Browse the repository at this point in the history
WIP: Fixed merge conflict
  • Loading branch information
Fraser-Birks committed Sep 24, 2023
2 parents 541b904 + 8338085 commit 83b5621
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions matscipy/fracture_mechanics/crack.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
Voigt_6_to_full_3x3_stress)
from matscipy.surface import MillerDirection, MillerPlane
from matscipy.neighbours import neighbour_list
from matscipy.fracture_mechanics.solvers import ode12r
from matscipy.optimize import ode12r

import matplotlib.pyplot as plt
from ase.optimize.precon import Exp, PreconLBFGS
Expand Down Expand Up @@ -1849,9 +1849,9 @@ def strain_err(self,cutoff,seperate_surface=False):
mid_cell_x = self.cryst.cell.diagonal()[0] / 2.0
mid_cell_y = self.cryst.cell.diagonal()[1] / 2.0
I_positions = self.cryst.get_positions()[I]
x_criteria = ((I_positions[:,0]-mid_cell_x)<0.5)
y_criteria = ((I_positions[:,1]-mid_cell_y)<((1.5*self.cutoff)))&\
((I_positions[:,1]-mid_cell_y)>(-1.5*self.cutoff))
x_criteria = ((I_positions[:,0] - mid_cell_x) < 0.5)
y_criteria = ((I_positions[:,1] - mid_cell_y) < ((1.5 * self.cutoff)))&\
((I_positions[:,1] - mid_cell_y) > (-1.5 * self.cutoff))
surface_mask_full = np.logical_and(x_criteria,y_criteria)
bulk_mask_full = np.logical_not(surface_mask_full)
surface_mask = np.logical_and(surface_mask_full,mask)
Expand Down
3 changes: 1 addition & 2 deletions matscipy/fracture_mechanics/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ python_sources = [
'crack.py',
'crackpathsel.py',
'energy_release.py',
'idealbrittlesolid.py',
'solvers.py'
'idealbrittlesolid.py'
]

# Install pure Python
Expand Down
1 change: 1 addition & 0 deletions matscipy/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ python_sources = [
'numerical.py',
'numpy_tricks.py',
'opls.py',
'optimize.py',
'precon.py',
'pressurecoupling.py',
'rings.py',
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions matscipy/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import numpy as np
from numpy.linalg import norm, inv
from ase import units

def gcd(a, b):
"""Calculate the greatest common divisor of a and b"""
Expand Down Expand Up @@ -327,11 +328,10 @@ def find_surface_energy(symbol,calc,a0,surface,size=(8,1,1),vacuum=10,fmax=0.000
if unit == 'ASE':
return [gamma_ase,'ase_units']
else:
from ase import units
gamma_SI = (gamma_ase / units.J ) * (units.m)**2
if unit =='J/m^2':
return [gamma_SI,'J/m^2']
return gamma_SI
elif unit == '0.1J/m^2':
return [10*gamma_SI,'0.1J/m^2'] # units required for the fracture code
return 10*gamma_SI # units required for the fracture code
else:
print('Error: Unsupported unit of surface energy.')

0 comments on commit 83b5621

Please sign in to comment.