36 #include "BidomainTissue.hpp" 38 #include "DistributedVector.hpp" 39 #include "AxisymmetricConductivityTensors.hpp" 40 #include "OrthotropicConductivityTensors.hpp" 41 #include "ChastePoint.hpp" 42 #include "AbstractChasteRegion.hpp" 44 template <
unsigned SPACE_DIM>
53 template <
unsigned SPACE_DIM>
60 template <
unsigned SPACE_DIM>
69 case cp::media_type::Orthotropic:
73 assert(ortho_file.
Exists());
78 case cp::media_type::Axisymmetric:
87 case cp::media_type::NoFibreOrientation:
100 c_vector<double, SPACE_DIM> extra_conductivities;
106 std::vector<c_vector<double, SPACE_DIM> > hetero_extra_conductivities;
112 assert(hetero_extra_conductivities.size()==0);
114 hetero_extra_conductivities.resize(num_local_elements, extra_conductivities);
117 catch(std::bad_alloc &r_bad_alloc)
119 std::cout <<
"Failed to allocate std::vector of size " << num_local_elements << std::endl;
127 std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > conductivities_heterogeneity_areas;
128 std::vector< c_vector<double,3> > intra_h_conductivities;
129 std::vector< c_vector<double,3> > extra_h_conductivities;
131 intra_h_conductivities,
132 extra_h_conductivities);
134 unsigned local_element_index = 0;
137 iter != (this->
mpMesh)->GetElementIteratorEnd();
142 for (
unsigned region_index=0; region_index< conductivities_heterogeneity_areas.size(); region_index++)
145 if (conductivities_heterogeneity_areas[region_index]->DoesContain(element_centroid))
148 for (
unsigned i=0; i<SPACE_DIM; i++)
150 hetero_extra_conductivities[local_element_index][i] = extra_h_conductivities[region_index][i];
154 local_element_index++;
166 template <
unsigned SPACE_DIM>
176 template <
unsigned SPACE_DIM>
void SetFibreOrientationFile(const FileFinder &rFibreOrientationFile)
BidomainTissue(AbstractCardiacCellFactory< SPACE_DIM > *pCellFactory, bool exchangeHalos=false)
cp::media_type GetConductivityMedia() const
void CreateExtracellularConductivityTensors()
void SetNonConstantConductivities(std::vector< c_vector< double, SPACE_DIM > > *pNonConstantConductivities)
void GetExtracellularConductivities(c_vector< double, 3 > &rExtraConductivities) const
virtual void Init(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)=0
virtual unsigned GetNumLocalElements() const
void GetConductivityHeterogeneities(std::vector< boost::shared_ptr< AbstractChasteRegion< DIM > > > &conductivitiesHeterogeneityAreas, std::vector< c_vector< double, 3 > > &intraConductivities, std::vector< c_vector< double, 3 > > &extraConductivities) const
std::string mFibreFilePathNoExtension
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
c_matrix< double, SPACE_DIM, SPACE_DIM > & rGetModifiedConductivityTensor(unsigned elementIndex, const c_matrix< double, SPACE_DIM, SPACE_DIM > &rOriginalConductivity, unsigned domainIndex)
void SetConstantConductivities(c_vector< double, 1 > constantConductivities)
AbstractTetrahedralMesh< ELEMENT_DIM, ELEMENT_DIM > * mpMesh
bool IsMeshProvided() const
AbstractConductivityModifier< ELEMENT_DIM, ELEMENT_DIM > * mpConductivityModifier
AbstractConductivityTensors< SPACE_DIM, SPACE_DIM > * mpExtracellularConductivityTensors
static HeartConfig * Instance()
bool GetConductivityHeterogeneitiesProvided() const
const c_matrix< double, SPACE_DIM, SPACE_DIM > & rGetExtracellularConductivityTensor(unsigned elementIndex)