From a270f72c71b7b7f71e47516ccac1737bd8b98903 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Sun, 17 Dec 2017 04:17:26 +0000 Subject: As presented at the 118th Statistical Mechanics Meeting at Rutgers University on 2017-12-17 --- figs/atoms.fig/Makefile | 15 +++++++ figs/atoms.fig/nematic-base.gp | 21 ++++++++++ figs/atoms.fig/nematic.py | 90 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 figs/atoms.fig/Makefile 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..8e8462f --- /dev/null +++ b/figs/atoms.fig/Makefile @@ -0,0 +1,15 @@ +PROJECTNAME=nematic +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/nematic-base.gp b/figs/atoms.fig/nematic-base.gp new file mode 100644 index 0000000..92ffc4d --- /dev/null +++ b/figs/atoms.fig/nematic-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +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/nematic.py b/figs/atoms.fig/nematic.py new file mode 100644 index 0000000..5c779c0 --- /dev/null +++ b/figs/atoms.fig/nematic.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=30 +# number of rods +N=75 +# aspect ratio +a=10 +# spread in theta angle +spread=pi/30 + +# 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 +while len(config)