70 throw OomphLibError(
"Computation of diagonal of pressure mass matrix is "
71 "not impmented yet.\n",
175 outfile <<
"ZONE" << std::endl;
184 for (
unsigned i = 0;
i < 2;
i++)
205 for (
unsigned i = 0;
i < 3;
i++)
213 for (
unsigned i = 0;
i < 2;
i++)
219 for (
unsigned i = 0;
i < 3;
i++)
254 outfile <<
"ZONE" << std::endl;
263 for (
unsigned i = 0;
i < 2;
i++)
284 for (
unsigned i = 0;
i < 3;
i++)
292 for (
unsigned i = 0;
i < 2;
i++)
298 for (
unsigned i = 0;
i < 3;
i++)
348 for (
unsigned i = 0;
i < 2;
i++)
476 for (
unsigned i = 0;
i < 2;
i++)
512 for (
unsigned i = 0;
i < Npts;
i++)
515 s[1] = -1 + 2.0 *
i / (Npts - 1);
553 for (
unsigned i = 0;
i < Npts;
i++)
556 s[0] = -1 + 2.0 *
i / (Npts - 1);
589 for (
unsigned j = 0;
j < 3;
j++)
609 for (
unsigned j = 0;
j < 3;
j++)
632 const unsigned&
nplot,
662 for (
unsigned i = 0;
i < 3;
i++)
688 const unsigned&
nplot,
718 for (
unsigned i = 0;
i < 3;
i++)
744 const unsigned&
nplot,
772 for (
unsigned i = 0;
i < 3;
i++)
775 interpolated_u[
i] = 0.0;
787 for (
unsigned i = 0;
i < 2;
i++)
793 for (
unsigned i = 0;
i < 3;
i++)
795 outfile << interpolated_u[
i] <<
" ";
812 const unsigned&
nplot)
850 for (
unsigned i = 0;
i < 3;
i++)
876 const unsigned&
nplot)
892 for (
unsigned i = 0;
i < 2;
i++)
898 for (
unsigned i = 0;
i < 3;
i++)
920 const unsigned&
nplot)
961 for (
unsigned i = 0;
i < 3;
i++)
966 for (
unsigned j = 0;
j < 2;
j++)
968 interpolated_dudx(
i,
j) = 0.0;
976 for (
unsigned i = 0;
i < 3;
i++)
987 for (
unsigned j = 0;
j < 2;
j++)
989 interpolated_dudx(
i,
j) +=
997 for (
unsigned i = 0;
i < 3;
i++)
1000 for (
unsigned k = 0;
k < 2;
k++)
1008 for (
unsigned i = 0;
i < 2;
i++)
1014 for (
unsigned i = 0;
i < 3;
i++)
1023 for (
unsigned i = 0;
i < 3;
i++)
1047 const unsigned&
nplot)
1066 for (
unsigned i = 0;
i < 2;
i++)
1101 for (
unsigned i = 0;
i < 2;
i++)
1118 for (
unsigned i = 0;
i < 3;
i++)
1120 for (
unsigned j = 0;
j < 3;
j++)
1149 for (
unsigned i = 0;
i < 3;
i++)
1164 for (
unsigned j = 0;
j < 2;
j++)
1183 for (
unsigned i = 0;
i < 3;
i++)
1185 for (
unsigned j = 0;
j < 3;
j++)
1228 for (
unsigned i = 0;
i < 3;
i++)
1240 for (
unsigned j = 0;
j < 2;
j++)
1303 throw OomphLibError(
"Not tested for spherical Navier-Stokes elements",
1310 std::ostringstream error_message;
1311 error_message <<
"Computation of vorticity in 2D requires a 1D vector\n"
1312 <<
"which contains the only non-zero component of the\n"
1313 <<
"vorticity vector. You've passed a vector of size "
1338 for (
unsigned i = 0;
i <
DIM;
i++)
1340 for (
unsigned j = 0;
j <
DIM;
j++)
1347 for (
unsigned i = 0;
i <
DIM;
i++)
1352 for (
unsigned j = 0;
j <
DIM;
j++)
1385 for (
unsigned i = 0;
i < 2;
i++)
1398 for (
unsigned i = 0;
i < 3;
i++)
1416 throw OomphLibError(
"Not tested for spherical Navier-Stokes elements",
1438 unsigned u_index[3];
1439 for (
unsigned i = 0;
i < 3;
i++)
1460 for (
unsigned i = 0;
i < 3;
i++)
1477 for (
unsigned i = 0;
i < 2;
i++)
1483 for (
unsigned i = 0;
i < 3;
i++)
1485 for (
unsigned j = 0;
j < 2;
j++)
1487 interpolated_dudx(
i,
j) +=
1494 for (
unsigned i = 0;
i < 3;
i++)
1496 for (
unsigned k = 0;
k < 2;
k++)
1506 for (
unsigned i = 0;
i < 3;
i++)
1536 for (
unsigned i = 0;
i < 2;
i++)
1573 if (
ndof() == 0)
return;
1586 for (
unsigned i = 0;
i < 3;
i++)
1632 const double W = w *
J;
1636 double interpolated_p = 0.0;
1658 for (
unsigned i = 0;
i < 2;
i++)
1664 for (
unsigned i = 0;
i < 3;
i++)
1672 for (
unsigned j = 0;
j < 2;
j++)
1682 "SphericalNS::fill_in...",
1688 for (
unsigned i = 0;
i < 2;
i++)
1707 const double r2 =
r *
r;
1712 const double u_r = interpolated_u[0];
1713 const double u_theta = interpolated_u[1];
1714 const double u_phi = interpolated_u[2];
1731 double conv =
u_r * interpolated_dudx(0, 0) *
r;
1758 sum += (-interpolated_p + 2.0 * interpolated_dudx(0, 0)) *
r2 *
1763 (
r * interpolated_dudx(1, 0) -
u_theta + interpolated_dudx(0, 1)) *
1768 ((-
r * interpolated_p + interpolated_dudx(1, 1) + 2.0 *
u_r) *
1854 (interpolated_dudx(0, 1) - 2.0 *
u_theta) *
1929 double conv = (
u_r * interpolated_dudx(1, 0) *
r +
1955 (
r * interpolated_dudx(1, 0) -
u_theta + interpolated_dudx(0, 1)) *
1960 (-
r * interpolated_p + 2.0 * interpolated_dudx(1, 1) + 2.0 *
u_r) *
1965 ((
r * interpolated_dudx(1, 0) -
u_theta + interpolated_dudx(0, 1)) *
1994 (
r2 * interpolated_dudx(1, 0) +
r *
u_theta) *
2033 (interpolated_dudx(1, 1) +
u_r) *
psif(
l2);
2307 interpolated_dudx(1, 1)) *
2373 unsigned u_index[3];
2374 for (
unsigned i = 0;
i < 3;
i++)
2385 for (
unsigned i = 0;
i < 3;
i++)
2413 for (
unsigned j = 0;
j <
nval;
j++)
2472 for (
unsigned v = 0;
v <
nv;
v++)
2500 4, 3, 4, 3, 3, 3, 4, 3, 4};
2518 unsigned u_index[3];
2519 for (
unsigned i = 0;
i < 3;
i++)
2530 for (
unsigned i = 0;
i < 3;
i++)
2595 for (
unsigned v = 0;
v <
nv;
v++)
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. Do not use the hanging node repre...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
unsigned ninternal_data() const
Return the number of internal data objects.
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.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
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.
int p_local_eqn(const unsigned &n) const
Return the local equation numbers for the pressure values.
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 npres_spherical_nst() const
Return number of pressure values.
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
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...
int p_nodal_index_spherical_nst() const
Set the value at which the pressure is stored in the nodes In this case the third index because there...
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned npres_spherical_nst() const
Return number of pressure values.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
double d_kin_energy_dt() const
Get integral of time derivative of kinetic energy over element.
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....
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s.
double interpolated_dudx_spherical_nst(const Vector< double > &s, const unsigned &i, const unsigned &j) const
Return matrix entry dudx(i,j) of the FE interpolated velocity derivative at local coordinate s.
virtual double dshape_and_dtest_eulerian_at_knot_spherical_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and derivatives w.r.t. global coords at ipt-th integration point Return J...
double pressure_integral() const
Integral of pressure over element.
virtual void pshape_spherical_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
void compute_error_e(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, FiniteElement::SteadyExactSolutionFctPt exact_soln_dr_pt, FiniteElement::SteadyExactSolutionFctPt exact_soln_dtheta_pt, double &u_error, double &u_norm, double &p_error, double &p_norm)
Validate against exact solution. Solution is provided direct from exact_soln function....
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
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....
virtual unsigned u_index_spherical_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all are initialised to one)
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,...
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)
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
virtual double p_spherical_nst(const unsigned &n_p) const =0
Pressure at local pressure "node" n_p Uses suitably interpolated value for hanging nodes.
virtual void get_body_force_spherical_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Calculate the body force at a given time and local and/or Eulerian position. This function is virtual...
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
double du_dt_spherical_nst(const unsigned &n, const unsigned &i) const
i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes.
const double & density_ratio() const
Density ratio for element: Element's density relative to the viscosity used in the definition of the ...
double cot(const double &th) const
Include a cot function to simplify the NS momentum and jacobian expressions.
const Vector< double > & g() const
Vector of gravitational components.
double interpolated_p_spherical_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
void compute_shear_stress(std::ostream &outfile)
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....
double kin_energy() const
Get integral of kinetic energy over element.
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 ...
double dissipation() const
Return integral of dissipation over element.
static double Default_Physical_Constant_Value
Static default value for the physical constants (all initialised to zero)
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....
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
virtual void fill_in_generic_residual_contribution_spherical_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 Jacobi...
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
virtual int p_local_eqn(const unsigned &n) const =0
Access function for the local equation number information for the pressure. p_local_eqn[n] = local eq...
virtual unsigned npres_spherical_nst() const =0
Function to return number of pressure degrees of freedom.
void extract_velocity(std::ostream &outfile)
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
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...
const double & re() const
Reynolds number.
void interpolated_u_spherical_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
const double & re_invro() const
Global Reynolds number multiplied by inverse Rossby number.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
const double Pi
50 digits from maple
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).