aims 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +100 -0
- data/bin/aims_output.rb +175 -0
- data/bin/aims_summary.rb +28 -0
- data/lib/aims.rb +35 -0
- data/lib/aims/atom.rb +197 -0
- data/lib/aims/bond.rb +46 -0
- data/lib/aims/cube.rb +46 -0
- data/lib/aims/geometry.rb +545 -0
- data/lib/aims/geometry_parser.rb +56 -0
- data/lib/aims/output.rb +484 -0
- data/lib/aims/plane.rb +74 -0
- data/lib/aims/vectorize.rb +22 -0
- data/lib/aims/volume.rb +137 -0
- data/lib/aims/wurtzite.rb +48 -0
- data/lib/aims/zinc_blende.rb +311 -0
- data/spec/atom_spec.rb +40 -0
- data/spec/bond_spec.rb +0 -0
- data/spec/output_spec.rb +42 -0
- data/spec/zinc_blende_spec.rb +63 -0
- metadata +82 -0
data/spec/atom_spec.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'aims'
|
2
|
+
include Aims
|
3
|
+
|
4
|
+
describe Atom do
|
5
|
+
|
6
|
+
a = Atom.new(0,0,0,"Atom")
|
7
|
+
a_copy = a.copy
|
8
|
+
|
9
|
+
it "Should not be constrained" do
|
10
|
+
a.constrained?.should be_false
|
11
|
+
end
|
12
|
+
|
13
|
+
it "constrained should be TRUE" do
|
14
|
+
a.constrain = true
|
15
|
+
a.constrained?.should be_true
|
16
|
+
end
|
17
|
+
|
18
|
+
it "constrained should be '.true.'" do
|
19
|
+
a.constrain = ".true."
|
20
|
+
a.constrained?.should be_true
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should == its copy" do
|
24
|
+
(a == a_copy).should be_true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should have the same hash as its copy" do
|
28
|
+
a.hash.should eq(a_copy.hash)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should eql? its copy" do
|
32
|
+
(a.eql?(a_copy)).should be_true
|
33
|
+
end
|
34
|
+
|
35
|
+
context "An array of duplicates" do
|
36
|
+
it "should have one element when uniq" do
|
37
|
+
[a, a_copy].uniq.size.should eq(1)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/spec/bond_spec.rb
ADDED
File without changes
|
data/spec/output_spec.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'aims'
|
2
|
+
include Aims
|
3
|
+
|
4
|
+
describe OutputParser do
|
5
|
+
|
6
|
+
updated_geometry_non_periodic =<<-EOL
|
7
|
+
x [A] y [A] z [A]
|
8
|
+
atom 0.00000000 -0.07326332 0.00000000 O
|
9
|
+
atom 0.76740638 -0.67036834 0.00000000 H
|
10
|
+
atom -0.76740638 -0.67036834 0.00000000 H
|
11
|
+
------------------------------------------------------------
|
12
|
+
EOL
|
13
|
+
|
14
|
+
updated_geometry_periodic =<<-EOL
|
15
|
+
x [A] y [A] z [A]
|
16
|
+
lattice_vector 1.99266923 1.99264227 -0.00253414
|
17
|
+
lattice_vector -0.00256109 1.99264197 1.99264198
|
18
|
+
lattice_vector 1.99266921 -0.00253413 1.99264226
|
19
|
+
|
20
|
+
atom 0.00000000 0.00000000 0.00000000 Al
|
21
|
+
|
22
|
+
Fractional coordinates:
|
23
|
+
L1 L2 L3
|
24
|
+
atom_frac 0.00000000 0.00000000 0.00000000 Al
|
25
|
+
EOL
|
26
|
+
|
27
|
+
it "should have 3 atoms" do
|
28
|
+
g = OutputParser.parse_updated_geometry(StringIO.new(updated_geometry_non_periodic), 3)
|
29
|
+
g.atoms[0].should eq(Atom.new(0,-0.07326332, 0, "O"))
|
30
|
+
g.atoms[1].should eq(Atom.new(0.76740638, -0.67036834, 0, "H"))
|
31
|
+
g.atoms[2].should eq(Atom.new(-0.76740638, -0.67036834, 0, "H"))
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should have 3 lattice vectors and 1 atom" do
|
35
|
+
g = OutputParser.parse_updated_geometry(StringIO.new(updated_geometry_periodic), 3)
|
36
|
+
g.lattice_vectors[0].should eq(Vector[1.99266923, 1.99264227, -0.00253414])
|
37
|
+
g.lattice_vectors[1].should eq(Vector[-0.00256109, 1.99264197, 1.99264198])
|
38
|
+
g.lattice_vectors[2].should eq(Vector[ 1.99266921, -0.00253413, 1.99264226])
|
39
|
+
g.atoms[0].should eq(Atom.new(0,0,0,"Al"))
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
require 'aims'
|
3
|
+
include Aims
|
4
|
+
|
5
|
+
describe ZincBlende do
|
6
|
+
|
7
|
+
zb = ZincBlende.new("Cation", "Anion", 5.75)
|
8
|
+
|
9
|
+
context "Bulk Geometry" do
|
10
|
+
bulk = zb.get_bulk
|
11
|
+
it "should have 2 atoms" do
|
12
|
+
bulk.atoms.size.should eq(2)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "001 Slab" do
|
17
|
+
(1..6).each do |i|
|
18
|
+
context "#{i} layers" do
|
19
|
+
s = zb.get_001_surface(i, 20)
|
20
|
+
it "should have #{i} atoms" do
|
21
|
+
s.atoms.size.should eq(i)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should have 0 constrained atoms" do
|
25
|
+
s.atoms.find_all{|a| a.constrained?}.size.should eq(0)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
6.times do |i|
|
31
|
+
context "#{i} constrained layers" do
|
32
|
+
s = zb.get_001_surface(6, 20, i)
|
33
|
+
it "should have 6 atoms" do
|
34
|
+
s.atoms.size.should eq(6)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should have i constrained atoms" do
|
38
|
+
s.atoms.find_all{|a| a.constrained?}.size.should eq(i)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context "110 Slab" do
|
45
|
+
|
46
|
+
(1..5).each do |i|
|
47
|
+
s = zb.get_110_surface(i, 20)
|
48
|
+
it "should have #{i*2} atoms" do
|
49
|
+
# The 110 surface has 2 atoms per monolayer
|
50
|
+
s.atoms.size.should eq(i*2)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
5.times do |i|
|
55
|
+
it "Should have #{i*2} constrained atoms" do
|
56
|
+
s = zb.get_110_surface(5, 20, i)
|
57
|
+
s.atoms.find_all{|a| a.constrained? }.size.should eq(i*2)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aims
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Joshua Shapiro
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-03 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &3812490 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *3812490
|
25
|
+
description: Support for generation and parsing of input and output files for FHI-AIMS
|
26
|
+
DFT package
|
27
|
+
email: joshua.shapiro@gmail.com
|
28
|
+
executables:
|
29
|
+
- aims_output.rb
|
30
|
+
- aims_summary.rb
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- bin/aims_output.rb
|
35
|
+
- bin/aims_summary.rb
|
36
|
+
- lib/aims/atom.rb
|
37
|
+
- lib/aims/bond.rb
|
38
|
+
- lib/aims/cube.rb
|
39
|
+
- lib/aims/geometry.rb
|
40
|
+
- lib/aims/geometry_parser.rb
|
41
|
+
- lib/aims/output.rb
|
42
|
+
- lib/aims/plane.rb
|
43
|
+
- lib/aims/vectorize.rb
|
44
|
+
- lib/aims/volume.rb
|
45
|
+
- lib/aims/wurtzite.rb
|
46
|
+
- lib/aims/zinc_blende.rb
|
47
|
+
- lib/aims.rb
|
48
|
+
- README.rdoc
|
49
|
+
- spec/atom_spec.rb
|
50
|
+
- spec/bond_spec.rb
|
51
|
+
- spec/output_spec.rb
|
52
|
+
- spec/zinc_blende_spec.rb
|
53
|
+
homepage: https://github.com/jns/Aims
|
54
|
+
licenses: []
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 1.8.17
|
74
|
+
signing_key:
|
75
|
+
specification_version: 3
|
76
|
+
summary: This gem offers support for parsing and generating geometry and control files, and
|
77
|
+
parsing output files for the FHI-AIMS DFT code.
|
78
|
+
test_files:
|
79
|
+
- spec/atom_spec.rb
|
80
|
+
- spec/bond_spec.rb
|
81
|
+
- spec/output_spec.rb
|
82
|
+
- spec/zinc_blende_spec.rb
|