🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.techniques.xtallography
Article #38

Re: Generating LARGE Cartesian Lattices?

#38
From: Uncle Al
Date: Fri, 18 Oct 2002 16:43
45 lines
3170 bytes
Paul Nuber wrote:
> 
> uncle Al wants it to work in windows, he may not have a fortran compiler.
> It is more easy with python.  You can download it from www.python.org.
> Read the tutorial and here you go, it allows you to do other cool things too.
> In the python shell you can type (translate from fortran below)
> 
>           from math import *
>           ff = open("te.xyz","w")
>           a = 4. ; c=5. ; r=150.
>           iamin = int(r/a) + 1 ; icmin = int(r/c) + 1
>           for i in range(iamin):
>               for j in range(iamin):
>                   for k in range(icmin):
>                       x = a*i + a*j*cos(2.*pi/3.)
>                       y =       b*j*sin(2.*pi/3.)
>                       z = c*k
>                       if x**2 + y**2 + z**2 < r**2 :
>                             ff.write("%8s%12.6f%12.6f%12.6f\n" % ("Te",x,y,z))
>           ff.close()
> 
> (ctrl-Z to exist shell)
> It takes about 30 seconds on my pentium 4 machine to generate
> the required file (about 10 Mbytes).
> best
> paul

I was looking for an elegant general solution given *.CIF data in
existing code.  Silly me.  I am entirely happy with a brute force
solution for the specific case.  The "obvious" solution for a regular
lattice is to take an existing large Cartesian rendering, look at the
constant x,y,z increments at its far fringes (significant figures),
and run a triple arithmetic increment from the origin to to any radius
desired.

The program will roar to its conclusion whether compiled from Fortran,
C++, Python, or (hold your nose) Basic.  No trig at all.

"8^>)  Thanks folks.  To the keyboard!

-- 
Uncle Al
http://www.mazepath.com/uncleal/
 (Toxic URL! Unsafe for children and most mammals)
"Quis custodiet ipsos custodes?"  The Net!
Technical Details
Message-ID: <3DB03A18.F9937765@hate.spam.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!news2.west.cox.net.POSTED!53ab2750!not-for-mail
References: <3DAC8E95.4E7ACFD1@hate.spam.net> <85160b48.0210151846.74eeb9f6@posting.google.com> <3DAD8AE7.59098CA4@hate.spam.net> <52fe159d.0210171148.380ede5a@posting.google.com> <3DAF2B5B.601E8D20@hate.spam.net> <46223b20.0210172119.334bb773@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f804b,b1027c29d7d8962b
X-Google-Attributes: gidf804b,public
X-Google-Thread: fcf0b,b1027c29d7d8962b
X-Google-Attributes: gidfcf0b,public
X-Google-ArrivalTime: 2002-10-18 09:43:19 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!news2.west.cox.net.POSTED!53ab2750!not-for-mail
Message-ID: <3DB03A18.F9937765@hate.spam.net>
From: Uncle Al <UncleAl0@hate.spam.net>
Organization: The Noble Krell
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: sci.techniques.xtallography,bionet.xtallography
Subject: Re: Generating LARGE Cartesian Lattices?
References: <3DAC8E95.4E7ACFD1@hate.spam.net> <85160b48.0210151846.74eeb9f6@posting.google.com> <3DAD8AE7.59098CA4@hate.spam.net> <52fe159d.0210171148.380ede5a@posting.google.com> <3DAF2B5B.601E8D20@hate.spam.net> <46223b20.0210172119.334bb773@posting.google.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 45
Date: Fri, 18 Oct 2002 16:43:16 GMT
NNTP-Posting-Host: 68.5.243.16
X-Complaints-To: abuse@cox.net
X-Trace: news2.west.cox.net 1034959396 68.5.243.16 (Fri, 18 Oct 2002 12:43:16 EDT)
NNTP-Posting-Date: Fri, 18 Oct 2002 12:43:16 EDT