36#include "AbstractConductivityTensors.hpp"
40template<
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];
55template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
60template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
63 mUseFibreOrientation =
true;
64 mFibreOrientationFile = rFibreOrientationFile;
67template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
72 EXCEPTION(
"Wrong number of conductivities provided");
75 mUseNonConstantConductivities =
false;
76 mConstantConductivities = constantConductivities;
79template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
84 EXCEPTION(
"Wrong number of conductivities provided");
87 mUseNonConstantConductivities =
false;
88 mConstantConductivities = constantConductivities;
91template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
96 EXCEPTION(
"Wrong number of conductivities provided");
99 mUseNonConstantConductivities =
false;
100 mConstantConductivities = constantConductivities;
103template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
106 mUseNonConstantConductivities =
true;
107 mpNonConstantConductivities = pNonConstantConductivities;
110template<
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];
#define EXCEPTION(message)
Forward declaration which is going to be used for friendship.
void SetNonConstantConductivities(std::vector< c_vector< double, SPACE_DIM > > *pNonConstantConductivities)
c_matrix< double, SPACE_DIM, SPACE_DIM > & operator[](const unsigned global_index)
void SetConstantConductivities(c_vector< double, 1 > constantConductivities)
void SetFibreOrientationFile(const FileFinder &rFibreOrientationFile)