98{
99 cout << "\n";
100 cout << "=== Hyperbolic: 2D radial dam-break in Cartesians ===\n";
101 cout << "\n";
102
103
104 const double west = -1;
105 const double east = 1;
106 const double south = -1;
107 const double north = 1;
108 const unsigned N = 151;
111
112 std::string dirname("./DATA");
113 mkdir( dirname.c_str(), S_IRWXU );
114 std::string filename_stub( "./DATA/HYP_2D_rad_dam" );
115
116 Example::Shallow_2d_rad conservative_problem;
117 TwoD_TVDLF_Mesh Shallow_2d_mesh( faces_x, faces_y, &conservative_problem, Example::Q_init );
118 Shallow_2d_mesh.set_limiter( 0 );
119
120 int file_counter( 1 );
121 const double t_end = 0.5;
123 x1[0] = 0.4;
124 x1[1] = 0.1;
126 x2[0] = 0.1;
127 x2[1] = 0.4;
128 do
129 {
130 Shallow_2d_mesh.update( 0.49, std::abs( Shallow_2d_mesh.get_time() - t_end ) );
131 Shallow_2d_mesh.dump_gnu( filename_stub +
Utility::stringify( file_counter ) +
"_gnu.dat" );
132 file_counter += 1;
133 }
134 while ( Shallow_2d_mesh.get_time() < t_end );
135
136 double h_clawpack( 1.13466 );
137 double theta = M_PI / 4;
139 x[ 0 ] = 0.5 * cos( theta );
140 x[ 1 ] = 0.5 * sin( theta );
141 double h_diag = Shallow_2d_mesh.get_point_values( x )[
h ];
142 if ( abs( h_diag - h_clawpack ) > 1.e-3 )
143 {
144 cout << "\033[1;31;48m * FAILED \033[0m\n";
145 cout << " deviation from the Clawpack data = " << abs( h_diag - h_clawpack ) << "\n";
146 return 1;
147 }
148 else
149 {
150 cout << "\033[1;32;48m * PASSED \033[0m\n";
151 return 0;
152 }
153}
An DenseVector class – a dense vector object.
DenseVector< double > power_node_vector(const double &lower, const double &upper, const std::size_t &N, const double &power)
Return a DENSE vector with the nodal points of a non-uniform mesh distributed between the upper/lower...
std::string stringify(const int &val)
Return an integer value as a string - useful for file naming.