• Tidak ada hasil yang ditemukan

Automatic Duality Domains (ADD) with stress and energy (internal duality)

B. GP FEATURES

1. Automatic Duality Domains (ADD) with stress and energy (internal duality)

“composed”. The LinkNLC subroutine is called at the beginning of the simulation, before dynamics occur, to relink all of the NLCs properly.

The GP code version 20 was developed to allow all particles, both real and imaginary, to have NLCs. This is advantageous for the automatic scale duality feature.

There are two main parts of the auto-duality feature, first the preparation then the detector and process. Separate from this is the ability for the NLCs to break under a specific strain.

a. Preparation

This preparation begins on line 1084, at the end of the Initialize subroutine. What needs to be prepared are the NLCs for all particles. This preparation is only performed when indicated from the input file; it asks if the user wants to relink the NLCs. If this is true, then the preparation is prepared.

i. Special List

To relink the particles, a special neighbor-list must be used. To create this special neighbor-list to link NLCs, an option was added to the subroutine: Update_List. This new parameter is a Boolean, when it is true, it creates neighbor-lists for regular dynamics of the simulation, i.e. one scale only interacts with the same scale. When this parameter is true, it creates neighbor-lists for the generation of NLCs. Specifically, one scale looks for adjacent scales, excluding its own scale.

The special call to Update_List is on line 1086, and the actual subroutine is on line 3136. The main alteration to this subroutine is to the particle “filter”. On line 3258 is the “filter” for neighbor-lists of regular dynamics. It makes sure that the candidate j particles are the same scale regardless of their realness. On line 3275 is the “filter” for neighbor-lists of NLC linking. It makes sure that the pair particles are not of the same scale, and does not care whether they are imaginary or not. This means that an imaginary particle can have an imaginary atom in its NLC, which should be fine.

ii. NLC Linking

The generation of NLCs for either real or imaginary particles, is the same. On line 4678 begins the subroutine LinkNLC. Its general structure is a double loop, the outer loop as particle, i, and the inner loop as particle, j. It acquires candidate j particles using

the neighbor-lists created by the subroutine Update_List(.false.) as previously described.

The core of this routine runs on particle pair differences, see line 4726. These particle differences are tested and corrected for Periodic boundary conditions, line 4729. Also, and most likely redundant, line 4743 filters out candidate j particles if they are too far away, according to the NLC strain formula.

This inner loop collects all candidate j particles (SymNei:line 4753), along with their positional differences (banl:line 4751) and scaled distances (dist:line 4752). All three of these collections are sorted from the smallest distance to the greatest, if there exists any, using the sort algorithm by John Mahaffy in March 10, 1995, line 4758. Now that they are sorted, they can be entered into the NLC for particle, i, lines 4775 & 4787.

The maximum number of NLC constituents is defined to be 12, line 4777. During the population of the NLC, the positional differences (banl) are being summed into the variable, neighsum, lines 4774 & 4781. This is divided by the number of NLC constituents (CN), line 4788. This is the average position of all of the NLC constituents, the negative of which is the error vector, errvect, line 4790.

iii. NLC Breakage

NLCs can be allowed to break when their constituents separate from each other, in a way, inducing a strain on the NLC. The NLC strain is determined when each imaginary particle's position is evaluated from its NLC constituents' positions.

The subroutine Evolve_Sample0 (for equilibrium) has additional debugging information that is dumped to Standard Error (File unit=0) because there really should not be any reason for an NLC to break during equilibration, unless under special circumstances, hence the debugging info. There is on line 1835 a test for the option to break NLCs, this option is specified in the input file, whether to allow NLCs to break or not. The strain level of the NLC is a function of the largest scale. For example, whether it's an imaginary atom linking to real particles or if it's an imaginary particle linking to real atoms. It uses whichever is the larger scale. This scale factor is on the next line, 1840. If the NLC constituent is too far away, it will make a call to BreakingNLC. This subroutine takes two arguments, the first is the global ID of the imaginary particle under consideration, and the second is the global ID of the real particle that will be removed from the NLC.

The BreakingNLC subroutine is located on line 4817 and deletes the entry from the NLC by moving all later NLC constituent IDs down, to cover it up, line 4842. Thus removing the offending constituent and subtracting the number of NLC constituents by one.

There is another NLC strain detector in the same spot but in subroutine Evolve_Sample, this is for the evolution between loading steps. It's located on line 2230 with the same parameters, but without any debugging output, since, for example, there was a crack propagating, there would be a very large amount of NLCs breaking and writing data every time slows the simulation tremendously.

b. Detector and Process

The ADDomain energy detector is located in subroutine Evolve_Sample, because this is the subroutine that evolves the sample between loading steps. So if an ADDomain was going to change energy it would be after a load step, when the forces and dynamics were being assigned.

i. Detector

The detector is located on line 2457. It compares the maximum VM stress for each ADDomain every Load-output step (LDOuts), which is specified in the input file, when the ADuality variable is set to true, also specified in the input file. If ADuality is true, that means that the simulation will attempt to automatically lump or decompose the ADDomains according to their maximum VM stress values.

It searches through all of the ADDomains' maximum VM stress and compares it to the stress range specified in the input file. The first value is the threshold to lump and the second is the threshold to decompose. After an ADDomain is decomposed or lumped, a small array called ADrecord is set to -1 or 1 respectively, this array keeps track of which domains have or have not been lumped or decomposed. This saves time trying to compose domains that already have been. After the compositions, the Boolean variable ListUpdateRequested is set to true, because after composition there is a different number of real particles, and these new real particles need to be included in the neighbor-lists, so that regular dynamics can be performed on them.

ii. Process

The actual decomposition or lumping process is performed by the subroutine:

composition, located on line 4623. It takes three arguments, the first is the ADDomain number, the second is the scale of the real particles/atoms, and the third is the composition direction, for example, -1 for decomposition (going down a scale) or +1 for lumping (going up a scale). This is why in the detector on line 2459 the call to composition has “(i,2,-1)” this will decompose the S2 real particles in the ADDomain i;

and on line 2462 “(i,1,1)” this will lump the real S1 atoms in the ADDomain i.

The subroutine, composition, simply searches all particles/atoms in the model for the ones that are in the ADDomain. This “filter”, line 4641, uses implicit integer math;

since copper atoms have an atomic number of 29, the copper particles that are in ADDomain 2, for example, will have an atomID of 229. So this filter divides their atomID by 100 to test whether it is in the correct ADDomain. Then it tests whether it is an imaginary particle, and if it is, whether it is of the correct scale. If it is then it turns it into a real particle by making the ID positive. If it was a real particle, it would make sure it is of the right scale, and then make its ID negative; to become an imaginary particle.

These determinations are made by the if statement on line 4643.