Dear Bob
I think I have sorted out most of the errors on my class. Now I can add all the 
atoms in Jmol but still one things very weird happen to me : 

1) all atoms have the same position! Is something wrong with the way how 
crystal print the fractional coordinates?

 1 T  26 FE    3.568442544039E-01  3.568442544031E-01  3.568442544031E-01

Do you have any suggestions? 

Thank you, Piero 
--
Pieremanuele Canepa
Room 104
Functional Material Group
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom

e-mail: pc...@kent.ac.uk
mobile: +44 (0) 7772-9756456
-----------------------------------------------------------
________________________________________
From: Robert Hanson [hans...@stolaf.edu]
Sent: Thursday, February 11, 2010 12:57 PM
To: jmol-developers@lists.sourceforge.net
Subject: Re: [Jmol-developers] Extend Jmol to crystal files

On Thu, Feb 11, 2010 at 5:56 AM, P.Canepa 
<pc...@kent.ac.uk<mailto:pc...@kent.ac.uk>> wrote:
Hi Rob,

I am sorry for wasting again your time ,

I have been trying for while  if my new part of the Resolver class  works !


I added this code  which should look though the file and find at a certain 
point these text lines within brackets. If these are found  it should  print  
out at least the message below, which I cannot see so far !

The code is fine. I think it is working properly. If these are found, it should 
NOT print out the message because it will return TRUE. Are you saying with this 
code that ANY ONE of these must be present within the first 16 lines? Isn't 
there one thing that HAS to be there? Please check on the file specifications 
and see if there is one unique phrase rather than all these checks. I wouldn't 
know, but you would.

Apperently there is some error! Is the variable lines meant as an array of 
Strings where each element of the array corresponds to precise line in my text 
file ?

Furthermore
 Thank you ,Piero

 private static boolean checkCrystal(String[] lines){
   for (int i = 0; i < lines.length; i++ ){

     if(lines[i].startsWith(" MOLECULAR CALCULATION ")) return true;
     if(lines[i].startsWith(" POLYMER CALCULATION ")) return true;
     if(lines[i].startsWith(" SLAB CALCULATION ")) return true;
     if(lines[i].startsWith(" CRYSTAL CALCULATION ")) return true;
     if(lines[i].startsWith(" LOCAL ATOMIC FUNCTIONS BASIS SET ")) return true;
    System.out.println("This is a crystal file");

   }
   return false;
 }

--
Pieremanuele Canepa
Room 104
Functional Material Group
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom

e-mail: pc...@kent.ac.uk<mailto:pc...@kent.ac.uk>
mobile: +44 (0) 7772-9756456
-----------------------------------------------------------
________________________________________
From: Robert Hanson [hans...@stolaf.edu<mailto:hans...@stolaf.edu>]
Sent: Wednesday, February 10, 2010 6:29 PM
To: 
jmol-developers@lists.sourceforge.net<mailto:jmol-developers@lists.sourceforge.net>
Subject: Re: [Jmol-developers] Extend Jmol to crystal files

On Wed, Feb 10, 2010 at 7:10 AM, P.Canepa 
<pc...@kent.ac.uk<mailto:pc...@kent.ac.uk><mailto:pc...@kent.ac.uk<mailto:pc...@kent.ac.uk>>>
 wrote:
Dear Bob,
3)  ATOMS IN THE ASYMMETRIC UNIT that starts the atomic coordinates section
As you seethe numbers of  lattice parameters and atomic coordinates are found 
two lines below.

In addition the values of the lattice parameters and x y z per each atoms are 
on the same line, how can I tackle this problem reading line by line (as you 
did in Wien2kReader.java) ?

All the readers are subclasses of smarter.AtomCollectionReader. At the end of 
that class code you will see a whole set of public functions you can tap into. 
In particular there is a global field "line" that is read with

readLine();

When you are reading a mix of text and numbers from a line, first consider 
whether there is guaranteed white space between them. Not all programs do that. 
If that is the case, then

String[] tokens = getTokens();  // from the NEXT line

or

String[] tokens = getTokens(line); // from the CURRENT line

would be my choice. Then I do something like:

atom.set(parseFloat(tokens[0]), parseFloat(tokens[1]), parseFloat(tokens[2]));


for example.

Or, if you know it is column based, you can just use:

readLine();

atom.set(parseFloat(line.substring(10,20)), parseFloat.....)

Something like that.

Don't worry so much about getting this perfect. I'll edit it down to the 
simplest way to read the file. Just get it reading the file successfully any 
way you want.

Bob

Can you help me?
Furthermore does jmol need the direct lattice vector to define the cell?
Thank you
--
Pieremanuele Canepa
Room 104
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom
-----------------------------------------------------------
________________________________________
From: Robert Hanson 
[hans...@stolaf.edu<mailto:hans...@stolaf.edu><mailto:hans...@stolaf.edu<mailto:hans...@stolaf.edu>>]
Sent: Tuesday, February 09, 2010 2:27 PM
To: 
jmol-developers@lists.sourceforge.net<mailto:jmol-developers@lists.sourceforge.net><mailto:jmol-developers@lists.sourceforge.net<mailto:jmol-developers@lists.sourceforge.net>>
Subject: Re: [Jmol-developers] Extend Jmol to crystal files

That would be great. Please:

1) Check out the Jmol code using SVN/Eclipse.

2) Create your reader. Please add this to org.jmol.adapter.readers.xtal (unless 
it is XML, then use ....xml). Take a look at 
org.jmol.adapter.smarter.AtomSetCollectionReader.java to get a sense of what is 
going to happen in the reader.

I can help if you get stuck. This mostly involves:

 (a) adding a bit of code to org.jmol.adapter.smarter.Resolver.java
 (b) copying one of the other readers as a template as CrystalReader.java
 (c) modifying the template as needed

3) Create a working patch and send it to us. This should be just two files -- 
Resolver.java and CrystalReader.java

4) I will check over your code, make sure it doesn't conflict with other 
readers, make sure it properly accounts for various options, and probably edit 
it a bit to be consistent with our styling. Then I will add it to Jmol 11.9.x

Bob

On Tue, Feb 9, 2010 at 5:19 AM, P.Canepa 
<pc...@kent.ac.uk<mailto:pc...@kent.ac.uk><mailto:pc...@kent.ac.uk<mailto:pc...@kent.ac.uk>><mailto:pc...@kent.ac.uk<mailto:pc...@kent.ac.uk><mailto:pc...@kent.ac.uk<mailto:pc...@kent.ac.uk>>>>
 wrote:
I am physic PhD student and  I am willing  to contribute to the development of  
Jmol.
 Reading trough Jmol web-page  I realized that it is already capable to save 
file for other famous period code such as: CASTEP, WIEN2k, VASP, etc... I would 
like to extend it to  CRYSTAL09, the periodic code developed at the University 
of Turin, Italy 
(http:\\www.crystal.unito.it<http://www.crystal.unito.it><http://www.crystal.unito.it><http://www.crystal.unito.it>).
 I have a bit of experience with java  (especially java swing) and I use daily 
CRYSTAL . Can you give me some hint as to start developing class to deal with 
crystal files?
Many Thanks, Piero


--
Pieremanuele Canepa
Room 104
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom
-----------------------------------------------------------
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net><mailto:Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net>><mailto:Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net><mailto:Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net>>>
https://lists.sourceforge.net/lists/listinfo/jmol-developers



--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net><mailto:Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net>>
https://lists.sourceforge.net/lists/listinfo/jmol-developers



--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net<mailto:Jmol-developers@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jmol-developers



--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to