Is there any way to speed up the PDE solver with the parallel computing toolbox?

5 ビュー (過去 30 日間)
Steven
Steven 2018 年 9 月 25 日
編集済み: Steven 2018 年 9 月 26 日
Can I speed up this code by paralleling it with the parallel computing toolbox?
thermalmodel = createpde('thermal','transient');
gm = multicuboid(1,1,0.5,'ZOffset',0.5);%if this doesn't work choose your own geometry
thermalmodel.Geometry = gm;
%%%%%%%%%%%%%%%%%%%%%%%GENERATE MESH %%%%%%%%%%%%%%%
% meshsize = 0.4;%mm
meshsize = 4;%mm
generateMesh(thermalmodel,'Hmax',meshsize/1000);
thermalmodel.Mesh
pdemesh(thermalmodel)
htc = vpa(25) *u.Watt/(u.m^2*u.Kelvin);
htc = rewrite(htc,u.Watt/(u.in^2*u.Kelvin));
htc = double(separateUnits(htc));
thermalBC(thermalmodel,'Face',1:thermalmodel.Geometry.NumFaces,'ConvectionCoefficient',htc,'AmbientTemperature',288.15);
thermalBC(thermalmodel,'Face',1,'Temperature',50+273);%bottom face
mybc = @(region,state) sin(350*state.time).^2;
thermalBC(thermalmodel,'Face',12,'Temperature',mybc);%top face
tfinal = 6;
tlist = 0:3:tfinal;
thermalIC(thermalmodel,0);
thermalmodel.SolverOptions.ReportStatistics = 'on';
result = solve(thermalmodel,tlist);
figure; pdeplot3D(thermalmodel)
pdeplot3D(thermalmodel,'XYData',T(:,end),'Contour','on','ColorMapData',results.Temperature);
title('Temperature in K')
colorbar
pdeplot3D(thermalmodel,'ColorMapData',results.Temperature);
axis equal
title(sprintf('Transient Temperature at Final Time (%g seconds)',tfinal));

採用された回答

Alan Weiss
Alan Weiss 2018 年 9 月 26 日
Sorry, currently Partial Differential Equation Toolbox™ does not use parallel computing.
Alan Weiss
MATLAB mathematical toolbox documentation

その他の回答 (1 件)

Ravi Kumar
Ravi Kumar 2018 年 9 月 26 日
Your mesh density is too high. I could not get the mesh generated on my machine in a reasonable time. This means, there are large number of DoFs. Can you run your problem first with the default mesh, by using:
generateMesh(thermalmodel);
instead of:
generateMesh(thermalmodel,'Hmax',meshsize/1000);
I am sure you will be able to solve this on a single machine. Then see how much mesh resolution you really need.
Regards, Ravi
  1 件のコメント
Steven
Steven 2018 年 9 月 26 日
編集済み: Steven 2018 年 9 月 26 日
it works fine on my machine even with mesh densities 100x this, the mesh density doesn't matter, the transient solution is not working. I'm more concerned about how to use the PDE toolbox with the parallel computing toolbox

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by