TanhSolnForMultiPoisson Namespace Reference

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

Functions

double scalar_soln (const Vector< double > &x)
 Scalar solution. More...
 
double scalar_source (const Vector< double > &x)
 Scalar source. More...
 
void get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void source_function (const Vector< double > &x, Vector< double > &source)
 Source function required to make the solution above an exact solution. More...
 

Variables

double Alpha =5.0
 Parameter for steepness of "step". More...
 
double TanPhi =1.0
 Parameter for angle Phi of "step" (45 degrees) More...
 
double Beta =1.0
 Interaction parameter. More...
 

Detailed Description

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

Function Documentation

◆ get_exact_u()

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

Exact solution as a Vector.

82  {
83  double u_scalar=scalar_soln(x);
84  for (unsigned i=0;i<N_FIELD;i++)
85  {
86  u[i]=double(i+1)*u_scalar;
87  }
88  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define N_FIELD
Definition: linear_solvers/two_d_multi_poisson.cc:47
double scalar_soln(const Vector< double > &x)
Scalar solution.
Definition: linear_solvers/two_d_multi_poisson.cc:65
list x
Definition: plotDoE.py:28

References i, N_FIELD, scalar_soln(), and plotDoE::x.

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

◆ scalar_soln()

double TanhSolnForMultiPoisson::scalar_soln ( const Vector< double > &  x)

Scalar solution.

66  {
67  return tanh(1.0-Alpha*(TanPhi*x[0]-x[1]));
68  }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tanh(const bfloat16 &a)
Definition: BFloat16.h:639
double TanPhi
Parameter for angle Phi of "step" (45 degrees)
Definition: linear_solvers/two_d_multi_poisson.cc:59
double Alpha
Parameter for steepness of "step".
Definition: linear_solvers/two_d_multi_poisson.cc:56

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

Referenced by get_exact_u(), and source_function().

◆ scalar_source()

double TanhSolnForMultiPoisson::scalar_source ( const Vector< double > &  x)

Scalar source.

72  {
73  return 2.0*tanh(-1.0+Alpha*(TanPhi*x[0]-x[1]))*
74  (1.0-pow(tanh(-1.0+Alpha*(TanPhi*x[0]-x[1])),2.0))*
75  Alpha*Alpha*TanPhi*TanPhi+2.0*tanh(-1.0+Alpha*(TanPhi*x[0]-x[1]))*
76  (1.0-pow(tanh(-1.0+Alpha*(TanPhi*x[0]-x[1])),2.0))*Alpha*Alpha;
77  }
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137

References Alpha, Eigen::bfloat16_impl::pow(), Eigen::bfloat16_impl::tanh(), TanPhi, and plotDoE::x.

Referenced by source_function().

◆ source_function()

void TanhSolnForMultiPoisson::source_function ( const Vector< double > &  x,
Vector< double > &  source 
)

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

92  {
93  double scalar_f=scalar_source(x);
94  double scalar_u=scalar_soln(x);
95  for (unsigned i=0;i<N_FIELD;i++)
96  {
97  source[i] = double(i+1)*scalar_f;
98  for (unsigned k=0;k<N_FIELD;k++)
99  {
100  source[i]+=Beta*double(k+1)*scalar_u;
101  }
102  source[i]*=double(i+1);
103  }
104  }
char char char int int * k
Definition: level2_impl.h:374
double scalar_source(const Vector< double > &x)
Scalar source.
Definition: linear_solvers/two_d_multi_poisson.cc:71
double Beta
Interaction parameter.
Definition: linear_solvers/two_d_multi_poisson.cc:62
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References Beta, i, k, N_FIELD, scalar_soln(), scalar_source(), TestProblem::source(), and plotDoE::x.

Referenced by MultiPoissonProblem< ELEMENT >::MultiPoissonProblem().

Variable Documentation

◆ Alpha

double TanhSolnForMultiPoisson::Alpha =5.0

Parameter for steepness of "step".

Referenced by main(), scalar_soln(), and scalar_source().

◆ Beta

double TanhSolnForMultiPoisson::Beta =1.0

◆ TanPhi

double TanhSolnForMultiPoisson::TanPhi =1.0

Parameter for angle Phi of "step" (45 degrees)

Referenced by scalar_soln(), and scalar_source().