Code covered by the BSD License  

Highlights from
A CUDA accelerated Beam Propagation Method [BPM] Solver using the Parallel Computing Toolbox

image thumbnail

A CUDA accelerated Beam Propagation Method [BPM] Solver using the Parallel Computing Toolbox

by

 

21 Oct 2010 (Updated )

A beam propagation method solver using the CUDA capabilities in the parallel computing toolbox.

FunRefractIdx(gx, gy, Nx, Ny, PosZ)
function [ RefractIdxOut ] = FunRefractIdx(gx, gy, Nx, Ny, PosZ)
%FUNREFRACTIDX This function provides the refractive index as a function of
% the mesh grids gx and gy.  
% The example is a 0.25mm-by-2mm cylindrical fiber.
% Author: Patrick Kano, Paul Lundquist
% Applied Energetics, Inc.
% %Modification Dates [M/D/Y]: 10/03/10 - Initial function definition
radsq = 0.5*10^(-3)*0.5*10^(-3);

if(PosZ<2*10^(-3))
 rdisk = gx.*gx + gy.*gy;
 boolmat = rdisk<radsq;   
 nrefract = 1.82;
 RefractIdxOut = (nrefract-1)*boolmat + ones(2*Nx,2*Ny);
else
 RefractIdxOut = ones(2*Nx,2*Ny);   
end
end %function definition

Contact us