36 #include "AbstractConductivityTensors.hpp"
40 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
43 mUseNonConstantConductivities(false),
44 mUseFibreOrientation(false),
47 double init_data[]={DBL_MAX, DBL_MAX, DBL_MAX};
49 for (
unsigned dim=0; dim<SPACE_DIM; dim++)
51 mConstantConductivities[dim] = init_data[dim];
55 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
60 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
63 mUseFibreOrientation =
true;
64 mFibreOrientationFile = rFibreOrientationFile;
67 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
72 EXCEPTION(
"Wrong number of conductivities provided");
75 mUseNonConstantConductivities =
false;
76 mConstantConductivities = constantConductivities;
79 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
84 EXCEPTION(
"Wrong number of conductivities provided");
87 mUseNonConstantConductivities =
false;
88 mConstantConductivities = constantConductivities;
91 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
96 EXCEPTION(
"Wrong number of conductivities provided");
99 mUseNonConstantConductivities =
false;
100 mConstantConductivities = constantConductivities;
103 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
106 mUseNonConstantConductivities =
true;
107 mpNonConstantConductivities = pNonConstantConductivities;
110 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
113 assert(mInitialised);
114 if (global_index >= this->mpMesh->GetNumElements() )
116 EXCEPTION(
"Conductivity tensor requested for element with global_index=" << global_index <<
", but there are only " << this->mpMesh->GetNumElements() <<
" elements in the mesh.");
119 if (!mUseNonConstantConductivities && !mUseFibreOrientation)
125 unsigned local_index = mpMesh->SolveElementMapping(global_index);
126 return mTensors[local_index];
void SetFibreOrientationFile(const FileFinder &rFibreOrientationFile)
void SetNonConstantConductivities(std::vector< c_vector< double, SPACE_DIM > > *pNonConstantConductivities)
#define EXCEPTION(message)
void SetConstantConductivities(c_vector< double, 1 > constantConductivities)
c_matrix< double, SPACE_DIM, SPACE_DIM > & operator[](const unsigned global_index)
Forward declaration which is going to be used for friendship.