oILAB
Loading...
Searching...
No Matches
MesoState.h
Go to the documentation of this file.
1//
2// Created by Nikhil Chandra Admal on 12/11/23.
3//
4
5#ifndef OILAB_MESOSTATE_H
6#define OILAB_MESOSTATE_H
7
8#include "ReferenceState.h"
9#include "Gb.h"
10#include <set>
11#include "Dislocations.h"
12#include "OrderedTuplet.h"
13
14namespace gbLAB {
15
16 template<int dim>
17 class MesoState : public ReferenceState<dim>, public Dislocations
18 {
22 using Matrix= typename Eigen::Matrix<IntScalarType,Eigen::Dynamic,Eigen::Dynamic>;
23 using Vector2d= Eigen::Vector2d;
24 using Matrix2d= Eigen::Matrix2d;
25
26 public:
27 // currently storing states of only one lattice as we are restricted to STGB
28 std::vector<Triplet> currentState;
29 std::vector<Triplet> defectsIndices;
30
31 explicit MesoState(const Gb<dim>& gb,
33 const int& periodScaling,
34 const double& a2,
35 const int& nImages);
36
37 explicit MesoState(const ReferenceState<dim>& rS, const double& a2, const int& nImages);
38
39 double energy() const;
40 Eigen::VectorXi getLocalStateCount(const int& numberOfInteractingPlanes) const
41 {
42 Eigen::VectorXi output(numberOfInteractingPlanes);
43 for(int i=0; i<numberOfInteractingPlanes; ++i)
44 output(i) = getOrthogonalPlaneIndices(i).size();
45 return output;
46 }
47
48 void insertDislocation(const Triplet&);
50 void removeDislocation(const Triplet& t);
51 Triplet insertRandomDislocation(const int& dipoleSign);
53 std::set<int> getOrthogonalPlaneIndices(const int& parallelPlaneIndex) const;
54
55 //template<int dm=dim>
56 typename std::enable_if<dim==3,void>::type
57 box(const int& heightFactor,
58 const int& dsclFactor,
59 const std::string& name) const;
60
61 template <typename T> int sgn(T val) const;
62 bool operator<(const MesoState& rhs) const;
63 };
64}
65#endif //OILAB_MESOSTATE_H
Definition Gb.h:16
void insertDislocation(const Triplet &)
std::set< int > getOrthogonalPlaneIndices(const int &parallelPlaneIndex) const
typename LatticeCore< dim >::VectorDimI VectorDimI
Definition MesoState.h:21
Triplet insertRandomDislocation(const int &dipoleSign)
std::vector< Triplet > currentState
Definition MesoState.h:28
typename LatticeCore< dim >::IntScalarType IntScalarType
Definition MesoState.h:19
LatticeCore< 3 >::VectorDimD VectorDimD
Definition MesoState.h:20
Eigen::VectorXi getLocalStateCount(const int &numberOfInteractingPlanes) const
Definition MesoState.h:40
MesoState(const ReferenceState< dim > &rS, const double &a2, const int &nImages)
Triplet insertRandomDislocation()
Eigen::Vector2d Vector2d
Definition MesoState.h:23
Eigen::Matrix2d Matrix2d
Definition MesoState.h:24
std::vector< Triplet > defectsIndices
Definition MesoState.h:29
int sgn(T val) const
void removeDislocation(const Triplet &t)
MesoState(const Gb< dim > &gb, const ReciprocalLatticeVector< dim > &axis, const int &periodScaling, const double &a2, const int &nImages)
bool operator<(const MesoState &rhs) const
typename Eigen::Matrix< IntScalarType, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition MesoState.h:22
Triplet removeRandomDislocation()
double energy() const
std::enable_if< dim==3, void >::type box(const int &heightFactor, const int &dsclFactor, const std::string &name) const
const Gb< dim > & gb
const ReciprocalLatticeVector< dim > & axis
Eigen::Matrix< double, dim, 1 > VectorDimD
Definition LatticeCore.h:24
long long int IntScalarType
Definition LatticeCore.h:26
Eigen::Matrix< IntScalarType, dim, 1 > VectorDimI
Definition LatticeCore.h:27