28 #ifndef OOMPH_VORTICITY_SMOOTHER_HEADER
29 #define OOMPH_VORTICITY_SMOOTHER_HEADER
33 #include <oomph-lib-config.h>
46 namespace VorticityRecoveryHelpers
85 if ((max_deriv < -1) || (max_deriv > 3))
89 "Invalid input value! Should be between -1 and 3!",
108 if ((max_deriv < 0) || (max_deriv > 1))
111 throw OomphLibError(
"Invalid input value! Should be between 0 and 3!",
161 unsigned n_bins =
n + n_dim - 1;
164 unsigned k = n_dim - 1;
177 for (
unsigned i = 0;
i <
k; ++
i)
222 template<
class ELEMENT>
283 unsigned n_vector = n_vort_deriv + n_veloc_deriv + 1;
289 for (
unsigned i = 0;
i < n_vort_deriv + 1;
i++)
296 for (
unsigned i = n_vort_deriv + 1;
i < n_vort_deriv + n_veloc_deriv + 1;
305 return vort_and_derivs;
316 const unsigned&
i)
const
326 if (n_vort_deriv + n_veloc_deriv + 1 == 0)
330 "Not recovering anything so this shouldn't be called.",
337 unsigned max_vort_order =
341 unsigned max_veloc_order =
345 unsigned max_vort_recov = 0;
348 unsigned max_veloc_recov = 0;
351 for (
unsigned j = 0;
j < max_vort_order + 1;
j++)
358 for (
unsigned j = 1;
j < max_veloc_order + 1;
j++)
365 std::pair<unsigned, unsigned> container_id;
368 unsigned nprev_deriv = 0;
371 unsigned n_deriv = 0;
374 if (
i < max_vort_recov)
377 for (
unsigned jj = 0; jj < n_vort_deriv + 1; jj++)
383 nprev_deriv += n_deriv;
389 container_id.first = jj;
392 container_id.second =
i - (nprev_deriv - n_deriv);
400 else if (
i < max_vort_recov + max_veloc_recov)
404 nprev_deriv = max_vort_recov;
407 for (
unsigned jj = n_vort_deriv + 1;
408 jj < n_vort_deriv + n_veloc_deriv + 1;
415 nprev_deriv += n_deriv;
421 container_id.first = jj;
424 container_id.second =
i - (nprev_deriv - n_deriv);
434 std::ostringstream error_message_stream;
437 error_message_stream <<
"Dof number " <<
i <<
" not associated "
438 <<
"with a vorticity or velocity derivative!"
461 const unsigned&
i)
const
464 std::pair<unsigned, unsigned> container_id;
467 unsigned derivative_index =
i;
471 int vector_index = -1;
480 for (
unsigned i = 0;
i < n_vort_derivs + 1;
i++)
499 if (vector_index == -1)
502 for (
unsigned i = 1;
i < n_veloc_derivs + 1;
i++)
508 vector_index = n_vort_derivs +
i;
523 if (vector_index == -1)
526 std::ostringstream error_message_stream;
529 error_message_stream <<
"Value of vector_index has not been set. "
530 <<
"Something's wrong!";
540 container_id.first = vector_index;
543 container_id.second = derivative_index;
558 std::pair<unsigned, unsigned>
id =
562 unsigned vector_index =
id.first;
565 unsigned deriv_index =
id.second;
571 unsigned max_vort_recov =
575 if (vector_index < max_vort_recov + 1)
578 unsigned n_prev_deriv = 0;
581 for (
unsigned j = 0;
j < vector_index;
j++)
588 index += n_prev_deriv + deriv_index;
594 unsigned n_prev_deriv = 0;
597 for (
unsigned j = 0;
j < max_vort_recov + 1;
j++)
607 for (
unsigned j = 1;
j < vector_index - n_vort_deriv;
j++)
614 index += n_prev_deriv + deriv_index;
666 unsigned n_terms = 0;
686 unsigned n_terms = 0;
773 unsigned n_node = this->nnode();
779 this->
shape(s, psif);
782 for (
unsigned i = 0;
i <
N_dim;
i++)
785 unsigned u_nodal_index = this->u_index_nst(
i);
788 for (
unsigned l = 0; l < n_node; l++)
791 values[
i] += this->nodal_value(
t, l, u_nodal_index) * psif[l];
797 values[
N_dim] = this->interpolated_p_nst(
s);
804 unsigned nnod = this->nnode();
807 for (
unsigned j = 0;
j < nnod;
j++)
810 Node* nod_pt = this->node_pt(
j);
826 const unsigned& nplot)
835 unsigned n_node = this->nnode();
841 outfile << this->tecplot_zone_string(nplot);
844 unsigned num_plot_points = this->nplot_points(nplot);
851 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
854 this->get_s_plot(iplot, nplot,
s);
857 for (
unsigned i = 0;
i <
N_dim;
i++)
860 x[
i] = this->interpolated_x(
s,
i);
863 outfile <<
x[
i] <<
" ";
867 outfile <<
"0.0 0.0 0.0 ";
874 unsigned n_vector = vort_and_derivs.size();
877 for (
unsigned i = 0;
i < n_vector;
i++)
880 unsigned i_entries = vort_and_derivs[
i].size();
883 for (
unsigned j = 0;
j < i_entries;
j++)
886 outfile << (vort_and_derivs[
i])[
j] <<
" ";
891 outfile << std::endl;
895 this->write_tecplot_zone_footer(outfile, nplot);
908 unsigned n_node = this->nnode();
914 outfile << this->tecplot_zone_string(nplot);
924 unsigned num_plot_points = this->nplot_points(nplot);
927 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
930 this->get_s_plot(iplot, nplot,
s);
936 for (
unsigned i = 0;
i <
N_dim;
i++)
939 x[
i] = this->interpolated_x(
s,
i);
942 outfile <<
x[
i] <<
" ";
946 for (
unsigned i = 0;
i <
N_dim;
i++)
949 outfile << this->interpolated_u_nst(
s,
i) <<
" ";
953 outfile << this->interpolated_p_nst(
s) <<
" ";
961 unsigned n_vector = vort_and_derivs.size();
964 for (
unsigned i = 0;
i < n_vector;
i++)
967 unsigned i_entries = vort_and_derivs[
i].size();
970 for (
unsigned j = 0;
j < i_entries;
j++)
973 outfile << (vort_and_derivs[
i])[
j] <<
" ";
978 outfile << std::endl;
982 this->write_tecplot_zone_footer(outfile, nplot);
997 const unsigned& nplot)
const
1003 unsigned num_plot_points = this->nplot_points_paraview(nplot);
1010 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
1013 this->get_s_plot(iplot, nplot,
s);
1019 file_out << this->interpolated_u_nst(
s,
i) << std::endl;
1025 file_out << this->interpolated_p_nst(
s) << std::endl;
1034 std::pair<unsigned, unsigned>
id =
1038 file_out << (vort_and_derivs[
id.first])[
id.second] << std::endl;
1045 std::stringstream error_stream;
1048 error_stream <<
"These VorticitySmoother elements only store "
1050 <<
"but i is currently: " <<
i << std::endl;
1115 return "d^3/dx^2dy";
1118 return "d^3/dxdy^2";
1144 std::stringstream error_stream;
1145 error_stream <<
"These Navier Stokes elements only store "
1147 <<
"but i is currently: " <<
i << std::endl;
1159 void output(std::ostream& outfile,
const unsigned& nplot)
1168 unsigned n_node = this->nnode();
1174 outfile << this->tecplot_zone_string(nplot);
1177 unsigned num_plot_points = this->nplot_points(nplot);
1184 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
1187 this->get_s_plot(iplot, nplot,
s);
1190 this->
shape(s, psif);
1193 for (
unsigned i = 0;
i <
N_dim;
i++)
1196 x[
i] = this->interpolated_x(
s,
i);
1199 outfile <<
x[
i] <<
" ";
1203 for (
unsigned i = 0;
i <
N_dim;
i++)
1206 outfile << this->interpolated_u_nst(
s,
i) <<
" ";
1210 outfile << this->interpolated_p_nst(
s) <<
" ";
1216 unsigned n_vector = vort_and_derivs.size();
1219 for (
unsigned i = 0;
i < n_vector;
i++)
1222 unsigned i_entries = vort_and_derivs[
i].size();
1225 for (
unsigned j = 0;
j < i_entries;
j++)
1228 outfile << (vort_and_derivs[
i])[
j] <<
" ";
1233 outfile << std::endl;
1237 this->write_tecplot_zone_footer(outfile, nplot);
1246 unsigned n_node = this->nnode();
1252 DShape dpsifdx(n_node, 2);
1255 this->dshape_eulerian(
s, psif, dpsifdx);
1261 for (
unsigned l = 0; l < n_node; l++)
1264 for (
unsigned j = 0;
j < 2;
j++)
1267 dveloc_dx[
j] += this->nodal_value(l, 0) * dpsifdx(l,
j);
1270 dveloc_dx[
j + 2] += this->nodal_value(l, 1) * dpsifdx(l,
j);
1278 const unsigned& index)
const
1281 unsigned n_node = this->nnode();
1287 DShape dpsifdx(n_node, 2);
1290 this->dshape_eulerian(
s, psif, dpsifdx);
1300 for (
unsigned l = 0; l < n_node; l++)
1303 dveloc_dx += this->nodal_value(l, 0) * dpsifdx(l, 0);
1308 for (
unsigned l = 0; l < n_node; l++)
1311 dveloc_dx += this->nodal_value(l, 0) * dpsifdx(l, 1);
1316 for (
unsigned l = 0; l < n_node; l++)
1319 dveloc_dx += this->nodal_value(l, 1) * dpsifdx(l, 0);
1324 for (
unsigned l = 0; l < n_node; l++)
1327 dveloc_dx += this->nodal_value(l, 1) * dpsifdx(l, 1);
1331 oomph_info <<
"Never get here!" << std::endl;
1341 unsigned n_node = this->nnode();
1347 DShape dpsifdx(n_node, 2);
1350 this->dshape_eulerian(
s, psif, dpsifdx);
1356 for (
unsigned l = 0; l < n_node; l++)
1359 for (
unsigned j = 0;
j < 2;
j++)
1370 double& dvorticity_dx,
1371 const unsigned& index)
const
1374 unsigned n_node = this->nnode();
1380 DShape dpsifdx(n_node, 2);
1383 this->dshape_eulerian(
s, psif, dpsifdx);
1386 dvorticity_dx = 0.0;
1393 for (
unsigned l = 0; l < n_node; l++)
1402 for (
unsigned l = 0; l < n_node; l++)
1410 oomph_info <<
"Never get here!" << std::endl;
1420 unsigned n_node = this->nnode();
1426 DShape dpsifdx(n_node, 2);
1429 this->dshape_eulerian(
s, psif, dpsifdx);
1435 for (
unsigned l = 0; l < n_node; l++)
1438 for (
unsigned j = 0;
j < 2;
j++)
1441 dvorticity_dxdy[
j] +=
1446 dvorticity_dxdy[2] +=
1455 double& dvorticity_dxdy,
1456 const unsigned& index)
const
1459 unsigned n_node = this->nnode();
1465 DShape dpsifdx(n_node, 2);
1468 this->dshape_eulerian(
s, psif, dpsifdx);
1471 dvorticity_dxdy = 0.0;
1478 for (
unsigned l = 0; l < n_node; l++)
1488 for (
unsigned l = 0; l < n_node; l++)
1498 for (
unsigned l = 0; l < n_node; l++)
1507 oomph_info <<
"Never get here!" << std::endl;
1518 unsigned n_node = this->nnode();
1524 DShape dpsifdx(n_node, 2);
1527 this->dshape_eulerian(
s, psif, dpsifdx);
1533 for (
unsigned l = 0; l < n_node; l++)
1536 dvorticity_dxdxdy[0] +=
1540 dvorticity_dxdxdy[1] +=
1544 dvorticity_dxdxdy[2] +=
1548 dvorticity_dxdxdy[3] +=
1557 double& dvorticity_dxdxdy,
1558 const unsigned& index)
const
1561 unsigned n_node = this->nnode();
1567 DShape dpsifdx(n_node, 2);
1570 this->dshape_eulerian(
s, psif, dpsifdx);
1573 dvorticity_dxdxdy = 0.0;
1580 for (
unsigned l = 0; l < n_node; l++)
1583 dvorticity_dxdxdy +=
1590 for (
unsigned l = 0; l < n_node; l++)
1593 dvorticity_dxdxdy +=
1600 for (
unsigned l = 0; l < n_node; l++)
1603 dvorticity_dxdxdy +=
1610 for (
unsigned l = 0; l < n_node; l++)
1613 dvorticity_dxdxdy +=
1619 oomph_info <<
"Never get here!" << std::endl;
1636 if ((n_recovered_derivs == 0) || (
i >= n_recovered_derivs))
1639 throw OomphLibError(
"Can't calculate this; not recovering enough data.",
1653 unsigned n_vector = synth_vort_and_derivs.size();
1656 double norm_squared = 0.0;
1659 unsigned n_node = this->nnode();
1665 DShape dpsifdx(n_node, 2);
1668 unsigned n_intpt = this->integral_pt()->nweight();
1677 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1680 for (
unsigned ii = 0; ii <
N_dim; ii++)
1683 s[ii] = this->integral_pt()->knot(ipt, ii);
1687 this->interpolated_x(
s,
x);
1690 double w = this->integral_pt()->weight(ipt);
1693 double J = this->dshape_eulerian(
s, psif, dpsifdx);
1699 double smoothed_vort = 0.0;
1702 for (
unsigned l = 0; l < n_node; l++)
1711 for (
unsigned jj = 0; jj < n_vector; jj++)
1725 double synth_quantity = 0.0;
1728 synth_quantity = (synth_vort_and_derivs[indices.first])[indices.second];
1731 norm_squared +=
pow(smoothed_vort - synth_quantity, 2) *
W;
1735 return norm_squared;
1744 unsigned n_node = this->nnode();
1750 this->
shape(s, psif);
1753 unsigned n_vector = vort_and_derivs.size();
1759 for (
unsigned i = 0;
i < n_vector;
i++)
1762 vort_and_derivs[
i].initialise(0.0);
1765 unsigned num_entries = vort_and_derivs[
i].size();
1768 for (
unsigned j = 0;
j < num_entries;
j++)
1771 for (
unsigned l = 0; l < n_node; l++)
1775 (vort_and_derivs[
i])[
j] +=
1835 template<
class ELEMENT>
1867 std::ostringstream error_stream;
1884 psi_r[3] =
x[0] *
x[0];
1885 psi_r[4] =
x[0] *
x[1];
1886 psi_r[5] =
x[1] *
x[1];
1894 psi_r[3] =
x[0] *
x[0];
1895 psi_r[4] =
x[0] *
x[1];
1896 psi_r[5] =
x[1] *
x[1];
1897 psi_r[6] =
x[0] *
x[0] *
x[0];
1898 psi_r[7] =
x[0] *
x[0] *
x[1];
1899 psi_r[8] =
x[0] *
x[1] *
x[1];
1900 psi_r[9] =
x[1] *
x[1] *
x[1];
1905 error_stream <<
"Recovery shape functions for recovery order "
1907 <<
" haven't yet been implemented for 2D" << std::endl;
1929 std::ostringstream error_stream;
1981 error_stream <<
"Recovery shape functions for recovery order "
1983 <<
" haven't yet been implemented for 2D" << std::endl;
2004 adjacent_elements_pt.clear();
2007 std::map<Node*, Vector<ELEMENT*>*> aux_adjacent_elements_pt;
2011 unsigned ndisagree = 0;
2018 unsigned nelem = mesh_pt->
nelement();
2019 for (
unsigned e = 0;
e < nelem;
e++)
2021 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt->
element_pt(
e));
2032 unsigned nnod = el_pt->nnode();
2033 for (
unsigned n = 0;
n < nnod;
n++)
2036 Node* nod_pt = el_pt->node_pt(
n);
2039 if (aux_adjacent_elements_pt[nod_pt] == 0)
2046 (*aux_adjacent_elements_pt[nod_pt]).push_back(el_pt);
2055 <<
"\n\n======================================================\n"
2057 << ndisagree <<
" out of " << mesh_pt->
nelement() <<
" elements"
2058 <<
"\nhave different preferences for the order of the recovery"
2059 <<
"\nshape functions. We are using: Recovery_order="
2062 <<
"======================================================\n\n";
2068 for (
unsigned e = 0;
e < nelem;
e++)
2070 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt->
element_pt(
e));
2073 unsigned n_node = el_pt->nvertex_node();
2074 for (
unsigned n = 0;
n < n_node;
n++)
2076 Node* nod_pt = el_pt->vertex_node_pt(
n);
2079 if (adjacent_elements_pt[nod_pt] == 0)
2082 vertex_node_pt.push_back(nod_pt);
2088 unsigned nel = (*aux_adjacent_elements_pt[nod_pt]).
size();
2089 for (
unsigned e = 0;
e < nel;
e++)
2091 (*adjacent_elements_pt[nod_pt])
2092 .push_back((*aux_adjacent_elements_pt[nod_pt])[
e]);
2100 aux_adjacent_elements_pt.begin();
2101 it != aux_adjacent_elements_pt.end();
2117 const unsigned& num_recovery_terms,
2122 unsigned nelem = patch_el_pt.size();
2125 ELEMENT* el_pt = patch_el_pt[0];
2132 int n_vort_derivs = el_pt->get_maximum_order_of_vorticity_derivative();
2135 int n_veloc_derivs = el_pt->get_maximum_order_of_velocity_derivative();
2138 if (n_vort_derivs + n_veloc_derivs == -1)
2141 std::ostringstream error_stream;
2144 error_stream <<
"Not recovering anything. Change the maximum number "
2145 <<
"of derivatives to recover.";
2156 std::pair<unsigned, unsigned> container_id =
2157 el_pt->vorticity_dof_to_container_id(n_deriv);
2160 unsigned max_recoverable_vort_order =
2161 el_pt->get_maximum_order_of_recoverable_vorticity_derivative();
2164 unsigned max_recoverable_veloc_order =
2165 el_pt->get_maximum_order_of_recoverable_velocity_derivative();
2168 unsigned counter = 0;
2172 int case_value = -1;
2175 for (
unsigned i = 0;
i < max_recoverable_vort_order + 1;
i++)
2178 counter += el_pt->npartial_derivative(
i);
2182 if (n_deriv < counter)
2194 if (case_value == -1)
2197 for (
unsigned i = 1;
i < max_recoverable_veloc_order + 1;
i++)
2200 counter += 2 * el_pt->npartial_derivative(
i);
2204 if (n_deriv < counter)
2207 case_value = max_recoverable_vort_order +
i;
2217 if (case_value == -1)
2220 std::ostringstream error_message_stream;
2223 error_message_stream
2224 <<
"Case order has not been set. Something's wrong!";
2234 double recovered_quantity = 0.0;
2238 num_recovery_terms, num_recovery_terms, 0.0);
2246 bool is_q_mesh =
true;
2261 for (
unsigned e = 0;
e < nelem;
e++)
2264 ELEMENT*
const el_pt = patch_el_pt[
e];
2273 unsigned n_intpt = integ_pt->
nweight();
2276 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2279 for (
unsigned i = 0;
i < 2;
i++)
2282 s[
i] = integ_pt->
knot(ipt,
i);
2286 double w = integ_pt->
weight(ipt);
2289 double J = el_pt->J_eulerian(
s);
2295 el_pt->interpolated_x(
s,
x);
2300 double W =
w *
J * (el_pt->geometric_jacobian(
x));
2311 el_pt->get_vorticity(
s, vorticity);
2312 recovered_quantity = vorticity[0];
2317 el_pt->get_raw_vorticity_deriv(
2318 s, recovered_quantity, container_id.second);
2323 el_pt->get_raw_vorticity_second_deriv(
2324 s, recovered_quantity, container_id.second);
2329 el_pt->get_raw_vorticity_third_deriv(
2330 s, recovered_quantity, container_id.second);
2335 el_pt->get_raw_velocity_deriv(
2336 s, recovered_quantity, container_id.second);
2341 oomph_info <<
"Never get here." << std::endl;
2349 for (
unsigned l = 0; l < num_recovery_terms; l++)
2352 rhs[l] += recovered_quantity * psi_r[l] *
W;
2356 for (
unsigned l = 0; l < num_recovery_terms; l++)
2359 for (
unsigned l2 = 0; l2 < num_recovery_terms; l2++)
2362 recovery_mat(l, l2) += psi_r[l] * psi_r[l2] *
W;
2381 recovered_vorticity_coefficient_pt =
2385 for (
unsigned icoeff = 0; icoeff < num_recovery_terms; icoeff++)
2388 (*recovered_vorticity_coefficient_pt)[icoeff] = rhs[icoeff];
2420 std::ostringstream error_stream;
2462 std::map<Node*, Vector<ELEMENT*>*> adjacent_elements_pt;
2468 setup_patches(mesh_pt, adjacent_elements_pt, vertex_node_pt);
2471 ELEMENT*
const el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt->
element_pt(0));
2474 unsigned smoothed_vorticity_index = el_pt->smoothed_vorticity_index();
2477 unsigned max_vort_order =
2478 el_pt->get_maximum_order_of_recoverable_vorticity_derivative();
2481 unsigned max_veloc_order =
2482 el_pt->get_maximum_order_of_recoverable_velocity_derivative();
2485 unsigned max_vort_recov = 0;
2488 unsigned max_veloc_recov = 0;
2491 for (
unsigned i = 0;
i < max_vort_order + 1;
i++)
2494 max_vort_recov += el_pt->npartial_derivative(
i);
2498 for (
unsigned i = 1;
i < max_veloc_order + 1;
i++)
2501 max_veloc_recov += 2 * el_pt->npartial_derivative(
i);
2505 unsigned n_recovered_vort_derivs =
2506 el_pt->nvorticity_derivatives_to_recover();
2509 unsigned n_recovered_veloc_derivs =
2510 el_pt->nvelocity_derivatives_to_recover();
2517 std::map<Node*, unsigned> count;
2520 unsigned nodal_dof = 0;
2523 for (
unsigned deriv = 0; deriv < max_vort_recov + max_veloc_recov;
2529 if ((
int(deriv) >
int(n_recovered_vort_derivs - 1)) &&
2530 (deriv < max_vort_recov))
2537 else if ((n_recovered_veloc_derivs == 0) && (deriv >= max_vort_recov))
2545 std::map<Node*, double> averaged_recovered_vort;
2552 adjacent_elements_pt.begin();
2553 it != adjacent_elements_pt.end();
2562 recovered_vorticity_coefficient_pt,
2569 unsigned nelem = (*(it->second)).size();
2572 for (
unsigned e = 0;
e < nelem;
e++)
2575 ELEMENT*
const el_pt = (*(it->second))[
e];
2578 unsigned nnode_el = el_pt->nnode();
2581 for (
unsigned j = 0;
j < nnode_el;
j++)
2584 Node* nod_pt = el_pt->node_pt(
j);
2587 el_pt->local_coordinate_of_node(
j,
s);
2590 el_pt->interpolated_x(
s,
x);
2599 double recovered_vort = 0.0;
2602 for (
unsigned i = 0;
i < num_recovery_terms;
i++)
2606 (*recovered_vorticity_coefficient_pt)[
i] * psi_r[
i];
2610 averaged_recovered_vort[nod_pt] += recovered_vort;
2618 delete recovered_vorticity_coefficient_pt;
2621 recovered_vorticity_coefficient_pt = 0;
2625 unsigned nnod = mesh_pt->
nnode();
2628 for (
unsigned j = 0;
j < nnod;
j++)
2634 averaged_recovered_vort[nod_pt] /= count[nod_pt];
2637 nod_pt->
set_value(smoothed_vorticity_index + nodal_dof,
2638 averaged_recovered_vort[nod_pt]);
2650 adjacent_elements_pt.begin();
2651 it != adjacent_elements_pt.end();
2659 oomph_info <<
"Time for vorticity recovery [sec]: "
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: matrices.h:1271
virtual void lubksub(DoubleVector &rhs)
LU backsubstitution.
Definition: matrices.cc:202
virtual void ludecompose()
LU decomposition using DenseLU (default linea solver)
Definition: matrices.cc:192
Definition: oomph_utilities.h:499
void disable_doc()
Disable documentation.
Definition: oomph_utilities.h:542
Definition: integral.h:297
Definition: integral.h:343
Definition: integral.h:389
Definition: integral.h:49
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: oomph_definitions.h:222
Definition: Telements.h:1130
Definition: integral.h:820
Definition: integral.h:867
Definition: integral.h:914
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
Definition: oomph-lib/src/generic/Vector.h:167
Definition: vorticity_smoother.h:55
int maximum_order_of_velocity_derivative() const
The maximum order of derivatives calculated in the velocity recovery.
Definition: vorticity_smoother.h:75
unsigned Number_of_values_per_field
Definition: vorticity_smoother.h:202
int Maximum_order_of_vorticity_derivative
Definition: vorticity_smoother.h:206
void set_maximum_order_of_velocity_derivative(const int &max_deriv)
The maximum order of derivatives calculated in the velocity recovery.
Definition: vorticity_smoother.h:103
RecoveryHelper()
Constructor.
Definition: vorticity_smoother.h:58
void calculate_number_of_values_per_field()
Definition: vorticity_smoother.h:126
int Maximum_order_of_velocity_derivative
Definition: vorticity_smoother.h:211
unsigned ncont_interpolated_values() const
Number of continuously interpolated values:
Definition: vorticity_smoother.h:191
unsigned npartial_derivative(const unsigned &n) const
Definition: vorticity_smoother.h:155
void set_maximum_order_of_vorticity_derivative(const int &max_deriv)
The maximum order of derivatives calculated in the vorticity recovery.
Definition: vorticity_smoother.h:82
int maximum_order_of_vorticity_derivative() const
The maximum order of derivatives calculated in the vorticity recovery.
Definition: vorticity_smoother.h:68
Definition: vorticity_smoother.h:224
int get_maximum_order_of_velocity_derivative() const
Definition: vorticity_smoother.h:655
void vorticity_and_its_derivs(const Vector< double > &s, Vector< Vector< double >> &vort_and_derivs) const
Compute smoothed vorticity and its derivatives.
Definition: vorticity_smoother.h:1740
unsigned ncont_interpolated_values() const
Number of continuously interpolated values:
Definition: vorticity_smoother.h:741
unsigned Smoothed_vorticity_index
Definition: vorticity_smoother.h:1791
unsigned npartial_derivative(const unsigned &n) const
Call the function written in VorticityRecoveryHelpers.
Definition: vorticity_smoother.h:702
void get_raw_vorticity_second_deriv(const Vector< double > &s, double &dvorticity_dxdy, const unsigned &index) const
Definition: vorticity_smoother.h:1454
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: vorticity_smoother.h:751
unsigned smoothed_vorticity_index() const
Index of smoothed vorticity – followed by derivatives.
Definition: vorticity_smoother.h:725
void(* ExactVorticityFctPt)(const Vector< double > &x, Vector< Vector< double >> &vort_and_derivs)
Definition: vorticity_smoother.h:265
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Definition: vorticity_smoother.h:995
ExactVorticityFctPt Exact_vorticity_fct_pt
Definition: vorticity_smoother.h:1823
double vorticity_error_squared(const unsigned &i)
Definition: vorticity_smoother.h:1628
unsigned Maximum_order_of_recoverable_velocity_derivatives
Definition: vorticity_smoother.h:1803
unsigned get_maximum_order_of_recoverable_vorticity_derivative() const
Definition: vorticity_smoother.h:625
unsigned Maximum_order_of_recoverable_vorticity_derivatives
Definition: vorticity_smoother.h:1798
unsigned nscalar_paraview() const
Definition: vorticity_smoother.h:987
unsigned nvorticity_derivatives_to_recover() const
Definition: vorticity_smoother.h:663
Vector< Vector< double > > create_container_for_vorticity_and_derivatives() const
Definition: vorticity_smoother.h:273
void get_raw_velocity_deriv(const Vector< double > &s, Vector< double > &dveloc_dx) const
Get raw derivative of velocity.
Definition: vorticity_smoother.h:1242
VorticitySmootherElement()
Constructor.
Definition: vorticity_smoother.h:227
void output(std::ostream &outfile, const unsigned &nplot)
Definition: vorticity_smoother.h:1159
int Maximum_order_of_velocity_derivative
Definition: vorticity_smoother.h:1819
unsigned stored_dof_to_recoverable_dof(const unsigned &i) const
Definition: vorticity_smoother.h:555
void output_smoothed_vorticity(std::ostream &outfile, const unsigned &nplot)
Output the velocity, smoothed vorticity and derivatives.
Definition: vorticity_smoother.h:899
int get_maximum_order_of_vorticity_derivative() const
Definition: vorticity_smoother.h:645
void get_raw_vorticity_third_deriv(const Vector< double > &s, Vector< double > &dvorticity_dxdxdy) const
Definition: vorticity_smoother.h:1514
void get_raw_vorticity_deriv(const Vector< double > &s, double &dvorticity_dx, const unsigned &index) const
Get raw derivative of smoothed vorticity.
Definition: vorticity_smoother.h:1369
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: vorticity_smoother.h:765
unsigned Number_of_values_per_field
Definition: vorticity_smoother.h:1810
void get_raw_vorticity_deriv(const Vector< double > &s, Vector< double > &dvorticity_dx) const
Get raw derivative of smoothed vorticity.
Definition: vorticity_smoother.h:1337
unsigned get_maximum_order_of_recoverable_velocity_derivative() const
Definition: vorticity_smoother.h:635
int Maximum_order_of_vorticity_derivative
Definition: vorticity_smoother.h:1814
unsigned required_nvalue(const unsigned &n) const
Definition: vorticity_smoother.h:734
unsigned nvelocity_derivatives_to_recover() const
Definition: vorticity_smoother.h:683
void output_analytical_veloc_and_vorticity(std::ostream &outfile, const unsigned &nplot)
Definition: vorticity_smoother.h:825
void pin_smoothed_vorticity()
Pin all smoothed vorticity quantities.
Definition: vorticity_smoother.h:801
ExactVorticityFctPt & exact_vorticity_fct_pt()
Definition: vorticity_smoother.h:710
std::pair< unsigned, unsigned > recovered_dof_to_container_id(const unsigned &i) const
Definition: vorticity_smoother.h:460
void get_raw_velocity_deriv(const Vector< double > &s, double &dveloc_dx, const unsigned &index) const
Get raw derivative of velocity.
Definition: vorticity_smoother.h:1276
void get_raw_vorticity_third_deriv(const Vector< double > &s, double &dvorticity_dxdxdy, const unsigned &index) const
Definition: vorticity_smoother.h:1556
void get_raw_vorticity_second_deriv(const Vector< double > &s, Vector< double > &dvorticity_dxdy) const
Get raw derivative of smoothed derivative vorticity.
Definition: vorticity_smoother.h:1416
std::pair< unsigned, unsigned > vorticity_dof_to_container_id(const unsigned &i) const
Definition: vorticity_smoother.h:315
std::string scalar_name_paraview(const unsigned &i) const
Definition: vorticity_smoother.h:1064
ExactVorticityFctPt exact_vorticity_fct_pt() const
Definition: vorticity_smoother.h:718
unsigned N_dim
Number of dimensions in the element.
Definition: vorticity_smoother.h:1787
Smoother for vorticity in 2D.
Definition: vorticity_smoother.h:1837
unsigned nrecovery_order() const
Get the recovery order.
Definition: vorticity_smoother.h:2393
void recover_vorticity(Mesh *mesh_pt, DocInfo &doc_info)
Definition: vorticity_smoother.h:2448
void recover_vorticity(Mesh *mesh_pt)
Recover vorticity from patches.
Definition: vorticity_smoother.h:2434
virtual ~VorticitySmoother()
Empty virtual destructor.
Definition: vorticity_smoother.h:1852
VorticitySmoother(const VorticitySmoother &)=delete
Broken copy constructor.
void shape_rec(const Vector< double > &x, Vector< double > &psi_r)
Definition: vorticity_smoother.h:1864
Integral * integral_rec(const bool &is_q_mesh)
Definition: vorticity_smoother.h:1926
unsigned & recovery_order()
Access function for order of recovery polynomials.
Definition: vorticity_smoother.h:1855
VorticitySmoother(const unsigned &recovery_order)
Constructor: Set order of recovery shape functions.
Definition: vorticity_smoother.h:1840
void operator=(const VorticitySmoother &)=delete
Broken assignment operator.
unsigned Recovery_order
Order of recovery polynomials.
Definition: vorticity_smoother.h:2665
void get_recovered_vorticity_in_patch(const Vector< ELEMENT * > &patch_el_pt, const unsigned &num_recovery_terms, Vector< double > *&recovered_vorticity_coefficient_pt, unsigned &n_deriv)
Definition: vorticity_smoother.h:2115
void setup_patches(Mesh *&mesh_pt, std::map< Node *, Vector< ELEMENT * > * > &adjacent_elements_pt, Vector< Node * > &vertex_node_pt)
Definition: vorticity_smoother.h:1999
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
squared absolute value
Definition: GlobalFunctions.h:87
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
void shape(const double &s, double *Psi)
Definition: shape.h:564
@ W
Definition: quadtree.h:63
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189
double timer()
returns the time in seconds after some point in past
Definition: oomph_utilities.cc:1295
class oomph::VorticityRecoveryHelpers::RecoveryHelper Recovery_helper
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2