Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: 512 homogeneous domain #2

Merged
merged 3 commits into from
Nov 15, 2022
Merged

test: 512 homogeneous domain #2

merged 3 commits into from
Nov 15, 2022

Conversation

astanziola
Copy link
Member

Hi @SonyPony , I actually don't manage to reproduce #1

I've added a script that checks the solution for a 512 domain, could you give it a look and see what differences there are with what you've tried?

Here's what I get when I run the script (I've zoomed into the origin of the plots in the first row to better check the phase

zoomed_512_example

@astanziola astanziola requested a review from SonyPony April 4, 2022 15:01
@SonyPony
Copy link
Collaborator

SonyPony commented Apr 6, 2022

Hi @astanziola,

I am sorry, that I didn't give you enough information for the bug replication. I am not normalizing the wavefield using the source.

Replication code:

N = 96;                                     % number of grid points in each direction
dx = 1.;                                     % step size [m]

omega = 1.;                                  % angular frequency [rads/s]
c0 = ones(N, N);                             % Homogeneous speed of sound [m/s]
min_sos = 1.0;
abs_coeff = zeros(N,N);                      % absorption coefficient [dB/cm]

src_location = [N / 2, N / 2];                     % Source location in gridpoints

% run the k-Wave solver for a single frequency 
p_kwave = kwave_solution(N, c0, abs_coeff, src_location, omega, min_sos, 0.0, 0.1, 2, dx);

% PLOTS
figure;
imagesc(real(p_kwave))
axis off
axis equal
title("kWave solution")
caxis([-0.2, 0.2])
colorbar
axis image
drawnow 

With N = 96
image

With N = 512
image

As can be seen in the second image, there is a negative dot at the source location, whereas there is none in the first image. Is normalizing with the source the only solution?

@astanziola
Copy link
Member Author

I see... Normalizing the source is a solution, but I agree with you that's not the only one (and theoretically it shouldn't be needed).

I'll keep investigating

@astanziola
Copy link
Member Author

Still not sure why this is happening, however this adds an interesting test, therefore I'm merging.

@astanziola astanziola merged commit 7d9f165 into main Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants