oILAB
Loading...
Searching...
No Matches
GbMesoState.h
Go to the documentation of this file.
1//
2// Created by Nikhil Chandra Admal on 5/26/24.
3//
4
5#ifndef OILAB_GBMESOSTATE_H
6#define OILAB_GBMESOSTATE_H
7
8#include <Gb.h>
9#include <GbContinuum.h>
10#include <LatticeCore.h>
11#include <OrderedTuplet.h>
12#include <PeriodicFunction.h>
13
14namespace gbLAB {
15
19 template<int dim>
20 class GbMesoState : public GbContinuum<dim> {
22 using BicrystalLatticeVectors= std::vector<LatticeVector<dim>>;
23
29 // ensure that the input is of the right dimension
30 static Eigen::Matrix<double, dim,dim-1> getMesoStateGbDomain(const std::vector<LatticeVector<dim>>& mesoStateCslVectors);
31
32
40 static std::map<OrderedTuplet<dim+1>, VectorDimD> get_xuPairs(const Gb<dim>& gb,
41 const std::vector<LatticeVector<dim>>& mesoStateCslVectors,
42 const std::deque<std::tuple<LatticeVector<dim>,VectorDimD,int>>& bs);
43
50 static std::map<OrderedTuplet<dim+1>,VectorDimD> bicrystalCoordsMap(const Gb<dim>& gb, const BicrystalLatticeVectors& bicrystalConfig);
51
52
58 static std::array<Eigen::Index,dim-1> discretize(const std::vector<LatticeVector<dim>>& mesoStateCslVectors, const Gb<dim>& gb);
59
60 public:
61
65 const Gb<dim>& gb;
66
71
76 // need the ensure that the inputs respect the above constraint
77 const std::vector<LatticeVector<dim>>& mesoStateCslVectors;
78
84
85
90 const std::deque<std::tuple<LatticeVector<dim>, VectorDimD,int>> bs;
91
92 // ensure that b in bs pair belongs to the DSCL vectors and s belongs to the box
93 // ensure that the lattice vectors in bicrystalConfig lie entirely in the box
94 explicit GbMesoState(const Gb<dim>& gb,
96 const std::deque<std::tuple<LatticeVector<dim>,VectorDimD,int>>& bs,
97 const std::vector<LatticeVector<dim>>& mesoStateCslVectors,
99
105 //std::pair<double,double> densityEnergy() const;
106 std::tuple<double,double,PeriodicFunction<double,dim>>
107 densityEnergy(const std::string& lmpLocation,
108 const std::string& potentialName,
109 bool relax,
110 const std::array<Eigen::Index,dim>& n= std::array<Eigen::Index,dim>{}) const;
111 std::pair<double,double> densityEnergyPython() const;
112
116 typename std::enable_if<dim==3,void>::type box(const std::string& filename) const;
117 };
118}
119
121#endif //OILAB_GBMESOSTATE_H
std::array< Eigen::Index, dim-1 > n
Definition GbContinuum.h:81
Definition Gb.h:16
static Eigen::Matrix< double, dim, dim-1 > getMesoStateGbDomain(const std::vector< LatticeVector< dim > > &mesoStateCslVectors)
Returns the cartesian coordinates of the CSL vectors that define a mesostate's GB.
std::enable_if< dim==3, void >::type box(const std::string &filename) const
const std::vector< LatticeVector< dim > > & mesoStateCslVectors
Definition GbMesoState.h:77
const ReciprocalLatticeVector< dim > & axis
Definition GbMesoState.h:70
std::vector< LatticeVector< dim > > BicrystalLatticeVectors
Definition GbMesoState.h:22
const std::deque< std::tuple< LatticeVector< dim >, VectorDimD, int > > bs
Definition GbMesoState.h:90
static std::map< OrderedTuplet< dim+1 >, VectorDimD > get_xuPairs(const Gb< dim > &gb, const std::vector< LatticeVector< dim > > &mesoStateCslVectors, const std::deque< std::tuple< LatticeVector< dim >, VectorDimD, int > > &bs)
Returns the displacement constraints for the GB continuum model from the translation-shift pairs def...
const Gb< dim > & gb
Definition GbMesoState.h:65
std::pair< double, double > densityEnergyPython() const
std::tuple< double, double, PeriodicFunction< double, dim > > densityEnergy(const std::string &lmpLocation, const std::string &potentialName, bool relax, const std::array< Eigen::Index, dim > &n=std::array< Eigen::Index, dim >{}) const
Calculate the energy of a mesostate using lammps.
typename LatticeCore< dim >::VectorDimD VectorDimD
Definition GbMesoState.h:21
static std::map< OrderedTuplet< dim+1 >, VectorDimD > bicrystalCoordsMap(const Gb< dim > &gb, const BicrystalLatticeVectors &bicrystalConfig)
Returns the Cartesian coordinates of the lattice vectors of the mesostates's bicrystal in the form of...
const BicrystalLatticeVectors & bicrystalConfig
Definition GbMesoState.h:83
static std::array< Eigen::Index, dim-1 > discretize(const std::vector< LatticeVector< dim > > &mesoStateCslVectors, const Gb< dim > &gb)
Returns the discretization of the grain boundary domain.
LatticeVector class.
Eigen::Matrix< double, dim, 1 > VectorDimD
Definition LatticeCore.h:24