OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
nanorod_pentBuilder.cpp
1/*
2 * Copyright (c) 2004-present, The University of Notre Dame. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
32 * research, please cite the following paper when you publish your work:
33 *
34 * [1] Drisko et al., J. Open Source Softw. 9, 7004 (2024).
35 *
36 * Good starting points for code and simulation methodology are:
37 *
38 * [2] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
39 * [3] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
40 * [4] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
41 * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
42 * [6] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
43 * [7] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
44 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
45 * [9] Drisko & Gezelter, J. Chem. Theory Comput. 20, 4986-4997 (2024).
46 */
47
48#include <config.h>
49
50#include <algorithm>
51#include <cmath>
52#include <cstdio>
53#include <cstdlib>
54#include <cstring>
55#include <fstream>
56#include <iostream>
57#include <map>
58#include <random>
59#include <string>
60
61#include "brains/Register.hpp"
62#include "brains/SimCreator.hpp"
63#include "brains/SimInfo.hpp"
64#include "io/DumpWriter.hpp"
65#include "lattice/Lattice.hpp"
69#include "shapedLatticePentRod.hpp"
70#include "shapedLatticeRod.hpp"
71#include "utils/Constants.hpp"
72#include "utils/MoLocator.hpp"
73#include "utils/StringUtils.hpp"
74
75using namespace std;
76using namespace OpenMD;
77void createMdFile(const std::string& oldMdFileName,
78 const std::string& newMdFileName, std::vector<int> numMol);
79
80int main(int argc, char* argv[]) {
82
83 gengetopt_args_info args_info;
84 std::string latticeType;
85 std::string inputFileName;
86 std::string outputFileName;
87 MoLocator* locator;
88 int nComponents;
89 double latticeConstant;
90 RealType rodRadius;
91 RealType rodLength;
92 Mat3x3d hmat;
93 DumpWriter* writer;
94
95 // Parse Command Line Arguments
96 if (cmdline_parser(argc, argv, &args_info) != 0) exit(1);
97
98 /* get lattice type */
99 latticeType = "FCC";
100
101 /* get input file name */
102 if (args_info.inputs_num)
103 inputFileName = args_info.inputs[0];
104 else {
105 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
106 "No input .omd file name was specified "
107 "on the command line");
108 painCave.isFatal = 1;
110 simError();
111 }
112
113 /* parse md file and set up the system */
114 SimCreator oldCreator;
115 SimInfo* oldInfo = oldCreator.createSim(inputFileName, false);
116
117 latticeConstant = args_info.latticeConstant_arg;
118 rodRadius = args_info.radius_arg;
119 rodLength = args_info.length_arg;
120 Globals* simParams = oldInfo->getSimParams();
121
122 /* Create nanorod */
123 shapedLatticePentRod nanoRod(latticeConstant, latticeType, rodRadius,
124 rodLength);
125
126 /* Set up the random number generator engine */
127 std::random_device rd; // Non-deterministic, uniformly-distributed integer
128 // random number generator
129 std::mt19937 gen(rd()); // 32-bit Mersenne Twister random number engine
130
131 /* Build a lattice and get lattice points for this lattice constant */
132
133 // Rotation angles for lattice
134 RealType phi, theta, psi;
135
136 /*
137 RealType cphi, sphi, ctheta, stheta, cpsi, spsi;
138
139 cphi = cos(phi);
140 sphi = sin(phi);
141 ctheta = cos(theta);
142 stheta = sin(theta);
143 cpsi = cos(psi);
144 spsi = sin(psi);
145 */
146
147 // Rotates 45 degrees about z-axis
148 RotMat3x3d rotation45(45.0 * Constants::PI / 180.0, 0.0, 0.0);
149
150 /*rotation45[0][0] = sqrt(2)/2;
151 rotation45[0][1] = -sqrt(2)/2;
152 rotation45[0][2] = 0;
153 rotation45[1][0] = sqrt(2)/2;
154 rotation45[1][1] = sqrt(2)/2;
155 rotation45[1][2] = 0;
156 rotation45[2][0] = 0;
157 rotation45[2][1] = 0;
158 rotation45[2][2] = 1;*/
159
160 phi = 0.0;
161 theta = 72.0 * Constants::PI / 180.0;
162 psi = 0.0;
163
164 // Rotates 72 degrees about y-axis
165 RotMat3x3d rotation72(phi, theta, psi);
166
167 /*rotation72[0][0] = sqrt(5)/4 - 0.25;
168 rotation72[0][1] = 0;
169 rotation72[0][2] = sqrt(2*(sqrt(5) + 5))/4;
170 rotation72[1][0] = 0;
171 rotation72[1][1] = 1;
172 rotation72[1][2] = 0;
173 rotation72[2][0] = -sqrt(2*(sqrt(5) + 5))/4;
174 rotation72[2][1] = 0;
175 rotation72[2][2] = sqrt(5)/4 - 0.25;*/
176
177 vector<Vector3d> getsites = nanoRod.getSites();
178 vector<Vector3d> getorientations = nanoRod.getOrientations();
179 vector<Vector3d> sites;
180 vector<Vector3d> orientations;
181
182 for (unsigned int index = 0; index < getsites.size(); index++) {
183 Vector3d mySite = getsites[index];
184 Vector3d myOrient = getorientations[index];
185 Vector3d mySite2 = rotation45 * mySite;
186 Vector3d o2 = rotation45 * myOrient;
187 sites.push_back(mySite2);
188 orientations.push_back(o2);
189
190 mySite2 = rotation72 * mySite2;
191 o2 = rotation72 * o2;
192 sites.push_back(mySite2);
193 orientations.push_back(o2);
194
195 mySite2 = rotation72 * mySite2;
196 o2 = rotation72 * o2;
197 sites.push_back(mySite2);
198 orientations.push_back(o2);
199
200 mySite2 = rotation72 * mySite2;
201 o2 = rotation72 * o2;
202 sites.push_back(mySite2);
203 orientations.push_back(o2);
204
205 mySite2 = rotation72 * mySite2;
206 o2 = rotation72 * o2;
207 sites.push_back(mySite2);
208 orientations.push_back(o2);
209 }
210
211 int nCenter = int((rodLength + 1.154700538 * rodRadius) / 2.88);
212
213 for (unsigned int index = 0; index <= 0.5 * nCenter; index++) {
214 Vector3d myLoc_top(2.88 * index, 0.0, 0.0);
215 sites.push_back(myLoc_top);
216 orientations.push_back(Vector3d(0.0));
217 }
218
219 for (unsigned int index = 1; index <= 0.5 * nCenter; index++) {
220 Vector3d myLoc_bottom(-2.88 * index, 0.0, 0.0);
221 sites.push_back(myLoc_bottom);
222 orientations.push_back(Vector3d(0.0));
223 }
224
225 std::vector<std::size_t> vacancyTargets;
226 vector<bool> isVacancy;
227
228 Vector3d myLoc;
229 RealType myR;
230
231 for (unsigned int i = 0; i < sites.size(); i++)
232 isVacancy.push_back(false);
233
234 // cerr << "checking vacancyPercent" << "\n";
235 if (args_info.vacancyPercent_given) {
236 // cerr << "vacancyPercent given" << "\n";
237 if (args_info.vacancyPercent_arg < 0.0 ||
238 args_info.vacancyPercent_arg > 100.0) {
239 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
240 "vacancyPercent was set to a non-sensical value.");
241 painCave.isFatal = 1;
242 simError();
243 } else {
244 RealType vF = args_info.vacancyPercent_arg / 100.0;
245 // cerr << "vacancyPercent = " << vF << "\n";
246 RealType vIR;
247 RealType vOR;
248 if (args_info.vacancyInnerRadius_given) {
249 vIR = args_info.vacancyInnerRadius_arg;
250 } else {
251 vIR = 0.0;
252 }
253 if (args_info.vacancyOuterRadius_given) {
254 vOR = args_info.vacancyOuterRadius_arg;
255 } else {
256 vOR = rodRadius;
257 }
258 if (vIR >= 0.0 && vOR <= rodRadius && vOR >= vIR) {
259 for (unsigned int i = 0; i < sites.size(); i++) {
260 myLoc = sites[i];
261 myR = myLoc.length();
262 if (myR >= vIR && myR <= vOR) { vacancyTargets.push_back(i); }
263 }
264 std::shuffle(vacancyTargets.begin(), vacancyTargets.end(), gen);
265
266 int nTargets = vacancyTargets.size();
267 vacancyTargets.resize((int)(vF * nTargets));
268
269 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
270 "Removing %d atoms from randomly-selected\n"
271 "\tsites between %lf and %lf.",
272 (int)vacancyTargets.size(), vIR, vOR);
273 painCave.severity = OPENMD_INFO;
274 painCave.isFatal = 0;
275 simError();
276
277 isVacancy.clear();
278 for (std::size_t i = 0; i < sites.size(); i++) {
279 bool vac = false;
280 for (std::size_t j = 0; j < vacancyTargets.size(); j++) {
281 if (i == vacancyTargets[j]) vac = true;
282 }
283 isVacancy.push_back(vac);
284 }
285
286 } else {
287 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
288 "Something is strange about the vacancy\n"
289 "\tinner or outer radii. Check their values.");
290 painCave.isFatal = 1;
291 simError();
292 }
293 }
294 }
295
296 /* Get number of lattice sites */
297 int nSites = sites.size() - vacancyTargets.size();
298
299 // cerr << "sites.size() = " << sites.size() << "\n";
300 // cerr << "nSites = " << nSites << "\n";
301 // cerr << "vacancyTargets = " << vacancyTargets.size() << "\n";
302
303 std::vector<Component*> components = simParams->getComponents();
304 std::vector<RealType> molFractions;
305 std::vector<RealType> shellRadii;
306 std::vector<int> nMol;
307 std::map<int, int> componentFromSite;
308 nComponents = components.size();
309 // cerr << "nComponents = " << nComponents << "\n";
310
311 if (args_info.molFraction_given && args_info.shellRadius_given) {
312 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
313 "Specify either molFraction or shellRadius "
314 "arguments, but not both!");
315 painCave.isFatal = 1;
316 simError();
317 }
318
319 if (nComponents == 1) {
320 molFractions.push_back(1.0);
321 shellRadii.push_back(rodRadius);
322 } else if (args_info.molFraction_given) {
323 if ((int)args_info.molFraction_given == nComponents) {
324 for (int i = 0; i < nComponents; i++) {
325 molFractions.push_back(args_info.molFraction_arg[i]);
326 }
327 } else if ((int)args_info.molFraction_given == nComponents - 1) {
328 RealType remainingFraction = 1.0;
329 for (int i = 0; i < nComponents - 1; i++) {
330 molFractions.push_back(args_info.molFraction_arg[i]);
331 remainingFraction -= molFractions[i];
332 }
333 molFractions.push_back(remainingFraction);
334 } else {
335 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
336 "nanorodBuilder can't figure out molFractions "
337 "for all of the components in the <MetaData> block.");
338 painCave.isFatal = 1;
339 simError();
340 }
341 } else if ((int)args_info.shellRadius_given) {
342 if ((int)args_info.shellRadius_given == nComponents) {
343 for (int i = 0; i < nComponents; i++) {
344 shellRadii.push_back(args_info.shellRadius_arg[i]);
345 }
346 } else if ((int)args_info.shellRadius_given == nComponents - 1) {
347 for (int i = 0; i < nComponents - 1; i++) {
348 shellRadii.push_back(args_info.shellRadius_arg[i]);
349 }
350 shellRadii.push_back(rodRadius);
351 } else {
352 snprintf(
353 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
354 "nanorodBuilder can't figure out the\n"
355 "\tshell radii for all of the components in the <MetaData> block.");
356 painCave.isFatal = 1;
357 simError();
358 }
359 } else {
360 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
361 "You have a multi-component <MetaData> block,\n"
362 "\tbut have not specified either molFraction or shellRadius "
363 "arguments.");
364 painCave.isFatal = 1;
365 simError();
366 }
367
368 if (args_info.molFraction_given) {
369 RealType totalFraction = 0.0;
370
371 /* Do some simple sanity checking*/
372
373 for (int i = 0; i < nComponents; i++) {
374 if (molFractions.at(i) < 0.0) {
375 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
376 "One of the requested molFractions was"
377 " less than zero!");
378 painCave.isFatal = 1;
379 simError();
380 }
381 if (molFractions.at(i) > 1.0) {
382 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
383 "One of the requested molFractions was"
384 " greater than one!");
385 painCave.isFatal = 1;
386 simError();
387 }
388 totalFraction += molFractions.at(i);
389 }
390 if (abs(totalFraction - 1.0) > 1e-6) {
391 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
392 "The sum of molFractions was not close enough to 1.0");
393 painCave.isFatal = 1;
394 simError();
395 }
396
397 int remaining = nSites;
398 for (int i = 0; i < nComponents - 1; i++) {
399 nMol.push_back(int((RealType)nSites * molFractions.at(i)));
400 remaining -= nMol.at(i);
401 }
402 nMol.push_back(remaining);
403
404 // recompute actual mol fractions and perform final sanity check:
405
406 int totalMolecules = 0;
407 for (int i = 0; i < nComponents; i++) {
408 molFractions[i] = (RealType)(nMol.at(i)) / (RealType)nSites;
409 totalMolecules += nMol.at(i);
410 }
411 if (totalMolecules != nSites) {
412 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
413 "Computed total number of molecules is not equal "
414 "to the number of lattice sites!");
415 painCave.isFatal = 1;
416 simError();
417 }
418 } else {
419 for (unsigned int i = 0; i < shellRadii.size(); i++) {
420 if (shellRadii.at(i) > rodRadius + 1e-6) {
421 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
422 "One of the shellRadius values exceeds the rod Radius.");
423 painCave.isFatal = 1;
424 simError();
425 }
426 if (shellRadii.at(i) <= 0.0) {
427 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
428 "One of the shellRadius values is smaller than zero!");
429 painCave.isFatal = 1;
430 simError();
431 }
432 }
433 }
434
435 vector<int> ids;
436 if ((int)args_info.molFraction_given) {
437 // cerr << "molFraction given 2" << "\n";
438 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
439 "Creating a randomized spherically-capped nanorod.");
440 painCave.isFatal = 0;
441 painCave.severity = OPENMD_INFO;
442 simError();
443 /* Random rod is the default case*/
444
445 for (unsigned int i = 0; i < sites.size(); i++)
446 if (!isVacancy[i]) ids.push_back(i);
447
448 std::shuffle(ids.begin(), ids.end(), gen);
449
450 } else {
451 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
452 "Creating an fcc nanorod.");
453 painCave.isFatal = 0;
454 painCave.severity = OPENMD_INFO;
455 simError();
456
457 // RealType smallestSoFar;
458 int myComponent = -1;
459 nMol.clear();
460 nMol.resize(nComponents);
461
462 // cerr << "shellRadii[0] " << shellRadii[0] << "\n";
463 // cerr << "rodRadius " << rodRadius << "\n";
464
465 for (unsigned int i = 0; i < sites.size(); i++) {
466 myLoc = sites[i];
467 myR = myLoc.length();
468 // smallestSoFar = rodRadius;
469 // cerr << "vac = " << isVacancy[i]<< "\n";
470
471 if (!isVacancy[i]) {
472 // for (int j = 0; j < nComponents; j++) {
473 // if (myR <= shellRadii[j]) {
474 // if (shellRadii[j] <= smallestSoFar) {
475 // smallestSoFar = shellRadii[j];
476 // myComponent = j;
477 // }
478 // }
479 // }
480 myComponent = 0;
481 componentFromSite[i] = myComponent;
482 nMol[myComponent]++;
483 // cerr << "nMol for myComp(" << myComponent<<") = " <<
484 // nMol[myComponent] <<
485 //"\n";
486 }
487 }
488 }
489 // cerr << "nMol = " << nMol.at(0) << "\n";
490
491 outputFileName = args_info.output_arg;
492
493 // creat new .omd file on fly which corrects the number of molecule
494
495 createMdFile(inputFileName, outputFileName, nMol);
496
497 delete oldInfo;
498
499 SimCreator newCreator;
500 SimInfo* NewInfo = newCreator.createSim(outputFileName, false);
501
502 // Place molecules
503 Molecule* mol;
504 SimInfo::MoleculeIterator mi;
505 mol = NewInfo->beginMolecule(mi);
506
507 int l = 0;
508
509 for (int i = 0; i < nComponents; i++) {
510 locator =
511 new MoLocator(NewInfo->getMoleculeStamp(i), NewInfo->getForceField());
512
513 // cerr << "nMol = " << nMol.at(i) << "\n";
514 if (!args_info.molFraction_given) {
515 for (unsigned int n = 0; n < sites.size(); n++) {
516 if (!isVacancy[n]) {
517 if (componentFromSite[n] == i) {
518 mol = NewInfo->getMoleculeByGlobalIndex(l);
519 locator->placeMol(sites[n], orientations[n], mol);
520 l++;
521 }
522 }
523 }
524 } else {
525 for (int n = 0; n < nMol.at(i); n++) {
526 mol = NewInfo->getMoleculeByGlobalIndex(l);
527 locator->placeMol(sites[ids[l]], orientations[ids[l]], mol);
528 l++;
529 }
530 }
531 }
532
533 // fill Hmat
534 hmat(0, 0) = 10.0 * rodRadius;
535 hmat(0, 1) = 0.0;
536 hmat(0, 2) = 0.0;
537
538 hmat(1, 0) = 0.0;
539 hmat(1, 1) = 10.0 * rodRadius;
540 hmat(1, 2) = 0.0;
541
542 hmat(2, 0) = 0.0;
543 hmat(2, 1) = 0.0;
544 hmat(2, 2) = 5.0 * rodLength + 2.0 * rodRadius;
545
546 // set Hmat
547 NewInfo->getSnapshotManager()->getCurrentSnapshot()->setHmat(hmat);
548
549 // create dumpwriter and write out the coordinates
550 writer = new DumpWriter(NewInfo, outputFileName);
551
552 if (writer == NULL) {
553 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
554 "Error in creating dumpwriter object ");
555 painCave.isFatal = 1;
556 simError();
557 }
558
559 writer->writeDump();
560
561 // deleting the writer will put the closing at the end of the dump file
562
563 delete writer;
564
565 // cleanup a by calling sim error.....
566 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
567 "A new OpenMD file called \"%s\" has been "
568 "generated.\n",
569 outputFileName.c_str());
570 painCave.isFatal = 0;
571 painCave.severity = OPENMD_INFO;
572 simError();
573 return 0;
574}
575
576void createMdFile(const std::string& oldMdFileName,
577 const std::string& newMdFileName, std::vector<int> nMol) {
578 ifstream oldMdFile;
579 ofstream newMdFile;
580 const int MAXLEN = 65535;
581 char buffer[MAXLEN];
582
583 // create new .omd file based on old .omd file
584 oldMdFile.open(oldMdFileName.c_str());
585 newMdFile.open(newMdFileName.c_str());
586 oldMdFile.getline(buffer, MAXLEN);
587
588 unsigned int i = 0;
589 while (!oldMdFile.eof()) {
590 // correct molecule number
591 if (strstr(buffer, "nMol") != NULL) {
592 if (i < nMol.size()) {
593 snprintf(buffer, MAXLEN, "\tnMol = %i;", nMol.at(i));
594 newMdFile << buffer << std::endl;
595 i++;
596 }
597 } else
598 newMdFile << buffer << std::endl;
599
600 oldMdFile.getline(buffer, MAXLEN);
601 }
602
603 oldMdFile.close();
604 newMdFile.close();
605
606 if (i != nMol.size()) {
607 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
608 "Couldn't replace the correct number of nMol\n"
609 "\tstatements in component blocks. Make sure that all\n"
610 "\tcomponents in the template file have nMol=1");
611 painCave.isFatal = 1;
612 simError();
613 }
614}
void cmdline_parser_print_help(void)
Print the help.
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
SimInfo * createSim(const std::string &mdFileName, bool loadInitCoords=true)
Setup Simulation.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Definition SimInfo.hpp:96
Molecule * getMoleculeByGlobalIndex(int index)
Finds a molecule with a specified global index.
Definition SimInfo.hpp:303
ForceField * getForceField()
Returns the force field.
Definition SimInfo.hpp:269
Molecule * beginMolecule(MoleculeIterator &i)
Returns the first molecule in this SimInfo and intialize the iterator.
Definition SimInfo.cpp:243
MoleculeStamp * getMoleculeStamp(int id)
Returns the molecule stamp.
Definition SimInfo.hpp:293
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
Definition SimInfo.hpp:251
void setHmat(const Mat3x3d &m)
Sets the H-Matrix.
Definition Snapshot.cpp:220
Snapshot * getCurrentSnapshot()
Returns the pointer of current snapshot.
Real length() const
Returns the length of this vector.
Definition Vector.hpp:397
Implements a spherically-capped rod-shaped lattice.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
void registerLattice()
Register all lattice.
Definition Register.cpp:134
The header file for the command line option parser generated by GNU Gengetopt version 2....
Where the command line options are stored.
unsigned int vacancyInnerRadius_given
Whether vacancyInnerRadius was given.
double vacancyPercent_arg
Percentage of atoms to remove from within vacancy range.
double vacancyOuterRadius_arg
Radius arround core-shell where vacancies should be located.
unsigned inputs_num
unamed options number
unsigned int molFraction_given
Whether molFraction was given.
double length_arg
maximum length (default='100').
double * molFraction_arg
Builds a multi-component random alloy nanoparticle.
char * output_arg
output file name.
char ** inputs
unamed options (options without names)
double * shellRadius_arg
Radius containing within it only molecules of a specific component.
unsigned int shellRadius_given
Whether shellRadius was given.
double radius_arg
Nanoparticle radius in Angstroms.
double vacancyInnerRadius_arg
Radius arround core-shell where vacancies should be located.
unsigned int vacancyPercent_given
Whether vacancyPercent was given.
double latticeConstant_arg
Lattice spacing in Angstroms for cubic lattice.
unsigned int vacancyOuterRadius_given
Whether vacancyOuterRadius was given.