ArcTanSolnForPoisson Namespace Reference

Namespace for exact solution for Poisson equation with "sharp step". More...

Functions

void get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void get_source (const Vector< double > &x, double &source)
 Source function required to make the solution above an exact solution. More...
 
void get_exact_gradient (const Vector< double > &x, Vector< double > &dudx)
 Exact gradient as a Vector. More...
 

Variables

double Alpha =100.0
 Parameter for steepness of "step". More...
 

Detailed Description

Namespace for exact solution for Poisson equation with "sharp step".

Function Documentation

◆ get_exact_gradient()

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

Exact gradient as a Vector.

60  {
61  dudx[0] = Alpha/(1.0+(Alpha*(x[0]-0.5))*(Alpha*(x[0]-0.5)));
62  }
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53
list x
Definition: plotDoE.py:28

References TanhSolnForAdvectionDiffusion::Alpha, and plotDoE::x.

◆ get_exact_u()

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

Exact solution as a Vector.

55  {
56  u[0] = atan(Alpha*(x[0]-0.5));
57  }
double Alpha
Parameter for steepness of "step".
Definition: one_d_poisson_adapt.cc:51
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636

References Alpha, Eigen::bfloat16_impl::atan(), and plotDoE::x.

Referenced by RefineableOneDPoissonProblem< ELEMENT >::actions_before_newton_solve(), PRefineableOneDPoissonProblem< ELEMENT >::actions_before_newton_solve(), RefineableOneDPoissonProblem< ELEMENT >::doc_solution(), and PRefineableOneDPoissonProblem< ELEMENT >::doc_solution().

◆ get_source()

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

Source function required to make the solution above an exact solution.

61  {
62  // Cache tan( atan(Alpha*(x[0]-0.5)) ) term
63  double tan_term = tan( atan(Alpha*(x[0]-0.5)) );
64 
65  // Compute source function
66  source = -(2.0 * Alpha*Alpha * tan_term) /
67  ( (1.0 + tan_term*tan_term)*(1.0 + tan_term*tan_term) );
68  }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tan(const bfloat16 &a)
Definition: BFloat16.h:633
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References Alpha, Eigen::bfloat16_impl::atan(), TestProblem::source(), Eigen::bfloat16_impl::tan(), and plotDoE::x.

Referenced by main().

Variable Documentation

◆ Alpha

double ArcTanSolnForPoisson::Alpha =100.0

Parameter for steepness of "step".

Referenced by get_exact_u(), get_source(), and main().