36 #include "EllipticBoxDomainPdeModifier.hpp"
37 #include "SimpleLinearEllipticSolver.hpp"
39 template<
unsigned DIM>
42 bool isNeumannBoundaryCondition,
48 isNeumannBoundaryCondition,
55 template<
unsigned DIM>
60 template<
unsigned DIM>
64 std::shared_ptr<BoundaryConditionsContainer<DIM,DIM,1> > p_bcc = ConstructBoundaryConditionsContainer(rCellPopulation);
66 this->UpdateCellPdeElementMap(rCellPopulation);
70 this->SetUpSourceTermsForAveragedSourcePde(this->mpFeMesh, &this->mCellPdeElementMap);
79 Vec old_solution_copy = this->mSolution;
80 this->mSolution = solver.Solve();
81 if (old_solution_copy !=
nullptr)
86 this->UpdateCellData(rCellPopulation);
89 template<
unsigned DIM>
95 UpdateAtEndOfTimeStep(rCellPopulation);
96 this->UpdateAtEndOfOutputTimeStep(rCellPopulation);
99 template<
unsigned DIM>
106 assert(!(this->IsNeumannBoundaryCondition()));
108 if (!this->mSetBcsOnBoxBoundary)
111 std::set<unsigned> coarse_element_indices_in_map;
113 cell_iter != rCellPopulation.
End();
116 coarse_element_indices_in_map.insert(this->mCellPdeElementMap[*cell_iter]);
120 std::set<unsigned> coarse_mesh_boundary_node_indices;
121 for (
unsigned i=0; i<this->mpFeMesh->GetNumElements(); i++)
123 if (coarse_element_indices_in_map.find(i) == coarse_element_indices_in_map.end())
126 for (
unsigned j=0; j<DIM+1; j++)
129 coarse_mesh_boundary_node_indices.insert(node_index);
135 for (std::set<unsigned>::iterator iter = coarse_mesh_boundary_node_indices.begin();
136 iter != coarse_mesh_boundary_node_indices.end();
139 p_bcc->AddDirichletBoundaryCondition(this->mpFeMesh->GetNode(*iter), this->mpBoundaryCondition.get(), 0,
false);
145 node_iter != this->mpFeMesh->GetBoundaryNodeIteratorEnd();
148 p_bcc->AddDirichletBoundaryCondition(*node_iter, this->mpBoundaryCondition.get());
155 template<
unsigned DIM>
unsigned GetNodeGlobalIndex(unsigned localIndex) const
virtual ~EllipticBoxDomainPdeModifier()
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
void OutputSimulationModifierParameters(out_stream &rParamsFile)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
virtual void UpdateAtEndOfTimeStep(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
void OutputSimulationModifierParameters(out_stream &rParamsFile)
EllipticBoxDomainPdeModifier(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 std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > ConstructBoundaryConditionsContainer(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)