14 |
|
#include "sysBuild.hpp" |
15 |
|
#include "nanoBuilder.hpp" |
16 |
|
|
17 |
< |
nanoBuilder::nanoBuilder(int thisIsRandom, int thisHasVacancies, |
18 |
< |
int thisLatticeType, double thisParticleRadius, |
19 |
< |
double thisCoreRadius, double thisVacancyFraction, |
20 |
< |
double thisVacancyRadius, |
21 |
< |
double thisLatticeSpacing, |
22 |
< |
double solute_X, |
23 |
< |
int &hasError){ |
17 |
> |
nanoBuilder::nanoBuilder(int &hasError){ |
18 |
|
int Errors; |
19 |
|
int foundCore,foundShell; |
20 |
|
int i; |
49 |
|
|
50 |
|
hasError = 0; |
51 |
|
Errors = 0; |
52 |
< |
|
53 |
< |
|
54 |
< |
isRandom = thisIsRandom; |
55 |
< |
hasVacancies = thisHasVacancies; |
56 |
< |
latticeType = thisLatticeType; |
57 |
< |
particleRadius = thisParticleRadius; |
58 |
< |
coreRadius = thisCoreRadius; |
59 |
< |
vacancyFraction = thisVacancyFraction; |
60 |
< |
latticeSpacing = thisLatticeSpacing; |
61 |
< |
soluteX = solute_X; //Mole fraction for random particle. |
52 |
> |
|
53 |
> |
//Initialize class members from bsInfo struct that sysbuilder provides. |
54 |
> |
isRandom = bsInfo.isRandomParticle; |
55 |
> |
hasVacancies = bsInfo.hasVacancies; |
56 |
> |
latticeType = bsInfo.latticeType; |
57 |
> |
particleRadius = bsInfo.particleRadius; |
58 |
> |
coreRadius = bsInfo.coreRadius; |
59 |
> |
vacancyFraction = bsInfo.vacancyFraction; |
60 |
> |
latticeSpacing = bsInfo.latticeSpacing; |
61 |
> |
soluteX = bsInfo.soluteX; //Mole fraction for random particle. |
62 |
|
|
63 |
|
|
64 |
|
|
334 |
|
if (! moleculeVector[i].isVacancy) { |
335 |
|
orientationMunger( A ); |
336 |
|
if( moleculeVector[i].isCore){ |
337 |
< |
nCoreAtomCounter =+ nCoreModelAtoms; |
337 |
> |
nCoreAtomCounter += nCoreModelAtoms; |
338 |
|
coreLocate->placeMol(moleculeVector[i].pos,A,atoms,nShellAtomCounter); |
339 |
|
} |
340 |
|
else { |
341 |
< |
nShellAtomCounter =+ nShellModelAtoms; |
341 |
> |
nShellAtomCounter += nShellModelAtoms; |
342 |
|
shellLocate->placeMol(moleculeVector[i].pos,A,atoms,nCoreAtomCounter); |
343 |
|
} |
344 |
|
shesActualSizetoMe++; |
389 |
|
moleculeVector.push_back(myMol); |
390 |
|
|
391 |
|
if (dist <= coreRadius){ |
392 |
< |
coreAtomCount =+ nCoreModelAtoms; |
392 |
> |
coreAtomCount += nCoreModelAtoms; |
393 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
394 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
395 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |
400 |
|
} |
401 |
|
// Place shell |
402 |
|
else{ |
403 |
< |
shellAtomCount =+ nShellModelAtoms; |
403 |
> |
shellAtomCount += nShellModelAtoms; |
404 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
405 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
406 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |
424 |
|
moleculeVector.push_back(myMol); |
425 |
|
if (dist <= coreRadius){ |
426 |
|
|
427 |
< |
coreAtomCount =+ nCoreModelAtoms; |
427 |
> |
coreAtomCount += nCoreModelAtoms; |
428 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
429 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
430 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |
440 |
|
} |
441 |
|
} else { |
442 |
|
// Place shell |
443 |
< |
shellAtomCount =+ nShellModelAtoms; |
443 |
> |
shellAtomCount += nShellModelAtoms; |
444 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
445 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
446 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |
468 |
|
moleculeVector.push_back(myMol); |
469 |
|
if (nCoreMolCounter < nCoreMolecules){ |
470 |
|
|
471 |
< |
coreAtomCount =+ nCoreModelAtoms; |
471 |
> |
coreAtomCount += nCoreModelAtoms; |
472 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
473 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
474 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |
478 |
|
|
479 |
|
|
480 |
|
} else { |
481 |
< |
shellAtomCount =+ nShellModelAtoms; |
481 |
> |
shellAtomCount += nShellModelAtoms; |
482 |
|
moleculeVector[moleculeCount].pos[0] = pos[0]; |
483 |
|
moleculeVector[moleculeCount].pos[1] = pos[1]; |
484 |
|
moleculeVector[moleculeCount].pos[2] = pos[2]; |