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 "../Math/PeriodicFunction.h"
13
14namespace oILAB {
15
19template <int dim> class GbMesoState : public GbContinuum<dim> {
21 using BicrystalLatticeVectors = std::vector<LatticeVector<dim>>;
22
30 // ensure that the input is of the right dimension
31 static Eigen::Matrix<double, dim, dim - 1> getMesoStateGbDomain(
32 const std::vector<LatticeVector<dim>> &mesoStateCslVectors);
33
45 static std::map<OrderedTuplet<dim + 1>, VectorDimD> get_xuPairs(
46 const Gb<dim> &gb,
47 const std::vector<LatticeVector<dim>> &mesoStateCslVectors,
48 const std::deque<std::tuple<LatticeVector<dim>, VectorDimD, int>> &bs);
49
59 static std::map<OrderedTuplet<dim + 1>, VectorDimD>
62
69 static std::array<Eigen::Index, dim - 1>
71 const Gb<dim> &gb);
72
73public:
77 const Gb<dim> &gb;
78
83
89 // need the ensure that the inputs respect the above constraint
90 const std::vector<LatticeVector<dim>> &mesoStateCslVectors;
91
98
105 const std::deque<std::tuple<LatticeVector<dim>, VectorDimD, int>> bs;
106
107 // ensure that b in bs pair belongs to the DSCL vectors and s belongs to the
108 // box ensure that the lattice vectors in bicrystalConfig lie entirely in the
109 // box
110 explicit GbMesoState(
112 const std::deque<std::tuple<LatticeVector<dim>, VectorDimD, int>> &bs,
113 const std::vector<LatticeVector<dim>> &mesoStateCslVectors,
115
121 // std::pair<double,double> densityEnergy() const;
122 std::tuple<double, double, PeriodicFunction<double, dim>>
123 densityEnergy(const std::string &lmpLocation,
124 const std::string &potentialName, bool relax,
125 const std::array<Eigen::Index, dim> &n =
126 std::array<Eigen::Index, dim>{}) const;
127 std::pair<double, double> densityEnergyPython() const;
128
132 typename std::enable_if<dim == 3, void>::type
133 box(const std::string &filename) const;
134 };
135 } // namespace oILAB
136
138#endif //OILAB_GBMESOSTATE_H
std::array< Eigen::Index, dim-1 > n
Definition GbContinuum.h:83
Definition Gb.h:13
const ReciprocalLatticeVector< dim > & axis
Definition GbMesoState.h:82
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...
std::enable_if< dim==3, void >::type box(const std::string &filename) const
std::vector< LatticeVector< dim > > BicrystalLatticeVectors
Definition GbMesoState.h:21
const Gb< dim > & gb
Definition GbMesoState.h:77
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.
std::pair< double, double > densityEnergyPython() const
const std::vector< LatticeVector< dim > > & mesoStateCslVectors
Definition GbMesoState.h:90
const BicrystalLatticeVectors & bicrystalConfig
Definition GbMesoState.h:97
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...
typename LatticeCore< dim >::VectorDimD VectorDimD
Definition GbMesoState.h:20
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.
const std::deque< std::tuple< LatticeVector< dim >, VectorDimD, int > > bs
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.
LatticeVector class.
Eigen::Matrix< double, dim, 1 > VectorDimD
Definition LatticeCore.h:20