37 template<
unsigned DIM>
66 unsigned n_pres = this->npres_nst();
76 for (
unsigned i = 0;
i <
DIM;
i++)
83 int p_index = this->p_nodal_index_nst();
124 for (
unsigned i = 0;
i <
DIM;
i++)
170 for (
unsigned i = 0;
i <
DIM;
i++)
220 this->pshape_nst(
s,
psi_p);
290 template<
unsigned DIM>
304 unsigned n_pres = this->npres_nst();
308 for (
unsigned i = 0;
i <
DIM;
i++)
315 int p_index = this->p_nodal_index_nst();
354 double scaled_re = this->re() * this->density_ratio();
355 double scaled_re_st = this->re_st() * this->density_ratio();
373 for (
unsigned i = 0;
i <
DIM;
i++)
382 double J = this->dshape_and_dtest_eulerian_at_knot_nst(
393 double interpolated_p = 0.0;
403 interpolated_p += this->p_nst(
l) *
psip[
l];
413 for (
unsigned i = 0;
i <
DIM;
i++)
422 for (
unsigned j = 0;
j <
DIM;
j++)
435 for (
unsigned i = 0;
i <
DIM;
i++)
448 if (!this->Use_extrapolated_strainrate_to_compute_second_invariant)
454 this->extrapolated_strain_rate(
ipt,
463 double viscosity = this->Constitutive_eqn_pt->viscosity(second_invariant);
476 if (!this->Use_extrapolated_strainrate_to_compute_second_invariant)
480 this->Constitutive_eqn_pt->dviscosity_dinvariant(second_invariant);
494 for (
unsigned i = 0;
i <
DIM;
i++)
496 for (
unsigned j = 0;
j <
DIM;
j++)
504 for (
unsigned k = 0;
k <
DIM;
k++)
528 for (
unsigned k = 0;
k <
DIM;
k++)
531 for (
unsigned i = 0;
i <
DIM;
i++)
533 for (
unsigned j = 0;
j <
DIM;
j++)
539 for (
unsigned m = 0;
m <
DIM;
m++)
541 for (
unsigned n = 0;
n <
DIM;
n++)
560 for (
unsigned k = 0;
k <
DIM;
k++)
563 for (
unsigned i = 0;
i <
DIM;
i++)
565 for (
unsigned j = 0;
j <
DIM;
j++)
609 for (
unsigned i = 0;
i <
DIM;
i++)
638 sum += body_force[
i];
647 for (
unsigned k = 0;
k <
DIM;
k++)
654 sum -=
tmp * interpolated_dudx(
i,
k);
659 if (this->Pre_multiply_by_viscosity_ratio)
675 for (
unsigned k = 0;
k <
DIM;
k++)
678 (interpolated_dudx(
i,
k) +
679 this->Gamma[
i] * interpolated_dudx(
k,
i)) *
750 ->Use_extrapolated_strainrate_to_compute_second_invariant)
752 for (
unsigned k = 0;
k <
DIM;
k++)
756 (interpolated_dudx(
i,
k) +
757 this->Gamma[
i] * interpolated_dudx(
k,
i)) *
783 for (
unsigned k = 0;
k <
DIM;
k++)
797 for (
unsigned k = 0;
k <
DIM;
k++)
816 this->pressure_node_pt(
l2)->hanging_pt(
p_index);
849 if (this->Pre_multiply_by_viscosity_ratio)
924 for (
unsigned k = 0;
k <
DIM;
k++)
927 if (this->Pre_multiply_by_viscosity_ratio)
930 interpolated_dudx(
k,
k) *
testp[
l] * W *
989 if (this->Pre_multiply_by_viscosity_ratio)
1023 template<
unsigned DIM>
1035 const unsigned n_node = nnode();
1038 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
1041 const unsigned n_pres = this->npres_nst();
1045 for (
unsigned i = 0;
i <
DIM;
i++)
1052 const int p_index = this->p_nodal_index_nst();
1104 const unsigned n_intpt = integral_pt()->nweight();
1111 double scaled_re = this->re() * this->density_ratio();
1112 double scaled_re_st = this->re_st() * this->density_ratio();
1126 shape_controlling_node_lookup();
1129 for (std::map<Node*, unsigned>::iterator
it =
1138 unsigned q =
it->second;
1141 if (
nod_pt->has_auxiliary_node_update_fct_pt())
1147 for (
unsigned i = 0;
i <
DIM;
i++)
1153 for (
unsigned p = 0;
p <
DIM;
p++)
1163 nod_pt->perform_auxiliary_node_update_fct();
1173 nod_pt->perform_auxiliary_node_update_fct();
1188 for (
unsigned i = 0;
i <
DIM;
i++)
1190 s[
i] = integral_pt()->knot(
ipt,
i);
1194 const double w = integral_pt()->weight(
ipt);
1198 this->dshape_and_dtest_eulerian_at_knot_nst(
ipt,
1212 double interpolated_p = 0.0;
1222 interpolated_p += this->p_nst(
l) *
psip[
l];
1231 for (
unsigned i = 0;
i <
DIM;
i++)
1236 interpolated_x[
i] += nodal_position(
l,
i) *
psif[
l];
1240 for (
unsigned j = 0;
j <
DIM;
j++)
1247 if (!this->ALE_is_disabled)
1253 for (
unsigned i = 0;
i <
DIM;
i++)
1266 for (
unsigned p = 0;
p <
DIM;
p++)
1268 for (
unsigned i = 0;
i <
DIM;
i++)
1270 for (
unsigned k = 0;
k <
DIM;
k++)
1287 node_pt(0)->position_time_stepper_pt()->weight(1, 0);
1293 this->get_body_force_nst(time,
ipt,
s, interpolated_x, body_force);
1296 const double source = this->get_source_nst(time,
ipt, interpolated_x);
1300 this->get_body_force_gradient_nst(
1342 for (
unsigned i = 0;
i <
DIM;
i++)
1368 for (
unsigned p = 0;
p <
DIM;
p++)
1389 for (
unsigned k = 0;
k <
DIM;
k++)
1392 (interpolated_dudx(
i,
k) +
1393 this->Gamma[
i] * interpolated_dudx(
k,
i)) *
1403 for (
unsigned k = 0;
k <
DIM;
k++)
1406 if (!this->ALE_is_disabled)
1428 for (
unsigned k = 0;
k <
DIM;
k++)
1432 this->Gamma[
i] * interpolated_dudx(
k,
i)) *
1440 for (
unsigned k = 0;
k <
DIM;
k++)
1443 if (!this->ALE_is_disabled)
1449 if (!this->ALE_is_disabled)
1452 interpolated_dudx(
i,
p) *
testf(
l);
1510 for (
unsigned p = 0;
p <
DIM;
p++)
1515 interpolated_dudx(
i,
p) *
testf(
l);
1520 for (
unsigned k = 0;
k <
DIM;
k++)
1525 if (!this->ALE_is_disabled)
1592 for (
unsigned p = 0;
p <
DIM;
p++)
1601 double aux = -source;
1604 for (
unsigned k = 0;
k <
DIM;
k++)
1606 aux += interpolated_dudx(
k,
k);
1619 for (
unsigned k = 0;
k <
DIM;
k++)
1677 for (
unsigned p = 0;
p <
DIM;
p++)
1703 if (this->tree_pt()->father_pt() != 0)
1712 if (this->internal_data_pt(this->P_nst_internal_index)->nvalue() <=
1715 this->internal_data_pt(this->P_nst_internal_index)
1716 ->resize(this->npres_nst());
1721 delete internal_data_pt(this->P_nst_internal_index);
1722 internal_data_pt(this->P_nst_internal_index) =
new_data_pt;
1725 if (this->tree_pt()->father_pt() != 0)
1729 father_element_pt =
dynamic_cast<
1731 quadtree_pt()->father_pt()->object_pt());
1735 if (father_element_pt->p_order() == this->p_order())
1737 using namespace QuadTreeNames;
1740 int son_type = quadtree_pt()->son_type();
1776 double press = father_element_pt->interpolated_p_nst(
s_father);
1779 for (
unsigned p = 0;
p < this->npres_nst();
p++)
1781 internal_data_pt(this->P_nst_internal_index)->set_value(
p, 0.0);
1785 if (this->npres_nst() == 1)
1787 internal_data_pt(this->P_nst_internal_index)->set_value(0,
press);
1789 else if (this->npres_nst() == 3)
1791 internal_data_pt(this->P_nst_internal_index)->set_value(0,
press);
1792 internal_data_pt(this->P_nst_internal_index)->set_value(1,
press);
1793 internal_data_pt(this->P_nst_internal_index)->set_value(2,
press);
1797 internal_data_pt(this->P_nst_internal_index)->set_value(0,
press);
1798 internal_data_pt(this->P_nst_internal_index)->set_value(1,
press);
1799 internal_data_pt(this->P_nst_internal_index)->set_value(2,
press);
1800 internal_data_pt(this->P_nst_internal_index)->set_value(3,
press);
1816 if (this->tree_pt()->father_pt() != 0)
1825 if (this->internal_data_pt(this->P_nst_internal_index)->nvalue() <=
1828 this->internal_data_pt(this->P_nst_internal_index)
1829 ->resize(this->npres_nst());
1834 delete internal_data_pt(this->P_nst_internal_index);
1835 internal_data_pt(this->P_nst_internal_index) =
new_data_pt;
1838 if (this->tree_pt()->father_pt() != 0)
1842 father_element_pt =
dynamic_cast<
1844 octree_pt()->father_pt()->object_pt());
1848 if (father_element_pt->p_order() == this->p_order())
1850 using namespace OcTreeNames;
1853 int son_type = octree_pt()->son_type();
1860 for (
unsigned i = 0;
i < 3;
i++)
1866 double press = father_element_pt->interpolated_p_nst(
s_father);
1869 for (
unsigned p = 0;
p < this->npres_nst();
p++)
1871 internal_data_pt(this->P_nst_internal_index)->set_value(
p, 0.0);
1875 if (this->npres_nst() == 1)
1877 internal_data_pt(this->P_nst_internal_index)->set_value(0,
press);
1881 internal_data_pt(this->P_nst_internal_index)->set_value(0,
press);
1882 internal_data_pt(this->P_nst_internal_index)->set_value(1,
press);
1883 internal_data_pt(this->P_nst_internal_index)->set_value(2,
press);
1884 internal_data_pt(this->P_nst_internal_index)->set_value(3,
press);
1885 internal_data_pt(this->P_nst_internal_index)->set_value(4,
press);
1886 internal_data_pt(this->P_nst_internal_index)->set_value(5,
press);
1887 internal_data_pt(this->P_nst_internal_index)->set_value(6,
press);
1888 internal_data_pt(this->P_nst_internal_index)->set_value(7,
press);
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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 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.
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 ...
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 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.
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
unsigned ndof() const
Return the number of equations/dofs in the element.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Class that contains data for hanging nodes.
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
bool is_hanging() const
Test whether the node is geometrically hanging.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
An OomphLibError object which should be thrown when an run-time error is encountered....
p-refineable version of Crouzeix Raviart elements. Generic class definitions
A class that is used to template the p-refineable Q elements by dimension. It's really nothing more t...
Refineable version of the Navier–Stokes equations.
void further_build()
Further build, pass the pointers down to the sons.
void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Add element's contribution to elemental residual vector and/or Jacobian matrix flag=1: compute both f...
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,...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
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.
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).