ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/applications/nanoRodBuilder/Geometry.hpp
Revision: 2219
Committed: Tue May 3 22:55:29 2005 UTC (19 years, 2 months ago) by chuckv
File size: 3648 byte(s)
Log Message:
Adding support for generic geometry to nanorodbuilder.

File Contents

# Content
1 /*
2 * Geometry.hpp
3 * OOPSE-2.0
4 *
5 * Created by Charles F. Vardeman II on 5/3/05.
6 *
7 * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
8 *
9 * The University of Notre Dame grants you ("Licensee") a
10 * non-exclusive, royalty free, license to use, modify and
11 * redistribute this software in source and binary code form, provided
12 * that the following conditions are met:
13 *
14 * 1. Acknowledgement of the program authors must be made in any
15 * publication of scientific results based in part on use of the
16 * program. An acceptable form of acknowledgement is citation of
17 * the article in which the program was described (Matthew
18 * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
19 * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
20 * Parallel Simulation Engine for Molecular Dynamics,"
21 * J. Comput. Chem. 26, pp. 252-271 (2005))
22 *
23 * 2. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 *
26 * 3. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the
29 * distribution.
30 *
31 * This software is provided "AS IS," without a warranty of any
32 * kind. All express or implied conditions, representations and
33 * warranties, including any implied warranty of merchantability,
34 * fitness for a particular purpose or non-infringement, are hereby
35 * excluded. The University of Notre Dame and its licensors shall not
36 * be liable for any damages suffered by licensee as a result of
37 * using, modifying or distributing the software or its
38 * derivatives. In no event will the University of Notre Dame or its
39 * licensors be liable for any lost revenue, profit or data, or for
40 * direct, indirect, special, consequential, incidental or punitive
41 * damages, however caused and regardless of the theory of liability,
42 * arising out of the use of or inability to use software, even if the
43 * University of Notre Dame has been advised of the possibility of
44 * such damages.
45 */
46
47 #ifndef LATTICE_BASELATTICE_HPP
48 #define LATTICE_BASELATTICE_HPP
49
50 #include <vector>
51 #include "math/Vector3.hpp"
52
53 namespace oopse {
54
55 class Geometry{
56 protected:
57 Geometry(){
58
59 setOrigin(V3Zero);
60 }
61
62 public:
63
64 //virtual destructor of Lattice
65 virtual ~Geometry() {}
66
67 int getNumSitesPerCell() {return nCellSites;}
68
69 void getLatticePointsPos(std::vector<Vector3d>& latticePos, int nx, int ny, int nz);
70
71 std::vector<Vector3d> getLatticePointsOrt() {return cellSitesOrt;}
72
73 //get lattice constant of unit cell
74 virtual std::vector<double> getLatticeConstant() =0;
75
76 //set lattice constant of unit cell
77 virtual void setLatticeConstant(const std::vector<double>& lc)=0;
78
79 //get origin of unit cell
80 Vector3d getOrigin( ) {return origin;}
81
82 //set origin of unit cell
83 void setOrigin(const Vector3d& newOrigin){
84 this->origin = newOrigin;
85 }
86
87 // Test if point is inside geometry
88 bool isInside(double x, double y, double z);
89 // Dump geometry to a file
90 void dumpGeometry(const std::string& geomFileName);
91
92
93 protected:
94 virtual void update() =0;
95
96 int nCellSites;
97 Vector3d origin;
98 std::vector<Vector3d> cellSitesPos;
99 std::vector<Vector3d> cellSitesOrt;
100 Vector3d cellLen;
101 };
102
103
104 }
105
106 #endif
107