28 f[ 0 ] = q[ 0 ] / sqrt( 2. );
33 f[ 0 ] = q[ 0 ] / sqrt( 2. );
40 c[ 0 ] = c[ 1 ] = 1.0;
48 if ( ( std::abs( x ) < 0.25 ) && ( std::abs( y ) < 0.25 ) )
69 cout <<
"=== Hyperbolic: 2D linear advection at an angle =====\n";
73 const double west = 1.0;
74 const double east = -1.0;
75 const double south = -1.0;
76 const double north = 1.0;
77 const unsigned N = 51;
82 TwoD_TVDLF_Mesh NlinAdv_mesh( faces_x, faces_y, &conservative_problem, Example::Q_init );
86 unsigned loop_counter( 0 );
95 NlinAdv_mesh.
update( 0.49 );
99 while ( ( NlinAdv_mesh.
get_time() < 1.0 ) && ( loop_counter < 20 ) );
102 if ( ( asym > 5.e-10 ) || ( loop_counter >= 1000 ) )
104 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
105 cout <<
"asymmetry = " << asym <<
"\n";
106 cout <<
"loop counter = " << loop_counter <<
"\n";
111 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for hyperbolic problems.
An DenseVector class – a dense vector object.
void flux_fn_y(const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
A virtual flux function for the y-derivative.
NlinAdv()
Two dimemsional scalar linear advection problem.
void flux_fn_x(const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &f) const
A virtual flux function for the x-derivative.
void max_charac_speed(const DenseVector< double > &x, const DenseVector< double > &q, DenseVector< double > &c) const
Bound the wave speed.
A class to represent a two-dimensional hyperbolic system of equations.
DenseVector< double > get_point_values(const DenseVector< double > &x)
Get the vector of unknowns at a point in the 2D mesh.
const double & get_time() const
Get a const reference to the time value for the current mesh.
double update(const double &CFL, const double &max_dt=std::numeric_limits< long double >::max())
Update the mesh object.
void set_limiter(const unsigned &id)
Set the limiter type to be applied in the slope values.
void Q_init(const double &x, DenseVector< double > &q)
Set the initial state of the system.
DenseVector< double > uniform_node_vector(const double &lower, const double &upper, const std::size_t &N)
Return a DENSE vector with the nodal points of a uniform mesh distributed between the upper/lower bou...
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...