<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: Simulate Axisymmetric acoustic field using CUDA binary got wrong result</title>
		<link>http://www.k-wave.org/forum/topic/simulate-axisymmetric-acoustic-field-using-cuda-binary-got-wrong-result</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 02:30:13 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/simulate-axisymmetric-acoustic-field-using-cuda-binary-got-wrong-result" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Simulate Axisymmetric acoustic field using CUDA binary got wrong result"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-axisymmetric-acoustic-field-using-cuda-binary-got-wrong-result#post-8250</link>
			<pubDate>Wed, 21 Jul 2021 14:34:42 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8250@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi vbtraz,&#60;/p&#62;
&#60;p&#62;There is no GPU version of the axisymmetric code (CUDA has no native support for the required DTTs). It looks the CUDA code has incorrectly interpreted your simulations as 2D simulations, which is why they are incorrect.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vbtraz on "Simulate Axisymmetric acoustic field using CUDA binary got wrong result"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-axisymmetric-acoustic-field-using-cuda-binary-got-wrong-result#post-8237</link>
			<pubDate>Wed, 14 Jul 2021 07:08:26 +0000</pubDate>
			<dc:creator>vbtraz</dc:creator>
			<guid isPermaLink="false">8237@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;I want to calculate a AS field using a line source(disk source in 3D) with time varying signal.&#60;br /&#62;
I got same result using kspaceFirstOrderAS  and kspaceFirstOrderASC  as &#60;img src=&#34;https://i.ibb.co/7zMhnZz/kspace-First-Order-AS.jpg&#34; alt=&#34;kspace-First-Order-AS&#34; /&#62;&#60;br /&#62;
But the result seems wrong using kspaceFirstOrder-CUDA.exe. (I change kspaceFirstOrderASC to kspaceFirstOderASG)&#60;br /&#62;
&#60;img src=&#34;https://i.ibb.co/5B70XK4/kspace-First-Order-CUDA-exe.jpg&#34; alt=&#34;kspace-First-Order-CUDA-exe&#34; /&#62;&#60;/p&#62;
&#60;p&#62;My code is here: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clear; 

%% signal parameters
freq = 100e3; %[Hz]
p0 = 10; %[Pa]

%% medium (water / linear)
medium.sound_speed = 1500; %[m/s]
medium.density = 1000;     %[kg/m^3]

%% grids
dx = medium.sound_speed / (freq * 10); 

Nx = 512;
Ny = 128;
xMax = Nx * dx;
yMax = Ny * dx; 

kgrid = kWaveGrid(Nx, dx, Ny, dx);
kgrid.makeTime(medium.sound_speed, 0.3, (sqrt(xMax^2 + yMax^2)/medium.sound_speed + 1e-3) * 1.01); 

%% source
source.p_mask = zeros(Nx, Ny);
source.p_mask(21, 1:round(0.1/dx + 1)) = 1;
source.p = p0 * sin(2*pi*freq * kgrid.t_array); 

%% sensor
sensor.mask = zeros(Nx, Ny);
sensor.mask(21:Nx-20, 1) = 1; 

%% RUN
sensor_data = kspaceFirstOrderAS(kgrid, medium, source, sensor, &#38;#39;DataCast&#38;#39;, &#38;#39;gpuArray-single&#38;#39;, &#38;#39;DataRecast&#38;#39;, true, &#38;#39;PlotScale&#38;#39;, [-p0, p0]);
%sensor_data = kspaceFirstOrderASG(kgrid, medium, source, sensor, &#38;#39;DataCast&#38;#39;, &#38;#39;gpuArray-single&#38;#39;, &#38;#39;DataRecast&#38;#39;, true, &#38;#39;PlotScale&#38;#39;, [-p0, p0]); 

%% plot
figure;
data = sensor_data(:, end-round(1e-3/kgrid.dt-1) : end);
semilogy((0:Nx-41)*dx, rms(data, 2));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I change functon kspaceFirstOrderASC to kspaceFirstOrderASG to call kspaceFirstOrder-CUDA.exe&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function sensor_data = kspaceFirstOrderASG(varargin)
if ~any(strcmp(&#38;#39;FunctionName&#38;#39;, varargin))
    varargin = [varargin {&#38;#39;FunctionName&#38;#39;, &#38;#39;kspaceFirstOrderAS&#38;#39;}];
end

% Check for the binary name input. If not defined, set the default name of
% the GPU binary
if ~any(strcmp(&#38;#39;BinaryName&#38;#39;, varargin))
    if isunix
        varargin = [varargin {&#38;#39;BinaryName&#38;#39;, &#38;#39;kspaceFirstOrder-CUDA&#38;#39;}];
    else
        varargin = [varargin {&#38;#39;BinaryName&#38;#39;, &#38;#39;kspaceFirstOrder-CUDA.exe&#38;#39;}];
    end
end&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
