ls1-MarDyn
ls1-MarDyn molecular dynamics code
GridFiller.h
1/*
2 * Copyright (c) 2013-2017 Christoph Niethammer <christoph.niethammer@gmail.com>
3 *
4 * $COPYRIGHT$
5 *
6 * Additional copyrights may follow
7 *
8 * $HEADER
9 */
10
11#ifndef GRIDFILLER_H_
12#define GRIDFILLER_H_
13
14#include <array>
15#include <random>
16
17#include "Basis.h"
18#include "Lattice.h"
19#include "utils/generator/ObjectFillerBase.h"
20
21
24public:
25 GridFiller() : _lattice(), _basis(), _origin{{0.0, 0.0, 0.0}}, _object(nullptr), _latticeOccupancy(1.0), _dis(0.0, 1.0), _gen(0) {}
26 ~~GridFiller(){}
27
45 void readXML(XMLfileUnits& xmlconfig);
46
53 void init(Lattice& lattice, Basis& basis, double origin[3]);
54
56 void init();
57
58 /* Set object to fill */
59 void setObject(std::shared_ptr<Object> object) { _object = object; }
60
66 int getMolecule(Molecule *molecule);
67
68 std::string getPluginName() { return std::string("GridFiller"); }
69 static ObjectFillerBase* createInstance() { return new GridFiller(); }
70
71private:
72 Lattice _lattice;
73 Basis _basis;
74 std::array<double, 3> _origin;
75 std::shared_ptr<Object> _object;
76 double _latticeOccupancy;
77
78 std::uniform_real_distribution<> _dis;
79 std::mt19937 _gen;
80
81 /* Internal values/counters used during the creation by getMolecule */
82 long _baseCount;
83 double _lattice_point[3];
84};
85
86#endif // GRIDFILLER_H_
Definition: Basis.h:20
FullMolecule modeled as LJ sphere with point polarities.
Definition: FullMolecule.h:18
Definition: GridFiller.h:23
int getMolecule(Molecule *molecule)
Definition: GridFiller.cpp:124
void init()
Definition: GridFiller.cpp:32
void readXML(XMLfileUnits &xmlconfig)
Read in XML configuration for GridFiller and all its included objects.
Definition: GridFiller.cpp:89
Definition: Lattice.h:44
Definition: ObjectFillerBase.h:11
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-punstructured.h:270