Abstract

Simulation speed depends on code structures. Hence, it is crucial how to build a fast algorithm. We solve the Allen–Cahn equation by an explicit finite difference method, so it requires grid calculations implemented by many for-loops in the simulation code. In terms of programming, many for-loops make the simulation speed slow. We propose a model architecture containing a pad and a convolution operation on the Allen–Cahn equation for fast computation while maintaining accuracy. Also, the GPU operation is used to boost up the speed more. In this way, the simulation of other differential equations can be improved. In this paper, various numerical simulations are conducted to confirm that the Allen–Cahn equation follows motion by mean curvature and phase separation in two-dimensional and three-dimensional spaces. Finally, we demonstrate that our algorithm is much faster than an unoptimized code and the CPU operation.

Highlights

  • Numerical SolutionsWe define the thickness of the transition layer ε in equation (1) as εm [21]: hm εm 2√ 2tanh−1

  • It will be faster by performing GPU calculations, but we proposed a structure using padding and convolution operation in performing GPU calculations on AC equations

  • We proposed a structure using padding and convolution operation for the GPU calculation of the Allen–Cahn equation

Read more

Summary

Numerical Solutions

We define the thickness of the transition layer ε in equation (1) as εm [21]: hm εm 2√ 2tanh−1. E main Algorithm 1 is a set of steps in equation (6) using Pytorch. For GPU computing, the AC equation (1) can be expressed using Pytorch, and the algorithm can be represented as Figure 1.where f is a Pytorch model. In this Algorithm 1, nn.ReplicationPad2d (or nn.ReplicationPad3d) is applied to satisfy the boundary condition by padding the φn input using replication of the input boundary. E model can choose an operation mode between GPU and CPU by to (device) in Algorithm 1. If device cuda:[0], the model is implemented on GPU, otherwise on CPU. Kimy-de/gpuallencahn) and the corresponding author’s web page (https://sites.google.com/view/yh-choi/code)

Numerical Experiments
Conclusions
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call