|
k-dot-p 0.1
|
00001 /* 00002 *structure_point: all the data for a point within a structure 00003 00004 00005 Copyright (C) 2009 Joseph Pingenot 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Affero General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Affero General Public License for more details. 00016 00017 You should have received a copy of the GNU Affero General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 */ 00021 00022 #ifndef __STRUCTURE_POINT_HXX_ 00023 #define __STRUCTURE_POINT_HXX_ 00024 00025 #include <libkdotp/material.h++> 00026 00027 namespace kdotp { 00028 namespace structure { 00029 00030 /*Basically, a structure + utility functions for keeping track of 00031 what's going on at a point within a structure. 00032 NOTE that the user is responsible for freeing material structures; 00033 we only play with the pointers.*/ 00034 enum strain_component { 00035 EXX, 00036 EYY, 00037 EZZ, 00038 EXY, 00039 EXZ, 00040 EYZ 00041 }; 00042 00043 struct point { 00044 public: 00045 /*Strain structure meanings 00046 0: exx 00047 1: eyy 00048 2: ezz 00049 3: exy 00050 4: exz 00051 5: eyz 00052 */ 00053 double strain[6]; 00054 double get_strain_component(enum strain_component sc) {return strain[sc];} 00055 material* mat; 00056 /*Default copy constructor is OK*/ 00057 /*Default destructor is also OK; we don't actually free the mat*/ 00058 /*Default = is also fine*/ 00059 private: 00060 /*Use the constructor; default constructor is silly.*/ 00061 point() {} 00062 }; 00063 00064 } 00065 } 00066 00067 00068 #endif