Compare commits
1 Commits
developmen
...
master
Author | SHA1 | Date |
---|---|---|
Alex Selimov | 5e56f2da10 | 4 years ago |
@ -1,27 +0,0 @@
|
|||||||
image: python:3.8-buster
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- pip install -r requirements.txt
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- tests
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
pagestests:
|
|
||||||
stage: tests
|
|
||||||
script:
|
|
||||||
- mkdocs build --strict --verbose --site-dir test
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- test
|
|
||||||
except:
|
|
||||||
- development
|
|
||||||
pages:
|
|
||||||
stage: deploy
|
|
||||||
script:
|
|
||||||
- mkdocs build --strict --verbose
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
only:
|
|
||||||
- development
|
|
@ -1,24 +0,0 @@
|
|||||||
# CuNi Bicrystal Interface
|
|
||||||
This example builds a bicrystal of CuNi with a semi-coherent interface. The interface region is rendered at full atomistic resolution and the bulk of the layers are coarse-grained.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#Build Copper CG region and atom pad
|
|
||||||
cacmb --create Cu fcc 3.615 25 orient [-21-1] [011] [11-1] duplicate 7.44 6 4 Cu_cg.mb -ow
|
|
||||||
cacmb --create Cu fcc 3.615 2 orient [-21-1] [011] [11-1] duplicate 93 75 3 Cu_atom.mb -ow
|
|
||||||
#Build Nickel CG region and atom pad
|
|
||||||
cacmb --create Ni fcc 3.52 25 orient [-21-1] [011] [11-1] duplicate 7.6409 6.16 4 Ni_cg.mb -ow
|
|
||||||
cacmb --create Ni fcc 3.52 2 orient [-21-1] [011] [11-1] duplicate 95.511 77 3 Ni_atom.mb -ow
|
|
||||||
#Merge all into one block keeping full atomistic resolution at the interface
|
|
||||||
cacmb --merge z 4 Ni_cg.mb Ni_atom.mb Cu_atom.mb Cu_cg.mb -boundary pps cac_in.restart cac_in.xyz -ow
|
|
||||||
|
|
||||||
#Delete leftover files
|
|
||||||
rm Ni_cg.mb Ni_atom.mb Cu_atom.mb Cu_cg.mb
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Below are the .xyz file render which shows the atomistic and coarse-grained regions and the common neighbor analysi of the interface.
|
|
||||||
|
|
||||||
![xyz bicrystal render](../img/CuNi_xyz.png)
|
|
||||||
![interface structure for bicrystal model](../img/CuNi_int.png)
|
|
@ -1,48 +0,0 @@
|
|||||||
# Getting Started
|
|
||||||
|
|
||||||
The CACmb tool separates commands into two general groups, modes and options.
|
|
||||||
Modes are the main commands which conduct primary operations, these are listed below:
|
|
||||||
|
|
||||||
* [Mode Convert](Modes/convert.md)
|
|
||||||
* [Mode Create](Modes/create.md)
|
|
||||||
* [Mode Merge](Modes/merge.md)
|
|
||||||
|
|
||||||
To start a cacmb run, it is required to run one of the available modes and only one mode can be run at a time.
|
|
||||||
Additionally one can use options in order to adjust the model during any of the mode runs and unlimited number of options may be used.
|
|
||||||
While single line commands may be used satisfactorily to build a model, in order to build more complex models it is required to run multiple commands.
|
|
||||||
|
|
||||||
Currently CACmb only supports rhombehedral FCC finite elements with faces aligned to {111} slip planes.
|
|
||||||
This finite element is the primitive unit cell for the FCC crystal and is shown below:
|
|
||||||
|
|
||||||
![Rhombohedral Element](img/rhomb.png)
|
|
||||||
|
|
||||||
## Simple Example 1
|
|
||||||
For example, to build a model with an atomistic region bound by a coarse-grained region the following commands should be run:
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --create Cu fcc 3.615 15 duplicate 4 2 1 orient [112] [1-10] [11-1] Cu_cg.mb -ow
|
|
||||||
cacmb --create Cu fcc 3.615 2 duplicate 30 15 2 orient [112] [1-10] [11-1] Cu_at.mb -ow
|
|
||||||
cacmb --merge z 3 Cu_cg.mb Cu_at.mb Cu_cg.mb model.xyz -ow
|
|
||||||
```
|
|
||||||
|
|
||||||
When visualizing the model.xyz file using ovito we see our desired model (where the red atoms represent the element nodes and blue atoms are atomistic regions):
|
|
||||||
|
|
||||||
![Simple example 1 render](img/simple_example_1.png)
|
|
||||||
|
|
||||||
**Important Note: In order to fully utilize the cacmb capabilites use the .mb format when running multiple model build steps**
|
|
||||||
|
|
||||||
A description of each build step is below:
|
|
||||||
|
|
||||||
1. Build a coarse grained model with elements that have 15 atoms per edge. Orientation is set to `[112] [1-10] [11-1]`. We save it to `Cu_cg.mb` and pass `-ow` which is the flag to overwrite existing files with that name.
|
|
||||||
2. Build an atomistic model with the same dimensionsin the x and y directions as the coarse grained model. *A general way to match dimensions is by setting the duplicate value of the atoms to `esize*duplicate/2`. So for the x dimension we do `15*4/2` which is 30 and for the y dimension `15*2/2` which is 15.
|
|
||||||
3. Merge the models by stacking the coarse-grained and atomistic models. We start the stacking sequence from the bottom so the first region is the `Cu_cg.mb`, followed by the `Cu_at.mb` model in the middle, followed by another `Cu_cg.mb` region. We output it to model.xyz which renders the atoms and nodes of the model for visualization.
|
|
||||||
|
|
||||||
This whole process can be easily run as a shell script as long as cacmb is on your path.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
#!/bin/sh
|
|
||||||
cacmb --create Cu fcc 3.615 15 duplicate 4 2 1 orient [112] [1-10] [11-1] Cu_cg.mb -ow
|
|
||||||
cacmb --create Cu fcc 3.615 2 duplicate 30 15 2 orient [112] [1-10] [11-1] Cu_at.mb -ow
|
|
||||||
cacmb --merge z 3 Cu_cg.mb Cu_at.mb Cu_cg.mb model.xyz -ow
|
|
||||||
```
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
#Convert
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --convert infile outfile(s)
|
|
||||||
```
|
|
||||||
|
|
||||||
This mode converts a file `infile` to different files `outfile(s)`.
|
|
||||||
The extensions on both files determine which read and write subroutines are called.
|
|
||||||
This mode can also be used to apply options to a file by setting `infile` and `outfile` to the same value such as:
|
|
||||||
```
|
|
||||||
cacmb --convert cac.mb cac.mb {-options}
|
|
||||||
```
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
|||||||
# Create
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --create name element_type lattice_parameter esize
|
|
||||||
```
|
|
||||||
|
|
||||||
Mode create has the following parameters:
|
|
||||||
|
|
||||||
`name` - User defined name that either defines the atom type or the lattice type if using the basis option. If the basis command is not called then name must be an element.
|
|
||||||
|
|
||||||
`element_type` - Specifies which element type to use, this dictates the crystal being build. Current acceptable options for element_type are:
|
|
||||||
|
|
||||||
* FCC - Uses the Rhombohedral primitive fcc unit cell as the finite element.
|
|
||||||
|
|
||||||
`lattice_parameter` - The lattice parameter for the crystal structure.
|
|
||||||
|
|
||||||
`esize` - Number of atoms per edge of the finite element. A value of 2 signifies full atomistic resolution and is the lowest number acceptable.
|
|
||||||
|
|
||||||
**Example**
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --create Cu fcc 3.615 11
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates a copper fcc element with a lattice parameter of 3.615 with 11 atoms per side
|
|
||||||
|
|
||||||
## Optional keywords
|
|
||||||
|
|
||||||
Below are optional keywords that must directly follow after the esize command and before any options or filenames are passed
|
|
||||||
|
|
||||||
### Orient
|
|
||||||
|
|
||||||
```
|
|
||||||
orient [hkl] [hkl] [hkl]
|
|
||||||
```
|
|
||||||
|
|
||||||
The default orientation that is built is `[100] [010] [001]`.
|
|
||||||
If this keyword is present then the user must provide the orientation matrix in form `[hkl] [hkl] [hkl]` without spaces.
|
|
||||||
Currently only accepts whole number values for `[hkl]`.
|
|
||||||
|
|
||||||
*Example:* `orient [-112] [110] [-11-1]`
|
|
||||||
|
|
||||||
### Duplicate
|
|
||||||
|
|
||||||
```
|
|
||||||
duplicate numx numy numz
|
|
||||||
```
|
|
||||||
|
|
||||||
The default duplicate is `1 1 1`.
|
|
||||||
This is used to replicate elements along each dimension.
|
|
||||||
The unit of duplication is the lattice periodicity length times the size of elements being duplicated.
|
|
||||||
`numx numy numz` dicate the number of duplications units in the x,y, and z dimensions.
|
|
||||||
This keyword **cannot** be used with the `dim` command.
|
|
||||||
|
|
||||||
*Example:* `duplicate 10 10 10`
|
|
||||||
|
|
||||||
### Dim
|
|
||||||
|
|
||||||
```
|
|
||||||
dim dimx dimy dimz
|
|
||||||
```
|
|
||||||
|
|
||||||
There is no default `dim` as `duplicate` is the default option.
|
|
||||||
This command assigns a box with user-assigned dimensions and fills it with the desired element size.
|
|
||||||
**Note:** using dim may not result in periodic cells unless the origin of the cell is shifted from 0,0,0.
|
|
||||||
|
|
||||||
*Example:* `dimensions 100 100 100`
|
|
||||||
|
|
||||||
### Origin
|
|
||||||
|
|
||||||
```
|
|
||||||
origin x y z
|
|
||||||
```
|
|
||||||
|
|
||||||
This keyword is used to set the origin of the simulation cell.
|
|
||||||
When using the `duplicate` command, the origin is set to the minimum position of the rotated element.
|
|
||||||
When using the `dim` command the default origin is `(0,0,0)`.
|
|
||||||
When using the `dim` command for building it may become necessary to shift the origin of the simulation cell in order to produce a periodic simulation.
|
|
||||||
This origin can be retrieved by first running `--create` with `duplicate 1 1 1`.
|
|
||||||
|
|
||||||
*Example:* `origin 10 0 1`
|
|
||||||
|
|
||||||
### Basis
|
|
||||||
|
|
||||||
```
|
|
||||||
basis basisnum bname bx by bz
|
|
||||||
```
|
|
||||||
|
|
||||||
This function allows you to define a custom basis to be used at every lattice point.
|
|
||||||
The parameters for this keyword are:
|
|
||||||
|
|
||||||
- `basisnum` - The number of atoms in the basis
|
|
||||||
- `bname` - The type of the basis atom (e.g. Cu or Si)
|
|
||||||
- `bx by bz` - The position of the basis atom.
|
|
||||||
|
|
||||||
`bname bx by bz` must be repeated `basisnum` times for this command.
|
|
||||||
|
|
||||||
*Example:*
|
|
||||||
`basis 2 Si 0 0 0 Si 1.35775 1.35775 1.35775` when used with the `fcc` element produces a diamond structure with Si.
|
|
||||||
|
|
||||||
### efill
|
|
||||||
```
|
|
||||||
efill
|
|
||||||
```
|
|
||||||
This command attempts to maximize the degree of coarse-graining by iterating through esizes smaller than the user specified when filling in the jagged boundaries to create a periodic block.
|
|
||||||
This command will iterate through element sizes from the user specified `esize-2` to a minimum esize of 11.
|
|
||||||
Below is an example of a model without efill and a model with efill.
|
|
||||||
|
|
||||||
*Model without efill*
|
|
||||||
![Model without efill command](../img/not_efilled_vtk.png)
|
|
||||||
|
|
||||||
*Model with efill*
|
|
||||||
![Model with efill command](../img/efilled_vtk.png)
|
|
@ -1,28 +0,0 @@
|
|||||||
# Merge
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --merge dim N infiles
|
|
||||||
```
|
|
||||||
|
|
||||||
This mode merges multiple data files and creates one big simulation cell. The parameters are:
|
|
||||||
|
|
||||||
`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.
|
|
||||||
|
|
||||||
`N` - The number of files which are being read
|
|
||||||
|
|
||||||
`infiles` - The input files which are to be merged. There must be `N` of them.
|
|
||||||
|
|
||||||
|
|
||||||
## 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]`.
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# Boundary
|
|
||||||
|
|
||||||
```
|
|
||||||
-boundary box_bc
|
|
||||||
```
|
|
||||||
|
|
||||||
This allows the user to specify the boundary conditions for the model being outputted. The format is a 3 character string with `p` indicating periodic and `s` indicating shrink-wrapped.
|
|
||||||
|
|
||||||
**Example** `ppp` - is a fully periodic model, `pss` is periodic in the x dimension and shrink wrapped in y and z.
|
|
@ -1,7 +0,0 @@
|
|||||||
# Deform
|
|
||||||
```
|
|
||||||
-deform dim dl
|
|
||||||
```
|
|
||||||
This command is used to apply a uniaxial strain unto a simulation cell.
|
|
||||||
The argument `dim` takes the values of `x, y, or z` and the argument `dl` is the change in length to be applied (in Angstroms.
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# Delete Overlap
|
|
||||||
```
|
|
||||||
-delete overlap rc_off
|
|
||||||
```
|
|
||||||
|
|
||||||
This delete option removes overlapping atoms.
|
|
||||||
For every neighboring pair of atoms, the distance between them is checked.
|
|
||||||
If the distance is less than `rc_off` then the atom with the higher index in the data arrays is deleted.
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
# Dislocation
|
|
||||||
|
|
||||||
There are various options for creating dislocations.
|
|
||||||
These are listed below.
|
|
||||||
|
|
||||||
## dislgen
|
|
||||||
|
|
||||||
```
|
|
||||||
-dislgen [ijk] [hkl] x y z burgers char_angle poisson
|
|
||||||
```
|
|
||||||
|
|
||||||
This options adds an arbitrarily oriented dislocation into your model based on user inputs using the volterra displacement fields. The options are below
|
|
||||||
|
|
||||||
`[ijk]` - The vector for the line direction
|
|
||||||
|
|
||||||
`[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)
|
|
||||||
|
|
||||||
`poisson` - Poisson's ratio used for the displacement field.
|
|
||||||
|
|
||||||
## disloop
|
|
||||||
|
|
||||||
````
|
|
||||||
-disloop loop_normal radius x y z bx by bz poisson
|
|
||||||
````
|
|
||||||
|
|
||||||
This option imposes the displacement field for a dislocation in order to create a loop. This loop is unstable and will close if stress isn't applied.
|
|
||||||
|
|
||||||
`loop_normal` - The box dimension which defines the normal to the loop plane. As of now this dimension must be a close packed direction, meaning that for fcc a box dimension has to be of the (111) family of planes. Either `x`, `y`, or `z`.
|
|
||||||
|
|
||||||
`radius` - The radius of the loop in Angstroms.
|
|
||||||
|
|
||||||
`x y z` - The centroid of the loop.
|
|
||||||
|
|
||||||
`bx by bz` - The burgers vector for the dislocation
|
|
||||||
|
|
||||||
`poisson` - Poisson ratio for continuum solution
|
|
||||||
|
|
||||||
## vacancy disloop
|
|
||||||
|
|
||||||
```
|
|
||||||
-vacancydisloop loop_normal radius x y z
|
|
||||||
```
|
|
||||||
|
|
||||||
This option creates a circular planar vacancy cluster of radius `radius` normal to the `loop_normal` centered on position `x y z`. Upon relaxing or energy minimization this cluster should become a prismatic dislocation loop.
|
|
||||||
|
|
||||||
|
|
@ -1,129 +0,0 @@
|
|||||||
# Group
|
|
||||||
|
|
||||||
```
|
|
||||||
-group select_type group_shape shape_arguments
|
|
||||||
```
|
|
||||||
|
|
||||||
This option selects a group of either elements or atoms and applies some transformation to them.
|
|
||||||
|
|
||||||
`select_type` - Either `atoms`, `elements`, or 'both'. `elements` selects elements based on whether the element center is within the group. `both` selects elements based on the element center and atoms based on their position.
|
|
||||||
|
|
||||||
`group_shape` - Specifies what shape the group takes and dictates which options must be passed. Each shape requires different arguments and these arguments are represented by the placeholder `shape_arguments`. The accepted group shapes and arguments are below:
|
|
||||||
|
|
||||||
## Group Shapes
|
|
||||||
These are the allowed group shapes
|
|
||||||
|
|
||||||
### Block
|
|
||||||
```
|
|
||||||
-group atoms block xlo xhi ylo yhi zlo zhi
|
|
||||||
```
|
|
||||||
|
|
||||||
This selects a group residing in a block with edges perpendicular to the simulation cell. The block boundaries are given by `xlo xhi ylo yhi zlo zhi`.
|
|
||||||
|
|
||||||
`additional keywords`- Represents the various transformations which can be performed on a group. These additional keywords are given below.
|
|
||||||
|
|
||||||
### Wedge
|
|
||||||
```
|
|
||||||
-group atoms wedge dim1 dim2 bx by bz bw
|
|
||||||
```
|
|
||||||
|
|
||||||
This selects a group which are within a wedge shape. The options are given as follows:
|
|
||||||
`dim1` - The dimension containing the plane normal of the wedge base.
|
|
||||||
`dim2` - The thickness dimension. Wedge groups are currently required to span the entire cell thickness in one dimensions which is normal to the triangular face. This through thickness dimension is dim2.
|
|
||||||
`bx by bz` - Centroid of the center of the base
|
|
||||||
`bw` - Base width
|
|
||||||
|
|
||||||
### Notch
|
|
||||||
```
|
|
||||||
-group atoms notch dim1 dim2 bx by bz bw tr
|
|
||||||
```
|
|
||||||
|
|
||||||
This shape is similar to a wedge shape except instead of becoming atomically sharp, it finishes in a rounded tip with tip radius `tr`. Options are as follows.
|
|
||||||
`dim1` - The dimension containing the plane normal of the wedge base.
|
|
||||||
`dim2` - The thickness dimension. Wedge groups are currently required to span the entire cell thickness in one dimensions which is normal to the triangular face. This through thickness dimension is dim2.
|
|
||||||
`bx by bz` - Centroid of the center of the base
|
|
||||||
`bw` - Base width
|
|
||||||
`tr` - Tip radius
|
|
||||||
|
|
||||||
### Sphere
|
|
||||||
```
|
|
||||||
-group atoms sphere x y z r
|
|
||||||
```
|
|
||||||
|
|
||||||
This shape selects all atoms within a sphere centered at `(x,y,z)` with radius `r`.
|
|
||||||
|
|
||||||
## Group selection operators
|
|
||||||
|
|
||||||
The following are a list of group operations which alter how the atoms/elements in the group are selected.
|
|
||||||
|
|
||||||
|
|
||||||
### Random
|
|
||||||
```
|
|
||||||
random n
|
|
||||||
```
|
|
||||||
|
|
||||||
This command selects `n` random atoms and `n` random elements within your group bounds.
|
|
||||||
If using group type `atoms` or `elements` then only `n` random atoms or elements are selected.
|
|
||||||
These random atoms/elements then form the new group.
|
|
||||||
|
|
||||||
*Example:*
|
|
||||||
```
|
|
||||||
group atoms block -inf inf -inf inf inf*0.5 inf random 10
|
|
||||||
```
|
|
||||||
The above example selects 10 random atoms from the specified group.
|
|
||||||
These atoms will all have z values which place them in the top half of the cell.
|
|
||||||
|
|
||||||
### Node
|
|
||||||
```
|
|
||||||
nodes
|
|
||||||
```
|
|
||||||
|
|
||||||
This keyword changes the selection criteria when using `elements` or `both` to element nodes instead of element centroids.
|
|
||||||
|
|
||||||
### Flip
|
|
||||||
|
|
||||||
```
|
|
||||||
flip
|
|
||||||
```
|
|
||||||
|
|
||||||
This keyword changes the group selection criteria from the atoms/elements inside a region to the atoms/elements outside the group.
|
|
||||||
|
|
||||||
### Notsize
|
|
||||||
```
|
|
||||||
notsize esize
|
|
||||||
```
|
|
||||||
Notsize filters out elements of size `esize` when determining the group. For example, if the user runs `notsize 25` and the group bounds contain elements with esizes of 13, 15, 25 (from the efill command for example) then only the elements with esize 13 and 15 are selected as part of the group.
|
|
||||||
|
|
||||||
|
|
||||||
## Group modification operators
|
|
||||||
|
|
||||||
These modifiers operate on selected atoms and elements to adjust their properties.
|
|
||||||
|
|
||||||
### Displace
|
|
||||||
|
|
||||||
```
|
|
||||||
displace x y z
|
|
||||||
```
|
|
||||||
This operation shifts all grouped atoms/nodes by a vector `(x,y,z)`.
|
|
||||||
|
|
||||||
### Delete
|
|
||||||
|
|
||||||
```
|
|
||||||
delete
|
|
||||||
```
|
|
||||||
This command deletes all selected atoms and elements within the group.
|
|
||||||
|
|
||||||
### Type
|
|
||||||
```
|
|
||||||
type atom_type
|
|
||||||
```
|
|
||||||
This command changes all atoms and basis atoms at element nodes for the group elements and atoms to type `atom_type`.
|
|
||||||
`atom-type` should be two characters which describe the atomic element (such as `Cu` or `Ni`)
|
|
||||||
|
|
||||||
### Refine
|
|
||||||
```
|
|
||||||
refine
|
|
||||||
```
|
|
||||||
This command refines all elements within the group to full atomistic resolution.
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
# Orient
|
|
||||||
|
|
||||||
```
|
|
||||||
-orient [hkl] [hkl] [hkl]
|
|
||||||
```
|
|
||||||
|
|
||||||
This command transforms the simulation cell into the specified orientation.
|
|
||||||
This can be useful when attempting to view the model along different slip planes.
|
|
||||||
In general the dimensions will not be periodic as the box will not have flat surfaces along the x, y, and z dimensions.
|
|
||||||
*Example:* `-orient [-112] [110] [-11-1]`
|
|
||||||
|
|
||||||
This command also comes with a sub command `unorient`.
|
|
||||||
## Unorient
|
|
||||||
```
|
|
||||||
-unorient
|
|
||||||
```
|
|
||||||
This removes the orientation applied by an orient command during the current cacmb run.
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
# Overwrite
|
|
||||||
```
|
|
||||||
-ow
|
|
||||||
```
|
|
||||||
|
|
||||||
If this option is passed then all files are automatically overwritten without asking the user.
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# Redefine Box Boundaries
|
|
||||||
|
|
||||||
```
|
|
||||||
-redef_box redef_dim {xlo xhi} {ylo yhi} {zlo zhi}
|
|
||||||
```
|
|
||||||
This option allows for the user to redefine box boundaries deleting atoms/elements outside of the new box boundaries. Elements are refined to atmoistics if they intersect the newly defined box boundaries.
|
|
||||||
The arguments are described below:
|
|
||||||
`redef_dim` - The dimensions to be redefined. Can be any permutation of `x`, `y`, `z`, `xy`, `yz`, `xz`, `xyz`. The order of the dimensions dictates the order that the new dimensions must be defined
|
|
@ -1,20 +0,0 @@
|
|||||||
# Define Orientation
|
|
||||||
|
|
||||||
```
|
|
||||||
-sbox_ori sbox [hkl] [hkl] [hkl]
|
|
||||||
```
|
|
||||||
|
|
||||||
This option is primarily used when reading data from non .mb formats.
|
|
||||||
This code sets the orientation of the elements and atoms that are part of the sub_box `sbox` to the user provided orientation.
|
|
||||||
This doesn't change anything about the model, but is required in order to accurately use the `dislgen` or `orient` options when operating on non .mb files.
|
|
||||||
|
|
||||||
*Example:*
|
|
||||||
|
|
||||||
```
|
|
||||||
cacmb --create Cu fcc 3.615 2 orient [112] [1-10] [11-1] duplicate 10 10 10 cac.lmp
|
|
||||||
cacmb --convert cac.lmp cac_out.lmp -sbox_ori 1 [112] [1-10] [11-1] -dislgen [112] [11-1] inf*0.5 inf*0.5 inf*0.5 2.556 90 0.3
|
|
||||||
```
|
|
||||||
The above command attempts to insert a dislocation using the `dislgen` option.
|
|
||||||
In order to do the coordinate transformation, the code needs to know what the orientation of the model originally and so the sbox_ori command sets the sbox information.
|
|
||||||
To better understand how the sub_boxes work, please view sub_box in the Getting Started guide.
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# Slip Plane
|
|
||||||
```
|
|
||||||
-slip_plane dim pos
|
|
||||||
```
|
|
||||||
|
|
||||||
This command forces a slip plane at position `pos` along dimension `dim` by finding which elements that plane intersects and refining them to full atomistics.
|
|
||||||
|
|
||||||
## Optional Arguments
|
|
||||||
|
|
||||||
### efill
|
|
||||||
```
|
|
||||||
-slip_plane dim pos efill
|
|
||||||
```
|
|
||||||
The efill option attempts to remesh the elements that are refined while ensuring an element discontinuity on the prescribed slip plane
|
|
@ -1,8 +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.
|
|
||||||
|
|
Before Width: | Height: | Size: 374 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 396 KiB |
Before Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 292 KiB |
@ -1,31 +0,0 @@
|
|||||||
# CACmb: The Concurent Atomistic-Continuum Model Builder
|
|
||||||
|
|
||||||
CACmb is a tool used to build coarse-grained atomistic models for use with the PyCAC and LammpsCAC toolkits.
|
|
||||||
This tool also allows for the creation of equivalent atomistic models to be used in lammps throught the .lmp data format.
|
|
||||||
|
|
||||||
![cacmb image](img/demo.gif)
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
CACmb requires only a fortran compiler and does not need any external libraries.
|
|
||||||
This code has been tested using both gfortran and ifort fortran compilers solely on linux.
|
|
||||||
|
|
||||||
## Build instructions
|
|
||||||
CACmb can be built by the following commands:
|
|
||||||
```
|
|
||||||
git clone https://gitlab.com/aselimov/cacmb
|
|
||||||
cd cacmb/src
|
|
||||||
make
|
|
||||||
```
|
|
||||||
You can also install cacmb to /usr/local/bin by running:
|
|
||||||
```
|
|
||||||
sudo make install
|
|
||||||
```
|
|
||||||
Otherwise make sure your cacmb executable is available on your system path.
|
|
||||||
|
|
||||||
Please view the [Getting Started](Getting_Started.md) guide for an introduction and basic usage instructions.
|
|
||||||
|
|
||||||
## License
|
|
||||||
This tool is available under the MIT license which is printed below, a full copy of which is available at the cacmb [Gitlab repository.](https://gitlab.com/aselimov/cacmb/-/blob/development/LICENSE)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
site_name: "CACmb: The Concurrent Atomistic Continuum Model Builder"
|
|
||||||
site_url: https://aselimov.gitlab.io/cacmb
|
|
||||||
site_dir: public
|
|
||||||
theme: readthedocs
|
|
||||||
|
|
||||||
use_directory_urls: false
|
|
||||||
|
|
||||||
extra_javascript:
|
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
# Documentation static site generator & deployment tool
|
|
||||||
mkdocs>=1.1.2
|
|
||||||
|
|
||||||
# Add your custom theme if not inside a theme_dir
|
|
||||||
# (https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes)
|
|
||||||
# mkdocs-material>=5.4.0
|
|
@ -1,312 +0,0 @@
|
|||||||
module mode_da
|
|
||||||
!This mode is used to calculate the dislocation analysis algorithm for both CG and atomistic regions
|
|
||||||
|
|
||||||
use parameters
|
|
||||||
use io
|
|
||||||
use elements
|
|
||||||
use neighbors
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
integer :: num_d_points
|
|
||||||
integer, allocatable :: is_slipped(:,:,:)
|
|
||||||
real(kind=dp), allocatable :: disl_line(:,:), disl_data(:)
|
|
||||||
|
|
||||||
private :: write_xyz
|
|
||||||
public
|
|
||||||
contains
|
|
||||||
|
|
||||||
subroutine da(arg_pos)
|
|
||||||
!This is the main calling subroutine for the dislocation analysis code
|
|
||||||
integer, intent(out) :: arg_pos
|
|
||||||
real(kind=dp), dimension(6) :: temp_box_bd
|
|
||||||
|
|
||||||
integer :: ppos
|
|
||||||
character(len=100) :: outfile
|
|
||||||
|
|
||||||
!Now call the dislocation analysis code for the coarse-grained elements
|
|
||||||
call parse_command(arg_pos)
|
|
||||||
|
|
||||||
call read_in(1, (/0.0_dp,0.0_dp,0.0_dp/), temp_box_bd)
|
|
||||||
|
|
||||||
!Now allocate the necessary variables
|
|
||||||
if(allocated(is_slipped)) deallocate(is_slipped)
|
|
||||||
allocate(is_slipped(max_basisnum, max_ng_node, ele_num))
|
|
||||||
|
|
||||||
if(allocated(disl_line)) deallocate(disl_line)
|
|
||||||
num_d_points=0
|
|
||||||
allocate(disl_line(3,1024))
|
|
||||||
allocate(disl_data(1024))
|
|
||||||
|
|
||||||
call cga_da
|
|
||||||
|
|
||||||
!Now create the output file num and write out to xyz format
|
|
||||||
ppos = scan(trim(infiles(1)),".", BACK= .true.)
|
|
||||||
if ( ppos > 0 ) then
|
|
||||||
outfile = 'da_'//infiles(1)(1:ppos)//'vtk'
|
|
||||||
else
|
|
||||||
outfile = 'da_'//infiles(1)//'.vtk'
|
|
||||||
end if
|
|
||||||
call write_da_vtk(outfile)
|
|
||||||
|
|
||||||
ppos = scan(trim(infiles(1)),".", BACK= .true.)
|
|
||||||
if ( ppos > 0 ) then
|
|
||||||
outfile = 'da_'//infiles(1)(1:ppos)//'xyz'
|
|
||||||
else
|
|
||||||
outfile = 'da_'//infiles(1)//'.xyz'
|
|
||||||
end if
|
|
||||||
call write_da_xyz(outfile)
|
|
||||||
|
|
||||||
return
|
|
||||||
end subroutine da
|
|
||||||
|
|
||||||
|
|
||||||
subroutine parse_command(arg_pos)
|
|
||||||
!This subroutine parses the arguments for mode command
|
|
||||||
integer, intent(out) :: arg_pos
|
|
||||||
integer :: i, arglen
|
|
||||||
character(len = 100) :: textholder
|
|
||||||
logical :: file_exists
|
|
||||||
|
|
||||||
!Read the input file
|
|
||||||
call get_command_argument(2,textholder, arglen)
|
|
||||||
if (arglen == 0) stop "Missing file for dislocation analysis"
|
|
||||||
call get_in_file(textholder)
|
|
||||||
|
|
||||||
arg_pos = 3
|
|
||||||
return
|
|
||||||
end subroutine parse_command
|
|
||||||
|
|
||||||
subroutine cga_da
|
|
||||||
|
|
||||||
integer :: i, j, k, l, ibasis, nei, close_neighbors(2,4,6), far_neighbor(4,6), minindex, minindices(2), linevec(3)
|
|
||||||
|
|
||||||
integer :: face_types(ele_num*6), face_ele(6*ele_num), diff_pair(2,6)
|
|
||||||
real(kind = dp) :: face_centroids(3, ele_num*6), r(3), rc, vnode(3, max_basisnum, 4), vnorm, &
|
|
||||||
max_node_dist, ndiff, rmax(3), rmin(3), rnorm, v1(3), v2(3), v1norm, v2norm, theta1, theta2, &
|
|
||||||
diff_mag(6), diffvec(3)
|
|
||||||
real(kind=dp), allocatable :: disl_line_temp(:,:), disl_data_temp(:)
|
|
||||||
logical :: is_edge
|
|
||||||
|
|
||||||
!Initialize variables
|
|
||||||
l = 0
|
|
||||||
max_node_dist = 0
|
|
||||||
|
|
||||||
!Now save the close and far neighbors of the nodes. This is done to attempt to figure out the character of the dislocation
|
|
||||||
!by comparing how the burgers vector is distributed over the face.
|
|
||||||
do j = 1, 6
|
|
||||||
close_neighbors(1, 1, j) = cubic_faces(4, j)
|
|
||||||
close_neighbors(2, 1, j) = cubic_faces(2, j)
|
|
||||||
far_neighbor(1,j) = cubic_faces(3,j)
|
|
||||||
|
|
||||||
close_neighbors(1, 2, j) = cubic_faces(1, j)
|
|
||||||
close_neighbors(2, 2, j) = cubic_faces(3, j)
|
|
||||||
far_neighbor(2,j) = cubic_faces(4,j)
|
|
||||||
|
|
||||||
close_neighbors(1, 3, j) = cubic_faces(2, j)
|
|
||||||
close_neighbors(2, 3, j) = cubic_faces(4, j)
|
|
||||||
far_neighbor(3,j) = cubic_faces(1,j)
|
|
||||||
|
|
||||||
close_neighbors(1, 4, j) = cubic_faces(3, j)
|
|
||||||
close_neighbors(2, 4, j) = cubic_faces(1, j)
|
|
||||||
far_neighbor(4,j) = cubic_faces(2,j)
|
|
||||||
end do
|
|
||||||
|
|
||||||
!First calculate all of the face centroids
|
|
||||||
do i = 1, ele_num
|
|
||||||
do j = 1, 6
|
|
||||||
r(:) = 0.0_dp
|
|
||||||
rmax= -Huge(1.0)
|
|
||||||
rmin= Huge(1.0)
|
|
||||||
do k = 1, 4
|
|
||||||
do ibasis = 1, basisnum(lat_ele(i))
|
|
||||||
r = r + r_node(:, ibasis, cubic_faces(k,j), i)
|
|
||||||
rmax= max(rmax, r_node(:, ibasis, cubic_faces(k,j), i))
|
|
||||||
rmin= min(rmin, r_node(:, ibasis, cubic_faces(k,j), i))
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
|
|
||||||
rnorm=norm2(rmax-rmin)
|
|
||||||
max_node_dist = max(max_node_dist, rnorm)
|
|
||||||
r = r/(basisnum(lat_ele(i))*4)
|
|
||||||
|
|
||||||
!add the face centroids, the type, and map the elements faces to the face arrays
|
|
||||||
l = l + 1
|
|
||||||
face_centroids(:, l) = r
|
|
||||||
face_types(l) = j
|
|
||||||
face_ele(l) = i
|
|
||||||
|
|
||||||
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
|
|
||||||
!Now set the cut off distance as half the distance from opposite nodes in the largest element
|
|
||||||
rc = 0.5*max_node_dist
|
|
||||||
call calc_NN(l, face_centroids(:,1:l), rc)
|
|
||||||
|
|
||||||
!Now loop overall the faces and make sure the nearest neighbor is the opposite type. If it isn't than we dscard it
|
|
||||||
is_slipped = 0
|
|
||||||
do i = 1, l
|
|
||||||
nei = nn(i)
|
|
||||||
|
|
||||||
!Skip if it's 0 or the closest face belongs to the same element
|
|
||||||
if ((nei == 0).or.(face_ele(i) == face_ele(nei))) cycle
|
|
||||||
|
|
||||||
|
|
||||||
!Check the face types, the way that the faces are laid out in the cubic_faces array face 1's opposite is 6 and
|
|
||||||
! face 2's opposite is 5 and etc
|
|
||||||
vnode = 0
|
|
||||||
if(face_types(i) == (7-face_types(nei))) then
|
|
||||||
vnorm = 0
|
|
||||||
do j = 1, 4
|
|
||||||
do ibasis = 1, basisnum(lat_ele(face_ele(i)))
|
|
||||||
!Compute the vectors between all nodes at the face.
|
|
||||||
vnode(:,ibasis,j) = r_node(:,ibasis, cubic_faces(j,face_types(i)), face_ele(i)) - &
|
|
||||||
r_node(:,ibasis, cubic_faces(j,face_types(nei)), face_ele(nei))
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
|
|
||||||
!Now calculate the maximum difference between nodes
|
|
||||||
vnorm = 0
|
|
||||||
do j = 1, 4
|
|
||||||
do k=j,4
|
|
||||||
v1=vnode(:,1,j) - vnode(:,1,k)
|
|
||||||
v1norm=norm2(v1)
|
|
||||||
if (vnorm < v1norm) then
|
|
||||||
vnorm = v1norm
|
|
||||||
diffvec= v1
|
|
||||||
end if
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
!Now calculate the difference between the largest norm and the smallest norm, if it's larger than 0.5 then mark it
|
|
||||||
!as slipped. This value probably can be converted to a variable value that depends on the current lattice parameter
|
|
||||||
!I think 0.5 works ok though.
|
|
||||||
if (vnorm>0.5_dp) then
|
|
||||||
print *, "Element number ", face_ele(i), " is dislocated along face ", face_types(i), &
|
|
||||||
" with neighbor ", face_ele(nei), " with max displacement of ", vnorm
|
|
||||||
l=0
|
|
||||||
do j = 1, 4
|
|
||||||
is_slipped(:, cubic_faces(j,face_types(i)), face_ele(i)) = 1
|
|
||||||
|
|
||||||
!This portion of the code is used to determine what the character of the dislocation most likely is
|
|
||||||
!effectively how this works is we look for the two nodes with the most similar burgers vector.
|
|
||||||
!The vector between these two nodes is close to the line direction and as a result we can probably estimate
|
|
||||||
!if it's close to edge, screw, or if it's pretty fairly mixed.
|
|
||||||
do k = j+1, 4
|
|
||||||
l=l+1
|
|
||||||
diff_mag(l) = norm2(vnode(:, 1, j)-vnode(:,1,k))
|
|
||||||
diff_pair(1,l)=cubic_faces(j, face_types(i))
|
|
||||||
diff_pair(2,l)=cubic_faces(k, face_types(i))
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
minindex = minloc(diff_mag,1)
|
|
||||||
!Now figure out if the min difference between nodes is associated with a 112 direction
|
|
||||||
is_edge = .false.
|
|
||||||
do j = 1,6
|
|
||||||
if((diff_pair(1,minindex) == oneonetwopairs(1,j)).and.(diff_pair(2,minindex)==oneonetwopairs(2,j))) then
|
|
||||||
is_edge=.true.
|
|
||||||
exit
|
|
||||||
else if((diff_pair(2,minindex)==oneonetwopairs(1,j)).and.(diff_pair(1,minindex)==oneonetwopairs(2,j)))then
|
|
||||||
is_edge=.true.
|
|
||||||
exit
|
|
||||||
end if
|
|
||||||
end do
|
|
||||||
|
|
||||||
if(is_edge) then
|
|
||||||
print *, 'Dislocation has primarily edge character'
|
|
||||||
else
|
|
||||||
print *, 'Dislocation has primarily screw character'
|
|
||||||
end if
|
|
||||||
|
|
||||||
if( i < nei) then
|
|
||||||
num_d_points=num_d_points+2
|
|
||||||
if(num_d_points > size(disl_line,2)) then
|
|
||||||
allocate(disl_line_temp(3,size(disl_line,2)+1024))
|
|
||||||
disl_line_temp=0.0_dp
|
|
||||||
disl_line_temp(:, 1:size(disl_line,2))=disl_line
|
|
||||||
call move_alloc(disl_line_temp, disl_line)
|
|
||||||
end if
|
|
||||||
if(num_d_points/2 > size(disl_data)) then
|
|
||||||
allocate(disl_data_temp(size(disl_data)+1024))
|
|
||||||
disl_data_temp=0
|
|
||||||
disl_data_temp(1:size(disl_data)) = disl_data
|
|
||||||
call move_alloc(disl_data_temp, disl_data)
|
|
||||||
end if
|
|
||||||
print *, num_d_points/2, vnorm
|
|
||||||
disl_data(num_d_points/2)=vnorm
|
|
||||||
disl_line(:,num_d_points-1) =r_node(:, 1, diff_pair(1,minindex), face_ele(i))
|
|
||||||
disl_line(:,num_d_points) =r_node(:, 1, diff_pair(2,minindex), face_ele(i))
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
end do
|
|
||||||
|
|
||||||
end subroutine cga_da
|
|
||||||
|
|
||||||
subroutine write_da_vtk(outfile)
|
|
||||||
character (len=*), intent(in) :: outfile
|
|
||||||
|
|
||||||
integer :: i
|
|
||||||
open(unit=11, file=outfile, action='write', status='replace', position='rewind')
|
|
||||||
|
|
||||||
write(11, '(a)') '# vtk DataFile Version 4.0.1'
|
|
||||||
write(11, '(a)') 'Dislocation line analyzed via cacmb dislocation analysis'
|
|
||||||
write(11, '(a)') 'ASCII'
|
|
||||||
write(11, '(a)') 'DATASET UNSTRUCTURED_GRID'
|
|
||||||
write(11, *) 'POINTS', num_d_points, 'float'
|
|
||||||
|
|
||||||
!Write the points to the file
|
|
||||||
do i = 1, num_d_points
|
|
||||||
write(11, '(3f23.15)') disl_line(:, i)
|
|
||||||
end do
|
|
||||||
|
|
||||||
write(11,*) 'CELLS', num_d_points/2, num_d_points/2*3
|
|
||||||
do i=1, num_d_points, 2
|
|
||||||
write(11,'(3i16)') 2, i-1, i
|
|
||||||
end do
|
|
||||||
|
|
||||||
write(11,*) 'CELL_TYPES', num_d_points/2
|
|
||||||
do i=1, num_d_points, 2
|
|
||||||
write(11,'(i16)') 3
|
|
||||||
end do
|
|
||||||
|
|
||||||
write(11,*) 'CELL_DATA', num_d_points/2
|
|
||||||
write(11, '(a)') 'SCALARS burgers_vec, float'
|
|
||||||
write(11, '(a)') 'LOOKUP_TABLE default'
|
|
||||||
do i=1, num_d_points, 2
|
|
||||||
write(11, '(f23.15)') disl_data((i+1)/2)
|
|
||||||
end do
|
|
||||||
|
|
||||||
close(11)
|
|
||||||
|
|
||||||
end subroutine write_da_vtk
|
|
||||||
|
|
||||||
subroutine write_da_xyz(outfile)
|
|
||||||
!This subroutine write the element positions to a .xyz file and marks whether they are slipped or not
|
|
||||||
character(len=*), intent(in) :: outfile
|
|
||||||
integer :: i, ibasis, inod, outn
|
|
||||||
|
|
||||||
open(unit=11, file=outfile, action='write', status='replace', position='rewind')
|
|
||||||
|
|
||||||
!Write number of node_atoms
|
|
||||||
write(11, '(i16)') node_atoms
|
|
||||||
!Write comment
|
|
||||||
write(11, '(a)') "is_slipped x y z"
|
|
||||||
!Write nodal positions
|
|
||||||
outn = 0
|
|
||||||
do i = 1, ele_num
|
|
||||||
do inod = 1, ng_node(lat_ele(i))
|
|
||||||
do ibasis = 1, basisnum(lat_ele(i))
|
|
||||||
write(11, '(1i16, 3f23.15)') is_slipped(ibasis,inod,i), r_node(:,ibasis,inod,i)
|
|
||||||
outn = outn + 1
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
|
|
||||||
if(outn /= node_atoms) then
|
|
||||||
print *, "outn", outn, " doesn't equal node_atoms ", node_atoms
|
|
||||||
end if
|
|
||||||
|
|
||||||
close(11)
|
|
||||||
end subroutine write_da_xyz
|
|
||||||
end module mode_da
|
|
@ -1,146 +0,0 @@
|
|||||||
module opt_bubble
|
|
||||||
!This module contains the bubble option which can be used to create voids with specific pressures of certain atoms
|
|
||||||
|
|
||||||
use atoms
|
|
||||||
use parameters
|
|
||||||
use elements
|
|
||||||
use box
|
|
||||||
use opt_group
|
|
||||||
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
real(kind=dp), private :: br, brat, c(3)
|
|
||||||
character(len=2), private :: species
|
|
||||||
|
|
||||||
public
|
|
||||||
contains
|
|
||||||
subroutine bubble(arg_pos)
|
|
||||||
integer, intent(inout) :: arg_pos
|
|
||||||
|
|
||||||
integer :: new_type, n, j, i, atom_num_pre
|
|
||||||
real(kind = dp) :: p(3), rand, factor, per, vol, mass
|
|
||||||
|
|
||||||
print *, '------------------------------------------------------------'
|
|
||||||
print *, 'Option Bubble'
|
|
||||||
print *, '------------------------------------------------------------'
|
|
||||||
!First we parse the bubble command
|
|
||||||
call parse_bubble(arg_pos)
|
|
||||||
|
|
||||||
!Now we use the existing group code to delete a sphere which represents the bubble
|
|
||||||
centroid=c
|
|
||||||
radius = br
|
|
||||||
type='all'
|
|
||||||
gshape='sphere'
|
|
||||||
group_nodes = .true.
|
|
||||||
group_atom_types=0
|
|
||||||
call get_group
|
|
||||||
call refine_group
|
|
||||||
call get_group
|
|
||||||
atom_num_pre= atom_num
|
|
||||||
call delete_group
|
|
||||||
|
|
||||||
!Now we create a new atom type with the desired species
|
|
||||||
call atommass(species, mass)
|
|
||||||
call add_atom_type(mass, new_type)
|
|
||||||
|
|
||||||
!Now we calculate the number of atoms we need to add for the desired pressure
|
|
||||||
!print *, "Creating a bubble with pressure", bp, " at temperature ", bt, " with radius ", br
|
|
||||||
!
|
|
||||||
!factor = 1.0e24/6.02214e23
|
|
||||||
!if (bp <= 10.0) then
|
|
||||||
! per=factor*(3.29674113+4.51777872*bp**(-0.80473167))
|
|
||||||
!else if (bp .le. 20.0) then
|
|
||||||
! per=factor*(4.73419689-0.072919483*bp)
|
|
||||||
!else
|
|
||||||
! per=factor*(4.73419689-0.072919483*bp)
|
|
||||||
! print *, 'warning: pressure is too high'
|
|
||||||
! print *, 'equation of state is only valid for < 20 GPa'
|
|
||||||
!endif
|
|
||||||
!vol = 4.0*pi/3.0*br**3.0
|
|
||||||
|
|
||||||
n = brat*(atom_num_pre-atom_num)
|
|
||||||
print *, "Adding ", n, " atoms of species ", species
|
|
||||||
|
|
||||||
!Now add n atoms randomly within the sphere
|
|
||||||
do i = 1, n
|
|
||||||
do while(.true.)
|
|
||||||
do j = 1, 3
|
|
||||||
call random_number(rand)
|
|
||||||
p(j) = rand*(2*br) + c(j)-br
|
|
||||||
end do
|
|
||||||
if (norm2(p-c) < br) exit
|
|
||||||
end do
|
|
||||||
|
|
||||||
call add_atom(0, new_type, p)
|
|
||||||
end do
|
|
||||||
|
|
||||||
end subroutine bubble
|
|
||||||
|
|
||||||
subroutine parse_bubble(arg_pos)
|
|
||||||
integer, intent(inout) :: arg_pos
|
|
||||||
|
|
||||||
integer :: i, arglen
|
|
||||||
real(kind=dp) :: mass
|
|
||||||
character(len=100) :: tmptxt
|
|
||||||
|
|
||||||
|
|
||||||
!First read in the bubble centroid
|
|
||||||
do i = 1, 3
|
|
||||||
arg_pos = arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, tmptxt, arglen)
|
|
||||||
print *, trim(adjustl(tmptxt))
|
|
||||||
call parse_pos(i, tmptxt, c(i))
|
|
||||||
end do
|
|
||||||
|
|
||||||
!Now the bubble radius
|
|
||||||
arg_pos = arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, tmptxt, arglen)
|
|
||||||
print *, trim(adjustl(tmptxt))
|
|
||||||
if(arglen == 0) stop "Missing bubble radius"
|
|
||||||
read(tmptxt, *) br
|
|
||||||
|
|
||||||
!Now bubble ratio
|
|
||||||
arg_pos = arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, tmptxt, arglen)
|
|
||||||
print *, trim(adjustl(tmptxt))
|
|
||||||
if(arglen == 0) stop "Missing bubble ratio"
|
|
||||||
read(tmptxt, *) brat
|
|
||||||
|
|
||||||
!Now the bubble species
|
|
||||||
arg_pos = arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, species, arglen)
|
|
||||||
print *, species
|
|
||||||
if(arglen == 0) stop "Missing bubble species"
|
|
||||||
|
|
||||||
|
|
||||||
!OPtional arguments
|
|
||||||
do while(.true.)
|
|
||||||
if(arg_pos > command_argument_count()) exit
|
|
||||||
arg_pos=arg_pos+1
|
|
||||||
|
|
||||||
call get_command_argument(arg_pos, tmptxt)
|
|
||||||
tmptxt=adjustl(tmptxt)
|
|
||||||
select case(trim(tmptxt))
|
|
||||||
|
|
||||||
case('excludetypes')
|
|
||||||
arg_pos=arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, tmptxt, arglen)
|
|
||||||
if(arglen==0) stop "Missing number of atoms to exclude"
|
|
||||||
read(tmptxt, *) exclude_num
|
|
||||||
do i=1,exclude_num
|
|
||||||
arg_pos = arg_pos + 1
|
|
||||||
call get_command_argument(arg_pos, tmptxt, arglen)
|
|
||||||
if(arglen==0) stop "Missing exclude atom types"
|
|
||||||
call atommass(tmptxt, mass)
|
|
||||||
call add_atom_type(mass, exclude_types(i))
|
|
||||||
end do
|
|
||||||
|
|
||||||
case default
|
|
||||||
exit
|
|
||||||
end select
|
|
||||||
end do
|
|
||||||
|
|
||||||
return
|
|
||||||
end subroutine parse_bubble
|
|
||||||
end module opt_bubble
|
|
||||||
|
|