From 7629eb82cc5e05ef514912d9f393d0f42feb8c93 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Thu, 26 Oct 2017 20:02:17 +0000 Subject: As presented at Rutgers University on 2017-10-26 --- figs/atoms.fig/Makefile | 15 ++++++ figs/atoms.fig/chiral-base.gp | 22 +++++++++ figs/atoms.fig/chiral.py | 102 +++++++++++++++++++++++++++++++++++++++++ figs/atoms.fig/crystal-base.gp | 21 +++++++++ figs/atoms.fig/crystal.py | 24 ++++++++++ figs/atoms.fig/gas-base.gp | 21 +++++++++ figs/atoms.fig/gas.py | 39 ++++++++++++++++ figs/atoms.fig/liquid-base.gp | 21 +++++++++ figs/atoms.fig/liquid.py | 39 ++++++++++++++++ figs/atoms.fig/nematic-base.gp | 21 +++++++++ figs/atoms.fig/nematic.py | 90 ++++++++++++++++++++++++++++++++++++ 11 files changed, 415 insertions(+) create mode 100644 figs/atoms.fig/Makefile create mode 100644 figs/atoms.fig/chiral-base.gp create mode 100644 figs/atoms.fig/chiral.py create mode 100644 figs/atoms.fig/crystal-base.gp create mode 100644 figs/atoms.fig/crystal.py create mode 100644 figs/atoms.fig/gas-base.gp create mode 100644 figs/atoms.fig/gas.py create mode 100644 figs/atoms.fig/liquid-base.gp create mode 100644 figs/atoms.fig/liquid.py create mode 100644 figs/atoms.fig/nematic-base.gp create mode 100644 figs/atoms.fig/nematic.py (limited to 'figs/atoms.fig') diff --git a/figs/atoms.fig/Makefile b/figs/atoms.fig/Makefile new file mode 100644 index 0000000..a4b610f --- /dev/null +++ b/figs/atoms.fig/Makefile @@ -0,0 +1,15 @@ +PROJECTNAME=crystal liquid gas nematic chiral +PNGS=$(addsuffix .png, $(PROJECTNAME)) + +all: $(PNGS) + +$(PNGS): + cp $(patsubst %.png, %, $@)-base.gp $(patsubst %.png, %, $@).gp + python $(patsubst %.png, %, $@).py >> $(patsubst %.png, %, $@).gp + gnuplot $(patsubst %.png, %, $@).gp > $@ + +clean-aux: + rm -f $(addsuffix .gp, $(PROJECTNAME)) + +clean: clean-aux + rm -f $(PNGS) diff --git a/figs/atoms.fig/chiral-base.gp b/figs/atoms.fig/chiral-base.gp new file mode 100644 index 0000000..74db566 --- /dev/null +++ b/figs/atoms.fig/chiral-base.gp @@ -0,0 +1,22 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view 80,10,1.5 +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999") + +splot \ diff --git a/figs/atoms.fig/chiral.py b/figs/atoms.fig/chiral.py new file mode 100644 index 0000000..eed6df8 --- /dev/null +++ b/figs/atoms.fig/chiral.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 + +from math import * +import random +import sys + +# size of space +L=30 +# number of lines +H=5 +# heigh of lines +height=5 +# number of rods per line +N=16 +# aspect ratio +a=10 +# spread in theta angle +spread_t=pi/60 +# in phi +spread_p=pi/60 +# in height +spread_h=1/120 + +# check whether two rods overlap +def check_overlap(rod1,rod2): + # relative placement + relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1]) + if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2): + return(True) + # relative angle + relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1])) + # exclusion volume + # rotate other rod + relative_pos=unrotate(relative_pos, [0,relative_ang[1]]) + #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-21 and abs(c)<1.0001): + if(c>0): + return([w[0],0]) + else: + return([w[0],pi]) + if(s>=0): + return([w[0],acos(c)]) + return([w[0],2*pi-acos(c)]) + +# configuration +config=[] +# add rods +for h in range(H): + config_h=[] + while len(config_h)1 and abs(c)<1.0001): + if(c>0): + return([w[0],0]) + else: + return([w[0],pi]) + if(s>=0): + return([w[0],acos(c)]) + return([w[0],2*pi-acos(c)]) + +# configuration +config=[] +# add rods +while len(config)