TanhSolnForLinearWave Namespace Reference

Functions

double exact_u (const double &time, const Vector< double > &x)
 Exact solution. More...
 
double exact_dudt (const double &time, const Vector< double > &x)
 1st time-deriv of exact solution More...
 
double exact_d2udt2 (const double &time, const Vector< double > &x)
 2nd time-deriv of exact solution More...
 
void get_exact_u (const double &time, const Vector< double > &x, Vector< double > &u)
 Exact solution as a vector. More...
 
void get_source (const double &time, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
void get_exact_gradient (const double &time, const Vector< double > &x, Vector< double > &dudx)
 Gradient of exact solution. More...
 
void prescribed_flux_on_fixed_y_boundary (const double &time, const Vector< double > &x, double &flux)
 Prescribed flux on a fixed y max boundary. More...
 

Variables

double Alpha
 Parameter for steepness of step. More...
 
double Phi
 Orientation of step wave. More...
 

Detailed Description

Namespace for exact solution for LinearWave equation with sharp step

Namespace for travelling wave solution for LinearWave equation with sharp step

Function Documentation

◆ exact_d2udt2()

double TanhSolnForLinearWave::exact_d2udt2 ( const double time,
const Vector< double > &  x 
)

2nd time-deriv of exact solution

74  {
75  double zeta=cos(Phi)*x[0]+sin(Phi)*x[1];
76  return -2.0*Alpha*Alpha*tanh(1.0-Alpha*(zeta-time))/
77  (cosh(1.0-Alpha*(zeta-time))*cosh(1.0-Alpha*(zeta-time)));
78  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tanh(const bfloat16 &a)
Definition: BFloat16.h:639
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 cosh(const bfloat16 &a)
Definition: BFloat16.h:638
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
double Alpha
Parameter for steepness of step.
Definition: two_d_linear_wave.cc:52
double Phi
Orientation of step wave.
Definition: two_d_linear_wave.cc:55
list x
Definition: plotDoE.py:28

References Alpha, cos(), Eigen::bfloat16_impl::cosh(), Phi, sin(), Eigen::bfloat16_impl::tanh(), plotDoE::x, and Eigen::zeta().

Referenced by LinearWaveProblem< ELEMENT, TIMESTEPPER >::actions_before_implicit_timestep(), get_exact_u(), and LinearWaveProblem< ELEMENT, TIMESTEPPER >::set_initial_condition().

◆ exact_dudt()

double TanhSolnForLinearWave::exact_dudt ( const double time,
const Vector< double > &  x 
)

◆ exact_u()

◆ get_exact_gradient()

void TanhSolnForLinearWave::get_exact_gradient ( const double time,
const Vector< double > &  x,
Vector< double > &  dudx 
)

Gradient of exact solution.

98  {
99  double zeta=cos(Phi)*x[0]+sin(Phi)*x[1];
100  dudx[0] = -Alpha*cos(Phi)/(cosh(1.0-Alpha*(zeta-time))
101  *cosh(1.0-Alpha*(zeta-time)));
102  dudx[1] = -Alpha*sin(Phi)/(cosh(1.0-Alpha*(zeta-time))
103  *cosh(1.0-Alpha*(zeta-time)));
104  }
double Phi
Angle of bump.
Definition: heat_transfer_and_melting/two_d_unsteady_heat_melt/two_d_unsteady_heat.cc:61
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53

References TanhSolnForAdvectionDiffusion::Alpha, cos(), Eigen::bfloat16_impl::cosh(), ExactSolnForUnsteadyHeat::Phi, sin(), plotDoE::x, and Eigen::zeta().

Referenced by prescribed_flux_on_fixed_y_boundary().

◆ get_exact_u()

void TanhSolnForLinearWave::get_exact_u ( const double time,
const Vector< double > &  x,
Vector< double > &  u 
)

Exact solution as a vector.

84  {
85  u[0]=exact_u(time,x);
86  u[1]=exact_dudt(time,x);
87  u[2]=exact_d2udt2(time,x);
88  }
double exact_d2udt2(const double &time, const Vector< double > &x)
2nd time-deriv of exact solution
Definition: two_d_linear_wave.cc:73
double exact_dudt(const double &time, const Vector< double > &x)
1st time-deriv of exact solution
Definition: two_d_linear_wave.cc:65
double exact_u(const double &time, const Vector< double > &x)
Exact solution.
Definition: two_d_linear_wave.cc:58

References exact_d2udt2(), exact_dudt(), exact_u(), and plotDoE::x.

Referenced by LinearWaveProblem< ELEMENT, TIMESTEPPER >::doc_solution().

◆ get_source()

void TanhSolnForLinearWave::get_source ( const double time,
const Vector< double > &  x,
double source 
)

Source function to make it an exact solution.

92  {
93  source=0.0;
94  }
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References TestProblem::source().

Referenced by main().

◆ prescribed_flux_on_fixed_y_boundary()

void TanhSolnForLinearWave::prescribed_flux_on_fixed_y_boundary ( const double time,
const Vector< double > &  x,
double flux 
)

Prescribed flux on a fixed y max boundary.

111  {
112  // Set up normal
113  Vector<double> dudx(2), n(2);
114  n[0]=1.0;
115  n[1]=0.0;
116 
117  // Get gradient
118  get_exact_gradient(time,x,dudx);
119 
120  // Flux
121  flux = dudx[0]*n[0] + dudx[1]*n[1];
122  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
void get_exact_gradient(const double &time, const Vector< double > &x, Vector< double > &dudx)
Gradient of exact solution.
Definition: two_d_linear_wave_flux.cc:96

References ProblemParameters::flux(), get_exact_gradient(), n, and plotDoE::x.

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

Variable Documentation

◆ Alpha

double TanhSolnForLinearWave::Alpha

◆ Phi

double TanhSolnForLinearWave::Phi