00001 #ifndef __VERTEX3D_HPP__ 00002 #define __VERTEX3D_HPP__ 00003 00004 #include <algorithm> 00005 #include <functional> 00006 00007 #include <boost/array.hpp> 00008 00009 namespace DAPTA { // Define namespace DAPTA 00010 00012 00016 class Vertex3d { 00017 public: 00018 typedef double CoordType; 00019 typedef boost::array<CoordType,3> CoordArrayType; 00020 00021 static const int dimension = 3; 00022 00023 Vertex3d(Vertex3d *copy) { 00024 coords.at(0) = copy->coords.at(0); 00025 coords.at(1) = copy->coords.at(1); 00026 coords.at(2) = copy->coords.at(2); 00027 globalID = 0; 00028 00029 for(int i=0; i<3; i++) { 00030 u0[i] = copy->u0[i]; 00031 u1[i] = copy->u1[i]; 00032 f[i] = copy->f[i]; 00033 cons[i] = copy->cons[i]; 00034 f_add[i] = copy->f_add[i]; 00035 u1_add[i] = copy->u1_add[i]; 00036 m = copy->m; 00037 } 00038 } 00039 Vertex3d(boost::array<CoordType,3> new_coords, int i=0) { 00040 coords.at(0) = new_coords.at(0); 00041 coords.at(1) = new_coords.at(1); 00042 coords.at(2) = new_coords.at(2); 00043 globalID = i; 00044 00045 for(int i=0; i<3; i++) { 00046 u0[i] = 0.0; 00047 u1[i] = 0.0; 00048 f[i] = 0.0; 00049 cons[i] = false; 00050 f_add[i] = 0.0; 00051 u1_add[i] = 0.0; 00052 m = 0.0; 00053 } 00054 } 00055 Vertex3d(double x, double y, double z, int i=0) { 00056 coords.at(0) = x; 00057 coords.at(1) = y; 00058 coords.at(2) = z; 00059 globalID = i; 00060 00061 for(int i=0; i<3; i++) { 00062 u0[i] = 0.0; 00063 u1[i] = 0.0; 00064 f[i] = 0.0; 00065 cons[i] = false; 00066 f_add[i] = 0.0; 00067 u1_add[i] = 0.0; 00068 m = 0.0; 00069 } 00070 } 00071 Vertex3d() { 00072 coords.at(0) = 0.0; 00073 coords.at(1) = 0.0; 00074 coords.at(2) = 0.0; 00075 globalID = 0; 00076 00077 for(int i=0; i<3; i++) { 00078 u0[i] = 0.0; 00079 u1[i] = 0.0; 00080 f[i] = 0.0; 00081 cons[i] = false; 00082 f_add[i] = 0.0; 00083 u1_add[i] = 0.0; 00084 m = 0.0; 00085 } 00086 } 00087 ~Vertex3d() {;} 00088 00089 static const std::string deck_keyword; 00090 00091 boost::array<CoordType,3> coords; 00092 00093 int globalID; 00094 00095 void resetForces() { 00096 for(int i=0; i<3; i++) 00097 f[i] = f_add[i]; 00098 } 00099 void resetDisplacements() { 00100 for(int i=0; i<3; i++) { 00101 u0[i] = 0.0; 00102 u1[i] = 0.0; 00103 } 00104 } 00105 double u0[3]; 00106 double u1[3]; 00107 double f[3]; 00108 double m; 00109 00110 bool cons[3]; 00111 double f_add[3]; 00112 double u1_add[3]; 00113 private: 00114 }; 00115 const std::string Vertex3d::deck_keyword = "NODE"; 00116 00117 } // namespace DAPTA 00118 00119 #include "Vertex3d.cpp" 00120 00121 #endif
1.5.1