Example #1
0
 def init_manager(self, hdf5_path, identifier=None):
     if identifier == None:
         identifier = os.path.splitext(hdf5_path)[0].split('/')[-1]
     base_id = identifier
     # Make sure identifier is unique
     n = 1
     while identifier in self.visualisation_managers:
         identifier = base_id + str(n)
         n += 1
     visualisationManager = VisualisationManager(hdf5_path, self.app)
     self.visualisation_managers[identifier] = visualisationManager
     return [
         identifier, hdf5_path,
         visualisationManager.available_visualisations
     ]
Example #2
0
import sys, os, inspect
import os, sys, inspect, inviwopy
path_to_current_folder = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(path_to_current_folder + "/../")
import envisionpy
import envisionpy.hdf5parser
from envisionpy.network import VisualisationManager

VASP_DIR = path_to_current_folder + "/../unit_testing/resources/TiPO4_bandstructure"
HDF5_FILE = path_to_current_folder + "/../demo_force2.hdf5"

try:
    os.remove(HDF5_FILE)
except:
    print("Somthing went wrong")

envisionpy.hdf5parser.force_parser(HDF5_FILE, VASP_DIR)

inviwopy.app.network.clear()

# Initialize inviwo network
visManager = VisualisationManager(HDF5_FILE, inviwopy.app)
visManager.start("test")
Example #3
0
##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
##  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
##  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
## ##############################################################################################

import sys, os, inspect
import os, sys, inspect, inviwopy
path_to_current_folder = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(path_to_current_folder + "/../")
import envisionpy
import envisionpy.hdf5parser
from envisionpy.network import VisualisationManager

VASP_DIR = path_to_current_folder + "/../unit_testing/resources/TiPO4_bandstructure"
HDF5_FILE = path_to_current_folder + "/../temp7.hdf5"

#try:
#    os.remove(HDF5_FILE)
#except:
#    print("no habla espanol")

envisionpy.hdf5parser.force_parser(HDF5_FILE, VASP_DIR, True)

inviwopy.app.network.clear()

# Initialize inviwo network
visManager = VisualisationManager(HDF5_FILE, inviwopy.app, True)
visManager.start("force")
Example #4
0
## ##############################################################################################

import sys, os, inspect
import os, sys, inspect, inviwopy
path_to_current_folder = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(path_to_current_folder + "/../")
import envisionpy
import envisionpy.hdf5parser
from envisionpy.network import VisualisationManager

#--------VASP-------
#Path to VASP-files and path to where the generated HDF5-file will be located.
VASP_DIR = path_to_current_folder + "/../unit_testing/resources/MD/VASP/Al_300K"
#HDF5_FILE = path_to_current_folder + "/../demo_molecular_dynamics.hdf5"

#--------Premade HDF5-files-------
#Path to a HDF5-file already generated by the molecular_dynamics parser
HDF5_FILE = path_to_current_folder + "/../md_test.hdf5"
#HDF5_FILE = path_to_current_folder + "/../test_md_2punkt0.hdf5"

#parse the VASP-file for molecular dynamics
envisionpy.hdf5parser.mol_dynamic_parser(HDF5_FILE, VASP_DIR)

#clear any old network
inviwopy.app.network.clear()

#Initialize inviwo network
visManager = VisualisationManager(HDF5_FILE, inviwopy.app, True)
visManager.start("molecular_dynamics")
Example #5
0
import sys, os, inspect
import os, sys, inspect, inviwopy

path_to_current_folder = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(path_to_current_folder + "/../")
import envisionpy
import envisionpy.hdf5parser
from envisionpy.network import VisualisationManager

# Path to the vasp output directory you wish to visualise
VASP_DIR = path_to_current_folder + "/../unit_testing/resources/Cu_band_CUB"
HDF5_FILE = path_to_current_folder + "/../unit_testing/resources/DemoSlice.hdf5"

# Parse for charge density visualisation.
envisionpy.hdf5parser.charge(HDF5_FILE, VASP_DIR)
envisionpy.hdf5parser.unitcell(HDF5_FILE, VASP_DIR)

# Clear any old network
inviwopy.app.network.clear()

# Initialize inviwo network
visManager = VisualisationManager(HDF5_FILE, inviwopy.app)

visManager.start("charge")
visManager.start("atom")

visManager.subnetworks['charge'].toggle_slice_plane(True)
visManager.subnetworks['charge'].show(False, True)