46 template<
unsigned DIM>
    54 template<
unsigned DIM>
    55 int GeneralisedNewtonianNavierStokesEquations<DIM>::
    56 Pressure_not_stored_at_node = -100;
    59 template<
unsigned DIM>
    60 double GeneralisedNewtonianNavierStokesEquations<DIM>
::    64 template<
unsigned DIM>
    65 double GeneralisedNewtonianNavierStokesEquations<DIM>::
    66 Default_Physical_Ratio_Value = 1.0;
    69 template<
unsigned DIM>
    75 template<
unsigned DIM>
    76 bool GeneralisedNewtonianNavierStokesEquations<DIM>::
    77 Pre_multiply_by_viscosity_ratio = 
false;
    86  template<
unsigned DIM>
    90   const unsigned& which_one)
    93   unsigned n_dof=ndof();
    95   if ((which_one==0)||(which_one==1)) press_mass_diag.assign(n_dof,0.0);   
    96   if ((which_one==0)||(which_one==2)) veloc_mass_diag.assign(n_dof,0.0);
    99   unsigned n_node = nnode();
   102   unsigned n_dim = this->dim();
   109   for(
unsigned i=0; 
i<n_dim; 
i++)
   111     u_nodal_index[
i] = this->u_index_nst(
i);
   118   unsigned n_pres = npres_nst();
   124   unsigned n_intpt = integral_pt()->nweight();
   130   for(
unsigned ipt=0; ipt<n_intpt; ipt++)
   134     double w = integral_pt()->weight(ipt);
   137     double J = J_eulerian_at_knot(ipt);
   140     for(
unsigned i=0;
i<n_dim;
i++)
   142       s[
i] = integral_pt()->knot(ipt,
i);
   151     if ((which_one==0)||(which_one==2))
   155       shape_at_knot(ipt,psi);
   158       for(
unsigned l=0; l<n_node; l++)
   161         for(
unsigned i=0; 
i<n_dim; 
i++)
   163           local_eqn = nodal_local_eqn(l,u_nodal_index[
i]);
   169             veloc_mass_diag[local_eqn] += pow(psi[l],2) * 
W;
   176     if ((which_one==0)||(which_one==1))
   182       for(
unsigned l=0; l<n_pres; l++)
   185         local_eqn = p_local_eqn(l);
   191           press_mass_diag[local_eqn] += pow(psi_p[l],2) * 
W;
   206 template<
unsigned DIM>
   211               double& error, 
double& norm)
   223  unsigned n_intpt = integral_pt()->nweight();
   225  outfile << 
"ZONE" << std::endl;
   231  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
   235    for(
unsigned i=0;
i<DIM;
i++)
   237      s[
i] = integral_pt()->knot(ipt,
i);
   241    double w = integral_pt()->weight(ipt);
   244    double J=J_eulerian(s);
   253    (*exact_soln_pt)(time,x,exact_soln);
   256    for(
unsigned i=0;
i<DIM;
i++)
   258      norm+=exact_soln[
i]*exact_soln[
i]*
W;
   259      error+=(exact_soln[
i]-interpolated_u_nst(s,
i))*
   260       (exact_soln[
i]-interpolated_u_nst(s,
i))*W;
   264    for(
unsigned i=0;
i<DIM;
i++)
   266      outfile << x[
i] << 
" ";
   270    for(
unsigned i=0;
i<DIM;
i++)
   272      outfile << exact_soln[
i]-interpolated_u_nst(s,
i) << 
" ";
   275    outfile << std::endl;
   286 template<
unsigned DIM>
   288  std::ostream &outfile,
   290  double& error, 
double& norm)
   303  unsigned n_intpt = integral_pt()->nweight();
   306  outfile << 
"ZONE" << std::endl;
   312  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
   316    for(
unsigned i=0;
i<DIM;
i++)
   318      s[
i] = integral_pt()->knot(ipt,
i);
   322    double w = integral_pt()->weight(ipt);
   325    double J=J_eulerian(s);
   334    (*exact_soln_pt)(x,exact_soln);
   337    for(
unsigned i=0;
i<DIM;
i++)
   339      norm+=exact_soln[
i]*exact_soln[
i]*
W;
   340      error+=(exact_soln[
i]-interpolated_u_nst(s,
i))*
   341       (exact_soln[
i]-interpolated_u_nst(s,
i))*W;
   345    for(
unsigned i=0;
i<DIM;
i++)
   347      outfile << x[
i] << 
" ";
   351    for(
unsigned i=0;
i<DIM;
i++)
   353      outfile << exact_soln[
i]-interpolated_u_nst(s,
i) << 
" ";
   355    outfile << std::endl;   
   365 template<
unsigned DIM>
   368            const unsigned &nplot, 
   379  outfile << tecplot_zone_string(nplot);
   385  unsigned num_plot_points=nplot_points(nplot);
   386  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   390    get_s_plot(iplot,nplot,s);
   396    (*exact_soln_pt)(x,exact_soln);
   399    for(
unsigned i=0;
i<DIM;
i++)
   401      outfile << x[
i] << 
" ";
   405    for(
unsigned i=0;
i<exact_soln.size();
i++)
   407      outfile << exact_soln[
i] << 
" ";
   410    outfile << std::endl;
   415  write_tecplot_zone_footer(outfile,nplot);
   425 template<
unsigned DIM>
   428            const unsigned &nplot, 
   440  outfile << tecplot_zone_string(nplot);
   446  unsigned num_plot_points=nplot_points(nplot);
   447  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   451    get_s_plot(iplot,nplot,s);
   457    (*exact_soln_pt)(time,x,exact_soln);
   460    for(
unsigned i=0;
i<DIM;
i++)
   462      outfile << x[
i] << 
" ";
   466    for(
unsigned i=0;
i<exact_soln.size();
i++)
   468      outfile << exact_soln[
i] << 
" ";
   471    outfile << std::endl;
   475  write_tecplot_zone_footer(outfile,nplot);
   486 template<
unsigned DIM>
   489              const unsigned& nplot, 
   494  unsigned n_node = nnode();
   505  outfile << tecplot_zone_string(nplot);
   508  unsigned num_plot_points=nplot_points(nplot);
   509  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   513    get_s_plot(iplot,nplot,s);
   519    for(
unsigned i=0;
i<DIM;
i++) 
   521      interpolated_x[
i]=0.0;
   522      interpolated_u[
i]=0.0;
   524      unsigned u_nodal_index = u_index_nst(
i);
   526      for(
unsigned l=0;l<n_node;l++) 
   528        interpolated_u[
i] += nodal_value(t,l,u_nodal_index)*psi[l];
   529        interpolated_x[
i] += nodal_position(t,l,
i)*psi[l];
   534    for(
unsigned i=0;
i<DIM;
i++) 
   536      outfile << interpolated_x[
i] << 
" ";
   540    for(
unsigned i=0;
i<DIM;
i++) 
   542      outfile << interpolated_u[
i] << 
" ";
   545    outfile << std::endl;   
   549  write_tecplot_zone_footer(outfile,nplot);
   559 template<
unsigned DIM>
   561 output(std::ostream &outfile, 
const unsigned &nplot)
   568  outfile << tecplot_zone_string(nplot);
   571  unsigned num_plot_points=nplot_points(nplot);
   572  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   576    get_s_plot(iplot,nplot,s);
   579    for(
unsigned i=0;
i<DIM;
i++) 
   581      outfile << interpolated_x(s,
i) << 
" ";
   585    for(
unsigned i=0;
i<DIM;
i++) 
   587      outfile << interpolated_u_nst(s,
i) << 
" ";
   591    outfile << interpolated_p_nst(s)  << 
" ";
   593    outfile << std::endl;   
   595  outfile << std::endl;
   598  write_tecplot_zone_footer(outfile,nplot);
   609 template<
unsigned DIM>
   611 output(FILE* file_pt, 
const unsigned &nplot)
   618   fprintf(file_pt,
"%s",tecplot_zone_string(nplot).c_str());
   621  unsigned num_plot_points=nplot_points(nplot);
   622  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   626    get_s_plot(iplot,nplot,s);
   629    for(
unsigned i=0;
i<DIM;
i++) 
   631      fprintf(file_pt,
"%g ",interpolated_x(s,
i));
   635    for(
unsigned i=0;
i<DIM;
i++) 
   637      fprintf(file_pt,
"%g ",interpolated_u_nst(s,
i));
   641    fprintf(file_pt,
"%g \n",interpolated_p_nst(s));
   643  fprintf(file_pt,
"\n");
   646  write_tecplot_zone_footer(file_pt,nplot);
   657 template<
unsigned DIM>
   672  outfile << tecplot_zone_string(nplot);
   675  unsigned n_node = nnode();
   679  DShape dpsifdx(n_node,DIM);
   682  unsigned num_plot_points=nplot_points(nplot);
   683  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   687    get_s_plot(iplot,nplot,s);
   690    dshape_eulerian(s,psif,dpsifdx);
   699    for(
unsigned i=0;
i<DIM;
i++)
   704      for(
unsigned j=0;j<DIM;j++)
   706        interpolated_dudx(
i,j) = 0.0;
   714    for(
unsigned i=0;
i<DIM;
i++)
   717      unsigned u_nodal_index = u_index_nst(
i);
   719      for(
unsigned l=0;l<n_node;l++) 
   721        dudt[
i]+=du_dt_nst(l,u_nodal_index)*psif[l];
   722        mesh_veloc[
i]+=dnodal_position_dt(l,
i)*psif[l];
   725        for(
unsigned j=0;j<DIM;j++)
   727          interpolated_dudx(
i,j) += nodal_value(l,u_nodal_index)*dpsifdx(l,j);
   734    for(
unsigned i=0;
i<DIM;
i++)
   737      for (
unsigned k=0;k<DIM;k++)
   739        dudt_ALE[
i]-=mesh_veloc[k]*interpolated_dudx(
i,k);
   745    for(
unsigned i=0;
i<DIM;
i++) 
   747      outfile << interpolated_x(s,
i) << 
" ";
   751    for(
unsigned i=0;
i<DIM;
i++) 
   753      outfile << interpolated_u_nst(s,
i) << 
" ";
   757    outfile << interpolated_p_nst(s)  << 
" ";
   760    for(
unsigned i=0;
i<DIM;
i++) 
   762      outfile << dudt_ALE[
i] << 
" ";
   772    outfile << dissipation(s) << 
" ";
   775    outfile << std::endl;   
   780  write_tecplot_zone_footer(outfile,nplot); 
   790 template<
unsigned DIM>
   811     "Can't output vorticity in 1D - in fact, what do you mean\n";
   812    error_message += 
"by the 1D Navier-Stokes equations?\n";
   815                        OOMPH_CURRENT_FUNCTION,
   816                        OOMPH_EXCEPTION_LOCATION);
   820  outfile << tecplot_zone_string(nplot);
   823  unsigned num_plot_points=nplot_points(nplot);
   824  for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
   828    get_s_plot(iplot,nplot,s);
   831    for(
unsigned i=0;
i<DIM;
i++) 
   833      outfile << interpolated_x(s,
i) << 
" ";
   837    get_vorticity(s,vorticity);
   841      outfile << vorticity[0];
   845      outfile << vorticity[0] << 
" "   846              << vorticity[1] << 
" "   847              << vorticity[2] << 
" ";
   850    outfile << std::endl;   
   852  outfile << std::endl;
   855  write_tecplot_zone_footer(outfile,nplot);
   864 template<
unsigned DIM>
   868   "Check the dissipation calculation for GeneralisedNewtonian NSt",
   869   OOMPH_CURRENT_FUNCTION,
   870   OOMPH_EXCEPTION_LOCATION);
   876  unsigned n_intpt = integral_pt()->nweight();
   882  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
   886    for(
unsigned i=0;
i<DIM;
i++)
   888      s[
i] = integral_pt()->knot(ipt,
i);
   892    double w = integral_pt()->weight(ipt);
   895    double J = J_eulerian(s);
   899    strain_rate(s,strainrate);
   902    double local_diss=0.0;
   903    for(
unsigned i=0;
i<DIM;
i++) 
   905      for(
unsigned j=0;j<DIM;j++) 
   907        local_diss+=2.0*strainrate(
i,j)*strainrate(
i,j);
   911    diss+=local_diss*w*J;
   923 template<
unsigned DIM>
   935  if(!Use_extrapolated_strainrate_to_compute_second_invariant)
   937    strain_rate(s,strainrate);
   941    extrapolated_strain_rate(s,strainrate);
   947  double visc=Constitutive_eqn_pt->viscosity(second_invariant);
   950  double press=interpolated_p_nst(s);
   953  for (
unsigned i=0;
i<DIM;
i++)
   955    traction[
i]=-press*N[
i];
   956    for (
unsigned j=0;j<DIM;j++)
   958      traction[
i]+=visc*2.0*strainrate(
i,j)*N[j];
   970 template<
unsigned DIM>
   985  if(!Use_extrapolated_strainrate_to_compute_second_invariant)
   987    strain_rate(s,strainrate);
   991    extrapolated_strain_rate(s,strainrate);
   997  double visc=Constitutive_eqn_pt->viscosity(second_invariant);
  1000  double press=interpolated_p_nst(s);
  1003  for (
unsigned i=0;
i<DIM;
i++)
  1006    traction_p[
i]=-press*N[
i];
  1007    for (
unsigned j=0;j<DIM;j++)
  1010      traction_visc[
i]+=visc*2.0*strainrate(
i,j)*N[j];
  1013    traction_visc_n[
i]=traction_visc[
i]*N[
i];
  1014    traction_visc_t[
i]=traction_visc[
i]-traction_visc_n[
i];
  1022 template<
unsigned DIM>
  1027   "Check the dissipation calculation for GeneralisedNewtonian NSt",
  1028   OOMPH_CURRENT_FUNCTION,
  1029   OOMPH_EXCEPTION_LOCATION);
  1033  strain_rate(s,strainrate);
  1036  double local_diss=0.0;
  1037  for(
unsigned i=0;
i<DIM;
i++) 
  1039    for(
unsigned j=0;j<DIM;j++) 
  1041      local_diss+=2.0*strainrate(
i,j)*strainrate(
i,j);
  1051 template<
unsigned DIM>
  1058    if ((strainrate.
ncol()!=DIM)||(strainrate.
nrow()!=DIM))
  1060      std::ostringstream error_message;
  1061      error_message  << 
"The strain rate has incorrect dimensions "   1062                     << strainrate.
ncol() << 
" x "   1063                     << strainrate.
nrow() << 
" Not " << DIM << std::endl;
  1066                          OOMPH_CURRENT_FUNCTION,
  1067                          OOMPH_EXCEPTION_LOCATION);
  1075    unsigned n_node = nnode();
  1079    DShape dpsidx(n_node,DIM);
  1082    dshape_eulerian(s,psi,dpsidx);
  1085    for(
unsigned i=0;
i<DIM;
i++)
  1087      for(
unsigned j=0;j<DIM;j++)
  1094      for(
unsigned i=0;
i<DIM;
i++)
  1097        unsigned u_nodal_index = u_index_nst(
i);
  1099        for(
unsigned j=0;j<DIM;j++)
  1102          for(
unsigned l=0;l<n_node;l++) 
  1104            dudx(
i,j) += nodal_value(l,u_nodal_index)*dpsidx(l,j);
  1110    for(
unsigned i=0;
i<DIM;
i++)
  1113      for(
unsigned j=0;j<DIM;j++)
  1115        strainrate(
i,j)=0.5*(dudx(
i,j)+dudx(j,
i));
  1125 template<
unsigned DIM>
  1132    if ((strainrate.
ncol()!=DIM)||(strainrate.
nrow()!=DIM))
  1134      std::ostringstream error_message;
  1135      error_message  << 
"The strain rate has incorrect dimensions "   1136                     << strainrate.
ncol() << 
" x "   1137                     << strainrate.
nrow() << 
" Not " << DIM << std::endl;
  1140                          OOMPH_CURRENT_FUNCTION,
  1141                          OOMPH_EXCEPTION_LOCATION);
  1149    unsigned n_node = nnode();
  1153    DShape dpsidx(n_node,DIM);
  1158    for (
unsigned j=0;j<n_node;j++)
  1160      for(
unsigned k=0;k<DIM;k++)
  1162        backed_up_nodal_position(j,k)=node_pt(j)->x(k);
  1163        node_pt(j)->x(k)=node_pt(j)->x(t,k);
  1168    dshape_eulerian(s,psi,dpsidx);
  1171    for(
unsigned i=0;
i<DIM;
i++)
  1173      for(
unsigned j=0;j<DIM;j++)
  1180      for(
unsigned i=0;
i<DIM;
i++)
  1183        unsigned u_nodal_index = u_index_nst(
i);
  1185        for(
unsigned j=0;j<DIM;j++)
  1188          for(
unsigned l=0;l<n_node;l++) 
  1190            dudx(
i,j) += nodal_value(t,l,u_nodal_index)*dpsidx(l,j);
  1196    for(
unsigned i=0;
i<DIM;
i++)
  1199      for(
unsigned j=0;j<DIM;j++)
  1201        strainrate(
i,j)=0.5*(dudx(
i,j)+dudx(j,
i));
  1206    for (
unsigned j=0;j<n_node;j++)
  1208      for(
unsigned k=0;k<DIM;k++)
  1210        node_pt(j)->x(k)=backed_up_nodal_position(j,k);
  1220 template<
unsigned DIM>
  1227    if ((strainrate.
ncol()!=DIM)||(strainrate.
nrow()!=DIM))
  1229      std::ostringstream error_message;
  1230      error_message  << 
"The strain rate has incorrect dimensions "   1231                     << strainrate.
ncol() << 
" x "   1232                     << strainrate.
nrow() << 
" Not " << DIM << std::endl;
  1235                          OOMPH_CURRENT_FUNCTION,
  1236                          OOMPH_EXCEPTION_LOCATION);
  1242  strain_rate(2,s,strain_rate_minus_two);
  1245  strain_rate(1,s,strain_rate_minus_one);
  1248  TimeStepper* time_stepper_pt=node_pt(0)->time_stepper_pt();
  1251  double dt_current=time_stepper_pt->
time_pt()->
dt(0);
  1252  double dt_prev=time_stepper_pt->
time_pt()->
dt(1);
  1255  for (
unsigned i=0;
i<DIM;
i++)
  1257    for (
unsigned j=0;j<DIM;j++)
  1260      double slope=(strain_rate_minus_one(
i,j)-strain_rate_minus_two(
i,j))/
  1264      strainrate(
i,j)=strain_rate_minus_one(
i,j)+slope*dt_current;
  1282    if (vorticity.size()!=1)
  1284      std::ostringstream error_message;
  1286       << 
"Computation of vorticity in 2D requires a 1D vector\n"  1287       << 
"which contains the only non-zero component of the\n"  1288       << 
"vorticity vector. You've passed a vector of size "  1289       << vorticity.size() << std::endl;
  1292                          OOMPH_CURRENT_FUNCTION,
  1293                          OOMPH_EXCEPTION_LOCATION);
  1304  unsigned n_node = nnode();
  1308  DShape dpsidx(n_node,DIM);
  1311  dshape_eulerian(s,psi,dpsidx);
  1314  for(
unsigned i=0;
i<DIM;
i++)
  1316    for(
unsigned j=0;j<DIM;j++)
  1323    for(
unsigned i=0;
i<DIM;
i++)
  1326      unsigned u_nodal_index = u_index_nst(
i);
  1328      for(
unsigned j=0;j<DIM;j++)
  1331        for(
unsigned l=0;l<n_node;l++) 
  1333          dudx(
i,j) += nodal_value(l,u_nodal_index)*dpsidx(l,j);
  1339  vorticity[0]=dudx(1,0)-dudx(0,1);
  1356    if (vorticity.size()!=3)
  1358      std::ostringstream error_message;
  1360       << 
"Computation of vorticity in 3D requires a 3D vector\n"  1361       << 
"which contains the only non-zero component of the\n"  1362       << 
"vorticity vector. You've passed a vector of size "  1363       << vorticity.size() << std::endl;
  1366                          OOMPH_CURRENT_FUNCTION,
  1367                          OOMPH_EXCEPTION_LOCATION);
  1378  unsigned n_node = nnode();
  1382  DShape dpsidx(n_node,DIM);
  1385  dshape_eulerian(s,psi,dpsidx);
  1388  for(
unsigned i=0;
i<DIM;
i++)
  1390    for(
unsigned j=0;j<DIM;j++)
  1397    for(
unsigned i=0;
i<DIM;
i++)
  1400      unsigned u_nodal_index = u_index_nst(
i);
  1402      for(
unsigned j=0;j<DIM;j++)
  1405        for(
unsigned l=0;l<n_node;l++) 
  1407          dudx(
i,j) += nodal_value(l,u_nodal_index)*dpsidx(l,j);
  1412  vorticity[0]=dudx(2,1)-dudx(1,2);
  1413  vorticity[1]=dudx(0,2)-dudx(2,0);
  1414  vorticity[2]=dudx(1,0)-dudx(0,1);
  1427 template<
unsigned DIM>
  1432   "Check the kinetic energy calculation for GeneralisedNewtonian NSt",
  1433   OOMPH_CURRENT_FUNCTION,
  1434   OOMPH_EXCEPTION_LOCATION);
  1440  unsigned n_intpt = integral_pt()->nweight();
  1446  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
  1449    for(
unsigned i=0;
i<DIM;
i++)
  1451      s[
i] = integral_pt()->knot(ipt,
i);
  1455    double w = integral_pt()->weight(ipt);
  1458    double J = J_eulerian(s);
  1461    double veloc_squared=0.0;
  1462    for(
unsigned i=0;
i<DIM;
i++) 
  1464      veloc_squared+=interpolated_u_nst(s,
i)*interpolated_u_nst(s,
i);
  1467    kin_en+=0.5*veloc_squared*w*J;
  1478 template<
unsigned DIM>
  1482  double d_kin_en_dt=0.0;
  1485  const unsigned n_intpt = integral_pt()->nweight();
  1491  const unsigned n_node = this->nnode();
  1495  DShape dpsidx(n_node,DIM);
  1498  unsigned u_index[DIM];
  1499  for(
unsigned i=0;
i<DIM;
i++) {u_index[
i] = this->u_index_nst(
i);}
  1502  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
  1505    double J = dshape_eulerian_at_knot(ipt,psi,dpsidx);
  1508    double w = integral_pt()->weight(ipt);
  1511    Vector<double> interpolated_u(DIM,0.0), interpolated_dudt(DIM,0.0);
  1514    for(
unsigned l=0;l<n_node;l++)
  1517      for(
unsigned i=0;
i<DIM;
i++)
  1519        interpolated_u[
i] += nodal_value(l,u_index[
i])*psi(l);
  1520        interpolated_dudt[
i] += du_dt_nst(l,u_index[i])*psi(l);
  1531      for(
unsigned l=0;l<n_node;l++) 
  1533        for(
unsigned i=0;
i<DIM;
i++)
  1535          mesh_velocity[
i] += this->dnodal_position_dt(l,
i)*psi(l);
  1537          for(
unsigned j=0;j<DIM;j++)
  1539            interpolated_dudx(
i,j) += 
  1540             this->nodal_value(l,u_index[
i])*dpsidx(l,j);
  1546      for(
unsigned i=0;
i<DIM;
i++)
  1548        for (
unsigned k=0;k<DIM;k++)
  1550          interpolated_dudt[
i] -= mesh_velocity[k]*interpolated_dudx(
i,k);
  1558    for(
unsigned i=0;
i<DIM;
i++) 
  1559     { sum += interpolated_u[
i]*interpolated_dudt[
i];}
  1561    d_kin_en_dt += sum*w*J;
  1572 template<
unsigned DIM>
  1580  unsigned n_intpt = integral_pt()->nweight();
  1586  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
  1590    for(
unsigned i=0;
i<DIM;
i++)
  1592      s[
i] = integral_pt()->knot(ipt,
i);
  1596    double w = integral_pt()->weight(ipt);
  1599    double J = J_eulerian(s);
  1605    double press=interpolated_p_nst(s);
  1620 template<
unsigned DIM>
  1623                                     double& max_invariant,
  1624                                     double& min_viscosity,
  1625                                     double& max_viscosity)
 const  1628   min_invariant=DBL_MAX;
  1629   max_invariant=-DBL_MAX;
  1630   min_viscosity=DBL_MAX;
  1631   max_viscosity=-DBL_MAX;
  1634   unsigned Nintpt = integral_pt()->nweight();
  1640   for(
unsigned ipt=0;ipt<Nintpt;ipt++)
  1643     for(
unsigned i=0;
i<DIM;
i++) s[
i] = integral_pt()->knot(ipt,
i);
  1647     strain_rate(s,strainrate);
  1654     double viscosity=Constitutive_eqn_pt->viscosity(second_invariant);
  1656     min_invariant=std::min(min_invariant,second_invariant);
  1657     max_invariant=std::max(max_invariant,second_invariant);
  1658     min_viscosity=std::min(min_viscosity,viscosity);
  1659     max_viscosity=std::max(max_viscosity,viscosity);
  1670 template<
unsigned DIM>
  1678  if (ndof()==0) 
return;
  1681  unsigned n_node = nnode();
  1684  double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
  1687  unsigned n_pres = npres_nst();
  1690  unsigned u_nodal_index[DIM];
  1691  for(
unsigned i=0;
i<DIM;
i++) {u_nodal_index[
i] = u_index_nst(
i);}
  1694  Shape psif(n_node), testf(n_node);
  1695  DShape dpsifdx(n_node,DIM), dtestfdx(n_node,DIM);
  1698  Shape psip(n_pres), testp(n_pres);
  1701  unsigned n_intpt = integral_pt()->nweight();
  1708  double scaled_re = re()*density_ratio();
  1709  double scaled_re_st = re_st()*density_ratio();
  1710  double scaled_re_inv_fr = re_invfr()*density_ratio();
  1711  double visc_ratio = viscosity_ratio();
  1715  int local_eqn=0, local_unknown=0;
  1718  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
  1721    for(
unsigned i=0;
i<DIM;
i++) s[
i] = integral_pt()->knot(ipt,
i);
  1723    double w = integral_pt()->weight(ipt);
  1727     dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,testf,dtestfdx);
  1730    pshape_nst(s,psip,testp);
  1737    double interpolated_p=0.0;
  1745    for(
unsigned l=0;l<n_pres;l++) interpolated_p += p_nst(l)*psip[l];
  1750    for(
unsigned l=0;l<n_node;l++) 
  1753      for(
unsigned i=0;
i<DIM;
i++)
  1756        double u_value = raw_nodal_value(l,u_nodal_index[
i]);
  1757        interpolated_u[
i] += u_value*psif[l];
  1758        interpolated_x[
i] += raw_nodal_position(l,i)*psif[l];
  1759        dudt[
i] += du_dt_nst(l,i)*psif[l];
  1762        for(
unsigned j=0;j<DIM;j++)
  1764          interpolated_dudx(i,j) += u_value*dpsifdx(l,j);
  1772      for(
unsigned l=0;l<n_node;l++) 
  1775        for(
unsigned i=0;
i<DIM;
i++)
  1777          mesh_velocity[
i] += this->raw_dnodal_position_dt(l,
i)*psif[l];
  1788    if(!Use_extrapolated_strainrate_to_compute_second_invariant)
  1790      strain_rate(s,strainrate_to_compute_second_invariant);
  1794      extrapolated_strain_rate(ipt,strainrate_to_compute_second_invariant);
  1799     strainrate_to_compute_second_invariant);
  1802    double viscosity=Constitutive_eqn_pt->viscosity(second_invariant);
  1806    get_body_force_nst(time,ipt,s,interpolated_x,body_force);
  1809    double source = get_source_nst(time,ipt,interpolated_x);
  1815    if(!Use_extrapolated_strainrate_to_compute_second_invariant)
  1818      double dviscosity_dsecond_invariant=
  1819       Constitutive_eqn_pt->dviscosity_dinvariant(second_invariant);
  1823      strain_rate(s,strainrate);
  1833      for(
unsigned i=0;
i<DIM;
i++)
  1835        for(
unsigned j=0;j<DIM;j++)
  1840            kroneckerdelta(
i,
i)=1.0;
  1843            for(
unsigned k=0;k<DIM;k++)
  1847                tmp+=strainrate(k,k);
  1850            dinvariant_dstrainrate(
i,
i)=tmp;
  1854            dinvariant_dstrainrate(
i,j)=-strainrate(j,
i);
  1864      for(
unsigned l=0;l<n_node;l++)
  1867        for(
unsigned k=0;k<DIM;k++)
  1870          for(
unsigned i=0;
i<DIM;
i++)
  1872            for(
unsigned j=0;j<DIM;j++)
  1875              dstrainrate_dunknown(
i,j,k,l)=0.0;
  1878              for(
unsigned m=0;m<DIM;m++)
  1880                for(
unsigned n=0;n<DIM;n++)
  1882                  dstrainrate_dunknown(
i,j,k,l)+=
  1883                   0.5*(kroneckerdelta(
i,m)*kroneckerdelta(j,n)+
  1884                        kroneckerdelta(
i,n)*kroneckerdelta(j,m))*
  1885                   kroneckerdelta(m,k)*dpsifdx(l,n);
  1895      for(
unsigned l=0;l<n_node;l++)
  1898        for(
unsigned k=0;k<DIM;k++)
  1901          for(
unsigned i=0;
i<DIM;
i++)
  1903            for(
unsigned j=0;j<DIM;j++)
  1905              dviscosity_dunknown(k,l)+=dviscosity_dsecond_invariant*
  1906               dinvariant_dstrainrate(
i,j)*dstrainrate_dunknown(
i,j,k,l);
  1919    for(
unsigned l=0;l<n_node;l++)
  1922      for(
unsigned i=0;
i<DIM;
i++)
  1925        local_eqn = nodal_local_eqn(l,u_nodal_index[
i]);
  1929          residuals[local_eqn] += 
  1930           body_force[
i]*testf[l]*
W;
  1933          residuals[local_eqn] += scaled_re_inv_fr*testf[l]*G[
i]*
W;
  1937          if(Pre_multiply_by_viscosity_ratio)
  1939            residuals[local_eqn]  += 
  1940             visc_ratio*viscosity*interpolated_p*dtestfdx(l,i)*
W;
  1944            residuals[local_eqn]  += interpolated_p*dtestfdx(l,i)*
W;
  1951          for(
unsigned k=0;k<DIM;k++)
  1953            residuals[local_eqn] -= visc_ratio*viscosity*
  1954             (interpolated_dudx(i,k) + Gamma[
i]*interpolated_dudx(k,i))
  1960          residuals[local_eqn] -= scaled_re_st*dudt[
i]*testf[l]*
W;
  1964          for(
unsigned k=0;k<DIM;k++)
  1966            double tmp=scaled_re*interpolated_u[k];
  1968            residuals[local_eqn] -= tmp*interpolated_dudx(i,k)*testf[l]*
W;
  1976            for(
unsigned l2=0;l2<n_node;l2++)
  1979              for(
unsigned i2=0;i2<DIM;i2++)
  1982                local_unknown = nodal_local_eqn(l2,u_nodal_index[i2]);
  1983                if(local_unknown >= 0)
  1986                  jacobian(local_eqn,local_unknown) 
  1987                   -= visc_ratio*viscosity*Gamma[
i]*
  1988                   dpsifdx(l2,i)*dtestfdx(l,i2)*
W;
  1994                    for(
unsigned k=0;k<DIM;k++)
  1996                      jacobian(local_eqn,local_unknown)
  1997                       -= visc_ratio*viscosity*dpsifdx(l2,k)*dtestfdx(l,k)*
W;
  2001                  if(!Use_extrapolated_strainrate_to_compute_second_invariant)
  2003                    for(
unsigned k=0;k<DIM;k++)
  2005                      jacobian(local_eqn,local_unknown)
  2006                       -= visc_ratio*dviscosity_dunknown(i2,l2)*
  2007                       (interpolated_dudx(i,k) + Gamma[
i]*interpolated_dudx(k,i))
  2013                  jacobian(local_eqn,local_unknown)
  2014                   -= scaled_re*psif[l2]*interpolated_dudx(i,i2)*testf[l]*
W;
  2025                      mass_matrix(local_eqn,local_unknown) +=
  2026                       scaled_re_st*psif[l2]*testf[l]*
W;
  2030                    jacobian(local_eqn,local_unknown)
  2032                     node_pt(l2)->time_stepper_pt()->weight(1,0)*
  2033                     psif[l2]*testf[l]*
W;  
  2036                    for(
unsigned k=0;k<DIM;k++)
  2038                      double tmp=scaled_re*interpolated_u[k];
  2040                      jacobian(local_eqn,local_unknown) -=
  2041                       tmp*dpsifdx(l2,k)*testf[l]*
W;
  2051            for(
unsigned l2=0;l2<n_pres;l2++)
  2054              local_unknown = p_local_eqn(l2);
  2055              if(local_unknown >= 0)
  2057                if(Pre_multiply_by_viscosity_ratio)
  2059                  jacobian(local_eqn,local_unknown)
  2060                   += visc_ratio*viscosity*psip[l2]*dtestfdx(l,i)*
W;
  2064                  jacobian(local_eqn,local_unknown)
  2065                   += psip[l2]*dtestfdx(l,i)*
W;
  2082    for(
unsigned l=0;l<n_pres;l++)
  2084      local_eqn = p_local_eqn(l);
  2094        for(
unsigned k=0;k<DIM;k++)
  2097          aux += interpolated_dudx(k,k);
  2101        if(Pre_multiply_by_viscosity_ratio)
  2103          residuals[local_eqn]+=visc_ratio*viscosity*aux*testp[l]*
W;
  2107          residuals[local_eqn]+=aux*testp[l]*
W;
  2114          for(
unsigned l2=0;l2<n_node;l2++)
  2117            for(
unsigned i2=0;i2<DIM;i2++)
  2120              local_unknown = nodal_local_eqn(l2,u_nodal_index[i2]);
  2121              if(local_unknown >= 0)
  2123                if(Pre_multiply_by_viscosity_ratio)
  2125                  jacobian(local_eqn,local_unknown)
  2126                   += visc_ratio*viscosity*dpsifdx(l2,i2)*testp[l]*
W;
  2130                  jacobian(local_eqn,local_unknown)
  2131                   += dpsifdx(l2,i2)*testp[l]*
W;
  2150 template<
unsigned DIM>
  2153  double* 
const ¶meter_pt,
  2160                      OOMPH_CURRENT_FUNCTION,
  2161                      OOMPH_EXCEPTION_LOCATION);
  2168 template<
unsigned DIM>
  2176   "Not yet implemented\n",
  2177   OOMPH_CURRENT_FUNCTION,
  2178   OOMPH_EXCEPTION_LOCATION);
  2188 template <
unsigned DIM>
  2192  dresidual_dnodal_coordinates)
  2195  if(ndof()==0) { 
return; }
  2198  const unsigned n_node = nnode();
  2201  double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
  2204  const unsigned n_pres = npres_nst();
  2207  unsigned u_nodal_index[DIM];
  2208  for(
unsigned i=0;
i<DIM;
i++) { u_nodal_index[
i] = u_index_nst(
i); }
  2211  Shape psif(n_node), testf(n_node);
  2212  DShape dpsifdx(n_node,DIM), dtestfdx(n_node,DIM);
  2215  Shape psip(n_pres), testp(n_pres);
  2233  const unsigned n_intpt = integral_pt()->nweight();
  2240  double scaled_re = re()*density_ratio();
  2241  double scaled_re_st = re_st()*density_ratio();
  2242  double scaled_re_inv_fr = re_invfr()*density_ratio();
  2243  double visc_ratio = viscosity_ratio();
  2252  bool element_has_node_with_aux_node_update_fct=
false;
  2253  for (
unsigned q=0;q<n_node;q++)
  2255    Node* nod_pt=node_pt(q);
  2260      element_has_node_with_aux_node_update_fct=
true;
  2264      for (
unsigned i=0;
i<DIM;
i++)
  2266        u_ref[
i]=*(nod_pt->
value_pt(u_nodal_index[
i]));
  2270      for (
unsigned p=0;p<DIM;p++)
  2273        double backup=nod_pt->
x(p);
  2277        nod_pt->
x(p)+=eps_fd;
  2283        d_U_dX(p,q)=(*(nod_pt->
value_pt(u_nodal_index[p]))-u_ref[p])/eps_fd;
  2286        nod_pt->
x(p)=backup;
  2298  for(
unsigned ipt=0;ipt<n_intpt;ipt++)
  2301    for(
unsigned i=0;
i<DIM;
i++) { s[
i] = integral_pt()->knot(ipt,
i); }
  2304    const double w = integral_pt()->weight(ipt);
  2307    const double J = dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,
  2310                                                           d_dtestfdx_dX,dJ_dX);
  2313    pshape_nst(s,psip,testp);
  2317    double interpolated_p=0.0;
  2325    for(
unsigned l=0;l<n_pres;l++) { interpolated_p += p_nst(l)*psip[l]; }
  2330    for(
unsigned l=0;l<n_node;l++) 
  2333      for(
unsigned i=0;
i<DIM;
i++)
  2336        double u_value = raw_nodal_value(l,u_nodal_index[
i]);
  2337        interpolated_u[
i] += u_value*psif[l];
  2338        interpolated_x[
i] += raw_nodal_position(l,i)*psif[l];
  2339        dudt[
i] += du_dt_nst(l,i)*psif[l];
  2342        for(
unsigned j=0;j<DIM;j++)
  2344          interpolated_dudx(i,j) += u_value*dpsifdx(l,j);
  2352      for(
unsigned l=0;l<n_node;l++) 
  2355        for(
unsigned i=0;
i<DIM;
i++)
  2357          mesh_velocity[
i] += this->raw_dnodal_position_dt(l,
i)*psif[l];
  2363    for(
unsigned q=0;q<n_node;q++)
  2366      for(
unsigned p=0;p<DIM;p++)
  2368        for(
unsigned i=0;
i<DIM;
i++)
  2370          for(
unsigned k=0;k<DIM;k++)
  2373            for(
unsigned j=0;j<n_node;j++)
  2376               raw_nodal_value(j,u_nodal_index[
i])*d_dpsifdx_dX(p,q,j,k);
  2378            d_dudx_dX(p,q,
i,k) = aux;
  2386    const double pos_time_weight
  2387     = node_pt(0)->position_time_stepper_pt()->weight(1,0);
  2388    const double val_time_weight = node_pt(0)->time_stepper_pt()->weight(1,0);
  2392    get_body_force_nst(time,ipt,s,interpolated_x,body_force);
  2395    const double source = get_source_nst(time,ipt,interpolated_x);
  2402    get_body_force_gradient_nst(
  2403     time,ipt,s,interpolated_x,d_body_force_dx);
  2407    get_source_gradient_nst(time,ipt,interpolated_x,source_gradient);
  2417    for(
unsigned l=0;l<n_node;l++)
  2421      for(
unsigned i=0;
i<DIM;
i++)
  2424        local_eqn = nodal_local_eqn(l,u_nodal_index[
i]);;
  2430          for (
unsigned p=0;p<DIM;p++)
  2433            for (
unsigned q=0;q<n_node;q++)
  2440              double sum = body_force[
i]*testf[l];
  2443              sum += scaled_re_inv_fr*testf[l]*G[
i];
  2446              sum  += interpolated_p*dtestfdx(l,i);
  2452              for(
unsigned k=0;k<DIM;k++)
  2455                 (interpolated_dudx(i,k) + Gamma[
i]*interpolated_dudx(k,i))
  2462              sum -= scaled_re_st*dudt[
i]*testf[l];
  2465              for(
unsigned k=0;k<DIM;k++)
  2467                double tmp=scaled_re*interpolated_u[k];
  2469                sum -= tmp*interpolated_dudx(i,k)*testf[l];
  2473              dresidual_dnodal_coordinates(local_eqn,p,q)+=sum*dJ_dX(p,q)*w;
  2479              sum=d_body_force_dx(i,p)*psif(q)*testf(l);
  2482              sum += interpolated_p*d_dtestfdx_dX(p,q,l,i);
  2485              for (
unsigned k=0;k<DIM;k++)
  2488                 (interpolated_dudx(i,k) + Gamma[
i]*interpolated_dudx(k,i))
  2489                 *d_dtestfdx_dX(p,q,l,k)+                
  2490                 (d_dudx_dX(p,q,i,k) + Gamma[
i]*d_dudx_dX(p,q,k,i))
  2495              for(
unsigned k=0;k<DIM;k++)
  2497                double tmp=scaled_re*interpolated_u[k];
  2499                sum -= tmp*d_dudx_dX(p,q,i,k)*testf(l);
  2503                 sum+=scaled_re_st*pos_time_weight*
  2504                  psif(q)*interpolated_dudx(i,p)*testf(l);
  2508              dresidual_dnodal_coordinates(local_eqn,p,q)+=sum*J*w;
  2512              if(element_has_node_with_aux_node_update_fct)
  2514                sum=-visc_ratio*Gamma[
i]*dpsifdx(q,i)*dtestfdx(l,p)
  2515                 -scaled_re*psif(q)*interpolated_dudx(i,p)*testf(l);
  2518                  sum-=scaled_re_st*val_time_weight*psif(q)*testf(l);
  2519                  for (
unsigned k=0;k<DIM;k++)
  2521                    sum-=visc_ratio*dpsifdx(q,k)*dtestfdx(l,k);
  2522                    double tmp=scaled_re*interpolated_u[k];
  2524                    sum-=tmp*dpsifdx(q,k)*testf(l); 
  2527                dresidual_dnodal_coordinates(local_eqn,p,q)+=
  2528                 sum*d_U_dX(p,q)*J*w; 
  2541    for(
unsigned l=0;l<n_pres;l++)
  2543      local_eqn = p_local_eqn(l);
  2550        for (
unsigned p=0;p<DIM;p++)
  2553          for (
unsigned q=0;q<n_node;q++)
  2563            for(
unsigned k=0;k<DIM;k++)
  2565              aux += interpolated_dudx(k,k);
  2569            dresidual_dnodal_coordinates(local_eqn,p,q)+=
  2570             aux*dJ_dX(p,q)*testp[l]*w;
  2576            aux=-source_gradient[p]*psif(q);
  2577            for(
unsigned k=0;k<DIM;k++)
  2579              aux += d_dudx_dX(p,q,k,k);
  2582            dresidual_dnodal_coordinates(local_eqn,p,q)+=
  2587            if(element_has_node_with_aux_node_update_fct)
  2589              aux=dpsifdx(q,p)*testp(l);
  2590              dresidual_dnodal_coordinates(local_eqn,p,q)+=
  2591               aux*d_U_dX(p,q)*J*w;
  2616 Initial_Nvalue[9]={2,2,2,2,2,2,2,2,2};
  2622 Initial_Nvalue[27]={3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3};
  2628 template<
unsigned DIM>
  2631  {
return Initial_Nvalue[n];}
  2643 template<
unsigned DIM>
  2648  unsigned u_index[DIM];
  2649  for(
unsigned i=0;
i<DIM;
i++) {u_index[
i] = this->u_index_nst(
i);}
  2652  unsigned n_node = this->nnode();
  2653  for(
unsigned n=0;n<n_node;n++)
  2657    for(
unsigned i=0;
i<DIM;
i++)
  2659      paired_load_data.insert(std::make_pair(this->node_pt(n),u_index[
i]));
  2664  identify_pressure_data(paired_load_data);
  2678 template<
unsigned DIM>
  2681 std::set<std::pair<Data*,unsigned> > &paired_pressure_data)
  2684  unsigned n_internal = this->ninternal_data();
  2685  for(
unsigned l=0;l<n_internal;l++)
  2687    unsigned nval=this->internal_data_pt(l)->nvalue();
  2689    for (
unsigned j=0;j<nval;j++)
  2691      paired_pressure_data.insert(std::make_pair(this->internal_data_pt(l),j));
  2705 template<
unsigned DIM>
  2708  std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
 const  2711  unsigned n_node = this->nnode();
  2714  unsigned n_press = this->npres_nst();
  2717  std::pair<unsigned,unsigned> dof_lookup;
  2720  unsigned pressure_dof_number = DIM;
  2723  for (
unsigned n = 0; n < n_press; n++)
  2726    int local_eqn_number = this->p_local_eqn(n);
  2731    if (local_eqn_number >= 0)
  2735      dof_lookup.first = this->eqn_number(local_eqn_number);
  2736      dof_lookup.second = pressure_dof_number;
  2739      dof_lookup_list.push_front(dof_lookup);
  2744  for (
unsigned n = 0; n < n_node; n++)
  2747    unsigned nv = this->node_pt(n)->nvalue();
  2750    for (
unsigned v = 0; v < nv; v++)
  2753      int local_eqn_number = this->nodal_local_eqn(n, v);
  2756      if (local_eqn_number >= 0)
  2760        dof_lookup.first = this->eqn_number(local_eqn_number);
  2761        dof_lookup.second = v;
  2764        dof_lookup_list.push_front(dof_lookup);
  2784 Initial_Nvalue[9]={3,2,3,2,2,2,3,2,3};
  2794 Initial_Nvalue[27]={4,3,4,3,3,3,4,3,4,3,3,3,3,3,3,3,3,3,4,3,4,3,3,3,4,3,4};
  2799 Pconv[8]={0,2,6,8,18,20,24,26};
  2810 template<
unsigned DIM>
  2815  unsigned u_index[DIM];
  2816  for(
unsigned i=0;
i<DIM;
i++) {u_index[
i] = this->u_index_nst(
i);}
  2819  unsigned n_node = this->nnode();
  2820  for(
unsigned n=0;n<n_node;n++)
  2824    for(
unsigned i=0;
i<DIM;
i++)
  2826      paired_load_data.insert(std::make_pair(this->node_pt(n),u_index[
i]));
  2831  this->identify_pressure_data(paired_load_data);
  2844 template<
unsigned DIM>
  2847 std::set<std::pair<Data*,unsigned> > &paired_pressure_data)
  2850  unsigned p_index = 
static_cast<unsigned>(this->p_nodal_index_nst());
  2853  unsigned n_pres= npres_nst();
  2854  for(
unsigned l=0;l<n_pres;l++)
  2858    paired_pressure_data.insert(std::make_pair(this->node_pt(Pconv[l]),p_index));
  2871 template<
unsigned DIM>
  2874  std::list<std::pair<
unsigned long,
  2875  unsigned> >& dof_lookup_list)
 const  2878    unsigned n_node = this->nnode();
  2884    std::pair<unsigned,unsigned> dof_lookup;
  2887    for (
unsigned n = 0; n < n_node; n++)
  2890      unsigned nv = this->required_nvalue(n); 
  2893      for (
unsigned v = 0; v < nv; v++)
  2896        int local_eqn_number = this->nodal_local_eqn(n, v);
  2901        if (local_eqn_number >= 0)
  2905          dof_lookup.first = this->eqn_number(local_eqn_number);
  2908          dof_lookup.second = v;
  2911          dof_lookup_list.push_front(dof_lookup);
 bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed...
 
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations. Flag=1 (or 0): do (or don't) compute the Jaco...
 
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
 
unsigned long nrow() const
Return the number of rows of the matrix. 
 
unsigned long ncol() const
Return the number of columns of the matrix. 
 
double dissipation() const
Return integral of dissipation over element. 
 
void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed...
 
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
 
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following t...
 
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not. 
 
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format...
 
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing. 
 
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function  as ...
 
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
 
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing. 
 
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing. 
 
bool has_auxiliary_node_update_fct_pt()
Boolean to indicate if node has a pointer to and auxiliary update function. 
 
void max_and_min_invariant_and_viscosity(double &min_invariant, double &max_invariant, double &min_viscosity, double &max_viscosity) const
Get max. and min. strain rate invariant and visocosity over all integration points in element...
 
double kin_energy() const
Get integral of kinetic energy over element. 
 
double pressure_integral() const
Integral of pressure over element. 
 
double & x(const unsigned &i)
Return the i-th nodal coordinate. 
 
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element. 
 
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution"  as ...
 
virtual void fill_in_generic_dresidual_contribution_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
Compute the derivatives of the residuals for the Navier–Stokes equations with respect to a parameter...
 
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: x,y,[z],u,v,[w] in tecplot format. nplot points in each coordinate direction at time...
 
double & dt(const unsigned &t=0)
 
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector. 
 
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) 
 
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
 
double d_kin_energy_dt() const
Get integral of time derivative of kinetic energy over element. 
 
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates. Overwrites default implementation in FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}. 
 
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s...
 
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given number of plot points. Function prints as many components as are returned in solution Vector. 
 
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
 
double Default_Physical_Constant_Value
Default value for physical constants. 
 
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s. 
 
virtual void extrapolated_strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Extrapolated strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) based on the previous time steps evaluat...
 
Time *const  & time_pt() const
Access function for the pointer to time (const version) 
 
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined. 
 
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing. 
 
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
 
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor. 
 
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n. 
 
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations. 
 
void output_vorticity(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z], [omega_x,omega_y,[and/or omega_z]] in tecplot format. nplot points in each ...
 
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points. 
 
void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Compute the hessian tensor vector products required to perform continuation of bifurcations analytica...