Nektar++
|
#include <DriverSteadyState.h>
Static Public Member Functions | |
static DriverSharedPtr | create (const LibUtilities::SessionReaderSharedPtr &pSession) |
Creates an instance of this class. More... | |
Static Public Member Functions inherited from Nektar::SolverUtils::DriverModifiedArnoldi | |
static DriverSharedPtr | create (const LibUtilities::SessionReaderSharedPtr &pSession) |
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) |
Constructor. More... | |
virtual SOLVER_UTILS_EXPORT | ~DriverSteadyState () |
Destructor. More... | |
virtual SOLVER_UTILS_EXPORT void | v_InitObject (ostream &out=cout) |
Second-stage initialisation. More... | |
virtual SOLVER_UTILS_EXPORT void | v_Execute (ostream &out=cout) |
Virtual function for solve implementation. More... | |
Protected Member Functions inherited from Nektar::SolverUtils::DriverModifiedArnoldi | |
DriverModifiedArnoldi (const LibUtilities::SessionReaderSharedPtr pSession) | |
Constructor. More... | |
virtual | ~DriverModifiedArnoldi () |
Destructor. More... | |
Protected Member Functions inherited from Nektar::SolverUtils::DriverArnoldi | |
DriverArnoldi (const LibUtilities::SessionReaderSharedPtr pSession) | |
Constructor. More... | |
virtual | ~DriverArnoldi () |
Destructor. 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 (ostream &evlout, const int k, const NekDouble real, const NekDouble imag, NekDouble resid=NekConstants::kNekUnsetDouble, bool DumpInverse=true) |
virtual Array< OneD, NekDouble > | v_GetRealEvl (void) |
virtual Array< OneD, NekDouble > | v_GetImagEvl (void) |
Protected Member Functions inherited from Nektar::SolverUtils::Driver | |
Driver (const LibUtilities::SessionReaderSharedPtr pSession) | |
Initialises EquationSystem class members. 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 Attributes | |
int | m_stepCounter |
int | m_Check |
int | m_Check_BaseFlow |
NekDouble | TOL |
int | m_infosteps |
int | m_checksteps |
int | NumVar_SFD |
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 |
Friends | |
class | MemoryManager< DriverSteadyState > |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::SolverUtils::DriverArnoldi | |
int | m_kdim |
int | m_nvec |
Dimension of Krylov subspace. More... | |
int | m_nits |
Number of vectors to test. More... | |
NekDouble | m_evtol |
Maxmum number of iterations. More... | |
NekDouble | m_period |
Tolerance of iteratiosn. More... | |
bool | m_timeSteppingAlgorithm |
Period of time stepping algorithm. More... | |
int | m_infosteps |
underlying operator is time stepping More... | |
int | m_nfields |
interval to dump information if required. More... | |
NekDouble | m_realShift |
NekDouble | m_imagShift |
int | m_negatedOp |
Array< OneD, NekDouble > | m_real_evl |
Operator in solve call is negated. More... | |
Array< OneD, NekDouble > | m_imag_evl |
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 |
I the Coupling between SFD and arnoldi. 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... | |
Definition at line 49 of file DriverSteadyState.h.
|
protected |
Constructor.
Definition at line 54 of file DriverSteadyState.cpp.
|
protectedvirtual |
void Nektar::SolverUtils::DriverSteadyState::ComputeOptimization | ( | ) |
Definition at line 356 of file DriverSteadyState.cpp.
References GradientDescentMethod(), m_Delta, Nektar::SolverUtils::DriverArnoldi::m_kdim, m_X, ReadEVfile(), and SetSFDOperator().
Referenced by v_Execute().
void Nektar::SolverUtils::DriverSteadyState::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 | ||
) |
Encapsulated SFD method
Definition at line 336 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().
void Nektar::SolverUtils::DriverSteadyState::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 | ||
) |
This routine evaluates |q-qBar|_inf (and |q1-q0|_inf) and writes the values in "ConvergenceHistory.txt"
Definition at line 580 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::Timer::Start(), Nektar::Timer::Stop(), Nektar::Timer::TimePerTest(), timer, and totalTime.
Referenced by v_Execute().
|
inlinestatic |
Creates an instance of this class.
Definition at line 55 of file DriverSteadyState.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
void Nektar::SolverUtils::DriverSteadyState::EvalEV_ScalarSFD | ( | const NekDouble & | X_input, |
const NekDouble & | Delta_input, | ||
const complex< NekDouble > & | alpha, | ||
NekDouble & | MaxEV | ||
) |
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 472 of file DriverSteadyState.cpp.
Referenced by GradientDescentMethod().
void Nektar::SolverUtils::DriverSteadyState::GradientDescentMethod | ( | const complex< NekDouble > & | alpha, |
NekDouble & | X_output, | ||
NekDouble & | Delta_output | ||
) |
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) = *u(n).
Definition at line 386 of file DriverSteadyState.cpp.
References EvalEV_ScalarSFD().
Referenced by ComputeOptimization(), and v_Execute().
void Nektar::SolverUtils::DriverSteadyState::PrintSummarySFD | ( | ) |
Definition at line 634 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().
void Nektar::SolverUtils::DriverSteadyState::ReadEVfile | ( | int & | KrylovSubspaceDim, |
NekDouble & | growthEV, | ||
NekDouble & | frequencyEV | ||
) |
Definition at line 508 of file DriverSteadyState.cpp.
References ASSERTL0, and Nektar::SolverUtils::Driver::m_session.
Referenced by ComputeOptimization().
void Nektar::SolverUtils::DriverSteadyState::SetSFDOperator | ( | const NekDouble | X_input, |
const NekDouble | Delta_input | ||
) |
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 323 of file DriverSteadyState.cpp.
References M11, M12, M21, M22, and m_dt.
Referenced by ComputeOptimization(), and v_Execute().
|
protectedvirtual |
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 78 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::Timer::Start(), timer, TOL, totalTime, and Nektar::SolverUtils::DriverModifiedArnoldi::v_Execute().
|
protectedvirtual |
Second-stage initialisation.
Reimplemented from Nektar::SolverUtils::DriverModifiedArnoldi.
Definition at line 72 of file DriverSteadyState.cpp.
References Nektar::SolverUtils::DriverModifiedArnoldi::v_InitObject().
|
friend |
Definition at line 52 of file DriverSteadyState.h.
|
private |
Definition at line 152 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 151 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
static |
Name of the class.
Definition at line 64 of file DriverSteadyState.h.
|
private |
Definition at line 130 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 147 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 146 of file DriverSteadyState.h.
Referenced by v_Execute().
|
staticprotected |
Definition at line 118 of file DriverSteadyState.h.
|
private |
Definition at line 132 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
For adaptive SFD method.
Definition at line 150 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 155 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 154 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition of the SFD operator.
Definition at line 141 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 142 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 143 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 144 of file DriverSteadyState.h.
Referenced by ComputeSFD(), and SetSFDOperator().
|
private |
Definition at line 122 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 123 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 126 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition of the SFD parameters:
Definition at line 136 of file DriverSteadyState.h.
Referenced by ComputeOptimization(), ConvergenceHistory(), PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 138 of file DriverSteadyState.h.
Referenced by SetSFDOperator(), and v_Execute().
|
private |
Definition at line 133 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 125 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 153 of file DriverSteadyState.h.
Referenced by v_Execute().
|
private |
Definition at line 121 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 137 of file DriverSteadyState.h.
Referenced by ComputeOptimization(), ConvergenceHistory(), PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 127 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 129 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().
|
private |
Definition at line 124 of file DriverSteadyState.h.
Referenced by PrintSummarySFD(), and v_Execute().
|
private |
Definition at line 131 of file DriverSteadyState.h.
Referenced by ConvergenceHistory(), and v_Execute().