34 #ifndef OOMPH_POLAR_FLUID_TRACTION_ELEMENTS_HEADER 35 #define OOMPH_POLAR_FLUID_TRACTION_ELEMENTS_HEADER 44 #include "../generic/Qelements.h" 56 template <
class ELEMENT>
78 virtual inline int u_local_eqn(
const unsigned &n,
const unsigned &
i)
88 unsigned n_node =
nnode();
92 for(
unsigned i=0;
i<n_node;
i++) {test[
i] = psi[
i];}
106 for(
unsigned i=0;
i<
Dim;
i++) {result[
i] = 0.0;}
111 (*Traction_fct_pt)(time,
x,result);
153 Pext_data_pt=pext_data_pt;
157 External_data_number_of_Pext =
187 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(element_pt);
189 if(elem_pt->dim()==3)
198 "This flux element will not work correctly if nodes are hanging\n",
199 OOMPH_CURRENT_FUNCTION,
200 OOMPH_EXCEPTION_LOCATION);
260 void output(std::ostream &outfile,
const unsigned &nplot)
264 double u(
const unsigned &l,
const unsigned &
i )
268 double x(
const unsigned &l,
const unsigned &
i )
285 template<
class ELEMENT>
293 unsigned n_node =
nnode();
299 Shape psif(n_node), testf(n_node);
305 const double Alpha =
alpha();
319 int local_eqn=0,local_unknown=0,pext_local_eqn=0,pext_local_unknown=0;
337 pext=Pext_data_pt->
value(0);
341 pext_local_unknown=pext_local_eqn;
346 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
363 for(
unsigned i=0;
i<
Dim;
i++)
365 interpolated_x[
i] = 0.0;
366 interpolated_u[
i] = 0.0;
371 for(
unsigned l=0;l<n_node;l++)
374 for(
unsigned i=0;
i<
Dim;
i++)
389 for(
unsigned l=0;l<n_node;l++)
399 residuals[local_eqn] -= multiplier*eta*3.0*(interpolated_u[
i]/interpolated_x[0])
400 *testf[l]*interpolated_x[0]*Alpha*W;
406 residuals[local_eqn] += pext*testf[l]*interpolated_x[0]*Alpha*
W;
414 for(
unsigned l2=0;l2<n_node;l2++)
421 if(local_unknown >= 0)
424 jacobian(local_eqn,local_unknown)
425 -= multiplier*eta*3.0*(psif[l2]/interpolated_x[0])
426 *testf[l]*interpolated_x[0]*Alpha*W;
435 if(pext_local_unknown >= 0)
438 jacobian(local_eqn,pext_local_unknown) += testf[l]*interpolated_x[0]*Alpha*
W;
457 if(pext_local_eqn >= 0)
460 residuals[pext_local_eqn] += interpolated_u[0]*interpolated_x[0]*Alpha*
W;
473 for(
unsigned l2=0;l2<n_node;l2++)
480 if(local_unknown >= 0)
483 jacobian(pext_local_eqn,local_unknown)
484 += psif[l2]*interpolated_x[0]*Alpha*
W;
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 O...
void set_external_pressure_data(Data *pext_data_pt)
Function for setting up external pressure.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
const double get_eta() const
Eta.
const double & alpha() const
Alpha.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Compute the element's residual Vector and the jacobian matrix Plus the mass matrix especially for eig...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
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 ...
Data * Pext_data_pt
Pointer to the Data item that stores the external pressure.
double shape_and_test_at_knot(const unsigned &ipt, Shape &psi, Shape &test) const
Function to compute the shape and test functions and to return the Jacobian of mapping.
void(* Traction_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to an imposed traction function.
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void(*&)(const double &t, const Vector< double > &x, Vector< double > &result) traction_fct_pt()
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
A general Finite Element class.
double *& alpha_pt()
Pointer to Alpha.
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the jacobian.
const int boundary() const
Boundary.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
unsigned External_data_number_of_Pext
The Data that contains the traded pressure is stored as external Data for the element. Which external Data item is it?
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
PolarNavierStokesTractionElement(FiniteElement *const &element_pt, const int &face_index)
double x(const unsigned &l, const unsigned &i)
local position
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
unsigned Dim
The highest dimension of the problem.
void get_traction(double time, const Vector< double > &x, Vector< double > &result)
Function to calculate the traction applied to the fluid.
double u(const unsigned &l, const unsigned &i)
local velocities
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
~PolarNavierStokesTractionElement()
Destructor should not delete anything.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
double * Alpha_pt
Pointer to the angle alpha.
A class that represents a collection of data; each Data object may contain many different individual ...
double & time()
Return the current value of the continuous time.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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...
void fill_in_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
This function returns the residuals for the traction function. flag=1(or 0): do (or don't) compute th...
void set_boundary(int bound)
Function to set boundary.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
void output(std::ostream &outfile)
Overload the output function.
void set_eta(double eta)
Function to set Eta.
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
unsigned nnode() const
Return the number of nodes.
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
virtual int u_local_eqn(const unsigned &n, const unsigned &i)
Access function that returns the local equation numbers for velocity components. u_local_eqn(n,i) = local equation number or < 0 if pinned. The default is to asssume that n is the local node number and the i-th velocity component is the i-th unknown stored at the node.
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...