102 this->mpFeMesh->ConstructRegularSlabMesh(stepSize, pMeshCuboid->GetWidth(0));
105 this->mpFeMesh->ConstructRegularSlabMesh(stepSize, pMeshCuboid->GetWidth(0), pMeshCuboid->GetWidth(1));
108 this->mpFeMesh->ConstructRegularSlabMesh(stepSize, pMeshCuboid->GetWidth(0), pMeshCuboid->GetWidth(1), pMeshCuboid->GetWidth(2));
120 c_vector<double,DIM> centre_of_coarse_mesh = zero_vector<double>(DIM);
121 for (
unsigned i=0; i<this->mpFeMesh->GetNumNodes(); i++)
123 centre_of_coarse_mesh += this->mpFeMesh->GetNode(i)->rGetLocation();
125 centre_of_coarse_mesh /= this->mpFeMesh->GetNumNodes();
128 this->mpFeMesh->Translate(centre_of_cuboid - centre_of_coarse_mesh);
138 cell_iter != rCellPopulation.
End();
142 double solution_at_cell = 0.0;
145 unsigned elem_index = mCellPdeElementMap[*cell_iter];
152 for (
unsigned i=0; i<DIM+1; i++)
155 solution_at_cell += nodal_value * weights(i);
158 cell_iter->GetCellData()->SetItem(this->mDependentVariableName, solution_at_cell);
160 if (this->mOutputGradient)
163 c_vector<double, DIM> solution_gradient = zero_vector<double>(DIM);
166 c_matrix<double, DIM, DIM> jacobian, inverse_jacobian;
168 this->mpFeMesh->GetInverseJacobianForElement(elem_index, jacobian, jacobian_det, inverse_jacobian);
170 c_matrix<double, DIM, DIM+1> grad_phi;
173 for (
unsigned node_index=0; node_index<DIM+1; node_index++)
177 for (
unsigned j=0; j<DIM; j++)
179 solution_gradient(j) += nodal_value* grad_phi(j, node_index);
186 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
189 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
190 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_y", solution_gradient(1));
193 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_x", solution_gradient(0));
194 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_y", solution_gradient(1));
195 cell_iter->GetCellData()->SetItem(this->mDependentVariableName+
"_grad_z", solution_gradient(2));
void OutputSimulationModifierParameters(out_stream &rParamsFile)
AbstractBoxDomainPdeModifier(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, boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid=boost::shared_ptr< ChasteCuboid< DIM > >(), double stepSize=1.0, Vec solution=nullptr)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
bool AreBcsSetOnBoxBoundary()
virtual ~AbstractBoxDomainPdeModifier()
void GenerateFeMesh(boost::shared_ptr< ChasteCuboid< DIM > > pMeshCuboid, double stepSize)
boost::shared_ptr< ChasteCuboid< DIM > > mpMeshCuboid
void UpdateCellData(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
void SetBcsOnBoxBoundary(bool setBcsOnBoxBoundary)
void UpdateCellPdeElementMap(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
void InitialiseCellPdeElementMap(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
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)