IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CKNGeometricUnitCell Class Reference

Class for Geometric unit cell. More...

#include "KNGeometricUnitCell.h"

Collaboration diagram for CKNGeometricUnitCell:
Collaboration graph

Public Member Functions

 CKNGeometricUnitCell ()
 
 ~CKNGeometricUnitCell ()
 
CKNGeometricCoordination GetCoordination ()
 
void SetCoordination (CKNGeometricCoordination coordination)
 Get coordination of unit cell. More...
 
void SetCoordination (double *pfCoordination)
 Set coordination of unit cell. More...
 
void SetCoordination (double fXCoordination, double fYCoordination, double fZCoordination)
 Set coordination of unit cell. More...
 
void SetID (double fID)
 
double GetID ()
 Set unit cell ID. More...
 
void ShiftID (double fShift)
 Get unit cell ID. More...
 
void ArrangeAtom (CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
 Set atoms information(coordination, type) in unit cell. More...
 
unsigned int NumberingSubElement (CKNGeometricCoordination ShapeCoordination, double fLength[3], int nShapeType, char *pszDomainMatName)
 Assign atom ID to sub element(atoms in unit cell) More...
 
void SetSubDomainMaterial (CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
 Set atoms information(coordination, type) in unit cell. More...
 
double * GetAssignedIndex ()
 
void SetAssignIndex (double fXAssignIndex, double fYAssignIndex, double fZAssignIndex)
 Get Assign index. More...
 
void CheckingNeighborCandiate (double fAssignedCount[3], bool bFrontFace, bool bBackEnd)
 Find neigbhor candidate for neighbor in atom. Maxium 26 unitcell index can be assigned. More...
 
int GetSubElementSize ()
 
CKNGeometricAtomGetSubElementAt (double fIndex)
 Get atom count in unit cell. More...
 
CKNGeometricAtomGetSubElementByID (double fID)
 Return atom in unitcell by atom ID. More...
 
std::vector< double > * GetNeighborCellID ()
 
void ShiftAtomID (double fShift)
 Get neighbor unit cell ID. More...
 
void SetUnitcellList (std::vector< CKNGeometricUnitCell > *pVect, std::vector< CKNGeometricUnitCell > *pVectPrev, std::vector< CKNGeometricUnitCell > *pVectNext)
 Set unit cell list of shape to each unit cell. More...
 
void BuildNeighborInformation (double *pfAssignCount, std::vector< CKNGeometricAtom * > *pSurfaceList)
 Build neighbor information to each atom. More...
 
void Serialize (double *pBuffer)
 Convert unit cell data to double buffer. More...
 
void Deserialize (double *pBuffer)
 Convert double buffer to unit cell data. More...
 
void SetPeriodic (bool bPeriodic, int periodicDirection)
 To mark unit cell is periodic condition. More...
 
bool IsPeriodicUnitCell ()
 Check this unit cell is periodic condition or not. More...
 
void CopyInnerAtomIndex (CKNGeometricUnitCell srcUnitCell)
 Copy atom id from source. This functino for periodic atom setting. More...
 

Static Public Member Functions

static void SetLength (double fLength[3], double fOriginLength[3])
 Set unit cell length. More...
 
static double GetLength (AXIS_DEFINE index)
 
static void ResetSubElementID ()
 Get unit cell length. More...
 
static double GetSubElementID ()
 Reset SubElement ID to Zero. More...
 
static double CalculatingIndex (double fXAssignedIndex, double fYAssignedIndex, double fZAssignedIndex, double fAssignedCount[3])
 Calulating unit cell index. More...
 
static void SetFullFillIndex (int nIndex)
 Changing Full fill neighbor index. More...
 

Static Public Attributes

static int m_nFullFillIndex = 15
 Get SubElement ID. It means new atom id. More...
 

Private Member Functions

int IsMachedNeighborRule (CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
 Checking neighbor with rule. More...
 
void FinalSubElement ()
 Finalizing SubElement. More...
 
bool FindingNeighborInUnitcell (CKNGeometricUnitCell *pUnitcell, CKNGeometricAtom *pCompare1, CKNGeometricAtom::ATOM_TYPE type1, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
 Finding neighbor in same unit cell. More...
 
void SetPeriodicDirection (int periodicDirection)
 Set periodic direction. More...
 
void AddPeridoicDirection (CKNGeometricAtom::PERIODIC_DIRECTION periodicDirection)
 Adding periodic direction. More...
 

Private Attributes

double m_fAssignedIndex [3]
 Assign index. More...
 
std::vector
< CKNGeometricUnitCell > * 
m_vectUnitCellInShape
 Unit cell list in shape. More...
 
std::vector
< CKNGeometricUnitCell > * 
m_vectUnitCellInPrev
 Front side unit cell list in shape. More...
 
std::vector
< CKNGeometricUnitCell > * 
m_vectUnitCellInNext
 Back side unit cell list in shape. More...
 
CKNGeometricCoordination m_coordination
 Coordination of unit cell. More...
 
std::vector< CKNGeometricAtomm_vectIntenalAtom
 Atom in unit cell. More...
 
std::vector< double > m_vectNeighborCellID
 Neighbor unit cell list. More...
 
double m_fUnitCellID
 Unit cell ID. More...
 
bool m_bPeriodicElement
 Periodic element flag. More...
 
int m_periodicDirection
 Periodic direction information. More...
 

Static Private Attributes

static double m_fLength [3]
 Unit cell length. More...
 
static double m_SubElementID = ATOM_DEFAULT_INDEX + 1
 Maxium atom ID in shape. More...
 

Detailed Description

Class for Geometric unit cell.

Date
03/Oct/2014
Author
Kyu Nam Cho(mysto.nosp@m.us@k.nosp@m.orea..nosp@m.ac.k.nosp@m.r), Hoon Ryu(elec1.nosp@m.020@.nosp@m.gmail.nosp@m..com)

Definition at line 20 of file KNGeometricUnitCell.h.

Constructor & Destructor Documentation

CKNGeometricUnitCell::CKNGeometricUnitCell ( )

Definition at line 19 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, m_bPeriodicElement, m_fAssignedIndex, and m_fUnitCellID.

20 {
21  m_fUnitCellID = -1;
22  m_bPeriodicElement = false;
23 
24  m_fAssignedIndex[_X] = 0;
25  m_fAssignedIndex[_Y] = 0;
26  m_fAssignedIndex[_Z] = 0;
27 }
double m_fUnitCellID
Unit cell ID.
double m_fAssignedIndex[3]
Assign index.
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
bool m_bPeriodicElement
Periodic element flag.
Definition: CKNGlobal.h:105
CKNGeometricUnitCell::~CKNGeometricUnitCell ( )

Definition at line 29 of file KNGeometricUnitCell.cpp.

References FinalSubElement().

30 {
32 }
void FinalSubElement()
Finalizing SubElement.

Here is the call graph for this function:

Member Function Documentation

void CKNGeometricUnitCell::AddPeridoicDirection ( CKNGeometricAtom::PERIODIC_DIRECTION  periodicDirection)
private

Adding periodic direction.

Parameters
periodicDirectionPeriodic direction

Definition at line 627 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtomFactory::GetAtomCountInUnitcell(), and m_vectIntenalAtom.

628 {
630 
631  for (i = 0; i < nSize; ++i)
632  m_vectIntenalAtom[i].AddPeridoicDirection(periodicDirection);
633 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
void AddPeridoicDirection(CKNGeometricAtom::PERIODIC_DIRECTION periodicDirection)
Adding periodic direction.

Here is the call graph for this function:

void CKNGeometricUnitCell::ArrangeAtom ( CKNCommandFileParser::LPINPUT_CMD_PARAM  lpParam)

Set atoms information(coordination, type) in unit cell.

Parameters
lpParamInput parameter parsing from command file

Definition at line 70 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtom::A, CKNGeometricAtom::C, CKNGeometricAtomFactory::GetMaterialNumber(), m_coordination, CKNGeometricAtomFactory::m_vectAtomList_1, CKNGeometricAtomFactory::m_vectAtomList_2, m_vectIntenalAtom, CKNGeometricAtom::SetCoordination(), CKNGeometricAtom::SetDomainMaterial(), CKNGeometricCoordination::SetOffset(), CKNGeometricAtom::SetType(), and CKNCommandFileParser::INPUT_CMD_PARAM::szDomainMat.

Referenced by CKNGeometricShape::ArrangeUnitCell().

71 {
72  int i, nSize;
73 
75  for (i = 0; i < nSize; ++i)
76  {
77  CKNGeometricCoordination AtomCoordnation = CKNGeometricAtomFactory::m_vectAtomList_1[i].GetCoordination();
78  CKNGeometricAtom SubElement;
79 
80  AtomCoordnation.SetOffset(m_coordination);
83  SubElement.SetCoordination(AtomCoordnation);
84  m_vectIntenalAtom.push_back(SubElement);
85  }
86 
88  for (i = 0; i < nSize; ++i)
89  {
90  CKNGeometricCoordination AtomCoordnation = CKNGeometricAtomFactory::m_vectAtomList_2[i].GetCoordination();
91  CKNGeometricAtom SubElement;
92 
93  AtomCoordnation.SetOffset(m_coordination);
94  SubElement.SetCoordination(AtomCoordnation);
97  m_vectIntenalAtom.push_back(SubElement);
98  }
99 }
CKNGeometricCoordination m_coordination
Coordination of unit cell.
Class for coordination.
void SetCoordination(CKNGeometricCoordination coordination)
Get atom coordination.
void SetType(ATOM_TYPE type, MATERIAL_INDEX number)
Set atom information.
void SetOffset(CKNGeometricCoordination coord)
To offset coordination.
static MATERIAL_INDEX GetMaterialNumber(char *pszMaterialName, CKNGeometricAtom::ATOM_TYPE type)
Get total atom counts in unit cell.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
char szDomainMat[NMAXDOMAIN][1024]
Material type.
Class for Atom.
static std::vector< CKNGeometricAtom > m_vectAtomList_1
Get total Neighbor count in unit cell.
void SetDomainMaterial(MATERIAL_INDEX number)
Set atom material information.
static std::vector< CKNGeometricAtom > m_vectAtomList_2
Atom array for cation.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricUnitCell::BuildNeighborInformation ( double *  pfAssignCount,
std::vector< CKNGeometricAtom * > *  pSurfaceList 
)

Build neighbor information to each atom.

Parameters
pfAssignCountAssign count of shape
pSurfaceListSurface atom list

Finding internally first

Finding neighbor unitcell internal

Definition at line 348 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, CKNGeometricAtom::A, ATOM_DEFAULT_INDEX, FindingNeighborInUnitcell(), GetID(), CKNGeometricAtom::GetNeighborAtomID(), CKNGeometricAtom::GetNeighborCount(), CKNGeometricAtom::GetType(), IsMachedNeighborRule(), m_nFullFillIndex, m_vectIntenalAtom, m_vectNeighborCellID, CKNGeometricAtomFactory::m_vectNeighborRelation1To2, CKNGeometricAtomFactory::m_vectNeighborRelation2To1, m_vectUnitCellInNext, m_vectUnitCellInPrev, m_vectUnitCellInShape, and CKNGeometricAtom::SetNeighbor().

349 {
350  double i, j, nSecondIndex, nSize;
351  int nCheckFill = 0;
352  int nMatchingIndex;
353  CKNGeometricAtom *pCompare1, *pCompare2, *pAtom;
354  CKNGeometricAtom::ATOM_TYPE type1, type2;
355  std::vector<CKNGeometricCoordination> *pNeighborRelation = NULL;
356  bool bFindAll = false;
357 
358  nSize = m_vectIntenalAtom.size();
359  for (i = 0; i < nSize; ++i)
360  {
361  if (ATOM_DEFAULT_INDEX == m_vectIntenalAtom[(unsigned int)i].GetID())
362  continue;
363 
364  pCompare1 = &m_vectIntenalAtom[(unsigned int)i];
365  type1 = pCompare1->GetType();
366 
367  if (CKNGeometricAtom::A == type1)
369  else
371 
372  bFindAll = false;
373  nCheckFill = 0;
375  nSecondIndex = -1;
376  for (j = 0; j < nSize - 1; ++j)
377  {
378  nSecondIndex++;
379 
380  if (nSecondIndex == i)
381  nSecondIndex++;
382 
383  pCompare2 = &m_vectIntenalAtom[(unsigned int)nSecondIndex];
384 
385  type2 = pCompare2->GetType();
386  if (type1 == type2)
387  continue;
388 
389  nMatchingIndex = IsMachedNeighborRule(pCompare1, pCompare2, pNeighborRelation, nCheckFill);
390 
391  if (-1 != nMatchingIndex)
392  {
393  pCompare1->SetNeighbor(nMatchingIndex, pCompare2);
394  nCheckFill |= (int)(pow((double)2, (int)nMatchingIndex));
395  }
396 
397  if (m_nFullFillIndex == nCheckFill)
398  {
399  bFindAll = true;
400  break;
401  }
402  }
403 
404  if (bFindAll)
405  continue;
406 
408  int nNeighborUnitcellSize = m_vectNeighborCellID.size();
409 
410  for (j = 0; j < nNeighborUnitcellSize; ++j)
411  {
412  double fNeighborID = m_vectNeighborCellID[(unsigned int)j];
413  CKNGeometricUnitCell NeighborCell;
414 
415 #ifndef DISABLE_MPI_ROUTINE
416  if (fNeighborID < 0)
417  {
418  if( m_vectUnitCellInPrev->size() > 0 )
419  {
420  NeighborCell = m_vectUnitCellInPrev->at((int)fNeighborID + (int)(floor(pfAssignCount[_Y]) * floor(pfAssignCount[_Z])));
421  bFindAll = FindingNeighborInUnitcell(&NeighborCell, pCompare1, type1, pNeighborRelation, nCheckFill);
422  }
423  }
424  else if (fNeighborID >= m_vectUnitCellInShape->size())
425  {
426  if( m_vectUnitCellInNext->size() > 0 )
427  {
428  NeighborCell = m_vectUnitCellInNext->at((int)fNeighborID - (int)(floor(pfAssignCount[_X]) * floor(pfAssignCount[_Y]) * floor(pfAssignCount[_Z])));
429  bFindAll = FindingNeighborInUnitcell(&NeighborCell, pCompare1, type1, pNeighborRelation, nCheckFill);
430  }
431  }
432  else
433 #endif //DISABLE_MPI_ROUTINE
434  {
435  NeighborCell = m_vectUnitCellInShape->at((unsigned int)fNeighborID);
436  bFindAll = FindingNeighborInUnitcell(&NeighborCell, pCompare1, type1, pNeighborRelation, nCheckFill);
437  }
438 
439  if (bFindAll)
440  break;
441  }
442 
444  if (bFindAll)
445  continue;
446  }
447 
448  for (i = 0; i < nSize; ++i)
449  {
450  int nNeighborSize;
451  if (ATOM_DEFAULT_INDEX == m_vectIntenalAtom[(unsigned int)i].GetID())
452  continue;
453 
454  pAtom = &m_vectIntenalAtom[(unsigned int)i];
455  nNeighborSize = pAtom->GetNeighborCount();
456  for (j = 0; j < nNeighborSize; ++j)
457  {
458  if (ATOM_DEFAULT_INDEX == pAtom->GetNeighborAtomID(j))
459  {
460  pSurfaceList->push_back(pAtom);
461  break;
462  }
463  }
464  }
465 }
int IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Checking neighbor with rule.
ATOM_TYPE GetType()
unsigned int GetNeighborCount()
Class for Geometric unit cell.
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.
Definition: CKNGlobal.h:105
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInNext
Back side unit cell list in shape.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInPrev
Front side unit cell list in shape.
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
bool FindingNeighborInUnitcell(CKNGeometricUnitCell *pUnitcell, CKNGeometricAtom *pCompare1, CKNGeometricAtom::ATOM_TYPE type1, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Finding neighbor in same unit cell.
#define ATOM_DEFAULT_INDEX
Atom index default value that empty atom instance.
Definition: CKNGlobal.h:53
static std::vector< CKNGeometricCoordination > m_vectNeighborRelation2To1
Neighbor relationship from cation to anion.
Class for Atom.
static std::vector< CKNGeometricCoordination > m_vectNeighborRelation1To2
Neighbor relationship from anion to cation.
void SetNeighbor(unsigned int nIndex, CKNGeometricAtom *pNeighbor)
Set neighbor information.
static int m_nFullFillIndex
Get SubElement ID. It means new atom id.
double GetID()
Set unit cell ID.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInShape
Unit cell list in shape.
double GetNeighborAtomID(unsigned int nIndex)
Get neighbor atom count.

Here is the call graph for this function:

double CKNGeometricUnitCell::CalculatingIndex ( double  fXAssignedIndex,
double  fYAssignedIndex,
double  fZAssignedIndex,
double  fAssignedCount[3] 
)
static

Calulating unit cell index.

Parameters
fXAssignedIndexx direction index
fYAssignedIndexy direciton index
fZAssignedIndexz direction index
fAssignedCountAssigend count of shape
Returns
Unitcell index

Definition at line 306 of file KNGeometricUnitCell.cpp.

Referenced by CheckingNeighborCandiate(), and CKNGeometricShape::PeriodicUnitCellNumbering().

307 {
308  return fXAssignedIndex * floor(fAssignedCount[1]) * floor(fAssignedCount[2]) + fYAssignedIndex * floor(fAssignedCount[2]) + fZAssignedIndex;
309 }

Here is the caller graph for this function:

void CKNGeometricUnitCell::CheckingNeighborCandiate ( double  fAssignedCount[3],
bool  bFrontFace,
bool  bBackEnd 
)

Find neigbhor candidate for neighbor in atom. Maxium 26 unitcell index can be assigned.

Parameters
fAssignedCountAssign index array
bFrontFaceIs this shape is front end face
bBackEndIs this shape is back end face

Definition at line 221 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, CalculatingIndex(), m_fAssignedIndex, and m_vectNeighborCellID.

222 {
223  double cx[3], cy[3], cz[3];
224  int cxCount = 1, cyCount = 1, czCount = 1;
225  int x, y, z;
226 
227  cx[0] = m_fAssignedIndex[_X];
228  cy[0] = m_fAssignedIndex[_Y];
229  cz[0] = m_fAssignedIndex[_Z];
230 
231  if (cx[0] > 0 || (cx[0] == 0 && false == bFrontFace))
232  cx[cxCount++] = cx[0] - 1;
233 
234  if (cy[0] > 0)
235  cy[cyCount++] = cy[0] - 1;
236 
237  if (cz[0] > 0)
238  cz[czCount++] = cz[0] - 1;
239 
240  if (cx[0] < fAssignedCount[_X] - 1 || (cx[0] == fAssignedCount[_X] - 1 && false == bBackEnd))
241  cx[cxCount++] = cx[0] + 1;
242 
243  if (cy[0] < fAssignedCount[_Y] - 1)
244  cy[cyCount++] = cy[0] + 1;
245 
246  if (cz[0] < fAssignedCount[_Z] - 1)
247  cz[czCount++] = cz[0] + 1;
248 
249  for (x = 0; x < cxCount; ++x)
250  {
251  for (y = 0; y < cyCount; ++y)
252  {
253  for (z = 0; z < czCount; ++z)
254  {
255  if (0 == x && 0 == y && 0 == z)
256  continue;
257 
258  m_vectNeighborCellID.push_back(CalculatingIndex(cx[x], cy[y], cz[z], fAssignedCount));
259  }
260  }
261  }
262 }
double m_fAssignedIndex[3]
Assign index.
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
static double CalculatingIndex(double fXAssignedIndex, double fYAssignedIndex, double fZAssignedIndex, double fAssignedCount[3])
Calulating unit cell index.

Here is the call graph for this function:

void CKNGeometricUnitCell::CopyInnerAtomIndex ( CKNGeometricUnitCell  srcUnitCell)

Copy atom id from source. This functino for periodic atom setting.

Parameters
srcUnitCellSource unit cell

Definition at line 314 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtom::GetID(), GetSubElementAt(), GetSubElementSize(), m_vectIntenalAtom, and SetID().

315 {
316  int i, nSize = srcUnitCell.GetSubElementSize();
317  for (i = 0; i < nSize; ++i)
318  m_vectIntenalAtom[i].SetID(srcUnitCell.GetSubElementAt(i)->GetID());
319 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
CKNGeometricAtom * GetSubElementAt(double fIndex)
Get atom count in unit cell.
void SetID(double fID)

Here is the call graph for this function:

void CKNGeometricUnitCell::Deserialize ( double *  pBuffer)

Convert double buffer to unit cell data.

Parameters
pBufferSource data buffer for serialization

Definition at line 557 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtom::A, CKNGeometricAtom::C, CKNGeometricAtomFactory::GetAtomCountInUnitcell(), m_vectIntenalAtom, CKNGeometricAtom::SetCoordination(), CKNGeometricAtom::SetID(), CKNGeometricAtom::SetPeriodic(), CKNGeometricAtom::SetPeriodicDirection(), and CKNGeometricAtom::SetType().

Referenced by CKNGeometricShape::Deserialize().

558 {
560  int nPos = 0;
561 
562  for( i = 0; i < nSize;++i)
563  {
564  CKNGeometricAtom atom;
565 
566  atom.SetID(pBuffer[nPos++]);
567  if( 0 == pBuffer[nPos++])
568  atom.SetType(CKNGeometricAtom::A, (MATERIAL_INDEX)((int)pBuffer[nPos++]));
569  else
570  atom.SetType(CKNGeometricAtom::C, (MATERIAL_INDEX)((int)pBuffer[nPos++]));
571 
572  atom.SetPeriodic((bool)pBuffer[nPos++]);
573 
574  double x = pBuffer[nPos++];
575  double y = pBuffer[nPos++];
576  double z = pBuffer[nPos++];
577  atom.SetCoordination(x, y, z);
578  atom.SetPeriodicDirection((int)pBuffer[nPos++]);
579  m_vectIntenalAtom.push_back(atom);
580  }
581 }
MATERIAL_INDEX
Definition: CKNGlobal.h:106
void SetPeriodicDirection(int periodicDirection)
void SetCoordination(CKNGeometricCoordination coordination)
Get atom coordination.
void SetType(ATOM_TYPE type, MATERIAL_INDEX number)
Set atom information.
void SetID(double fID)
Set atom ID.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
Class for Atom.
void SetPeriodic(bool bPeriodic)

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricUnitCell::FinalSubElement ( )
private

Finalizing SubElement.

Definition at line 294 of file KNGeometricUnitCell.cpp.

References m_vectIntenalAtom.

Referenced by ~CKNGeometricUnitCell().

295 {
296  m_vectIntenalAtom.clear();
297 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.

Here is the caller graph for this function:

bool CKNGeometricUnitCell::FindingNeighborInUnitcell ( CKNGeometricUnitCell pUnitcell,
CKNGeometricAtom pCompare1,
CKNGeometricAtom::ATOM_TYPE  type1,
std::vector< CKNGeometricCoordination > *  pNeighborRelation,
int &  nCheckFill 
)
private

Finding neighbor in same unit cell.

Parameters
pUnitcellSearching target unit cell
pCompare1First comparing target atom
type1First compparing target atom type
pNeighborRelationNeighbor relation rule
[out]nCheckFillfinding result of first comparing target atom's neighbor
Returns
Finding neighbor all or not yet

Definition at line 505 of file KNGeometricUnitCell.cpp.

References GetSubElementAt(), GetSubElementSize(), CKNGeometricAtom::GetType(), IsMachedNeighborRule(), and CKNGeometricAtom::SetNeighbor().

Referenced by BuildNeighborInformation().

506 {
507  int i, nSize = pUnitcell->GetSubElementSize();
509  int nMatchingIndex;
510 
511  for (i = 0; i < nSize; ++i)
512  {
513  CKNGeometricAtom *pCompare2 = pUnitcell->GetSubElementAt(i);
514  type2 = pCompare2->GetType();
515  /*if (type1 == type2)
516  continue;*/
517 
518  nMatchingIndex = IsMachedNeighborRule(pCompare1, pCompare2, pNeighborRelation, nCheckFill);
519 
520  if (-1 != nMatchingIndex)
521  {
522  pCompare1->SetNeighbor(nMatchingIndex, pCompare2);
523  nCheckFill |= (int)(pow((double)2, (int)nMatchingIndex));
524  }
525 
526  if (15 == nCheckFill)
527  return true;
528  }
529 
530  return false;
531 }
int IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Checking neighbor with rule.
ATOM_TYPE GetType()
CKNGeometricAtom * GetSubElementAt(double fIndex)
Get atom count in unit cell.
Class for Atom.
void SetNeighbor(unsigned int nIndex, CKNGeometricAtom *pNeighbor)
Set neighbor information.

Here is the call graph for this function:

Here is the caller graph for this function:

double* CKNGeometricUnitCell::GetAssignedIndex ( )
inline

Definition at line 42 of file KNGeometricUnitCell.h.

References m_fAssignedIndex.

42 { return m_fAssignedIndex; };
double m_fAssignedIndex[3]
Assign index.
CKNGeometricCoordination CKNGeometricUnitCell::GetCoordination ( )
inline

Definition at line 32 of file KNGeometricUnitCell.h.

References m_coordination.

32 { return m_coordination; };
CKNGeometricCoordination m_coordination
Coordination of unit cell.
double CKNGeometricUnitCell::GetID ( )
inline

Set unit cell ID.

Definition at line 37 of file KNGeometricUnitCell.h.

References m_fUnitCellID.

Referenced by BuildNeighborInformation(), and GetSubElementByID().

37 { return m_fUnitCellID; };
double m_fUnitCellID
Unit cell ID.

Here is the caller graph for this function:

static double CKNGeometricUnitCell::GetLength ( AXIS_DEFINE  index)
inlinestatic

Definition at line 27 of file KNGeometricUnitCell.h.

References m_fLength.

Referenced by CKNGeometricShape::ArrangeUnitCell(), and CKNGeometricShape::CalculateUnitcellCount().

27 { return m_fLength[index]; };
static double m_fLength[3]
Unit cell length.

Here is the caller graph for this function:

std::vector<double>* CKNGeometricUnitCell::GetNeighborCellID ( )
inline

Definition at line 48 of file KNGeometricUnitCell.h.

References m_vectNeighborCellID.

48 { return &m_vectNeighborCellID; };
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.
CKNGeometricAtom * CKNGeometricUnitCell::GetSubElementAt ( double  fIndex)

Get atom count in unit cell.

Return atom in unitcell by sequence

Parameters
fIndexIndex of atom
Returns
Pointer of atom instance

Definition at line 268 of file KNGeometricUnitCell.cpp.

References m_vectIntenalAtom.

Referenced by CopyInnerAtomIndex(), and FindingNeighborInUnitcell().

269 {
270  if (fIndex >= m_vectIntenalAtom.size())
271  return NULL;
272 
273  return &m_vectIntenalAtom[(int)floor(fIndex)];
274 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.

Here is the caller graph for this function:

CKNGeometricAtom * CKNGeometricUnitCell::GetSubElementByID ( double  fID)

Return atom in unitcell by atom ID.

Parameters
fIDIndex of atom
Returns
Pointer of atom instance

Definition at line 280 of file KNGeometricUnitCell.cpp.

References GetID(), and m_vectIntenalAtom.

281 {
282  int nSize, i;
283 
284  nSize = m_vectIntenalAtom.size();
285  for( i = 0 ;i < nSize ; ++ i )
286  {
287  if( fID == m_vectIntenalAtom[i].GetID() )
288  return &m_vectIntenalAtom[i];
289  }
290 
291  return NULL;
292 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
double GetID()
Set unit cell ID.

Here is the call graph for this function:

static double CKNGeometricUnitCell::GetSubElementID ( )
inlinestatic

Reset SubElement ID to Zero.

Definition at line 29 of file KNGeometricUnitCell.h.

Referenced by CKNGeometricShape::ConstructMapInfo(), and CKNGeometricShape::ExchangeAtomInfoBetweenNode().

29 { return m_SubElementID;};
static double m_SubElementID
Maxium atom ID in shape.

Here is the caller graph for this function:

int CKNGeometricUnitCell::GetSubElementSize ( )
inline

Definition at line 45 of file KNGeometricUnitCell.h.

References m_vectIntenalAtom.

Referenced by CopyInnerAtomIndex(), and FindingNeighborInUnitcell().

45 { return m_vectIntenalAtom.size(); };
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.

Here is the caller graph for this function:

int CKNGeometricUnitCell::IsMachedNeighborRule ( CKNGeometricAtom pCompare1,
CKNGeometricAtom pCompare2,
std::vector< CKNGeometricCoordination > *  pNeighborRelation,
int &  nCheckFill 
)
private

Checking neighbor with rule.

Parameters
pCompare1First comparing target atom
pCompare2Second comparing target atom
pNeighborRelationNeighbor relation rule
[out]nCheckFillfinding result of first comparing target atom's neighbor
Returns
Neighbor index

Definition at line 474 of file KNGeometricUnitCell.cpp.

References ATOM_DEFAULT_INDEX, CKNGeometricAtom::GetCoordination(), CKNGeometricAtom::GetNeighborAtomID(), and CKNGeometricCoordination::SetOffset().

Referenced by BuildNeighborInformation(), and FindingNeighborInUnitcell().

475 {
476  int i, nSize;
477  CKNGeometricCoordination coordination1;
478  CKNGeometricCoordination coordination2 = pCompare2->GetCoordination();
479 
480  nSize = pNeighborRelation->size();
481  for (i = 0; i < nSize; ++i)
482  {
483  double fNeighbor = pCompare1->GetNeighborAtomID(i);
484  if (ATOM_DEFAULT_INDEX != fNeighbor)
485  continue;
486 
487  coordination1 = pCompare1->GetCoordination();
488  coordination1.SetOffset(pNeighborRelation->at(i));
489 
490  if (coordination2 == coordination1)
491  return i;
492  }
493 
494  return -1;
495 }
Class for coordination.
void SetOffset(CKNGeometricCoordination coord)
To offset coordination.
#define ATOM_DEFAULT_INDEX
Atom index default value that empty atom instance.
Definition: CKNGlobal.h:53
CKNGeometricCoordination GetCoordination()
Get Domain atom material type.
double GetNeighborAtomID(unsigned int nIndex)
Get neighbor atom count.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CKNGeometricUnitCell::IsPeriodicUnitCell ( )
inline

Check this unit cell is periodic condition or not.

Definition at line 55 of file KNGeometricUnitCell.h.

References m_bPeriodicElement.

unsigned int CKNGeometricUnitCell::NumberingSubElement ( CKNGeometricCoordination  ShapeCoordination,
double  fLength[3],
int  nShapeType,
char *  pszDomainMatName 
)

Assign atom ID to sub element(atoms in unit cell)

Parameters
ShapeCoordinationCoordination of shape
fLengthLength of shape
szShapeForm of shape
Returns
Atom count

Definition at line 153 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, BOX_SHAPE, CYLINDER_SHAPE, GENERAL_TOLERANCE, CKNGeometricCoordination::GetCoordination(), CKNGeometricAtomFactory::GetMaterialNumber(), m_SubElementID, and m_vectIntenalAtom.

Referenced by CKNGeometricShape::ArrangeUnitCell().

154 {
155  double cx, cy, cz;
156  int i, nSize = m_vectIntenalAtom.size();
157  unsigned int count = 0;
158 
159  for (i = 0; i < nSize; ++i)
160  {
161  CKNGeometricCoordination coordination = m_vectIntenalAtom[i].GetCoordination();
162 
163  cx = coordination.GetCoordination(_X);
164  cy = coordination.GetCoordination(_Y);
165  cz = coordination.GetCoordination(_Z);
166 
167  if (cx < 0 || cx > ShapeCoordination.GetCoordination(_X) + fLength[_X])
168  {
169  if( fabs(cx - (ShapeCoordination.GetCoordination(_X) + fLength[_X])) > GENERAL_TOLERANCE)
170  {
171  //printf("cx: %10.10f, cy: %10.10f, cz %10.10f\n", cx, cy, cz);
172  continue;
173  }
174  }
175 
176  switch (nShapeType)
177  {
178  case BOX_SHAPE:
179  if (cy < 0 || cy > ShapeCoordination.GetCoordination(_Y) + fLength[_Y])
180  continue;
181 
182  if (cz < 0 || cz > ShapeCoordination.GetCoordination(_Z) + fLength[_Z])
183  continue;
184  break;
185  case CYLINDER_SHAPE:
186  if ((pow((cy - (fLength[_Y] / 2)), 2) / pow(fLength[_Y] / 2, 2)) +
187  pow((cz - (fLength[_Z] / 2)), 2) / pow(fLength[_Z] / 2, 2) > 1)
188  continue;
189  break;
190  }
191 
192  count++;
193 
194  MATERIAL_INDEX nMaterialType;
195 
196  nMaterialType = CKNGeometricAtomFactory::GetMaterialNumber(pszDomainMatName, m_vectIntenalAtom[i].GetType());
197  m_vectIntenalAtom[i].SetMaterial(nMaterialType);
198  m_vectIntenalAtom[i].SetID(m_SubElementID++);
199  }
200 
201  return count;
202 }
MATERIAL_INDEX
Definition: CKNGlobal.h:106
#define CYLINDER_SHAPE
Definition: CKNGlobal.h:89
Class for coordination.
Definition: CKNGlobal.h:105
#define GENERAL_TOLERANCE
General tolerance definition.
Definition: CKNGlobal.h:48
Definition: CKNGlobal.h:105
static MATERIAL_INDEX GetMaterialNumber(char *pszMaterialName, CKNGeometricAtom::ATOM_TYPE type)
Get total atom counts in unit cell.
Definition: CKNGlobal.h:105
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
#define BOX_SHAPE
Definition: CKNGlobal.h:88
double GetCoordination(AXIS_DEFINE coord)
Get coordination specific axis.
static double m_SubElementID
Maxium atom ID in shape.

Here is the call graph for this function:

Here is the caller graph for this function:

static void CKNGeometricUnitCell::ResetSubElementID ( )
inlinestatic

Get unit cell length.

Definition at line 28 of file KNGeometricUnitCell.h.

References m_SubElementID.

Referenced by CKNGeometricShape::ArrangeUnitCell().

28 { m_SubElementID = 0; };
static double m_SubElementID
Maxium atom ID in shape.

Here is the caller graph for this function:

void CKNGeometricUnitCell::Serialize ( double *  pBuffer)

Convert unit cell data to double buffer.

Parameters
[out]pBufferData buffer to save serialization result

Definition at line 536 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, and m_vectIntenalAtom.

537 {
538  int i, nSize = m_vectIntenalAtom.size();
539  int nPos = 0;
540 
541  for( i = 0; i < nSize;++i)
542  {
543  pBuffer[nPos++] = m_vectIntenalAtom[i].GetID();
544  pBuffer[nPos++] = (double)m_vectIntenalAtom[i].GetType();
545  pBuffer[nPos++] = (double)m_vectIntenalAtom[i].GetMaterialNumber();
546  pBuffer[nPos++] = (double)m_vectIntenalAtom[i].IsPeriodicAtom();
547  pBuffer[nPos++] = m_vectIntenalAtom[i].GetCoordination().GetCoordination(_X);
548  pBuffer[nPos++] = m_vectIntenalAtom[i].GetCoordination().GetCoordination(_Y);
549  pBuffer[nPos++] = m_vectIntenalAtom[i].GetCoordination().GetCoordination(_Z);
550  pBuffer[nPos++] = (double)m_vectIntenalAtom[i].GetPeriodicDirection();
551  }
552 }
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
void CKNGeometricUnitCell::SetAssignIndex ( double  fXAssignIndex,
double  fYAssignIndex,
double  fZAssignIndex 
)

Get Assign index.

Assign index set to unit cell. This index will be used for boundary check, neighbor unit cell finding

Parameters
fXAssignIndexAssign index of x
fYAssignIndexAssign index of y
fZAssignIndexAssign index of z

Definition at line 209 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, and m_fAssignedIndex.

Referenced by CKNGeometricShape::ArrangeUnitCell().

210 {
211  m_fAssignedIndex[_X] = floor(fXAssignIndex);
212  m_fAssignedIndex[_Y] = floor(fYAssignIndex);
213  m_fAssignedIndex[_Z] = floor(fZAssignIndex);
214 }
double m_fAssignedIndex[3]
Assign index.
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetCoordination ( CKNGeometricCoordination  coordination)

Get coordination of unit cell.

Set coordination of unit cell

Parameters
coordinationCoordination

Definition at line 44 of file KNGeometricUnitCell.cpp.

References CKNGeometricCoordination::GetCoordinationAll(), m_coordination, and CKNGeometricCoordination::SetCoordination().

Referenced by CKNGeometricShape::ArrangeUnitCell().

45 {
47 }
CKNGeometricCoordination m_coordination
Coordination of unit cell.
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination with double buffer.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetCoordination ( double *  pfCoordination)

Set coordination of unit cell.

Parameters
pfCoordinationCoordination buffer

Definition at line 52 of file KNGeometricUnitCell.cpp.

References m_coordination, and CKNGeometricCoordination::SetCoordination().

53 {
54  m_coordination.SetCoordination(pfCoordination);
55 }
CKNGeometricCoordination m_coordination
Coordination of unit cell.
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination with double buffer.

Here is the call graph for this function:

void CKNGeometricUnitCell::SetCoordination ( double  fXCoordination,
double  fYCoordination,
double  fZCoordination 
)

Set coordination of unit cell.

Parameters
fXCoordinationx Coordination
fYCoordinationy Coordination
fZCoordinationz Coordination

Definition at line 62 of file KNGeometricUnitCell.cpp.

References m_coordination, and CKNGeometricCoordination::SetCoordination().

63 {
64  m_coordination.SetCoordination(fXCoordination, fYCoordination, fZCoordination);
65 }
CKNGeometricCoordination m_coordination
Coordination of unit cell.
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination with double buffer.

Here is the call graph for this function:

static void CKNGeometricUnitCell::SetFullFillIndex ( int  nIndex)
inlinestatic

Changing Full fill neighbor index.

Definition at line 58 of file KNGeometricUnitCell.h.

References m_nFullFillIndex.

void CKNGeometricUnitCell::SetID ( double  fID)
inline

Definition at line 36 of file KNGeometricUnitCell.h.

References m_fUnitCellID.

Referenced by CKNGeometricShape::ArrangeUnitCell(), CopyInnerAtomIndex(), and CKNGeometricShape::Deserialize().

36 { m_fUnitCellID = fID; };
double m_fUnitCellID
Unit cell ID.

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetLength ( double  fLength[3],
double  fOriginLength[3] 
)
static

Set unit cell length.

Definition at line 34 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, and m_fLength.

Referenced by CKNGeometricShape::SetAtomAndNeighborInformation(), and CKNGeometricConstructionLaunch::SetUnitCellInformation().

35 {
36  m_fLength[_X] = fOriginLength[_X];
37  m_fLength[_Y] = fOriginLength[_Y];
38  m_fLength[_Z] = fOriginLength[_Z];
39 }
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
static double m_fLength[3]
Unit cell length.
Definition: CKNGlobal.h:105

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetPeriodic ( bool  bPeriodic,
int  periodicDirection 
)

To mark unit cell is periodic condition.

Parameters
bPeriodicPeriodic flag
periodicDirectionPeriodic direction

Definition at line 587 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtomFactory::GetAtomCountInUnitcell(), m_bPeriodicElement, m_periodicDirection, and m_vectIntenalAtom.

Referenced by CKNGeometricShape::ArrangeUnitCell().

588 {
590  int nPos = 0;
591 
592  m_bPeriodicElement = bPeriodic;
593  m_periodicDirection = periodicDirection;
594  for (i = 0; i < nSize; ++i)
595  {
596  m_vectIntenalAtom[i].SetPeriodic(bPeriodic);
597  m_vectIntenalAtom[i].SetPeriodicDirection(periodicDirection);
598  }
599 }
int m_periodicDirection
Periodic direction information.
bool m_bPeriodicElement
Periodic element flag.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetPeriodicDirection ( int  periodicDirection)
private

Set periodic direction.

Parameters
periodicDirectionPeriodic direction

Definition at line 616 of file KNGeometricUnitCell.cpp.

References CKNGeometricAtomFactory::GetAtomCountInUnitcell(), and m_vectIntenalAtom.

617 {
619 
620  for (i = 0; i < nSize; ++i)
621  m_vectIntenalAtom[i].SetPeriodicDirection(periodicDirection);
622 }
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
void SetPeriodicDirection(int periodicDirection)
Set periodic direction.

Here is the call graph for this function:

void CKNGeometricUnitCell::SetSubDomainMaterial ( CKNCommandFileParser::LPINPUT_CMD_PARAM  lpParam)

Set atoms information(coordination, type) in unit cell.

Parameters
lpParamInput parameter parsing from command file

Definition at line 104 of file KNGeometricUnitCell.cpp.

References _X, _Y, _Z, BOX_SHAPE, CYLINDER_SHAPE, CKNCommandFileParser::INPUT_CMD_PARAM::fOrigin, CKNCommandFileParser::INPUT_CMD_PARAM::fShapeLength, CKNGeometricCoordination::GetCoordination(), CKNGeometricAtomFactory::GetMaterialNumber(), m_vectIntenalAtom, CKNCommandFileParser::INPUT_CMD_PARAM::nShape, CKNCommandFileParser::INPUT_CMD_PARAM::nSubDomainNumber, and CKNCommandFileParser::INPUT_CMD_PARAM::szDomainMat.

Referenced by CKNGeometricShape::ArrangeUnitCell().

105 {
106  double cx, cy, cz;
107  int i, j, nSize = m_vectIntenalAtom.size();
108 
109  for (j = 0; j < lpParam->nSubDomainNumber; ++j)
110  {
111  for (i = 0; i < nSize; ++i)
112  {
113  CKNGeometricCoordination coordination = m_vectIntenalAtom[i].GetCoordination();
114 
115  cx = coordination.GetCoordination(_X);
116  cy = coordination.GetCoordination(_Y);
117  cz = coordination.GetCoordination(_Z);
118 
119  if (cx < lpParam->fOrigin[j+1][0] || cx > (lpParam->fOrigin[j+1][0] + lpParam->fShapeLength[j+1][0]))
120  continue;
121 
122  switch (lpParam->nShape[j + 1])
123  {
124  case BOX_SHAPE:
125  if (cy < lpParam->fOrigin[j + 1][1] || cy >(lpParam->fOrigin[j + 1][1] + lpParam->fShapeLength[j + 1][1]))
126  continue;
127 
128  if (cz < lpParam->fOrigin[j + 1][2] || cz >(lpParam->fOrigin[j + 1][2] + lpParam->fShapeLength[j + 1][2]))
129  continue;
130  break;
131  case CYLINDER_SHAPE:
132  if ((pow(((cy - lpParam->fOrigin[j + 1][_Y]) - (lpParam->fShapeLength[j + 1][_Y] / 2)), 2) / pow(lpParam->fShapeLength[j + 1][_Y] / 2, 2)) +
133  pow(((cz - lpParam->fOrigin[j + 1][_Z]) - (lpParam->fShapeLength[j + 1][_Z] / 2)), 2) / pow(lpParam->fShapeLength[j + 1][_Z] / 2, 2) > 1)
134  continue;
135  break;
136  }
137 
138  MATERIAL_INDEX nMaterialType;
139 
140  nMaterialType = CKNGeometricAtomFactory::GetMaterialNumber(lpParam->szDomainMat[j+1], m_vectIntenalAtom[i].GetType());
141  m_vectIntenalAtom[i].SetMaterial(nMaterialType);
142  }
143  }
144 
145 }
MATERIAL_INDEX
Definition: CKNGlobal.h:106
#define CYLINDER_SHAPE
Definition: CKNGlobal.h:89
Class for coordination.
Definition: CKNGlobal.h:105
int nShape[NMAXDOMAIN]
Geometric Shape.
Definition: CKNGlobal.h:105
static MATERIAL_INDEX GetMaterialNumber(char *pszMaterialName, CKNGeometricAtom::ATOM_TYPE type)
Get total atom counts in unit cell.
Definition: CKNGlobal.h:105
double fShapeLength[NMAXDOMAIN][3]
Shap length x, y, z, direction.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.
char szDomainMat[NMAXDOMAIN][1024]
Material type.
int nSubDomainNumber
Numbers of Subdomain, except main domain.
#define BOX_SHAPE
Definition: CKNGlobal.h:88
double GetCoordination(AXIS_DEFINE coord)
Get coordination specific axis.
double fOrigin[NMAXDOMAIN][3]
Coordinator original coordinate.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricUnitCell::SetUnitcellList ( std::vector< CKNGeometricUnitCell > *  pVect,
std::vector< CKNGeometricUnitCell > *  pVectPrev,
std::vector< CKNGeometricUnitCell > *  pVectNext 
)

Set unit cell list of shape to each unit cell.

Parameters
pVectvector of unit cell
pVectPrevvector of previous unit cell
pVectNextvector of next unit cell

Definition at line 606 of file KNGeometricUnitCell.cpp.

References m_vectUnitCellInNext, m_vectUnitCellInPrev, and m_vectUnitCellInShape.

Referenced by CKNGeometricShape::ArrangeUnitCell().

607 {
608  m_vectUnitCellInShape = pVect;
609  m_vectUnitCellInPrev = pVectPrev;
610  m_vectUnitCellInNext = pVectNext;
611 }
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInNext
Back side unit cell list in shape.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInPrev
Front side unit cell list in shape.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInShape
Unit cell list in shape.

Here is the caller graph for this function:

void CKNGeometricUnitCell::ShiftAtomID ( double  fShift)

Get neighbor unit cell ID.

Shift atom ID by given fShift value

Parameters
fShiftShift value

Definition at line 324 of file KNGeometricUnitCell.cpp.

References m_vectIntenalAtom, and ShiftID().

325 {
326  int i, nSize = m_vectIntenalAtom.size();
327 
328  for (i = 0; i < nSize; ++i)
329  m_vectIntenalAtom[i].ShiftID(fShift);
330 }
void ShiftID(double fShift)
Get unit cell ID.
std::vector< CKNGeometricAtom > m_vectIntenalAtom
Atom in unit cell.

Here is the call graph for this function:

void CKNGeometricUnitCell::ShiftID ( double  fShift)

Get unit cell ID.

Shift subelement(atom) ID

Parameters
fShiftShift value

Definition at line 335 of file KNGeometricUnitCell.cpp.

References m_fUnitCellID, and m_vectNeighborCellID.

Referenced by ShiftAtomID().

336 {
337  int i, nSize = m_vectNeighborCellID.size();
338 
339  m_fUnitCellID += fShift;
340  for (i = 0; i < nSize; ++i)
341  m_vectNeighborCellID[i] += fShift;
342 }
double m_fUnitCellID
Unit cell ID.
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.

Here is the caller graph for this function:

Member Data Documentation

bool CKNGeometricUnitCell::m_bPeriodicElement
private

Periodic element flag.

Definition at line 77 of file KNGeometricUnitCell.h.

Referenced by CKNGeometricUnitCell(), IsPeriodicUnitCell(), and SetPeriodic().

CKNGeometricCoordination CKNGeometricUnitCell::m_coordination
private

Coordination of unit cell.

Definition at line 73 of file KNGeometricUnitCell.h.

Referenced by ArrangeAtom(), GetCoordination(), and SetCoordination().

double CKNGeometricUnitCell::m_fAssignedIndex[3]
private

Assign index.

Definition at line 69 of file KNGeometricUnitCell.h.

Referenced by CheckingNeighborCandiate(), CKNGeometricUnitCell(), GetAssignedIndex(), and SetAssignIndex().

double CKNGeometricUnitCell::m_fLength
staticprivate

Unit cell length.

Definition at line 67 of file KNGeometricUnitCell.h.

Referenced by GetLength(), and SetLength().

double CKNGeometricUnitCell::m_fUnitCellID
private

Unit cell ID.

Definition at line 76 of file KNGeometricUnitCell.h.

Referenced by CKNGeometricUnitCell(), GetID(), SetID(), and ShiftID().

int CKNGeometricUnitCell::m_nFullFillIndex = 15
static

Get SubElement ID. It means new atom id.

Check Neighbor relation check index 15 = 4 neighbors, 63 = 6 neighbors

Definition at line 29 of file KNGeometricUnitCell.h.

Referenced by BuildNeighborInformation(), and SetFullFillIndex().

int CKNGeometricUnitCell::m_periodicDirection
private

Periodic direction information.

Definition at line 78 of file KNGeometricUnitCell.h.

Referenced by SetPeriodic().

double CKNGeometricUnitCell::m_SubElementID = ATOM_DEFAULT_INDEX + 1
staticprivate

Maxium atom ID in shape.

Definition at line 68 of file KNGeometricUnitCell.h.

Referenced by NumberingSubElement(), and ResetSubElementID().

std::vector<double> CKNGeometricUnitCell::m_vectNeighborCellID
private

Neighbor unit cell list.

Definition at line 75 of file KNGeometricUnitCell.h.

Referenced by BuildNeighborInformation(), CheckingNeighborCandiate(), GetNeighborCellID(), and ShiftID().

std::vector<CKNGeometricUnitCell>* CKNGeometricUnitCell::m_vectUnitCellInNext
private

Back side unit cell list in shape.

Definition at line 72 of file KNGeometricUnitCell.h.

Referenced by BuildNeighborInformation(), and SetUnitcellList().

std::vector<CKNGeometricUnitCell>* CKNGeometricUnitCell::m_vectUnitCellInPrev
private

Front side unit cell list in shape.

Definition at line 71 of file KNGeometricUnitCell.h.

Referenced by BuildNeighborInformation(), and SetUnitcellList().

std::vector<CKNGeometricUnitCell>* CKNGeometricUnitCell::m_vectUnitCellInShape
private

Unit cell list in shape.

Definition at line 70 of file KNGeometricUnitCell.h.

Referenced by BuildNeighborInformation(), and SetUnitcellList().


The documentation for this class was generated from the following files: