IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
KNGeometricUnitCell.cpp
Go to the documentation of this file.
1 
7 #include "CKNGlobal.h"
8 #include "KNGeometricUnitCell.h"
10 #include "KNMPIManager.h"
11 #include "KNGeometricAtom.h"
12 #include <math.h>
13 
14 
18 
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 }
28 
30 {
32 }
33 
34 void CKNGeometricUnitCell::SetLength(double fLength[3], double fOriginLength[3])
35 {
36  m_fLength[_X] = fOriginLength[_X];
37  m_fLength[_Y] = fOriginLength[_Y];
38  m_fLength[_Z] = fOriginLength[_Z];
39 }
40 
45 {
47 }
48 
52 void CKNGeometricUnitCell::SetCoordination(double* pfCoordination)
53 {
54  m_coordination.SetCoordination(pfCoordination);
55 }
56 
62 void CKNGeometricUnitCell::SetCoordination(double fXCoordination, double fYCoordination, double fZCoordination)
63 {
64  m_coordination.SetCoordination(fXCoordination, fYCoordination, fZCoordination);
65 }
66 
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 }
100 
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 }
146 
153 unsigned int CKNGeometricUnitCell::NumberingSubElement(CKNGeometricCoordination ShapeCoordination, double fLength[3], int nShapeType, char *pszDomainMatName)
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 }
203 
209 void CKNGeometricUnitCell::SetAssignIndex(double fXAssignIndex, double fYAssignIndex, double fZAssignIndex)
210 {
211  m_fAssignedIndex[_X] = floor(fXAssignIndex);
212  m_fAssignedIndex[_Y] = floor(fYAssignIndex);
213  m_fAssignedIndex[_Z] = floor(fZAssignIndex);
214 }
215 
221 void CKNGeometricUnitCell::CheckingNeighborCandiate(double fAssignedCount[3], bool bFrontFace, bool bBackEnd)
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 }
263 
269 {
270  if (fIndex >= m_vectIntenalAtom.size())
271  return NULL;
272 
273  return &m_vectIntenalAtom[(int)floor(fIndex)];
274 }
275 
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 }
293 
295 {
296  m_vectIntenalAtom.clear();
297 }
298 
306 double CKNGeometricUnitCell::CalculatingIndex(double fXAssignedIndex, double fYAssignedIndex, double fZAssignedIndex, double fAssignedCount[3])
307 {
308  return fXAssignedIndex * floor(fAssignedCount[1]) * floor(fAssignedCount[2]) + fYAssignedIndex * floor(fAssignedCount[2]) + fZAssignedIndex;
309 }
310 
315 {
316  int i, nSize = srcUnitCell.GetSubElementSize();
317  for (i = 0; i < nSize; ++i)
318  m_vectIntenalAtom[i].SetID(srcUnitCell.GetSubElementAt(i)->GetID());
319 }
320 
325 {
326  int i, nSize = m_vectIntenalAtom.size();
327 
328  for (i = 0; i < nSize; ++i)
329  m_vectIntenalAtom[i].ShiftID(fShift);
330 }
331 
335 void CKNGeometricUnitCell::ShiftID(double fShift)
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 }
343 
348 void CKNGeometricUnitCell::BuildNeighborInformation(double *pfAssignCount, std::vector<CKNGeometricAtom*> *pSurfaceList)
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 }
466 
474 int CKNGeometricUnitCell::IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector<CKNGeometricCoordination> *pNeighborRelation, int &nCheckFill)
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 }
496 
505 bool CKNGeometricUnitCell::FindingNeighborInUnitcell(CKNGeometricUnitCell *pUnitcell, CKNGeometricAtom *pCompare1, CKNGeometricAtom::ATOM_TYPE type1, std::vector<CKNGeometricCoordination> *pNeighborRelation, int &nCheckFill)
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 }
532 
536 void CKNGeometricUnitCell::Serialize(double *pBuffer)
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 }
553 
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 }
582 
587 void CKNGeometricUnitCell::SetPeriodic(bool bPeriodic, int periodicDirection)
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 }
600 
606 void CKNGeometricUnitCell::SetUnitcellList(std::vector<CKNGeometricUnitCell> *pVect, std::vector<CKNGeometricUnitCell> *pVectPrev, std::vector<CKNGeometricUnitCell> *pVectNext)
607 {
608  m_vectUnitCellInShape = pVect;
609  m_vectUnitCellInPrev = pVectPrev;
610  m_vectUnitCellInNext = pVectNext;
611 }
612 
617 {
619 
620  for (i = 0; i < nSize; ++i)
621  m_vectIntenalAtom[i].SetPeriodicDirection(periodicDirection);
622 }
623 
628 {
630 
631  for (i = 0; i < nSize; ++i)
632  m_vectIntenalAtom[i].AddPeridoicDirection(periodicDirection);
633 }
double m_fUnitCellID
Unit cell ID.
MATERIAL_INDEX
Definition: CKNGlobal.h:106
#define CYLINDER_SHAPE
Definition: CKNGlobal.h:89
double m_fAssignedIndex[3]
Assign index.
CKNGeometricCoordination m_coordination
Coordination of unit cell.
Factory class for create CKNGeometricAtom instance.
int IsMachedNeighborRule(CKNGeometricAtom *pCompare1, CKNGeometricAtom *pCompare2, std::vector< CKNGeometricCoordination > *pNeighborRelation, int &nCheckFill)
Checking neighbor with rule.
ATOM_TYPE GetType()
Class for coordination.
unsigned int GetNeighborCount()
Class for Geometric unit cell.
std::vector< double > m_vectNeighborCellID
Neighbor unit cell list.
Definition: CKNGlobal.h:105
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.
void SetPeriodicDirection(int periodicDirection)
int m_periodicDirection
Periodic direction information.
void SetCoordination(CKNGeometricCoordination coordination)
Get atom coordination.
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.
void FinalSubElement()
Finalizing SubElement.
void SetType(ATOM_TYPE type, MATERIAL_INDEX number)
Set atom information.
int nShape[NMAXDOMAIN]
Geometric Shape.
Class for Geometric unit cell.
void ArrangeAtom(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set atoms information(coordination, type) in unit cell.
void SetOffset(CKNGeometricCoordination coord)
To offset coordination.
std::vector< CKNGeometricUnitCell > * m_vectUnitCellInPrev
Front side unit cell list in shape.
Class for Atom.
#define GENERAL_TOLERANCE
General tolerance definition.
Definition: CKNGlobal.h:48
Definition: CKNGlobal.h:105
CKNGeometricAtom * GetSubElementByID(double fID)
Return atom in unitcell by atom ID.
static MATERIAL_INDEX GetMaterialNumber(char *pszMaterialName, CKNGeometricAtom::ATOM_TYPE type)
Get total atom counts in unit cell.
static double m_fLength[3]
Unit cell length.
void SetID(double fID)
Set atom ID.
void SetAssignIndex(double fXAssignIndex, double fYAssignIndex, double fZAssignIndex)
Get Assign index.
bool m_bPeriodicElement
Periodic element flag.
Definition: CKNGlobal.h:105
Common definition for Solver.
void SetPeriodic(bool bPeriodic, int periodicDirection)
To mark unit cell is periodic condition.
Structure for save input command file parsing result.
double fShapeLength[NMAXDOMAIN][3]
Shap length x, y, z, direction.
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.
void Serialize(double *pBuffer)
Convert unit cell data to double buffer.
#define ATOM_DEFAULT_INDEX
Atom index default value that empty atom instance.
Definition: CKNGlobal.h:53
void AddPeridoicDirection(CKNGeometricAtom::PERIODIC_DIRECTION periodicDirection)
Adding periodic direction.
void SetPeriodicDirection(int periodicDirection)
Set periodic direction.
static std::vector< CKNGeometricCoordination > m_vectNeighborRelation2To1
Neighbor relationship from cation to anion.
unsigned int NumberingSubElement(CKNGeometricCoordination ShapeCoordination, double fLength[3], int nShapeType, char *pszDomainMatName)
Assign atom ID to sub element(atoms in unit cell)
char szDomainMat[NMAXDOMAIN][1024]
Material type.
int nSubDomainNumber
Numbers of Subdomain, except main domain.
CKNGeometricAtom * GetSubElementAt(double fIndex)
Get atom count in unit cell.
#define BOX_SHAPE
Definition: CKNGlobal.h:88
void SetID(double fID)
static void SetLength(double fLength[3], double fOriginLength[3])
Set unit cell length.
double GetCoordination(AXIS_DEFINE coord)
Get coordination specific axis.
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 std::vector< CKNGeometricAtom > m_vectAtomList_1
Get total Neighbor count in unit cell.
static double m_SubElementID
Maxium atom ID in shape.
void SetPeriodic(bool bPeriodic)
static std::vector< CKNGeometricCoordination > m_vectNeighborRelation1To2
Neighbor relationship from anion to cation.
MPI Mangement class.
void SetNeighbor(unsigned int nIndex, CKNGeometricAtom *pNeighbor)
Set neighbor information.
CKNGeometricCoordination GetCoordination()
Get Domain atom material type.
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination of unit cell.
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination with double buffer.
void SetDomainMaterial(MATERIAL_INDEX number)
Set atom material information.
static std::vector< CKNGeometricAtom > m_vectAtomList_2
Atom array for cation.
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.
double GetNeighborAtomID(unsigned int nIndex)
Get neighbor atom count.
double fOrigin[NMAXDOMAIN][3]
Coordinator original coordinate.