校园网页 · 学校官网
A simple GPU implementation of spectral-element methods for solving 3D Poisson type equations on cartesian meshes
首页 联系我们 学校主页 EN 学院概况 院长寄语 学院简介 教师队伍 教师 博士后/RAP 在站博士后/R... 出站博士后/R... 本科教育 专业介绍 本科招生 公告 研究生教育 研究生名单 科学研究 学术报告 学术会议 学术论文 沈捷 何易 学院新闻 综合新闻 发布者:吴锡娇 发布时间:2026-08-20 浏览次数: 16 A simple GPU implementation of spectral-element methods for solving 3D Poisson type equations on cartesian meshes.pdf Demonstration on how to run the code: This is a simple demonstration of running the MATLAB code provided in the appendix of the following paper: X. Liu, J. Shen and X. Zhang, A simple GPU implementation of spectral-element methods for solving 3D Poisson type equations on rectangular domains and its applications, Communications in Computational Physics, 36 (2024), pp. 1157-1185. DOI Download and unzip the code which consists of three MATLAB scripts. Matlab 2023 is needed. This is an example of accelerating a simple 3D Poisson solver (Q^k spectral element method) on GPU. See the paper above for details. The script Poisson3D.m sets Np=5 for Q^5 element, and Nx=40, Ny=40, Nz=40 for a 40^3 finite element mesh. You can change Np, Nx, Ny, Nz to any natural number. The script Poisson3D.m will detect whether there is a GPU device to use. If there is a GPU device, the script will do computation on default GPU device ID=1. Otherwise, the script will do the computation on CPU. You should change the GPU ID to the your desired one there are multiple GPU cards. The following is what it looks like when running the code on a machine equipped with at least one GPU card: ~ % cd Poisson_GPUCode Poisson_GPUCode % matlab -nodisplay < M A T L A B (R) > Copyright 1984-2023 The MathWorks, Inc. R2023a Update 2 (9.14.0.2254940) 64-bit (glnxa64) April 17, 2023 >> run('Poisson3D.m') 3D Poisson with total DoFs 201 by 201 by 201 Laplacian is Q5 spectral element method GPU computation: starting to load matrices/data GPU loading finished and computing started The ell infinity norm error is 1.970776e-10 The online GPU computation time is 7.340000e-02 Now in Poisson3D.m, set Np=5, and Nx=200, Ny=200, Nz=200, for which the number total Degree of Freedoms is 1001^3: >> run('Poisson3D.m') 3D Poisson with total DoFs 1001 by 1001 by 1001 Laplacian is Q5 spectral element method GPU computation: starting to load matrices/data GPU loading finished and computing started The ell infinity norm error is 1.300271e-11 The online GPU computation time is 7.877890e-01 Though the offline computation (loading data to GPU) may take a while, the online GPU computation time is 0.7877890 second for inverting high order accurate Laplacian for about one billion DoFs on one Nvidia A100 80G GPU card . The following is what happens if there is no GPU device available, when running the script Poisson3D.m. Be aware that GPU acceleration can be observed only for large enough problems. Poisson_GPUCode % matlab -nodisplay < M A T L A B (R) > Copyright 1984-2023 The MathWorks, Inc. R2023a Update 2 (9.14.0.2254940) 64-bit (glnxa64) April 17, 2023 >> run ('Poisson3D.m') 3D Poisson with total DoFs 201 by 201 by 201 Laplacian is Q5 spectral element method The ell infinity norm error is 1.964983e-10 The online CPU computation time is 2.100320e-01 Author: Xiangxiong Zhang . 版权所有:宁波东方理工大学数学科学学院 浙ICP备2023015999号 浙公网安备33021102001146号 地址:浙江省宁波市镇海区蛟川街道海江大道2911号数理楼 邮箱:math@eitech.edu.cn 邮编:315200
采集于
查看校方原文 ↗