richard-evans / vampire

Atomistic simulator for magnetic materials
GNU General Public License v2.0
122 stars 92 forks source link

Added VTK file output support #27

Closed peytondmurray closed 5 years ago

peytondmurray commented 6 years ago

I've always liked using Paraview for viewing micromagnetic simulations, so I added two new input file commands which allow for spins to be written in VTK file format:

@richard-evans, I noticed that the develop branch is far behind master - is master still the right branch to submit this pull request to?

richard-evans commented 6 years ago

@peytondmurray yes I do apologise for the large divergence between develop and master. There are a lot of changes and refactoring in the develop branch, and i/o has been completely rewritten. However, I am keen to add your support for vtk files - is it possible to look at a similar implementation in the develop branch?

peytondmurray commented 6 years ago

I'll take a look - it shouldn't be an issue to switch over. It looks like develop has moved away from using the .sln and instead favors the makefile now - is this correct? Are you still building on Windows at all?

richard-evans commented 6 years ago

Ok - would be great if you could! Windows development is usually an afterthought, as most users seem to be unix based. At the time VS didn't seem to like importing makefiles, but if that has changed that should make things a lot easier. Also, bash for windows also makes compilation a breeze (especially for MPI) and so I was contemplating making that the preferred way to actually use the code on Windows.

peytondmurray commented 6 years ago

I'm all in favor of switching to bash for windows, except CUDA isn't supported yet. What about CMake?

richard-evans commented 6 years ago

Ahh! The develop branch also has rudimentary cuda support :D. Anyway, I have no experience of cmake but certainly open to using it if it makes compilation easier.

peytondmurray commented 6 years ago

I don't have any experience with CMake either, but I'm willing to take a look to see if it will work. I was hoping to work a little bit on the CUDA code later on, so preserving that functionality is important.

richard-evans commented 6 years ago

Ok thanks - if you can get a build working with Cmake that would be good! I got a bit fed up of manually importing the files into VS every time I changed something, and so if there is an automatic way of doing that it would be very good.

peytondmurray commented 6 years ago

@richard-evans I've looked into the possibility of using CMake for this project, but I'm not convinced it would actually save any effort in maintaining the code. CMake could be used to build platform-specific makefiles/Visual Studio solutions/etc. However, if we wanted to use any compiler or linker flags, the CMake files would have to specify them for each particular compiler/linker case - which is already effectively what is done by the makefiles included in the project. It also has trouble producing sensibly organized .sln files; all the source files are automatically jammed in one single folder and all the headers are jammed into another, breaking the directory structure of the project. Getting around the issue is not worth the effort. I have a branch on my fork (cmake) that has a working CMake build that I can submit for a pull request if you really want it.

As an alternative, I have another branch on my fork (update-sln) where I've updated the vampire.sln file to work with the newest Visual Studio, and it compiles on my Windows 10 box. I think merging this branch to develop is the easiest, but the choice is up to you.

richard-evans commented 5 years ago

Thanks Payton. I have now added support for new format vtk files from the new vdc utility.