## unit_type

### Syntax

```
unit_type {grain_id [subdomain_id unitype]}
```

`grain_id`

,`subdomain_id`

= positive integer`unitype`

=*1*or positive even integer (>= 2 if`intpo_depth`

=*1*, >= 4 if`intpo_depth`

=*2*)

### Examples

```
unit_type {1 [1 12]}
unit_type {1 [1 1] [2 8]} {2 [1 6] [2 16] [3 10]}
unit_type {1 [1 14]} {2 [1 1]} {3 [1 6]}
```

### Description

The command sets the unit type in each subdomain in each grain.

Similar to the unit_num command, this command consists of two loops. The outer loop, illustrated by `{}`

, is based on grain; the inner loop, illustrated by `[]`

, is based on subdomain. Note that the curly brackets `{`

and `}`

as well as the square brackets `[`

and `]`

in the syntax/examples are to separate different grains and subdomains, the number of which are `grain_number`

and `subdomain_number`

, respectively; all brackets should not be included in preparing `cac.in`

.

The number of atoms per unit is $(\mathrm{unitype}+1)^3$, where `unitype`

must be either 1 (atomistic domain) or an even integer that is no less than 2 if `intpo_depth`

= *1* and no less than 4 if `intpo_depth`

= *2* (coarse-grained domain): in the latter case, (i) it must be even because of the first order Gaussian quadrature employed to solve the governing equations, (ii) it must be >= 2 or >=4 because of the first nearest neighbor (1NN) element and second nearest neighbor (2NN) element have 27 and 125 integration points, respectively (so there cannot be fewer than 27 and 125 atoms in one element, respectively). For more information of the 1NN/2NN element and the Gaussian quadrature implementation, read Appendices A and B of Xu et al., 2015.

The three examples above correspond to the three examples in the subdomain command:

- In the first example, there is only one grain, designated by the first
*1*, having only one subdomain, designated by the second*1*, with the`unitype`

=*12*. - In the second example, there are two grains, designated by the first
*1*and the second*2*, respectively. The first grain has two subdomains: the first is atomistics because`unitype`

=*1*; the second contains elements each of which has $(8+1)^3 = 729$ atoms. The second grain has three subdomains: the first contains elements each of which has $(6+1)^3 = 343$ atoms; the second contains elements each of which has $(16+1)^3 = 4913$ atoms; the third contains elements each of which has $(10+1)^3 = 1331$ atoms. - In the third example, there are three grains, each of which contains one unit type. Note that the second grain is atomistics because
`unitype`

=*1*.

The maximum `grain_id`

must be larger than or equal to `grain_number`

. All information related to `grain_id`

that is larger than `grain_number`

is discarded. Within each grain, the maximum `subdomain_id`

must equal the corresponding subdomain_number.

### Related commands

This command becomes irrelevant when `boolean_restart`

= *t*, in which case there is no need for the subdomain information.

### Related files

`model_init.f90`

### Default

None.