36 #include "EllipticGrowingDomainPdeModifier.hpp"
37 #include "CellBasedEllipticPdeSolver.hpp"
38 #include "AveragedSourceEllipticPde.hpp"
40 template<
unsigned DIM>
43 bool isNeumannBoundaryCondition,
47 isNeumannBoundaryCondition,
52 template<
unsigned DIM>
57 template<
unsigned DIM>
60 this->GenerateFeMesh(rCellPopulation);
66 VecGetSize(this->mSolution, &previous_solution_size);
70 bool is_previous_solution_size_correct = (previous_solution_size == (int)this->mpFeMesh->GetNumNodes());
74 if (is_previous_solution_size_correct)
77 VecDuplicate(this->mSolution, &initial_guess);
78 VecCopy(this->mSolution, initial_guess);
83 std::shared_ptr<BoundaryConditionsContainer<DIM,DIM,1> > p_bcc = this->ConstructBoundaryConditionsContainer();
91 if (is_previous_solution_size_correct)
93 this->mSolution = solver.
Solve(initial_guess);
99 Vec old_solution_copy = this->mSolution;
101 this->mSolution = solver.Solve();
104 if (old_solution_copy !=
nullptr)
110 this->UpdateCellData(rCellPopulation);
113 template<
unsigned DIM>
118 EXCEPTION(
"EllipticGrowingDomainPdeModifier cannot be used with an AveragedSourceEllipticPde. Use an EllipticBoxDomainPdeModifier instead.");
124 UpdateAtEndOfTimeStep(rCellPopulation);
125 this->UpdateAtEndOfOutputTimeStep(rCellPopulation);
128 template<
unsigned DIM>
134 assert(!(this->IsNeumannBoundaryCondition()));
136 node_iter != this->mpFeMesh->GetBoundaryNodeIteratorEnd();
139 p_bcc->AddDirichletBoundaryCondition(*node_iter, this->mpBoundaryCondition.get());
145 template<
unsigned DIM>
virtual std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > ConstructBoundaryConditionsContainer()
Vec Solve(Vec initialGuess=nullptr)
#define EXCEPTION(message)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
void OutputSimulationModifierParameters(out_stream &rParamsFile)
virtual ~EllipticGrowingDomainPdeModifier()
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
void OutputSimulationModifierParameters(out_stream &rParamsFile)
virtual void UpdateAtEndOfTimeStep(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
EllipticGrowingDomainPdeModifier(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)