IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
KNGeometricUnitCell.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <vector>
9 #include <string>
11 #include "KNGeometricAtomFactory.h"
12 #include "KNGeometricAtom.h"
13 #include "KNCommandFileParser.h"
21 {
22 public:
25 
26  static void SetLength(double fLength[3], double fOriginLength[3]);
27  static double GetLength(AXIS_DEFINE index){ return m_fLength[index]; };
28  static void ResetSubElementID(){ m_SubElementID = 0; };
29  static double GetSubElementID(){ return m_SubElementID;};
30  static int m_nFullFillIndex;
31 
33  void SetCoordination(CKNGeometricCoordination coordination);
34  void SetCoordination(double* pfCoordination);
35  void SetCoordination(double fXCoordination, double fYCoordination, double fZCoordination);
36  void SetID(double fID){ m_fUnitCellID = fID; };
37  double GetID(){ return m_fUnitCellID; };
38  void ShiftID(double fShift);
40  unsigned int NumberingSubElement(CKNGeometricCoordination ShapeCoordination, double fLength[3], int nShapeType, char *pszDomainMatName);
42  double* GetAssignedIndex(){ return m_fAssignedIndex; };
43  void SetAssignIndex(double fXAssignIndex, double fYAssignIndex, double fZAssignIndex);
44  void CheckingNeighborCandiate(double fAssignedCount[3], bool bFrontFace, bool bBackEnd);
45  int GetSubElementSize(){ return m_vectIntenalAtom.size(); };
46  CKNGeometricAtom* GetSubElementAt(double fIndex);
47  CKNGeometricAtom* GetSubElementByID(double fID);
48  std::vector<double>* GetNeighborCellID(){ return &m_vectNeighborCellID; };
49  void ShiftAtomID(double fShift);
50  void SetUnitcellList(std::vector<CKNGeometricUnitCell> *pVect, std::vector<CKNGeometricUnitCell> *pVectPrev, std::vector<CKNGeometricUnitCell> *pVectNext);
51  void BuildNeighborInformation(double *pfAssignCount, std::vector<CKNGeometricAtom*> *pSurfaceList);
52  void Serialize(double *pBuffer);
53  void Deserialize(double *pBuffer);
54  void SetPeriodic(bool bPeriodic, int periodicDirection);
56  static double CalculatingIndex(double fXAssignedIndex, double fYAssignedIndex, double fZAssignedIndex, double fAssignedCount[3]);
57  void CopyInnerAtomIndex(CKNGeometricUnitCell srcUnitCell);
58  static void SetFullFillIndex(int nIndex){ m_nFullFillIndex = nIndex; }
59 
60 private:
61  int IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector<CKNGeometricCoordination> *pNeighborRelation, int &nCheckFill);
62  void FinalSubElement();
63  bool FindingNeighborInUnitcell(CKNGeometricUnitCell *pUnitcell, CKNGeometricAtom *pCompare1, CKNGeometricAtom::ATOM_TYPE type1, std::vector<CKNGeometricCoordination> *pNeighborRelation, int &nCheckFill);
64  void SetPeriodicDirection(int periodicDirection);
66 
67  static double m_fLength[3];
68  static double m_SubElementID;
69  double m_fAssignedIndex[3];
70  std::vector<CKNGeometricUnitCell> *m_vectUnitCellInShape;
71  std::vector<CKNGeometricUnitCell> *m_vectUnitCellInPrev;
72  std::vector<CKNGeometricUnitCell> *m_vectUnitCellInNext;
74  std::vector<CKNGeometricAtom> m_vectIntenalAtom;
75  std::vector<double> m_vectNeighborCellID;
76  double m_fUnitCellID;
79 };
80 
double m_fUnitCellID
Unit cell ID.
Class for coordination.
double m_fAssignedIndex[3]
Assign index.
CKNGeometricCoordination m_coordination
Coordination of unit cell.
static void SetFullFillIndex(int nIndex)
Changing Full fill neighbor index.
Factory class for create CKNGeometricAtom instance.
int IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Checking neighbor with rule.
Class for coordination.
Class for Geometric unit cell.
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.
void CheckingNeighborCandiate(double fAssignedCount[3], bool bFrontFace, bool bBackEnd)
Find neigbhor candidate for neighbor in atom. Maxium 26 unitcell index can be assigned.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInNext
Back side unit cell list in shape.
static void ResetSubElementID()
Get unit cell length.
int m_periodicDirection
Periodic direction information.
void ShiftAtomID(double fShift)
Get neighbor unit cell ID.
void CopyInnerAtomIndex(CKNGeometricUnitCell srcUnitCell)
Copy atom id from source. This functino for periodic atom setting.
void ShiftID(double fShift)
Get unit cell ID.
This class for parsing input command file.
void FinalSubElement()
Finalizing SubElement.
std::vector< double > * GetNeighborCellID()
void ArrangeAtom(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set atoms information(coordination, type) in unit cell.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInPrev
Front side unit cell list in shape.
Class for Atom.
CKNGeometricAtom * GetSubElementByID(double fID)
Return atom in unitcell by atom ID.
CKNGeometricCoordination GetCoordination()
static double m_fLength[3]
Unit cell length.
void SetAssignIndex(double fXAssignIndex, double fYAssignIndex, double fZAssignIndex)
Get Assign index.
bool m_bPeriodicElement
Periodic element flag.
void SetPeriodic(bool bPeriodic, int periodicDirection)
To mark unit cell is periodic condition.
Structure for save input command file parsing result.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
AXIS_DEFINE
Definition: CKNGlobal.h:105
bool FindingNeighborInUnitcell(CKNGeometricUnitCell *pUnitcell, CKNGeometricAtom *pCompare1, CKNGeometricAtom::ATOM_TYPE type1, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Finding neighbor in same unit cell.
void Serialize(double *pBuffer)
Convert unit cell data to double buffer.
static double GetSubElementID()
Reset SubElement ID to Zero.
void AddPeridoicDirection(CKNGeometricAtom::PERIODIC_DIRECTION periodicDirection)
Adding periodic direction.
void SetPeriodicDirection(int periodicDirection)
Set periodic direction.
unsigned int NumberingSubElement(CKNGeometricCoordination ShapeCoordination, double fLength[3], int nShapeType, char *pszDomainMatName)
Assign atom ID to sub element(atoms in unit cell)
CKNGeometricAtom * GetSubElementAt(double fIndex)
Get atom count in unit cell.
void SetID(double fID)
static void SetLength(double fLength[3], double fOriginLength[3])
Set unit cell length.
void SetSubDomainMaterial(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set atoms information(coordination, type) in unit cell.
Class for Atom.
static double CalculatingIndex(double fXAssignedIndex, double fYAssignedIndex, double fZAssignedIndex, double fAssignedCount[3])
Calulating unit cell index.
static double m_SubElementID
Maxium atom ID in shape.
bool IsPeriodicUnitCell()
Check this unit cell is periodic condition or not.
static double GetLength(AXIS_DEFINE index)
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination of unit cell.
static int m_nFullFillIndex
Get SubElement ID. It means new atom id.
double GetID()
Set unit cell ID.
void Deserialize(double *pBuffer)
Convert double buffer to unit cell data.
void SetUnitcellList(std::vector< CKNGeometricUnitCell > *pVect, std::vector< CKNGeometricUnitCell > *pVectPrev, std::vector< CKNGeometricUnitCell > *pVectNext)
Set unit cell list of shape to each unit cell.
void BuildNeighborInformation(double *pfAssignCount, std::vector< CKNGeometricAtom * > *pSurfaceList)
Build neighbor information to each atom.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInShape
Unit cell list in shape.