SinSolution Namespace Reference

Namespace for forced exact solution for UnsteadyHeat equation. More...

Functions

void get_exact_u (const double &t, const Vector< double > &x, Vector< double > &u)
 Exact solution as a vector. More...
 
void get_exact_u (const double &t, const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void get_source (const double &t, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 

Variables

double U_shift =8.0
 

Detailed Description

Namespace for forced exact solution for UnsteadyHeat equation.

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

Function Documentation

◆ get_exact_u() [1/2]

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

Exact solution as a scalar.

129  {
130  // Cache the value of pi
132 
133  // The full solution
134  u=sin(pi*x[0])*sin(pi*x[1])*cos(2.0*pi*t)+U_shift;
135  } // End of get_exact_u
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
double Pi
Definition: two_d_biharmonic.cc:235
double U_shift
Definition: test_equal_order_galerkin.cc:111
const Mdouble pi
Definition: ExtendedMath.h:23
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36

References cos(), constants::pi, oomph::MathematicalConstants::Pi, sin(), plotPSD::t, U_shift, and plotDoE::x.

◆ get_exact_u() [2/2]

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

Exact solution as a vector.

117  {
118  // Cache the value of pi
120 
121  // The full solution
122  u[0]=sin(pi*x[0])*sin(pi*x[1])*cos(2.0*pi*t)+U_shift;
123  } // End of get_exact_u

References cos(), constants::pi, oomph::MathematicalConstants::Pi, sin(), plotPSD::t, U_shift, and plotDoE::x.

Referenced by UnsteadyHeatProblem< ELEMENT >::apply_boundary_conditions(), and UnsteadyHeatProblem< ELEMENT >::doc_solution().

◆ get_source()

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

Source function to make it an exact solution.

142  {
143  // Cache the value of pi
145 
146  // The temporal derivative of the solution
147  double du_dt=-2.0*pi*sin(pi*x[0])*sin(pi*x[1])*sin(2.0*pi*t);
148 
149  // Second derivative of spatial contribution w.r.t. x
150  double d2u_dx2=-pow(pi,2)*sin(pi*x[0])*sin(pi*x[1])*cos(2.0*pi*t);
151 
152  // Second derivative of spatial contribution w.r.t. y
153  double d2u_dy2=-pow(pi,2)*sin(pi*x[0])*sin(pi*x[1])*cos(2.0*pi*t);
154 
155  // Assign the source function value
157  GlobalParameters::Beta*(d2u_dx2+d2u_dy2);
158  } // End of get_source
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
double Beta
Parameter for amplitude of step translation.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:141
double Alpha
Parameter for steepness of step.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:138
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References GlobalParameters::Alpha, GlobalParameters::Beta, cos(), constants::pi, oomph::MathematicalConstants::Pi, Eigen::bfloat16_impl::pow(), sin(), TestProblem::source(), plotPSD::t, and plotDoE::x.

Referenced by main().

Variable Documentation

◆ U_shift

double SinSolution::U_shift =8.0

Referenced by get_exact_u().