Class: AimsProject::AimsProjectGeometry
- Inherits:
-
Object
- Object
- AimsProject::AimsProjectGeometry
- Defined in:
- lib/aims_project/aims_project_geometry.rb
Overview
A class that encapsulates the Aims::Geometry and other state information important for AimsProject
Instance Attribute Summary collapse
-
#correct_geometry ⇒ Object
Boolean flag indicating whether the atoms should be displaced to all lie within the unit cell.
-
#filename ⇒ Object
readonly
The filename defining this geometry.
Instance Method Summary collapse
- #geometry ⇒ Object
- #geometry_corrected ⇒ Object
- #geometry_original ⇒ Object
-
#initialize(file) ⇒ AimsProjectGeometry
constructor
A new instance of AimsProjectGeometry.
- #save ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file) ⇒ AimsProjectGeometry
Returns a new instance of AimsProjectGeometry.
14 15 16 17 |
# File 'lib/aims_project/aims_project_geometry.rb', line 14 def initialize(file) @filename = file @geometry_original = Aims::GeometryParser.parse(@filename) end |
Instance Attribute Details
#correct_geometry ⇒ Object
Boolean flag indicating whether the atoms should be displaced to all lie within the unit cell
9 10 11 |
# File 'lib/aims_project/aims_project_geometry.rb', line 9 def correct_geometry @correct_geometry end |
#filename ⇒ Object (readonly)
The filename defining this geometry
12 13 14 |
# File 'lib/aims_project/aims_project_geometry.rb', line 12 def filename @filename end |
Instance Method Details
#geometry ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/aims_project/aims_project_geometry.rb', line 19 def geometry if self.correct_geometry geometry_corrected else geometry_original end end |
#geometry_corrected ⇒ Object
27 28 29 30 31 32 |
# File 'lib/aims_project/aims_project_geometry.rb', line 27 def geometry_corrected if @geometry_corrected.nil? @geometry_corrected = @geometry_original.correct end @geometry_corrected end |
#geometry_original ⇒ Object
34 35 36 |
# File 'lib/aims_project/aims_project_geometry.rb', line 34 def geometry_original @geometry_original end |
#save ⇒ Object
43 44 45 46 47 48 |
# File 'lib/aims_project/aims_project_geometry.rb', line 43 def save unless @filename raise InvalidFilenameException end raise "AimsProjectGeometry.save is not yet implemented" end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/aims_project/aims_project_geometry.rb', line 38 def to_s @filename end |