36 #include "ParabolicGrowingDomainPdeModifier.hpp"
37 #include "CellBasedParabolicPdeSolver.hpp"
38 #include "AveragedSourceParabolicPde.hpp"
40 template<
unsigned DIM>
43 bool isNeumannBoundaryCondition,
47 isNeumannBoundaryCondition,
52 template<
unsigned DIM>
57 template<
unsigned DIM>
60 this->GenerateFeMesh(rCellPopulation);
63 std::shared_ptr<BoundaryConditionsContainer<DIM,DIM,1> > p_bcc = ConstructBoundaryConditionsContainer();
66 UpdateSolutionVector(rCellPopulation);
75 double current_time = p_simulation_time->GetTime();
76 double dt = p_simulation_time->GetTimeStep();
77 solver.
SetTimes(current_time,current_time + dt);
78 solver.SetTimeStep(dt);
81 Vec previous_solution = this->mSolution;
82 solver.SetInitialCondition(previous_solution);
86 this->mSolution = solver.Solve();
88 this->UpdateCellData(rCellPopulation);
91 template<
unsigned DIM>
98 EXCEPTION(
"ParabolicGrowingDomainPdeModifier cannot be used with an AveragedSourceParabolicPde. Use a ParabolicBoxDomainPdeModifier instead.");
102 this->GenerateFeMesh(rCellPopulation);
105 UpdateSolutionVector(rCellPopulation);
108 this->UpdateAtEndOfOutputTimeStep(rCellPopulation);
111 template<
unsigned DIM>
116 if (this->IsNeumannBoundaryCondition())
120 elem_iter != this->mpFeMesh->GetBoundaryElementIteratorEnd();
123 p_bcc->AddNeumannBoundaryCondition(*elem_iter, this->mpBoundaryCondition.get());
130 node_iter != this->mpFeMesh->GetBoundaryNodeIteratorEnd();
133 p_bcc->AddDirichletBoundaryCondition(*node_iter, this->mpBoundaryCondition.get());
140 template<
unsigned DIM>
150 std::string& variable_name = this->mDependentVariableName;
153 node_iter != this->mpFeMesh->GetNodeIteratorEnd();
158 node_iter != this->mpFeMesh->GetNodeIteratorEnd();
161 unsigned node_index = node_iter->GetIndex();
162 bool dirichlet_bc_applies = (node_iter->IsBoundaryNode()) && (!(this->IsNeumannBoundaryCondition()));
163 double boundary_value = this->GetBoundaryCondition()->GetValue(node_iter->rGetLocation());
165 double solution_at_node = rCellPopulation.
GetCellDataItemAtPdeNode(node_index, variable_name, dirichlet_bc_applies, boundary_value);
172 template<
unsigned DIM>
void OutputSimulationModifierParameters(out_stream &rParamsFile)
BoundaryElementIterator GetBoundaryElementIteratorBegin() const
void UpdateSolutionVector(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
#define EXCEPTION(message)
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
static SimulationTime * Instance()
virtual void UpdateAtEndOfTimeStep(AbstractCellPopulation< DIM, DIM > &rCellPopulation)
ParabolicGrowingDomainPdeModifier(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)
virtual std::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 1 > > ConstructBoundaryConditionsContainer()
virtual void SetupSolve(AbstractCellPopulation< DIM, DIM > &rCellPopulation, std::string outputDirectory)
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
void OutputSimulationModifierParameters(out_stream &rParamsFile)
void SetTimes(double tStart, double tEnd)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
virtual double GetCellDataItemAtPdeNode(unsigned pdeNodeIndex, std::string &rVariableName, bool dirichletBoundaryConditionApplies=false, double dirichletBoundaryValue=0.0)=0
NodeIterator GetNodeIteratorBegin(bool skipDeletedNodes=true)
virtual ~ParabolicGrowingDomainPdeModifier()