Skip to content

Commit

Permalink
Merge pull request #71 from ComputationalPhysics/submodule
Browse files Browse the repository at this point in the history
SimVis as a git submodule
  • Loading branch information
Anders Hafreager committed Oct 28, 2015
2 parents 5c05c36 + 496f72a commit 2aee508
Show file tree
Hide file tree
Showing 1,208 changed files with 10,257 additions and 353,996 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ Makefile*

#QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*
*.qmlproject.user.*

lammps.pri
lammps-android.pri
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "SimVis"]
path = SimVis
url = [email protected]:ComputationalPhysics/SimVis.git
2 changes: 2 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
simvis_srcdir = $$PWD/SimVis
simvis_builddir = $$shadowed($$PWD)/SimVis
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# atomify-lammps
Atomify - a live LAMMPS visualizer
# Atomify - a live LAMMPS visualizer #

- Simplifty your workflow significantly.
- Atomify is a script editor for LAMMPS supporting live visualization of the simulation. Edit your script, just press Run, and you will immediately see the atoms on your screen while LAMMPS is running. There is no need to dump the trajectories to disk and open them in VMD or Ovito anymore. It uses the high performance visualization library **[SimVis](https://github.com/computationalphysics/SimVis)** (based on Qt) allowing live visualization of millions of atoms in a live simulation.

## Why ##

The current workflow for developing LAMMPS scripts is as follows:
- Edit the script in your favorite text editor
- Open terminal, run the script and dump trajectories to disk
- Open VMD, Ovito or some other visualization software to visualize the dumped trajectories
With Atomify, we solved this problem by combining the script editing and visualizing in the same tool. Atomify runs LAMMPS internally, so there is almost no overhead in visualizing the simulation.

## Highlights ##
- Full OpenMP support (MPI support will come later)
- Also runs on your mobile phone / tablet (both Android and iOS)

## Installation ##

* Atomify is based on the Qt library, so you need to download **[Qt Creator](http://www.qt.io/download-open-source/)** (the open source version is fine). Qt version 5.5.0 or later is required.
* Download a stable source tarball of the **[LAMMPS source code](http://lammps.sandia.gov/download.html)**
It is now assumed that <atomify_source_folder> is the folder containing this README.md file. It is also assumed that <lammps_source_folder> is the folder containing the LAMMPS source code. This is for instance '~/Downloads/lammps-10Aug15/src'.
Once you have downloaded the LAMMPS source code and extracted the contents, you will need to patch the LAMMPS source code with the patch_lammps.py python script:
- `cd <atomify_source_folder>`
- `python patch_lammps.py <lammps_source_folder>`

Then, you will need to compile the LAMMPS source code with c++11 support. To do this, open the Makefile you will use (in <lammps_source_folder/MAKE/OPTIONS/Makefile.yourfavorite) and add '-std=c++11' to the CCFLAGS line. For instance, in the Makefile.ompi_g++, you should have the line `CCFLAGS = -g -O3 -std=c++11`.
Now compile LAMMPS as a library. For example, to make the ompi_g++ version of LAMMPS:
- `cd <lammps_source_folder>`
- `make ompi_g++ mode=lib`

The last step is to open Atomify in Qt Creator (open <atomify_source_folder>/atomify-lammps.pro). In Qt Creator, open the atomify-lammps.pro file and edit the two lines
`INCLUDEPATH += /projects/lammps-10Aug15/src`
`LIBS += -L/projects/lammps-10Aug15/src -llammps_omp`
to match your <lammps_source_folder> and which version you compiled. For instance, if you compiled the ompi_g++ version, the linking in the last line should be `-llammps_ompi_g++`.

Now, choose Release mode and enjoy Atomify.
1 change: 1 addition & 0 deletions SimVis
Submodule SimVis added at b198e8
4 changes: 2 additions & 2 deletions atomify-lammps.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = src atomify-lammps
SUBDIRS = SimVis atomify-lammps
CONFIG += ordered
atomify-lammps.depends = src
atomify-lammps.depends = SimVis
55 changes: 0 additions & 55 deletions atomify-lammps/AtomifyVisualizer.qml

This file was deleted.

6 changes: 3 additions & 3 deletions atomify-lammps/CPcompute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CPCompute::CPCompute(QObject *parent) : QObject(parent)
CPCompute::~CPCompute()
{
m_values.clear();
m_simulator = NULL;
m_simulator = nullptr;
m_dependencies.clear();
}

Expand All @@ -44,7 +44,7 @@ QString CPCompute::command() const
return m_command;
}

MySimulator *CPCompute::simulator() const
AtomifySimulator *CPCompute::simulator() const
{
return m_simulator;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ void CPCompute::setCommand(QString command)
emit commandChanged(command);
}

void CPCompute::setSimulator(MySimulator *simulator)
void CPCompute::setSimulator(AtomifySimulator *simulator)
{
if (m_simulator == simulator)
return;
Expand Down
13 changes: 6 additions & 7 deletions atomify-lammps/CPcompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
#define COMPUTE_H

#include <QObject>
#include <QPair>
#include <QVector>
#include "lammpsoutput.h"

class MySimulator; class LAMMPSController;
class AtomifySimulator; class LAMMPSController;
class CPCompute : public QObject
{
Q_OBJECT
Q_PROPERTY(QString identifier READ identifier WRITE setIdentifier NOTIFY identifierChanged)
Q_PROPERTY(QString fixIdentifier READ fixIdentifier WRITE setFixIdentifier NOTIFY fixIdentifierChanged)
Q_PROPERTY(QString fixCommand READ fixCommand WRITE setFixCommand NOTIFY fixCommandChanged)
Q_PROPERTY(QString command READ command WRITE setCommand NOTIFY commandChanged)
Q_PROPERTY(MySimulator* simulator READ simulator WRITE setSimulator NOTIFY simulatorChanged)
Q_PROPERTY(AtomifySimulator* simulator READ simulator WRITE setSimulator NOTIFY simulatorChanged)
Q_PROPERTY(QStringList dependencies READ dependencies WRITE setDependencies NOTIFY dependenciesChanged)
Q_PROPERTY(bool isVector READ isVector WRITE setIsVector NOTIFY isVectorChanged)
Q_PROPERTY(double time READ time)
Expand All @@ -31,7 +30,7 @@ class CPCompute : public QObject
QString m_command;

LammpsOutput m_output;
MySimulator* m_simulator = NULL;
AtomifySimulator* m_simulator = nullptr;
QStringList m_dependencies;
QList<double> m_values;
double m_time = 0;
Expand All @@ -43,7 +42,7 @@ class CPCompute : public QObject

QString identifier() const;
QString command() const;
MySimulator* simulator() const;
AtomifySimulator* simulator() const;
QStringList dependencies() const;
double firstValue() const;
double secondValue() const;
Expand All @@ -59,7 +58,7 @@ class CPCompute : public QObject
signals:
void identifierChanged(QString identifier);
void commandChanged(QString command);
void simulatorChanged(MySimulator* simulator);
void simulatorChanged(AtomifySimulator* simulator);
void dependenciesChanged(QStringList dependencies);
void firstValueChanged(double value);
void secondValueChanged(double value);
Expand All @@ -73,7 +72,7 @@ class CPCompute : public QObject
public slots:
void setIdentifier(QString identifier);
void setCommand(QString command);
void setSimulator(MySimulator* simulator);
void setSimulator(AtomifySimulator* simulator);
void setDependencies(QStringList dependencies);
void setValues(QVector<double> values);
void setIsVector(bool isVector);
Expand Down
124 changes: 0 additions & 124 deletions atomify-lammps/SliceControl.qml

This file was deleted.

Loading

0 comments on commit 2aee508

Please sign in to comment.