Nektar++
|
Base class for the development of solvers. More...
#include <DriverParareal.h>
Static Public Member Functions | |
static DriverSharedPtr | create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static std::string | className |
Name of the class. More... | |
Protected Member Functions | |
SOLVER_UTILS_EXPORT | DriverParareal (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) |
Constructor. More... | |
SOLVER_UTILS_EXPORT | ~DriverParareal () override=default |
Destructor. More... | |
SOLVER_UTILS_EXPORT void | v_InitObject (std::ostream &out=std::cout) override |
Virtual function for initialisation implementation. More... | |
SOLVER_UTILS_EXPORT void | v_Execute (std::ostream &out=std::cout) override |
Virtual function for solve implementation. More... | |
Protected Member Functions inherited from Nektar::SolverUtils::DriverParallelInTime | |
SOLVER_UTILS_EXPORT | DriverParallelInTime (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) |
Constructor. More... | |
SOLVER_UTILS_EXPORT | ~DriverParallelInTime () override=default |
Destructor. More... | |
SOLVER_UTILS_EXPORT void | v_InitObject (std::ostream &out=std::cout) override |
Virtual function for initialisation implementation. More... | |
SOLVER_UTILS_EXPORT void | v_Execute (std::ostream &out=std::cout) override |
Virtual function for solve implementation. More... | |
void | SetParallelInTimeEquationSystem (std::string AdvectiveType) |
void | GetParametersFromSession (void) |
void | InitialiseEqSystem (bool turnoff_output) |
void | InitialiseInterpolationField (void) |
void | PrintSolverInfo (std::ostream &out=std::cout) |
void | PrintHeader (const std::string &title, const char c) |
void | RecvFromPreviousProc (Array< OneD, Array< OneD, NekDouble > > &array, int &convergence) |
void | RecvFromPreviousProc (Array< OneD, NekDouble > &array) |
void | SendToNextProc (Array< OneD, Array< OneD, NekDouble > > &array, int &convergence) |
void | SendToNextProc (Array< OneD, NekDouble > &array) |
void | CopySolutionVector (const Array< OneD, const Array< OneD, NekDouble > > &in, Array< OneD, Array< OneD, NekDouble > > &out) |
void | CopyFromPhysField (const size_t timeLevel, Array< OneD, Array< OneD, NekDouble > > &out) |
void | CopyToPhysField (const size_t timeLevel, const Array< OneD, const Array< OneD, NekDouble > > &in) |
void | UpdateFieldCoeffs (const size_t timeLevel, const Array< OneD, const Array< OneD, NekDouble > > &in=NullNekDoubleArrayOfArray) |
void | EvaluateExactSolution (const size_t timeLevel, const NekDouble &time) |
void | SolutionConvergenceMonitoring (const size_t timeLevel, const size_t iter) |
void | SolutionConvergenceSummary (const size_t timeLevel) |
void | UpdateErrorNorm (const size_t timeLevel, const bool normalized) |
void | PrintErrorNorm (const size_t timeLevel, const bool normalized) |
NekDouble | vL2ErrorMax (void) |
NekDouble | EstimateCommunicationTime (Array< OneD, Array< OneD, NekDouble > > &buffer1, Array< OneD, Array< OneD, NekDouble > > &buffer2) |
void | Interpolate (const Array< OneD, MultiRegions::ExpListSharedPtr > &infield, const Array< OneD, MultiRegions::ExpListSharedPtr > &outfield, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) |
Protected Member Functions inherited from Nektar::SolverUtils::Driver | |
Driver (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) | |
Initialises EquationSystem class members. More... | |
virtual SOLVER_UTILS_EXPORT void | v_InitObject (std::ostream &out=std::cout) |
Virtual function for initialisation implementation. More... | |
virtual SOLVER_UTILS_EXPORT void | v_Execute (std::ostream &out=std::cout)=0 |
Virtual function for solve implementation. More... | |
Static Protected Attributes | |
static std::string | driverLookupId |
Static Protected Attributes inherited from Nektar::SolverUtils::Driver | |
static std::string | evolutionOperatorLookupIds [] |
static std::string | evolutionOperatorDef |
static std::string | driverDefault |
Private Member Functions | |
void | AllocateMemory (void) |
void | AssertParameters (void) |
void | UpdateInitialConditionFromSolver (const size_t timeLevel) |
void | UpdateSolverInitialCondition (const size_t timeLevel) |
void | UpdateSolution (const size_t timeLevel, const NekDouble time, const size_t nstep, const size_t wd, const size_t iter) |
void | CorrectionWithOldCoarseSolution (void) |
void | CorrectionWithNewCoarseSolution (void) |
void | InterpolateCoarseSolution (void) |
void | ApplyWindowing (const size_t w) |
void | CopyConvergedCheckPoints (const size_t w, const size_t k) |
void | WriteTimeChunkOuput (void) |
Private Attributes | |
Array< OneD, Array< OneD, NekDouble > > | m_initialCondition |
Array< OneD, Array< OneD, NekDouble > > | m_fineSolution |
Array< OneD, Array< OneD, NekDouble > > | m_coarseSolution |
Static Private Attributes | |
static constexpr size_t | m_fineLevel = 0 |
static constexpr size_t | m_coarseLevel = 1 |
Friends | |
class | MemoryManager< DriverParareal > |
Additional Inherited Members | |
Public Member Functions inherited from Nektar::SolverUtils::Driver | |
virtual | ~Driver ()=default |
Destructor. More... | |
SOLVER_UTILS_EXPORT void | InitObject (std::ostream &out=std::cout) |
Initialise Object. More... | |
SOLVER_UTILS_EXPORT void | Execute (std::ostream &out=std::cout) |
Execute driver. More... | |
SOLVER_UTILS_EXPORT Array< OneD, EquationSystemSharedPtr > | GetEqu () |
Protected Attributes inherited from Nektar::SolverUtils::DriverParallelInTime | |
NekDouble | m_totalTime |
Total time integration interval. More... | |
NekDouble | m_chunkTime |
Time integration interval per chunk. More... | |
NekDouble | m_time |
Local time. More... | |
size_t | m_numChunks |
Number of time chunks. More... | |
size_t | m_chunkRank |
Rank in time. More... | |
size_t | m_iterMaxPIT |
Maximum number of parallel-in-time iteration. More... | |
size_t | m_numWindowsPIT |
bool | m_exactSolution |
Using exact solution to compute error norms. More... | |
NekDouble | m_tolerPIT |
ParallelInTime tolerance. More... | |
size_t | m_nVar |
Number of variables. More... | |
size_t | m_nTimeLevel |
Number of time levels. More... | |
Array< OneD, size_t > | m_nsteps |
Number of time steps for each time level. More... | |
Array< OneD, NekDouble > | m_timestep |
Time step for each time level. More... | |
Array< OneD, size_t > | m_npts |
Number of dof for each time level. More... | |
Array< OneD, std::shared_ptr< UnsteadySystem > > | m_EqSys |
Equation system to solve. More... | |
Array< OneD, NekDouble > | m_vL2Errors |
Storage for parallel-in-time iteration. More... | |
Array< OneD, NekDouble > | m_vLinfErrors |
Array< OneD, Array< OneD, NekDouble > > | m_exactsoln |
Protected Attributes inherited from Nektar::SolverUtils::Driver | |
LibUtilities::CommSharedPtr | m_comm |
Communication object. More... | |
LibUtilities::SessionReaderSharedPtr | m_session |
Session reader object. More... | |
LibUtilities::SessionReaderSharedPtr | session_LinNS |
Coupling between SFD and arnoldi. More... | |
SpatialDomains::MeshGraphSharedPtr | m_graph |
MeshGraph object. More... | |
Array< OneD, EquationSystemSharedPtr > | m_equ |
Equation system to solve. More... | |
int | m_nequ |
number of equations More... | |
enum EvolutionOperatorType | m_EvolutionOperator |
Evolution Operator. More... | |
Base class for the development of solvers.
Definition at line 44 of file DriverParareal.h.
|
protected |
Constructor.
Definition at line 52 of file DriverParareal.cpp.
|
overrideprotecteddefault |
Destructor.
Definition at line 278 of file DriverParareal.cpp.
References m_coarseLevel, m_coarseSolution, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, m_fineSolution, m_initialCondition, Nektar::SolverUtils::DriverParallelInTime::m_npts, and Nektar::SolverUtils::DriverParallelInTime::m_nVar.
Referenced by v_InitObject().
|
private |
Definition at line 474 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::m_chunkRank, Nektar::SolverUtils::Driver::m_comm, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, m_initialCondition, Nektar::SolverUtils::DriverParallelInTime::m_npts, Nektar::SolverUtils::DriverParallelInTime::m_numChunks, Nektar::SolverUtils::DriverParallelInTime::m_numWindowsPIT, Nektar::SolverUtils::DriverParallelInTime::m_nVar, Vmath::Vcopy(), and Nektar::UnitTests::w().
Referenced by v_Execute().
Definition at line 299 of file DriverParareal.cpp.
References ASSERTL0, m_coarseLevel, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, Nektar::SolverUtils::DriverParallelInTime::m_nsteps, Nektar::SolverUtils::DriverParallelInTime::m_numChunks, Nektar::SolverUtils::DriverParallelInTime::m_numWindowsPIT, and Nektar::SolverUtils::DriverParallelInTime::m_timestep.
Referenced by v_Execute().
|
private |
Output directory name.
Definition at line 504 of file DriverParareal.cpp.
References CellMLToNektar.pycml::copy(), Nektar::SolverUtils::DriverParallelInTime::m_chunkRank, Nektar::SolverUtils::Driver::m_comm, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, Nektar::SolverUtils::DriverParallelInTime::m_nsteps, Nektar::SolverUtils::DriverParallelInTime::m_nTimeLevel, Nektar::SolverUtils::DriverParallelInTime::m_numChunks, Nektar::LibUtilities::ReduceMax, and Nektar::UnitTests::w().
Referenced by v_Execute().
Definition at line 444 of file DriverParareal.cpp.
References InterpolateCoarseSolution(), m_coarseSolution, m_fineLevel, m_fineSolution, Nektar::SolverUtils::DriverParallelInTime::m_npts, Nektar::SolverUtils::DriverParallelInTime::m_nVar, and Vmath::Vadd().
Referenced by v_Execute().
Definition at line 431 of file DriverParareal.cpp.
References m_coarseSolution, m_fineLevel, m_fineSolution, Nektar::SolverUtils::DriverParallelInTime::m_npts, Nektar::SolverUtils::DriverParallelInTime::m_nVar, and Vmath::Vsub().
Referenced by v_Execute().
|
inlinestatic |
Creates an instance of this class.
Definition at line 50 of file DriverParareal.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.
Definition at line 460 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::Interpolate(), m_coarseLevel, m_coarseSolution, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, Nektar::SolverUtils::DriverParallelInTime::m_npts, and Nektar::NullNekDoubleArrayOfArray.
Referenced by CorrectionWithNewCoarseSolution(), and v_Execute().
|
private |
Definition at line 378 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::Interpolate(), Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, m_initialCondition, and Nektar::NullNekDoubleArrayOfArray.
Referenced by v_Execute().
|
private |
Definition at line 400 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::m_chunkRank, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, Nektar::SolverUtils::DriverParallelInTime::m_nsteps, and Nektar::SolverUtils::DriverParallelInTime::m_numChunks.
Referenced by v_Execute().
|
private |
Definition at line 389 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::Interpolate(), Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, m_initialCondition, and Nektar::NullNekDoubleArrayOfArray.
Referenced by v_Execute().
|
overrideprotectedvirtual |
Virtual function for solve implementation.
Reimplemented from Nektar::SolverUtils::DriverParallelInTime.
Definition at line 74 of file DriverParareal.cpp.
References ApplyWindowing(), AssertParameters(), CopyConvergedCheckPoints(), Nektar::SolverUtils::DriverParallelInTime::CopyFromPhysField(), Nektar::SolverUtils::DriverParallelInTime::CopyToPhysField(), CorrectionWithNewCoarseSolution(), CorrectionWithOldCoarseSolution(), Nektar::LibUtilities::Timer::Elapsed(), Nektar::SolverUtils::DriverParallelInTime::EvaluateExactSolution(), CellMLToNektar.pycml::format, InterpolateCoarseSolution(), Nektar::SolverUtils::DriverParallelInTime::m_chunkRank, Nektar::SolverUtils::DriverParallelInTime::m_chunkTime, m_coarseLevel, m_coarseSolution, Nektar::SolverUtils::Driver::m_comm, Nektar::SolverUtils::DriverParallelInTime::m_EqSys, Nektar::SolverUtils::DriverParallelInTime::m_exactsoln, Nektar::SolverUtils::DriverParallelInTime::m_exactSolution, m_fineLevel, m_fineSolution, m_initialCondition, Nektar::SolverUtils::DriverParallelInTime::m_iterMaxPIT, Nektar::SolverUtils::DriverParallelInTime::m_nsteps, Nektar::SolverUtils::DriverParallelInTime::m_numChunks, Nektar::SolverUtils::DriverParallelInTime::m_numWindowsPIT, Nektar::SolverUtils::DriverParallelInTime::m_nVar, Nektar::SolverUtils::DriverParallelInTime::m_time, Nektar::SolverUtils::DriverParallelInTime::m_timestep, Nektar::SolverUtils::DriverParallelInTime::m_tolerPIT, Nektar::SolverUtils::DriverParallelInTime::m_totalTime, Nektar::SolverUtils::DriverParallelInTime::PrintHeader(), Nektar::SolverUtils::DriverParallelInTime::RecvFromPreviousProc(), Nektar::SolverUtils::DriverParallelInTime::SendToNextProc(), Nektar::SolverUtils::DriverParallelInTime::SolutionConvergenceMonitoring(), Nektar::SolverUtils::DriverParallelInTime::SolutionConvergenceSummary(), Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), UpdateInitialConditionFromSolver(), UpdateSolution(), UpdateSolverInitialCondition(), Nektar::SolverUtils::DriverParallelInTime::vL2ErrorMax(), Nektar::UnitTests::w(), and WriteTimeChunkOuput().
|
overrideprotectedvirtual |
Virtual function for initialisation implementation.
Reimplemented from Nektar::SolverUtils::DriverParallelInTime.
Definition at line 62 of file DriverParareal.cpp.
References AllocateMemory(), Nektar::SolverUtils::DriverParallelInTime::GetParametersFromSession(), Nektar::SolverUtils::DriverParallelInTime::InitialiseEqSystem(), Nektar::SolverUtils::DriverParallelInTime::PrintSolverInfo(), and Nektar::SolverUtils::DriverParallelInTime::v_InitObject().
Definition at line 565 of file DriverParareal.cpp.
References Nektar::SolverUtils::DriverParallelInTime::m_EqSys, m_fineLevel, Nektar::SolverUtils::DriverParallelInTime::PrintHeader(), and Nektar::SolverUtils::DriverParallelInTime::UpdateFieldCoeffs().
Referenced by v_Execute().
|
friend |
Definition at line 1 of file DriverParareal.h.
|
static |
Name of the class.
Definition at line 61 of file DriverParareal.h.
|
staticprotected |
Definition at line 79 of file DriverParareal.h.
|
staticconstexprprivate |
Definition at line 106 of file DriverParareal.h.
Referenced by AllocateMemory(), AssertParameters(), InterpolateCoarseSolution(), and v_Execute().
Definition at line 109 of file DriverParareal.h.
Referenced by AllocateMemory(), CorrectionWithNewCoarseSolution(), CorrectionWithOldCoarseSolution(), InterpolateCoarseSolution(), and v_Execute().
|
staticconstexprprivate |
Definition at line 105 of file DriverParareal.h.
Referenced by AllocateMemory(), ApplyWindowing(), AssertParameters(), CopyConvergedCheckPoints(), CorrectionWithNewCoarseSolution(), CorrectionWithOldCoarseSolution(), InterpolateCoarseSolution(), UpdateInitialConditionFromSolver(), UpdateSolverInitialCondition(), v_Execute(), and WriteTimeChunkOuput().
Definition at line 108 of file DriverParareal.h.
Referenced by AllocateMemory(), CorrectionWithNewCoarseSolution(), CorrectionWithOldCoarseSolution(), and v_Execute().
|
private |
Definition at line 107 of file DriverParareal.h.
Referenced by AllocateMemory(), ApplyWindowing(), UpdateInitialConditionFromSolver(), UpdateSolverInitialCondition(), and v_Execute().