Class: VaspUtils::Potcar
- Inherits:
-
Object
- Object
- VaspUtils::Potcar
- Defined in:
- lib/vasputils/potcar.rb
Overview
Class for dealing with POTCAR.
Defined Under Namespace
Classes: Concatenater
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#enmaxes ⇒ Object
readonly
Returns the value of attribute enmaxes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Potcar
constructor
A new instance of Potcar.
Constructor Details
#initialize ⇒ Potcar
Returns a new instance of Potcar.
10 11 12 13 |
# File 'lib/vasputils/potcar.rb', line 10 def initialize @elements = [] @enmaxes = [] end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
8 9 10 |
# File 'lib/vasputils/potcar.rb', line 8 def elements @elements end |
#enmaxes ⇒ Object (readonly)
Returns the value of attribute enmaxes.
8 9 10 |
# File 'lib/vasputils/potcar.rb', line 8 def enmaxes @enmaxes end |
Class Method Details
.load_file(path) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vasputils/potcar.rb', line 16 def self.load_file(path) result = self.new #elements = Array.new File.open( path, "r" ).each do |line| if line =~ /VRHFIN\s*=\s*([A-Za-z]*)/ result.elements << $1 elsif line =~ /ENMAX\s*=\s*(\d+\.\d+)/ result.enmaxes << $1.to_f end end result end |