90 unsigned cell_index = 0;
92 unsigned index_in_solution_repl = 0;
94 cell_iter != rCellPopulation.
End();
108 tet_node_index = cell_index;
113 tet_node_index = index_in_solution_repl;
114 index_in_solution_repl++;
117 double solution_at_node = solution_repl[tet_node_index];
119 cell_iter->GetCellData()->SetItem(this->mDependentVariableName, solution_at_node);
121 if (this->mOutputGradient)
124 c_vector<double, DIM> solution_gradient = zero_vector<double>(DIM);
126 Node<DIM>* p_tet_node = this->mpFeMesh->GetNode(tet_node_index);
134 c_matrix<double, DIM, DIM> jacobian, inverse_jacobian;
136 this->mpFeMesh->GetInverseJacobianForElement(*element_iter, jacobian, jacobian_det, inverse_jacobian);
138 c_matrix<double, DIM, DIM+1> grad_phi;
142 for (
unsigned node_index=0; node_index<DIM+1; node_index++)
144 double nodal_value = solution_repl[this->mpFeMesh->GetElement(*element_iter)->GetNodeGlobalIndex(node_index)];
146 for (
unsigned j=0; j<DIM; j++)
148 solution_gradient(j) += nodal_value* grad_phi(j, node_index);
159 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
162 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
163 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_y", solution_gradient(1));
166 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
167 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_y", solution_gradient(1));
168 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_z", solution_gradient(2));
void GenerateFeMesh(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
void OutputSimulationModifierParameters(out_stream &rParamsFile)
AbstractGrowingDomainPdeModifier(boost::shared_ptr< AbstractLinearPde< DIM, DIM > > pPde=boost::shared_ptr< AbstractLinearPde< DIM, DIM > >(), boost::shared_ptr< AbstractBoundaryCondition< DIM > > pBoundaryCondition=boost::shared_ptr< AbstractBoundaryCondition< DIM > >(), bool isNeumannBoundaryCondition=true, Vec solution=nullptr)
void UpdateCellData(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
virtual ~AbstractGrowingDomainPdeModifier()
static void ComputeTransformedBasisFunctionDerivatives(const ChastePoint< ELEMENT_DIM > &rPoint, const c_matrix< double, ELEMENT_DIM, ELEMENT_DIM > &rInverseJacobian, c_matrix< double, ELEMENT_DIM, ELEMENT_DIM+1 > &rReturnValue)