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++;
156 mpExtracellularConductivityTensors->SetNonConstantConductivities(&hetero_extra_conductivities);
160 mpExtracellularConductivityTensors->SetConstantConductivities(extra_conductivities);
163 mpExtracellularConductivityTensors->Init(this->mpMesh);
166template <
unsigned SPACE_DIM>
169 if (mpExtracellularConductivityTensors)
171 delete mpExtracellularConductivityTensors;
176template <
unsigned SPACE_DIM>
179 assert(mpExtracellularConductivityTensors);
180 if (this->mpConductivityModifier==NULL)
182 return (*mpExtracellularConductivityTensors)[elementIndex];
186 return this->mpConductivityModifier->rGetModifiedConductivityTensor(elementIndex, (*mpExtracellularConductivityTensors)[elementIndex], 1u);