From 38872d8d9f1d9ba6c3019e6eb42788b0e870b69c Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Mon, 27 Jan 2020 20:28:47 -0500 Subject: [PATCH 1/3] Update to readme with correct format for dislocation command --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 47f7045..1851f36 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,26 @@ This mode merges multiple data files and creates one big simulation cell. The pa `dim` - the dimension they are to be stacked along, can be either `x`, `y`, or `z`. If the argument `none` is passed then the cells are just overlaid. Future options will include a delete overlap command. +**Additional options:** + +**Shift** + +``` +shift x y z +``` + +If the shift command is passed to mode merge then each file after the first file in the merge command is displaced by the vector `[x, y, z]`. This is additive so if you are merging three files and this command is passed then the second file is shifted by `[x,y,z]` and the third file is shifted by `2*[x,y,z]`. + +Example: `cacmb --merge z 2 Cu.mb Cu2.mb Cu3.mb Cumerged.mb shift 2 0 0` will shift the atomic and element positions in the `Cu2.mb` file by `[2,0,0]` and the positions in `Cu3.mb` by `[4,0,0]`. + +**Wrap** + +``` +wrap +``` + +This will wrap atomic positions back inside the box. Effectively as if periodic boundary conditions are applied so that atoms which exit from one side of the simulation cell enter back in through the other. + ## Options Options are additional portions of code which have additional functionality. Options are performed in the order that they appear in the argument list and can be added to any mode. If wanting to use strictly options use `--convert` to specify input and output files. @@ -120,7 +140,7 @@ Options are additional portions of code which have additional functionality. Opt ### Option dislgen ``` --dislgen [ijk] [hkl] x y z char_angle poisson +-dislgen [ijk] [hkl] x y z burgers char_angle poisson ``` @@ -131,6 +151,8 @@ This options adds an arbitrarily oriented dislocation into your model based on u `[hkl]` - The vector for the slip plane +`burgers` - The magnitude of the burgers vector for the dislocation to be inserted + `x y z` - The position of the dislocation centroid `char_angle` - Character angle of the dislocation (0 is screw and 90 is edge) @@ -173,3 +195,26 @@ This selects a group residing in a block with edges perpendicular to the simulat `additional keywords`- Represents the various transformations which can be performed on a group. These additional keywords are given below. +**Displace** + +``` +displace x y z +``` + +This is similar to the mode merge `-shift` argument. This simply shift atoms and elements within the group by a vector `[x,y,z]`. + +**Wrap** + +``` +wrap +``` + +This command wraps atoms back into the simulation cell as though periodic boundary conditions are being used. + +**Remesh** + +``` +remesh esize +``` + +This command remeshes the atoms/elements within the group to the new element size `esize`. Currently only accepts an `esize` of 2 which refines it to full atomistics. \ No newline at end of file From 0d2a351cd576750a827ade223abf83060afd7976 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Mon, 27 Jan 2020 20:30:40 -0500 Subject: [PATCH 2/3] Fix to disl_gen. Problems with sub_box_bd and element dislocation displacement field --- src/io.f90 | 6 +++++- src/opt_disl.f90 | 28 ++++++---------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/io.f90 b/src/io.f90 index 9602a77..fdde73d 100644 --- a/src/io.f90 +++ b/src/io.f90 @@ -642,7 +642,11 @@ module io read(11,*) ((sub_box_ori(j, k, sub_box_num+i), j = 1, 3), k = 1, 3) !Read in subbox boundaries read(11,*) sub_box_bd(:,sub_box_num+i) - sub_box_bd(:,sub_box_num+i) = sub_box_bd(:, sub_box_num+i) + displace(:) + + do j = 1, 3 + sub_box_bd(2*j-1,sub_box_num+i) = sub_box_bd(2*j-1, sub_box_num+i) + displace(j) + sub_box_bd(2*j,sub_box_num+i) = sub_box_bd(2*j, sub_box_num+i) + displace(j) + end do !Read in sub_box_array_bd read(11,*) ((sub_box_array_bd(j, k, sub_box_num+i), j = 1, 2), k = 1, 2) end do diff --git a/src/opt_disl.f90 b/src/opt_disl.f90 index 79c45bf..62ceae6 100644 --- a/src/opt_disl.f90 +++ b/src/opt_disl.f90 @@ -70,7 +70,11 @@ module opt_disl call parse_pos(i, textholder, centroid(i)) end do - print *, centroid + arg_pos = arg_pos + 1 + call get_command_argument(arg_pos, textholder, arglen) + if (arglen==0) STOP "Missing parameter in dislgen command" + read(textholder, *) b + arg_pos = arg_pos + 1 call get_command_argument(arg_pos, textholder, arglen) @@ -84,26 +88,6 @@ module opt_disl read(textholder, *) poisson arg_pos = arg_pos + 1 - call get_command_argument(arg_pos, lattice, arglen) - if (arglen==0) STOP "Missing lattice in dislgen command" - - arg_pos = arg_pos + 1 - call get_command_argument(arg_pos, textholder, arglen) - if (arglen==0) STOP "Missing lattice parameter in dislgen command" - read(textholder, *) lattice_parameter - - arg_pos = arg_pos + 1 - !Now set the vurgers vector based on the lattice paarameter and lattice type - select case(lattice) - case('fcc') - b = lattice_parameter / sqrt(2.0_dp) - ! case('bcc') - ! b = lattice_parameter * sqrt(3.0_dp) / 2.0_dp - case default - print *, 'Error: Lattice structure', lattice, ' is not accepted for dislgen option' - STOP - end select - end subroutine parse_dislgen subroutine dislgen @@ -168,7 +152,7 @@ module opt_disl do i = 1, ele_num do inod=1, ng_node(lat_ele(i)) do ibasis = 1, basisnum(lat_ele(i)) - r = r_node(:,ibasis,inod,i) + r = r_node(:,ibasis,inod,i)-centroid r = matmul(inv_transform, r) if (r(1) == 0) then actan = pi/2 From 99a680542d9f95a5168f2943f29f9f4bea55e4d3 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Mon, 27 Jan 2020 20:32:18 -0500 Subject: [PATCH 3/3] Extended inf commands to be position independent of the inf command --- src/subroutines.f90 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/subroutines.f90 b/src/subroutines.f90 index 6efb97e..e8c365b 100644 --- a/src/subroutines.f90 +++ b/src/subroutines.f90 @@ -186,15 +186,26 @@ module subroutines pos=box_bd(2*i-1) else if ((index(pos_string,'-') > 0).and.(index(pos_string,'inf')>0)) then !Now extract the number we are reducing from infinity - read(pos_string(index(pos_string,'-')+1:), *, iostat=iospara) pos + if(index(pos_string,'inf') < index(pos_string,'-')) then + read(pos_string(index(pos_string,'-')+1:), *, iostat=iospara) pos + else + read(pos_string(1:index(pos_string,'-')-1), *, iostat=iospara) pos + end if pos = box_bd(2*i) - pos else if ((index(pos_string,'+') > 0).and.(index(pos_string,'inf')>0)) then !Now extract the number we are reducing from infinity - read(pos_string(index(pos_string,'+')+1:), *, iostat=iospara) pos - pos = box_bd(2*i-1) + pos + if(index(pos_string,'inf') < index(pos_string,'-')) then + read(pos_string(index(pos_string,'+')+1:), *, iostat=iospara) pos + else + read(pos_string(1:index(pos_string,'+')-1), *, iostat=iospara) pos + end if else if ((index(pos_string,'*') > 0).and.(index(pos_string,'inf')>0)) then !Now extract the number we are reducing from infinity - read(pos_string(index(pos_string,'*')+1:), *, iostat=iospara) pos + if(index(pos_string,'inf') < index(pos_string,'-')) then + read(pos_string(index(pos_string,'*')+1:), *, iostat=iospara) pos + else + read(pos_string(1:index(pos_string,'*')-1), *, iostat=iospara) pos + end if pos = (box_bd(2*i)-box_bd(2*i-1))*pos else read(pos_string, *, iostat=iospara) pos