Nektar++
|
#include <DriverSteadyState.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 Member Functions inherited from Nektar::SolverUtils::DriverModifiedArnoldi | |
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... | |
Static Public Attributes inherited from Nektar::SolverUtils::DriverModifiedArnoldi | |
static std::string | className |
Name of the class. More... | |
Protected Member Functions | |
SOLVER_UTILS_EXPORT | DriverSteadyState (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) |
Constructor. More... | |
SOLVER_UTILS_EXPORT | ~DriverSteadyState () override=default |
Destructor. More... | |
SOLVER_UTILS_EXPORT void | v_InitObject (std::ostream &out=std::cout) override |
Initialises EquationSystem class members. 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::DriverModifiedArnoldi | |
DriverModifiedArnoldi (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) | |
Constructor. More... | |
~DriverModifiedArnoldi () override=default | |
Destructor. More... | |
void | v_InitObject (std::ostream &out=std::cout) override |
Virtual function for initialisation implementation. More... | |
void | v_Execute (std::ostream &out=std::cout) override |
Virtual function for solve implementation. More... | |
Protected Member Functions inherited from Nektar::SolverUtils::DriverArnoldi | |
DriverArnoldi (const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph) | |
Constructor. More... | |
~DriverArnoldi () override=default | |
Destructor. More... | |
void | v_InitObject (std::ostream &out=std::cout) override |
Virtual function for initialisation implementation. More... | |
void | v_Execute (std::ostream &out=std::cout) override |
Virtual function for solve implementation. More... | |
void | CopyArnoldiArrayToField (Array< OneD, NekDouble > &array) |
Copy Arnoldi storage to fields. More... | |
void | CopyFieldToArnoldiArray (Array< OneD, NekDouble > &array) |
Copy fields to Arnoldi storage. More... | |
void | CopyFwdToAdj () |
Copy the forward field to the adjoint system in transient growth calculations. More... | |
void | WriteFld (std::string file, std::vector< Array< OneD, NekDouble > > coeffs) |
Write coefficients to file. More... | |
void | WriteFld (std::string file, Array< OneD, NekDouble > coeffs) |
void | WriteEvs (std::ostream &evlout, const int k, const NekDouble real, const NekDouble imag, NekDouble resid=NekConstants::kNekUnsetDouble, bool DumpInverse=true) |
void | MaskInit () |
Init mask. More... | |
void | GetMaskInfo (std::vector< std::vector< LibUtilities::EquationSharedPtr > > &selectedDomains, std::set< int > &unselectedVariables) |
SOLVER_UTILS_EXPORT void | ArnoldiSummary (std::ostream &out) |
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... | |
Private Member Functions | |
void | PrintSummarySFD () |
void | ConvergenceHistory (const Array< OneD, const Array< OneD, NekDouble > > &qBar1, const Array< OneD, const Array< OneD, NekDouble > > &q0, NekDouble &MaxNormDiff_q_qBar, NekDouble &MaxNormDiff_q1_q0) |
void | ComputeSFD (const int i, const Array< OneD, const Array< OneD, NekDouble > > &q0, const Array< OneD, const Array< OneD, NekDouble > > &qBar0, Array< OneD, Array< OneD, NekDouble > > &q1, Array< OneD, Array< OneD, NekDouble > > &qBar1) |
void | EvalEV_ScalarSFD (const NekDouble &X_input, const NekDouble &Delta_input, const std::complex< NekDouble > &alpha, NekDouble &MaxEV) |
void | GradientDescentMethod (const std::complex< NekDouble > &alpha, NekDouble &X_output, NekDouble &Delta_output) |
void | ReadEVfile (int &KrylovSubspaceDim, NekDouble &growthEV, NekDouble &frequencyEV) |
void | ComputeOptimization () |
void | SetSFDOperator (const NekDouble X_input, const NekDouble Delta_input) |
Private Attributes | |
int | m_stepCounter |
int | m_Check |
int | m_Check_BaseFlow |
NekDouble | TOL |
int | m_infosteps |
int | m_checksteps |
int | NumVar_SFD |
LibUtilities::Timer | timer |
NekDouble | cpuTime |
NekDouble | totalTime |
NekDouble | elapsed |
std::ofstream | m_file |
NekDouble | m_Delta |
Definition of the SFD parameters: More... | |
NekDouble | m_X |
NekDouble | m_dt |
NekDouble | M11 |
Definition of the SFD operator. More... | |
NekDouble | M12 |
NekDouble | M21 |
NekDouble | M22 |
NekDouble | Diff_q_qBar |
NekDouble | Diff_q1_q0 |
bool | FlowPartiallyConverged |
For adaptive SFD method. More... | |
NekDouble | AdaptiveTOL |
NekDouble | AdaptiveTime |
int | m_NonConvergingStepsCounter |
NekDouble | GrowthRateEV |
NekDouble | FrequencyEV |
Static Private Attributes | |
static std::string | driverLookupId |
Friends | |
class | MemoryManager< DriverSteadyState > |
Definition at line 44 of file DriverSteadyState.h.
|
protected |
Constructor.
Definition at line 56 of file DriverSteadyState.cpp.
|
overrideprotecteddefault |
Destructor.
|
private |
Definition at line 368 of file DriverSteadyState.cpp.
References GradientDescentMethod(), m_Delta, Nektar::SolverUtils::DriverArnoldi::m_kdim, m_X, ReadEVfile(), and SetSFDOperator().
Referenced by v_Execute().
|
private |
Encapsulated SFD method
Definition at line 348 of file DriverSteadyState.cpp.
References M11, M12, M21, M22, Nektar::SolverUtils::Driver::m_equ, Nektar::SolverUtils::Driver::m_nequ, and Vmath::Svtvp().
Referenced by v_Execute().
|
private |
This routine evaluates |q-qBar|_inf (and |q1-q0|_inf) and writes the values in "ConvergenceHistory.txt"
Definition at line 592 of file DriverSteadyState.cpp.
References cpuTime, elapsed, Nektar::SolverUtils::Driver::m_comm, m_Delta, Nektar::SolverUtils::Driver::m_equ, m_file, Nektar::SolverUtils::Driver::m_nequ, m_stepCounter, m_X, NumVar_SFD, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), timer, and totalTime.
Referenced by v_Execute().
|
inlinestatic |
Creates an instance of this class.
Definition at line 50 of file DriverSteadyState.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.
|
private |
This routine evaluates the maximum eigenvalue of the SFD system when applied to the 1D model u(n+1) = alpha*u(n)
Definition at line 481 of file DriverSteadyState.cpp.
References tinysimd::abs(), Nektar::UnitTests::d(), and tinysimd::sqrt().
Referenced by GradientDescentMethod().
|
private |
This routine implements a gradient descent method to find the parameters X end Delta which give the minimum eigenlavue of the SFD problem applied to the scalar case u(n+1) = \alpha*u(n).
Definition at line 398 of file DriverSteadyState.cpp.
References tinysimd::abs(), and EvalEV_ScalarSFD().
Referenced by ComputeOptimization(), and v_Execute().
|
private |
Definition at line 644 of file DriverSteadyState.cpp.
References AdaptiveTime, AdaptiveTOL, Nektar::SolverUtils::eAdaptiveSFD, m_Delta, Nektar::SolverUtils::Driver::m_EvolutionOperator, m_X, and TOL.
Referenced by v_Execute().
|
private |
Definition at line 522 of file DriverSteadyState.cpp.
References ASSERTL0, and Nektar::SolverUtils::Driver::m_session.
Referenced by ComputeOptimization().
|
private |
This routine defines the encapsulated SFD operator with first-order splitting and exact resolution of the second subproblem. (See http://scitation.aip.org/content/aip/journal/pof2/26/3/10.1063/1.4867482 for details)
Definition at line 333 of file DriverSteadyState.cpp.
References M11, M12, M21, M22, and m_dt.
Referenced by ComputeOptimization(), and v_Execute().
|
overrideprotectedvirtual |
Virtual function for solve implementation.
Definition of variables used in this algorithm
Call the Navier-Stokes solver for one time step
Copy the current flow field into q0
Apply the linear operator to the outcome of the solver
Update qBar
Copy the output of the SFD method into the current flow field
Loop for the adaptive SFD method
We save the final solution into a .fld file
Reimplemented from Nektar::SolverUtils::DriverModifiedArnoldi.
Definition at line 74 of file DriverSteadyState.cpp.
References AdaptiveTime, AdaptiveTOL, ComputeOptimization(), ComputeSFD(), ConvergenceHistory(), cpuTime, Diff_q1_q0, Diff_q_qBar, Nektar::SolverUtils::eAdaptiveSFD, elapsed, FlowPartiallyConverged, FrequencyEV, GradientDescentMethod(), GrowthRateEV, m_Check, m_Check_BaseFlow, m_checksteps, Nektar::SolverUtils::Driver::m_comm, m_Delta, m_dt, Nektar::SolverUtils::Driver::m_equ, Nektar::SolverUtils::Driver::m_EvolutionOperator, m_file, m_infosteps, Nektar::SolverUtils::Driver::m_nequ, m_NonConvergingStepsCounter, Nektar::SolverUtils::Driver::m_session, m_stepCounter, m_X, NumVar_SFD, PrintSummarySFD(), Nektar::LibUtilities::ReduceSum, SetSFDOperator(), Nektar::LibUtilities::Timer::Start(), timer, TOL, totalTime, and Nektar::SolverUtils::DriverModifiedArnoldi::v_Execute().
|
overrideprotectedvirtual |
Initialises EquationSystem class members.
Reimplemented from Nektar::SolverUtils::DriverModifiedArnoldi.
Definition at line 66 of file DriverSteadyState.cpp.
References Nektar::SolverUtils::DriverModifiedArnoldi::v_InitObject().
|
friend |
Definition at line 1 of file DriverSteadyState.h.
|
private |
Definition at line 111 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 110 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
static |
Name of the class.
Definition at line 61 of file DriverSteadyState.h.
|
private |
Definition at line 89 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 106 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 105 of file DriverSteadyState.h.
Referenced by v_Execute().
|
staticprivate |
Definition at line 144 of file DriverSteadyState.h.
|
private |
Definition at line 91 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
For adaptive SFD method.
Definition at line 109 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 114 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 113 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition of the SFD operator.
Definition at line 100 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 101 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 102 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 103 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 81 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 82 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 85 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition of the SFD parameters:
Definition at line 95 of file DriverSteadyState.h.
Referenced by ComputeOptimization(), ConvergenceHistory(), PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 97 of file DriverSteadyState.h.
Referenced by SetSFDOperator(), and v_Execute().
|
private |
Definition at line 92 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 84 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 112 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 80 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 96 of file DriverSteadyState.h.
Referenced by ComputeOptimization(), ConvergenceHistory(), PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 86 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 88 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 83 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 90 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().