34 #ifndef OOMPH_FLUID_TRACTION_ELEMENTS_HEADER 35 #define OOMPH_FLUID_TRACTION_ELEMENTS_HEADER 39 #include <oomph-lib-config.h> 44 #include "../generic/Qelements.h" 45 #include "../generic/Telements.h" 57 template <
class ELEMENT>
75 const unsigned &
i)
const 83 virtual inline int u_local_eqn(
const unsigned &n,
const unsigned &
i)
93 unsigned n_node =
nnode();
97 for(
unsigned i=0;
i<n_node;
i++) {test[
i] = psi[
i];}
111 for(
unsigned i=0;
i<
Dim;
i++) {result[
i] = 0.0;}
116 (*Traction_fct_pt)(time,x,n,result);
139 called_from_refineable_constructor=
false) :
150 if (!called_from_refineable_constructor)
153 if(element_pt->
dim()==3)
163 "This flux element will not work correctly if nodes are hanging\n",
164 OOMPH_CURRENT_FUNCTION,
165 OOMPH_EXCEPTION_LOCATION);
209 void output(std::ostream &outfile,
const unsigned &nplot)
227 template<
class ELEMENT>
235 unsigned n_node =
nnode();
241 Shape psif(n_node), testf(n_node);
250 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
266 for(
unsigned i=0;
i<
Dim;
i++) {interpolated_x[
i] = 0.0;}
269 for(
unsigned l=0;l<n_node;l++)
272 for(
unsigned i=0;
i<
Dim;
i++) {interpolated_x[
i] +=
282 get_traction(time,interpolated_x,interpolated_n,traction);
287 for(
unsigned l=0;l<n_node;l++)
290 for(
unsigned i=0;
i<
Dim;
i++)
297 residuals[local_eqn] += traction[
i]*testf[l]*
W;
327 template <
class ELEMENT>
350 ncont_interpolated_values();
357 refineable_fill_in_generic_residual_contribution_fluid_traction(
366 refineable_fill_in_generic_residual_contribution_fluid_traction(residuals,
376 void refineable_fill_in_generic_residual_contribution_fluid_traction(
394 template<
class ELEMENT>
403 unsigned u_nodal_index[this->
Dim];
404 for(
unsigned i=0;
i<this->
Dim;
i++)
406 u_nodal_index[
i] =
dynamic_cast<ELEMENT*
>(
411 unsigned n_node =
nnode();
417 Shape psif(n_node), testf(n_node);
426 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
442 for(
unsigned i=0;
i<this->
Dim;
i++) {interpolated_x[
i] = 0.0;}
445 for(
unsigned l=0;l<n_node;l++)
448 for(
unsigned i=0;
i<this->
Dim;
i++)
460 this->
get_traction(time,interpolated_x,interpolated_n,traction);
465 unsigned n_master=1;
double hang_weight=1.0;
472 for(
unsigned l=0;l<n_node;l++)
483 n_master = hang_info_pt->
nmaster();
492 for(
unsigned m=0;m<n_master;m++)
495 for(
unsigned i=0;
i<this->
Dim;
i++)
535 residuals[local_eqn] += traction[
i]*testf[l]*W*hang_weight;
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.
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...
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
void fill_in_generic_residual_contribution_fluid_traction(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
This function returns the residuals for the traction function. flag=1(or 0): do (or don't) compute th...
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 ...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
void refineable_fill_in_generic_residual_contribution_fluid_traction(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
This function returns the residuals for the traction function. flag=1(or 0): do (or don't) compute th...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values are the same as those in the bulk element.
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.
A general Finite Element class.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary, when viewed as part of a compound geometric object is specified using the boundary coordinate defined by the mesh. Note: Boundary coordinates will have been set up when creating the underlying mesh, and their values will have been stored at the nodes.
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...
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
void(*&)(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &result) traction_fct_pt()
unsigned nmaster() const
Return the number of master nodes.
bool is_hanging() const
Test whether the node is geometrically hanging.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
NavierStokesTractionElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
~RefineableNavierStokesTractionElement()
Destructor should not delete anything.
void output(std::ostream &outfile)
Overload the output function.
double & time()
Return the current value of the continuous time.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Class that contains data for hanging nodes.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
unsigned Dim
The highest dimension of the problem.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the Jacobian.
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)
~NavierStokesTractionElement()
Destructor should not delete anything.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
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(* Traction_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Pointer to an imposed traction function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the jacobian.
unsigned nnode() const
Return the number of nodes.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
void get_traction(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Function to calculate the traction applied to the fluid.
RefineableNavierStokesTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the face index.
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...