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

Conversion to VTK file using vdc not working. #114

Open
ViK0s opened this issue Jul 17, 2024 · 1 comment
Open

Conversion to VTK file using vdc not working. #114

ViK0s opened this issue Jul 17, 2024 · 1 comment

Comments

@ViK0s
Copy link

ViK0s commented Jul 17, 2024

Hello,
I have an issue with converting the data files into vtk files.
The conversion is resolved sucessfully but the resulting file has most of it data being set to the same values.
After further snooping and testing I have found that the variable atom on line 72 in vtk.cpp is not changing value and then after a while starts working as it should.

vampire/util/vdc/vtk.cpp

Lines 69 to 75 in 4c9651d

for(int i=0; i < vdc::atoms_list.size(); i++){
// get atom ID
unsigned int atom = vdc::atoms_list[i];
vtkfile << spins[3*atom+0] << " " << spins[3*atom+1] << " " << spins[3*atom+2] << " ";
}

Is there a fix for this?

@ViK0s
Copy link
Author

ViK0s commented Jul 17, 2024

I have found an easy fix, namely, just change the for loop and the int atom to loop over vdc::spliced_atoms_list.size() like so:

for(size_t i=0; i < vdc::sliced_atoms_list.size(); i++){

	// get atom ID
	unsigned int atom = vdc::sliced_atoms_list[i];

      vtkfile << spins[3*atom+0] << " " << spins[3*atom+1] << " " << spins[3*atom+2] << " ";
}

This let's me visualize the data using pyvista but, there is one weird thing that I now noticed - the ID section from the .vtu file has all ID data listed as 0, this happened also before the fix.

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

No branches or pull requests

1 participant