atomicrex  0.1
An advanced atomistic model building tool
SuperCellStructure.h
1 //
3 // Copyright (C) 2017, Alexander Stukowski and Paul Erhart
4 //
5 // This file is part of atomicrex.
6 //
7 // Atomicrex is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Atomicrex is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 //
21 
22 #pragma once
23 
24 #include "AtomicStructure.h"
25 #include "../dof/DegreeOfFreedom.h"
26 #include "../properties/FitProperty.h"
27 
32 namespace atomicrex {
33 
52 {
53 public:
54 
58  enum LatticeType {
59  LATTICE_FCC,
60  LATTICE_HCP,
61  LATTICE_BCC
62  };
63 
66 
68  virtual void updateStructure() override;
69 
71  virtual void parse(XML::Element structureElement) override;
72 
73 protected:
74 
76  Matrix3 unitCell() const;
77 
79  Matrix3 superCell() const;
80 
82  std::vector<std::pair<Point3, int>> unitCellBasis() const;
83 
85  std::vector<std::pair<Point3, int>> superCellAtoms() const;
86 
87 private:
88 
90  LatticeType _latticeType = LATTICE_FCC;
91 
93  int _cellSize = 1;
94 
96  ScalarDOF _latticeParameter;
97 
99  ScalarDOF _CtoAratio;
100 
102  CoupledFitProperty _latticeParameterProperty;
103 
105  CoupledFitProperty _CtoAratioProperty;
106 
107 protected:
108 
110  int _atomTypeA = 1;
111 
112 };
113 
114 } // End of namespace
Base class for maintaining structures.
Definition: AtomicStructure.h:42
This class defines a N x N x N supercell structure.
Definition: SuperCellStructure.h:51
Definition: FitProperty.h:184
int _atomTypeA
The atom type of the lattice.
Definition: SuperCellStructure.h:110
std::vector< std::pair< Point3, int > > unitCellBasis() const
Returns the atoms in the lattice unit cell (reduced coordinates).
Definition: SuperCellStructure.cpp:109
virtual void updateStructure() override
Updates the structure (atom positions, simulation cell, etc.)
Definition: SuperCellStructure.cpp:49
std::vector< std::pair< Point3, int > > superCellAtoms() const
Builds a list of atoms in the super cell.
Definition: SuperCellStructure.cpp:132
This file collects the definition of classes that define various simple crystal structures.
Definition: Atomicrex.h:67
A simple scalar degree of freedom that consists of a single value.
Definition: DegreeOfFreedom.h:169
std::string FPString
The default string type used throughout the code:
Definition: Atomicrex.h:70
Definition: XMLUtilities.h:69
Definition: FitJob.h:37
Matrix3 unitCell() const
Returns the geometry of the selected lattice unit cell.
Definition: SuperCellStructure.cpp:76
FitJob * job() const
Returns a pointer to the job to which this object belongs.
Definition: FitObject.h:150
virtual void parse(XML::Element structureElement) override
Parses any structure-specific parameters in the XML element in the job file.
Definition: SuperCellStructure.cpp:155
SuperCellStructure(const FPString &id, FitJob *job)
Constructor.
Definition: SuperCellStructure.cpp:34
Matrix3 superCell() const
Returns the geometry of the super cell.
Definition: SuperCellStructure.cpp:99
LatticeType
The list of lattice types supported by this class.
Definition: SuperCellStructure.h:58