IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
KNGeometricShape.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <vector>
11 #include "KNGeometricDirection.h"
12 #include "KNGeometricUnitCell.h"
13 #include "KNMatrixOperation.h"
14 #include "KNCommandFileParser.h"
15 #include "CKNGeometricParameter.h"
16 #include "CKNAtomMapInfo.h"
20 
28 {
29 public:
33  void SetOriginCoordination(double x, double y, double z);
34  void SetDirection(double x_axis, double y_axis, double z_axis);
35  void SetLength(double lx, double ly, double lz);
38  void SetMaterialType(char *pszType);
39  unsigned int GetShapeForm(){ return m_ShapeForm; };
40  void SetShapeForm(unsigned int form){ m_ShapeForm = form; };
41  void SetShapeForm(char *pszForm);
43  void SetConsideringBoundaryCondition(bool bConsider, AXIS_DEFINE direction){ m_bConsiderBoundaryCondition[direction] = bConsider; };
46  bool IsFrontFace(){ return m_bFrontFace; };
47  void SetFrontFace(bool bFrontFace){ m_bFrontFace = bFrontFace; };
48  bool IsBackendFace(){ return m_bBackendFace; };
49  void SetBackendFace(bool bBackendFace){ m_bBackendFace = bBackendFace; }
51  void ShiftAtomID(double fShift);
52  void PeriodicUnitCellNumbering(bool bXAxis = false);
53  void InitMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo);
54  bool RefillPeriodicBinding(CKNMatrixOperation::CKNCSR *pResult, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam, LPNEIGHBOR_MAP_INFO lpMapInfo, unsigned int nRepeatIndex, double fKValue[3]);
56  void SetTotalAtomCount(double fTotalAtomCountinMPI){ m_fTotalAtomCountinMPI = fTotalAtomCountinMPI;};
57  double GetAtomStartID(){ return m_fAtomIDStartIndex; };
59  void FinalShape();
60  std::vector<CKNGeometricAtom*>* GetSurfaceAtomList(){ return &m_vectSurfaceAtom; };
61 
63  unsigned int m_nAtomFirstLayer;
64  unsigned int m_nAtomLastLayer;
65 
66 private:
68 
69  double m_fLength[3];
70  double m_fAssignedCount[3];
71  unsigned int m_ShapeForm;
73  bool m_bFrontFace;
78  std::vector<CKNGeometricUnitCell> m_vectUnitCell;
79  std::vector<CKNGeometricUnitCell> m_vectPrevUnitCell;
80  std::vector<CKNGeometricUnitCell> m_vectNextUnitCell;
81  std::vector<CKNGeometricAtom*> m_vectSurfaceAtom;
84 
85  bool IsInBoundaryCondition(int x, int y, int z, int maxX, int maxY, int maxZ);
86  void FreeUnitCellList();
87  void InitShape();
88  void RotateMatrix(CKNMatrixOperation::CKNDMatrix *pMatrixNbr, CKNMatrixOperation::CKNDMatrix *pMatrixResult, double fDegree[2]);
89  CKNGeometricAtom* GetAtomByIndex(double fID);
90  double GetKPhaseSign(double fAtomPos, double fPeriodicAtomPos);
91  int GetPeriodicDirection(int x, int y, int z, int maxX, int maxY, int maxZ);
92  bool CalculateUnitcellCount();
95  double* Serialize(double fXLayer);
96  void Deserialize(std::vector<CKNGeometricUnitCell> *pVectUnitCell, double *pBuffer, bool bFrontSide);
97  void BuildGeoFileName(char *pszFileName, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam);
98 
100  bool SetMapInfoSize(LPNEIGHBOR_MAP_INFO lpMapInfo, double fSize);
101 
102 public:
105  static void FreeMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo);
110 
111 private:
112  static void BuildRotationMatrix(double fDegree[2]);
114 
115 };
116 
unsigned int m_ShapeForm
Shape form.
std::vector< CKNGeometricUnitCell > m_vectNextUnitCell
Back end edge unit cell that copy from next side node.
MATERIAL_INDEX
Definition: CKNGlobal.h:106
MATERIAL_INDEX m_MaterialType
Material type of shape.
Meterial parameter definition.
static CKNGeometricUnitCellInfo_cubic m_UnitCellInfo_cubic
bool SetMapInfoSize(LPNEIGHBOR_MAP_INFO lpMapInfo, double fSize)
Building Hamiltonian part.
Class for coordination.
void ExchangeAtomInfoBetweenNode()
Get start index of atom in shape, using in MPI running enviroment.
void SetMaterialType(MATERIAL_INDEX type)
Get maetrial typpe of shap.
bool IsBackendFace()
Set front face side mark to shape object.
void SetConsideringBoundaryCondition(bool bConsider, AXIS_DEFINE direction)
Get bondary condition of shape.
CKNGeometricDirection m_shapDirection
Direction of shape.
static bool SetAtomAndNeighborInformation(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set neighbor information to AtomFactory.
void BuildNeighborInformation()
Find neighbor of each atom.
Data and operation representation of Matrix.
Class for coordination.
std::vector< CKNGeometricAtom * > m_vectSurfaceAtom
bool RefillPeriodicBinding(CKNMatrixOperation::CKNCSR *pResult, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam, LPNEIGHBOR_MAP_INFO lpMapInfo, unsigned int nRepeatIndex, double fKValue[3])
Applying phase to Hamiltonian.
MATERIAL_INDEX GetMaterialType()
static void FreeMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo)
Release mapinfo data.
static void BuildRotationMatrix(double fDegree[2])
Build rotation matrix for given direction.
Class for direction.
void SetOriginCoordination(double x, double y, double z)
Building Geometric part.
void Deserialize(std::vector< CKNGeometricUnitCell > *pVectUnitCell, double *pBuffer, bool bFrontSide)
Deerialize unitcells from double array.
Data and operation representation of CSR(Compressed Sparse Row)
static void SetShapeInformation(CKNGeometricShape &shape, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set shape information(Length, material, bondary condition and so on)
void SetTotalAtomCount(double fTotalAtomCountinMPI)
Get total valid atom count in shape.
void SetDirection(double x_axis, double y_axis, double z_axis)
Set direciton of shape.
This class for parsing input command file.
std::vector< CKNGeometricUnitCell > m_vectPrevUnitCell
Front edge unit cell that copy from previous side node.
void SetLength(double lx, double ly, double lz)
Set length of shape.
bool m_bConsiderBoundaryCondition[3]
Bondary condition for each driection.
static IKNGeometricUnitCellInfo * m_pUnitCellInfo
Unitcell information pointer for using in class internal.
Class for Geometric unit cell.
Class for Geometric unit cell for cubic.
bool CalculateUnitcellCount()
Calculating unitcell count in shape.
void CheckingNeighborCandiate()
Checking neighbor unitcell by calculating index.
bool IsInBoundaryCondition(int x, int y, int z, int maxX, int maxY, int maxZ)
Check unitcell is in the bondary area or not.
double m_fAssignedCount[3]
Unitcell assigend count in shape for each direction.
std::vector< CKNGeometricUnitCell > m_vectUnitCell
Array of unitcell in shape.
Class for Geometric shape.
std::vector< CKNGeometricAtom * > * GetSurfaceAtomList()
double * Serialize(double fXLayer)
Serialize unitcells with specific later index to double array.
double GetAtomStartID()
Set total valid atom count in shape.
CKNGeometricCoordination m_originCoordination
Orign coordination of shape.
void FinalShape()
Finalize Shape variable.
bool m_bBackendFace
Flag of back end face or not.
Class for Geometric unit cell for cubic.
Structure for save input command file parsing result.
double GetKPhaseSign(double fAtomPos, double fPeriodicAtomPos)
Calculating Phase sign.
Collection of vector and matrix operation.
Class for direction.
AXIS_DEFINE
Definition: CKNGlobal.h:105
Iterface for Unitcell information.
bool ConstructMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Extract atom information from runtime objects.
double m_fLength[3]
Building Geometric part.
bool FillUnitcell(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set bondary condition of shape.
void InitShape()
Initialize Shape variable.
int GetPeriodicDirection(int x, int y, int z, int maxX, int maxY, int maxZ)
Get periodic direction information.
void SetBackendFace(bool bBackendFace)
Check is this back end face side in MPI running enviroment.
bool GetConsideringBoundaryCondition(AXIS_DEFINE direction)
Structure for neighbor information.
void SetShapeForm(unsigned int form)
Get form type of shape.
void SetFrontFace(bool bFrontFace)
Check is this front face side in MPI running enviroment.
Class for Geometric unit cell for cubic.
CKNGeometricAtom * GetAtomByIndex(double fID)
Get atom instance by ID.
Class for Atom.
double GetTotalAtomCount()
double m_fTotalAtomCountinMPI
Total valid atom count in shape.
void PeriodicUnitCellNumbering(bool bXAxis=false)
Numbering to periodic unitcell.
bool m_bFrontFace
Flag of front face or not.
double m_fAtomIDStartIndex
Start atom index in current Shape.
void RotateMatrix(CKNMatrixOperation::CKNDMatrix *pMatrixNbr, CKNMatrixOperation::CKNDMatrix *pMatrixResult, double fDegree[2])
Rotate matrix with calculated degree.
void FreeUnitCellList()
Relase unitcell list.
Class for Geometric unit cell for cubic.
void ArrangeUnitCell(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Arranging unitcell into shape.
static void CalculateDegree(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Calculating degree from direction information.
unsigned int m_nAtomLastLayer
Last layer information for sending to next node.
void BuildGeoFileName(char *pszFileName, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Make atom map naming.
void ShiftAtomID(double fShift)
Shift atom id in MPI running enviroment.
unsigned int GetShapeForm()
Structure for neighbor information.
Iterface for Unitcell information.
static CKNMatrixOperation::CKNDMatrix m_rotationMatrix
Rotation matrix for given direction.
static CKNGeometricUnitCellInfo_zincblende m_UnitCellInfo_zincblende
void InitMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo)
Intilize map info data.
unsigned int m_nAtomFirstLayer
Get Surface atom list.