Article View: sci.techniques.xtallography
Article #45Re: Generating LARGE Cartesian Lattices?
From: Jon
Date: Thu, 17 Oct 2002 19:48
Date: Thu, 17 Oct 2002 19:48
55 lines
3661 bytes
3661 bytes
Uncle Al <UncleAl0@hate.spam.net> wrote in message news:<3DAD8AE7.59098CA4@hate.spam.net>...
> The *problem* is that I need a 120-150 A radius, or about 250,000
> atoms (about 9 MB of output). Loathsome fat, stupid, and incapable
> Windows freezes solid at those memory requirements if any attempt is
> made to order the list or output in a window instead of a scratch
> file.
Eventually there comes a time when it's faster to write something
yourself, particularly when most of the programs you've mentioned are
going to aim to draw a picture of your 250,000 atoms for you. They
might even search through them calculating bond distances and angles
so as to be able to draw chemically reasonable little sticks between
the quarter of a million little balls. The problem is not the
operating system, but the programs you are running on it.
Just loop over a, b and c lattice translations throwing away anything
outside the radius you want. In fortran (which I hope you can read)
that leads to something like the following:
program hexlat
a=4.0 ! a and c parameters
c=5.0 ! ...clearly you'll want to fill in the right numbers
r=150.0 ! radius of sphere
PI=4.0*atan(1.0)
iamin=int(r/a)+1 ! number of cells in a,c directions
icmin=int(r/c)+1 ! ...plus 1 as fortran rounds down
do 1 ia=-iamin,iamin
do 1 ib=-iamin,iamin
do 1 ic=-icmin,icmin
x=a*ia+a*ib*cos(2.*PI/3.) ! Check these equations...
y= a*ib*sin(2.*PI/3.) ! You might want different
z=c*ic ! coords to these (a||x, c||z)
1 if(sqrt(x*x+y*y+z*z).le.r)write(*,*)x,y,z
end
At 15 lines of code (typed right in and untested :) it's hardly worth
looking for something to download. If this is enough to get you
started, then you just need to make a list of atoms in the origin cell
and add those co-ordinates to the x,y and z in the code above,
checking that the axis conventions are right. I've intentionally left
that out as an exercise - far too much crystallography is already done
by black boxes.
> I have exhausted obscenities in seven languages damning BillGates to Hell
Empower yourself and write your own program. I can't really see
there's a general audience for lists of 250,000 atom co-ordinates that
can be summarised by a cell, space group and list of atoms in the
asymmetric unit. The real problem for a general program is that
reading a cif file and being ready for all of the possible 230 space
groups introduces a rather large overhead.
Hope this helps,
Jon
Technical Details
Message-ID:
<52fe159d.0210171148.380ede5a@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<3DAC8E95.4E7ACFD1@hate.spam.net> <85160b48.0210151846.74eeb9f6@posting.google.com> <3DAD8AE7.59098CA4@hate.spam.net>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-17 12:48:24 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: wright@esrf.fr (Jon) Newsgroups: sci.techniques.xtallography,bionet.xtallography Subject: Re: Generating LARGE Cartesian Lattices? Date: 17 Oct 2002 12:48:23 -0700 Organization: http://groups.google.com/ Lines: 55 Message-ID: <52fe159d.0210171148.380ede5a@posting.google.com> References: <3DAC8E95.4E7ACFD1@hate.spam.net> <85160b48.0210151846.74eeb9f6@posting.google.com> <3DAD8AE7.59098CA4@hate.spam.net> NNTP-Posting-Host: 160.103.2.52 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1034884103 10560 127.0.0.1 (17 Oct 2002 19:48:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 17 Oct 2002 19:48:23 GMT