Skip to content
Snippets Groups Projects
Commit 9e78c11e authored by Armin Co's avatar Armin Co
Browse files

Fix GTK warning.

Removed a warning which apeared when the application started.
parent 0fbdfb4e
No related branches found
No related tags found
No related merge requests found
build
.vscode
\ No newline at end of file
......@@ -17,13 +17,13 @@ const Complex Ci(0.0, 1.0);
void Particle::initImpulse()
{
for (unsigned long iy = 0; iy < ny; iy++)
for (unsigned iy = 0; iy < ny; iy++)
{
double y = yAt(iy);
for (unsigned long ix = 0; ix < nx; ix++)
for (unsigned ix = 0; ix < nx; ix++)
{
double x = xAt(ix);
int index = nx * iy + ix;
unsigned index = nx * iy + ix;
m_psi[index] = A0 * exp(Ci / hbar * (x * k_px0 + y * k_py0) - lambda * (square(x - k_x0) + square(y - k_y0)));
}
}
......@@ -54,15 +54,15 @@ Particle::~Particle()
void Particle::propagate()
{
#pragma omp parallel for
for (unsigned long iy = 0; iy < ny; iy++)
for (unsigned iy = 0; iy < ny; iy++)
{
double y = yAt(iy);
for (unsigned long ix = 0; ix < nx; ix++)
for (unsigned ix = 0; ix < nx; ix++)
{
constexpr double l = 0.001; //lambda
double x = xAt(ix);
double E = square(y) * l;
int index = nx * iy + ix;
unsigned index = nx * iy + ix;
m_psi[index] *= exp(-Ci * dt / hbar * E);
}
}
......@@ -70,10 +70,10 @@ void Particle::propagate()
fftw_execute (m_planForward); // transform into impulse repr.
#pragma omp parallel for
for (unsigned long iy = 0; iy < ny; iy++)
for (unsigned iy = 0; iy < ny; iy++)
{
double py = pyAt(iy);
for (unsigned long ix = 0; ix < nx; ix++)
for (unsigned ix = 0; ix < nx; ix++)
{
double px = pxAt(ix);
double E = (square(px) + square(py)) / (2.0 * m);
......@@ -94,8 +94,8 @@ void Particle::updateImpulseImage()
std::array<Complex, valuesInArray> array;
unsigned px = 0;
unsigned py = 0;
unsigned long impulse_index = 0;
unsigned long array_index = 0;
unsigned impulse_index = 0;
unsigned array_index = 0;
#pragma omp parallel for
for (unsigned y = 0; y < ny; y++)
{
......@@ -129,9 +129,9 @@ void Particle::updateImpulseImage()
void Particle::updateLocalImage()
{
std::array<Complex, valuesInArray> array;
for (unsigned long y = 0; y < ny; y++)
for (unsigned y = 0; y < ny; y++)
{
for (unsigned long x = 0; x < nx; x++)
for (unsigned x = 0; x < nx; x++)
{
int index = y * nx + x;
array[index] = m_psi[index];
......
......@@ -46,7 +46,7 @@ void render(ArrayCanvas &ac)
int main(int argc, char* argv[])
{
// App and window
auto app = Gtk::Application::create(argc, argv, "An exmaple");
auto app = Gtk::Application::create(argc, argv, "cvh.qpong");
Gtk::Window window;
window.set_default_size(1024, 512);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment