T3 - GPU Computation
GPU Stress-energy Tensor Computation
%% Alcubierre
gridSize = [1 20 20 20];
worldCenter = (gridSize+1)./2;
velocity = 0.5;
R = 5;
sigma = 0.5;
Metric = metricGet_AlcubierreComoving(gridSize,worldCenter,velocity,R,sigma);
% Compute energy tensor on GPU
EnergyTensorGPU = getEnergyTensor(Metric,1); % Note the 1 as a second input arg
% Plotting Energy Tensor
clf
for i = 1:4
for j = 1:4
h = nexttile;
surfq(EnergyTensorGPU.tensor{i,j}(1,:,:,round(worldCenter(4))),'EdgeColor','none')
title(num2str(i) + "," + num2str(j))
end
end
sgtitle(Metric.name + " Energy Tensor")When to use the GPU?
20x20x20 Grid
60x60x60 Grid
Last updated