Coder Social home page Coder Social logo

gpuallencahn's Introduction

Fast and Accurate Numerical Solution of Allen–Cahn Equation

Yongho Kim, Gilnam Ryu, and Yongho Choi (2021) Fast and Accurate Numerical Solution of Allen-Cahn Equation, Mathematical Problems in Engineering, vol. 2021, Article ID 5263989, 12 pages, 2021. https://doi.org/10.1155/2021/5263989

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 computations 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.

Allen-Cahn Equation

model_f 스크린샷 2021-05-20 20 43 03

Implementations

"""
Number of iterations: --maxit
Grid size: --Nx, --Ny, (and --Nz)
Initial condition: --init 
# 2D: ['circle', 'dumbbell', 'star', 'separation', 'torus', 'maze'] 
# 3D: ['sphere', 'dumbbell', 'star', 'separation', 'torus', 'maze']
Operation mode: --mode # 0: pytorch gpu, 1: pytorch cpu, 2: python cpu
Saving npy files: --save  # 0: No, 1: Yes
"""
python 2d.py --mode 0 --init star
python 2d.py --mode 0 --init star --maxi 2001 --save 1
python 3d.py --mode 0 --init maze

Results

Screen Shot 2021-04-10 at 8 58 35 AM 스크린샷 2021-04-29 22 00 30

gpuallencahn's People

Contributors

kimy-de avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.