ExactSoln Namespace Reference

Namespace for exact solution. More...

Functions

void get_exact_u (const double &t, const Vector< double > &x, Vector< double > &u)
 Exact solution of the problem as a vector. More...
 
void get_exact_u (const double &t, const double &y, double &u)
 Exact solution of the problem as a scalar. More...
 
void prescribed_traction (const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
 Traction required at the top boundary. More...
 

Detailed Description

Namespace for exact solution.

Function Documentation

◆ get_exact_u() [1/2]

void ExactSoln::get_exact_u ( const double t,
const double y,
double u 
)

Exact solution of the problem as a scalar.

93  {
94  // I=sqrt(-1)
95  complex<double> I(0.0,1.0);
96  // omega
98  // lambda
99  complex<double> lambda(0.0,omega*Global_Parameters::ReSt);
100  lambda = I*sqrt(lambda);
101  // Solution
102  complex<double> sol(
103  exp(complex<double>(0.0,omega*t)) *
104  (exp(lambda*complex<double>(0.0,y))-exp(lambda*complex<double>(0.0,-y)))
105  /(exp(I*lambda)-exp(-I*lambda)) );
106 
107  // Assign real solution
108  u=real(sol);
109 
110  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
cout<< "The eigenvalues of A are:"<< endl<< ces.eigenvalues()<< endl;cout<< "The matrix of eigenvectors, V, is:"<< endl<< ces.eigenvectors()<< endl<< endl;complex< float > lambda
Definition: ComplexEigenSolver_compute.cpp:9
float real
Definition: datatypes.h:10
Scalar * y
Definition: level1_cplx_impl.h:128
#define I
Definition: main.h:127
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
Vector::Scalar omega(const Vector &t, const Vector &s, RealScalar angle)
Definition: IDRS.h:36
double ReSt
Womersley number: Product of Reynolds and Strouhal numbers.
Definition: fsi_channel_with_leaflet_precond.cc:225
t
Definition: plotPSD.py:36

References Eigen::bfloat16_impl::exp(), I, lambda, Eigen::internal::omega(), BiharmonicTestFunctions2::Pi, Global_Parameters::ReSt, sqrt(), plotPSD::t, and y.

◆ get_exact_u() [2/2]

void ExactSoln::get_exact_u ( const double t,
const Vector< double > &  x,
Vector< double > &  u 
)

Exact solution of the problem as a vector.

69  {
70  double y=x[1];
71  // I=sqrt(-1)
72  complex<double> I(0.0,1.0);
73  // omega
75  // lambda
76  complex<double> lambda(0.0,omega*Global_Parameters::ReSt);
77  lambda = I*sqrt(lambda);
78 
79  // Solution
80  complex<double> sol(
81  exp(complex<double>(0.0,omega*t)) *
82  (exp(lambda*complex<double>(0.0,y))-exp(lambda*complex<double>(0.0,-y)))
83  /(exp(I*lambda)-exp(-I*lambda)) );
84 
85  // Assign real solution
86  u.resize(2);
87  u[0]=real(sol);
88  u[1]=0.0;
89  }
list x
Definition: plotDoE.py:28

References Eigen::bfloat16_impl::exp(), I, lambda, Eigen::internal::omega(), BiharmonicTestFunctions2::Pi, Global_Parameters::ReSt, sqrt(), plotPSD::t, plotDoE::x, and y.

Referenced by RayleighProblem< ELEMENT, TIMESTEPPER >::actions_before_implicit_timestep(), RayleighProblem< ELEMENT, TIMESTEPPER >::doc_solution(), RayleighTractionProblem< ELEMENT, TIMESTEPPER >::doc_solution(), RayleighProblem< ELEMENT, TIMESTEPPER >::set_initial_condition(), and RayleighTractionProblem< ELEMENT, TIMESTEPPER >::set_initial_condition().

◆ prescribed_traction()

void ExactSoln::prescribed_traction ( const double t,
const Vector< double > &  x,
const Vector< double > &  n,
Vector< double > &  traction 
)

Traction required at the top boundary.

96  {
97  double y=x[1];
98  // I=sqrt(-1)
99  complex<double> I(0.0,1.0);
100  // omega
101  double omega=2.0*MathematicalConstants::Pi;
102  // lambda
103  complex<double> lambda(0.0,omega*Global_Parameters::ReSt);
104  lambda = I*sqrt(lambda);
105 
106  // Solution
107  complex<double> sol(
108  exp(complex<double>(0.0,omega*t)) *
109  (exp(lambda*complex<double>(0.0,y))+exp(lambda*complex<double>(0.0,-y)))
110  *I*lambda/(exp(I*lambda)-exp(-I*lambda)) );
111 
112  //Extract real part and stick into vector
113  traction.resize(2);
114  traction[0]=real(sol);
115  traction[1]=0.0;
116  }

References Eigen::bfloat16_impl::exp(), I, lambda, Eigen::internal::omega(), BiharmonicTestFunctions2::Pi, Global_Parameters::ReSt, sqrt(), plotPSD::t, plotDoE::x, and y.

Referenced by RayleighTractionProblem< ELEMENT, TIMESTEPPER >::RayleighTractionProblem().