00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ABSTRACTCONDUCTIVITYTENSORS_HPP_
00029 #define ABSTRACTCONDUCTIVITYTENSORS_HPP_
00030
00031 #include <vector>
00032 #include <string>
00033 #include <fstream>
00034 #include "UblasIncludes.hpp"
00035 #include "Exception.hpp"
00036
00037 template<unsigned SPACE_DIM>
00038 class AbstractConductivityTensors
00039 {
00040 protected:
00041 unsigned mNumElements;
00042
00043 bool mUseNonConstantConductivities;
00044 bool mUseFibreOrientation;
00045
00046
00047 c_vector<double, SPACE_DIM> mConstantConductivities;
00048
00049
00050 std::vector<c_vector<double, SPACE_DIM> >* mpNonConstantConductivities;
00051
00052
00053 std::vector< c_matrix<double,SPACE_DIM,SPACE_DIM> > mTensors;
00054
00055 bool mInitialised;
00056
00057 std::string mFibreOrientationFilename;
00058 std::ifstream mDataFile;
00059
00060
00061 void OpenFibreOrientationFile();
00062
00063 void CloseFibreOrientationFile();
00064
00065 unsigned GetTokensAtNextLine(std::vector<double>& tokens);
00066
00067 unsigned GetNumElementsFromFile();
00068
00069 public:
00070
00071 AbstractConductivityTensors();
00072
00073 virtual ~AbstractConductivityTensors();
00074
00080 void SetFibreOrientationFile(const std::string &rFibreOrientationFilename);
00081
00091 void SetConstantConductivities(c_vector<double, 1> constantConductivities);
00092
00093 void SetConstantConductivities(c_vector<double, 2> constantConductivities);
00094
00095 virtual void SetConstantConductivities(c_vector<double, 3> constantConductivities);
00096
00097
00105 void SetNonConstantConductivities(std::vector<c_vector<double, SPACE_DIM> >* pNonConstantConductivities);
00106
00110 virtual void Init() throw (Exception) = 0;
00111
00117 c_matrix<double,SPACE_DIM,SPACE_DIM>& operator[](const unsigned index);
00118 };
00119
00120
00121
00122 #endif