CppNoddy  0.92
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions | Variables
EVPOrrSommerfeldNeutralCurve_lapack.cpp File Reference
#include <cassert>
#include <EVP_bundle.h>
#include <BVP_bundle.h>
#include "../Utils_Fill.h"

Go to the source code of this file.

Classes

class  CppNoddy::Example::OS_evp_equation
 Define the OS equation for the global QZ EVP. More...
 
class  CppNoddy::Example::OS_bvp_equation
 Define the OSE for the local refinement procedure. More...
 
class  CppNoddy::Example::OS_evp_both_BC
 
class  CppNoddy::Example::OS_bvp_left_BC
 
class  CppNoddy::Example::OS_bvp_right_BC
 
class  CppNoddy::Example::Neutral_residual
 

Namespaces

namespace  CppNoddy
 A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechanics.
 
namespace  CppNoddy::Example
 

Enumerations

enum  {
  phi , phid , psi , psid ,
  eval
}
 

Functions

double CppNoddy::Example::U (double y)
 Globally define the base flow. More...
 
double CppNoddy::Example::Udd (double y)
 Globally define the base flow curvature. More...
 
int CppNoddy::Example::MAX_REFINE (3)
 
int main ()
 

Variables

double CppNoddy::Example::wave_speed
 The phase speed of the instability. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Function Documentation

◆ main()

int main ( )

Definition at line 244 of file EVPOrrSommerfeldNeutralCurve_lapack.cpp.

245{
246 cout << "\n";
247 cout << "=== EVP: Temporal OSE via the equation interface ====\n";
248 cout << "=== followed by local refinement of the eigenvalue \n";
249 cout << "=== and arclength continuation of the neutral curve.\n";
250 cout << "\n";
251
252 double tol = 1.e-8;
253 unsigned initial_QZ_mesh = 121;
254 DenseVector<double> Re( 1, 5750.0 );
255 Example::alpha = 1.0;
256 Example::Re = Re[0];
257
258 Example::Neutral_residual residual_problem( initial_QZ_mesh );
259
260 Newton<double> newton( &residual_problem, 20, tol );
261 newton.set_monitor_det( false );
262 newton.rescale_theta() = true;
263 newton.theta() = 0.00001;
264 newton.init_arc( Re, &Example::alpha, 0.001, 0.01 );
265
266 // set up the output file
267 std::string dirname("./DATA");
268 mkdir( dirname.c_str(), S_IRWXU );
269 TrackerFile my_file( "DATA/neutral.dat" );
270 my_file.precision( 8 );
271 my_file.push_ptr( &Re, "Reynolds number" );
272 my_file.push_ptr( &Example::alpha, "Wavenumber" );
273 my_file.push_ptr( &Example::wave_speed, "Phase speed" );
274 my_file.header();
275
276 double min_Re( Re[ 0 ] );
277 do
278 {
279 try {
280 newton.arclength_solve( Re );
281 } catch ( const ExceptionBifurcation &bifn ) {
282 }
283 my_file.update();
284 min_Re = std::min( Re[ 0 ], min_Re );
285 }
286 while ( Re[ 0 ] < 5820.0 );
287
288 std::cout << " Minimum Reynolds number (for this spatial resolution ) = " << min_Re << "\n";
289 // the known minimum critical Re is approx 5772 at alpha =1.02
290 // increase MAX_REFINE to get a closer value to 5772.
291 if ( std::abs( min_Re - 5772. ) < 30.0 )
292 {
293 cout << "\033[1;32;48m * PASSED \033[0m\n";
294 return 0;
295 }
296 cout << "\033[1;31;48m * FAILED \033[0m\n";
297 return 1;
298}
An DenseVector class – a dense vector object.
Definition: DenseVector.h:34
A vector NEWTON iteration class.
Definition: Newton.h:25
double Re
Globally define the Reynolds number and wavenumber.

References CppNoddy::Newton< _Type >::arclength_solve(), CppNoddy::TrackerFile::header(), CppNoddy::ArcLength_base< _Type >::init_arc(), CppNoddy::TrackerFile::precision(), CppNoddy::TrackerFile::push_ptr(), CppNoddy::ArcLength_base< _Type >::rescale_theta(), CppNoddy::Newton< _Type >::set_monitor_det(), CppNoddy::ArcLength_base< _Type >::theta(), and CppNoddy::TrackerFile::update().

© 2012

R.E. Hewitt