37 #ifndef ABSTRACTDYNAMICLINEARPDESOLVER_HPP_ 38 #define ABSTRACTDYNAMICLINEARPDESOLVER_HPP_ 41 #include "TimeStepper.hpp" 42 #include "AbstractLinearPdeSolver.hpp" 43 #include "PdeSimulationTime.hpp" 44 #include "AbstractTimeAdaptivityController.hpp" 45 #include "Hdf5DataWriter.hpp" 46 #include "Hdf5ToVtkConverter.hpp" 47 #include "Hdf5ToTxtConverter.hpp" 55 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
58 friend class TestSimpleLinearParabolicSolver;
160 void SetTimes(
double tStart,
double tEnd);
222 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
228 EXCEPTION(
"Output directory or filename prefix has not been set");
249 for (
unsigned i=0; i<PROBLEM_DIM; i++)
251 std::stringstream variable_name;
252 variable_name <<
"Variable_" << i;
261 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
281 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
289 EXCEPTION(
"Start time has to be less than end time");
295 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
300 EXCEPTION(
"Time step has to be greater than zero");
306 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
309 assert(initialCondition !=
nullptr);
313 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
317 if (PROBLEM_DIM == 1)
327 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
333 EXCEPTION(
"SetTimes() has not been called");
337 EXCEPTION(
"SetTimeStep() has not been called");
341 EXCEPTION(
"SetInitialCondition() has not been called");
374 bool timestep_changed =
false;
461 solution = next_solution;
499 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
505 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
508 assert(pTimeAdaptivityController !=
nullptr);
513 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
519 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
525 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
531 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
538 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM,
unsigned PROBLEM_DIM>
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
bool mOutputToParallelVtk
double mLastWorkingTimeStep
virtual void PrepareForSetupLinearSystem(Vec currentSolution)
Vec Solve(Vec lhsGuess=nullptr)
virtual void InitialiseForSolve(Vec initialSolution=nullptr)
void InitialiseHdf5Writer()
#define EXCEPTION(message)
void SetTimeStep(double dt)
static void BeginEvent(unsigned event)
void SetInitialCondition(Vec initialCondition)
void SetOutputToParallelVtk(bool output)
void ResetTimeStep(double dt)
void SetOutputDirectoryAndPrefix(std::string outputDirectory, std::string prefix)
void SetPrintingTimestepMultiple(unsigned multiple)
virtual void FollowingSolveLinearSystem(Vec currentSolution)
void AdvanceOneTimeStep()
void SetTimes(double tStart, double tEnd)
std::string mFilenamePrefix
void SetOutputToVtk(bool output)
void AdvanceAlongUnlimitedDimension()
AbstractTimeAdaptivityController * mpTimeAdaptivityController
int DefineVariable(const std::string &rVariableName, const std::string &rVariableUnits)
unsigned GetTotalTimeStepsTaken() const
void SetOutputToTxt(bool output)
double GetNextTimeStep(double currentTime, Vec currentSolution)
void PutVector(int variableID, Vec petscVector)
void SetTimeAdaptivityController(AbstractTimeAdaptivityController *pTimeAdaptivityController)
virtual void SetupLinearSystem(Vec currentSolution, bool computeMatrix)=0
std::vector< int > mVariableColumnIds
void DefineFixedDimension(long dimensionSize)
std::string mOutputDirectory
Hdf5DataWriter * mpHdf5Writer
void WriteOneStep(double time, Vec solution)
static void EndEvent(unsigned event)
virtual void FinaliseLinearSystem(Vec currentSolution)
void PutStripedVector(std::vector< int > variableIDs, Vec petscVector)
static void SetTime(double time)
void SetMatrixIsNotAssembled()
double GetNextTime() const
static void SetPdeTimeStepAndNextTime(double timestep, double next_time)
AbstractDynamicLinearPdeSolver(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
void PutUnlimitedVariable(double value)
LinearSystem * mpLinearSystem
unsigned mPrintingTimestepMultiple
virtual void EndDefineMode()
void DefineUnlimitedDimension(const std::string &rVariableName, const std::string &rVariableUnits, unsigned estimatedLength=1)