28#ifndef OOMPH_NAVIER_STOKES_SURFACE_DRAG_TORQUE_ELEMENTS_HEADER
29#define OOMPH_NAVIER_STOKES_SURFACE_DRAG_TORQUE_ELEMENTS_HEADER
33#include <oomph-lib-config.h>
46 template<
class ELEMENT>
94 for (
unsigned i = 0;
i <
ndim + 1;
i++)
101 for (
unsigned i = 0;
i < 2 *
ndim - 1;
i++)
126 for (
unsigned i = 0;
i <
ndim;
i++)
154 for (
unsigned i = 0;
i <
ndim + 1;
i++)
161 error_stream <<
"difference in Eulerian posn from bulk and face: "
184 for (
unsigned i = 0;
i <
ndim + 1;
i++)
186 drag_force[
i] -= traction[
i] * W;
192 for (
unsigned i = 0;
i <
ndim + 1;
i++)
202 drag_torque[0] -= (X[0] * traction[1] - X[1] * traction[0]) * W;
206 drag_torque[0] -= (X[1] * traction[2] - X[2] * traction[1]) * W;
207 drag_torque[1] -= (X[2] * traction[0] - X[0] * traction[2]) * W;
208 drag_torque[2] -= (X[0] * traction[1] - X[1] * traction[0]) * W;
212 throw OomphLibError(
"Dimension of a surface element must be 1 or 2\n",
230 const unsigned&
i)
const
286 for (
unsigned i = 0;
i <
dim_el + 1;
i++)
292 for (
unsigned i = 0;
i < dim_el + 1;
i++)
297 for (
unsigned i = 0;
i <
dim_el + 1;
i++)
302 for (
unsigned i = 0;
i <
dim_el + 1;
i++)
307 for (
unsigned i = 0;
i <
dim_el + 1;
i++)
309 outfile << -1.0 * traction[
i] <<
" ";
311 outfile << -(X[0] * traction[1] - X[1] * traction[0]);
A class that represents a collection of data; each Data object may contain many different individual ...
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 ...
Base class for elements that can specify a drag and torque (about the origin) – typically used for im...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
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.
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,...
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...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Calculate the vector of local coordinate in the bulk element given the local coordinates in this Face...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
A general Finite Element class.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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 interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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")
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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....
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"...
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
unsigned ndim() const
Access function to # of Eulerian coordinates.
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.
A class of elements that allow the determination of the drag and toque, relative to a given centre of...
void set_translation_and_rotation(Data *const &object_data_pt)
Set the translation and rotation of the rigid object as external data.
unsigned Translation_index
The index of where the translation and rotation data is stored.
Vector< double > Centre_of_rotation
The centre of rotation for the torque calculation.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
virtual void get_drag_and_torque(Vector< double > &drag_force, Vector< double > &drag_torque)
Function that specifies the drag force and the torque about the origin.
NavierStokesSurfaceDragTorqueElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of an index describing to which face the elem...
unsigned Dim
The highest dimension of the problem.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
double & centre_of_rotation(const unsigned &i)
Access function for the centre of rotation.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
An OomphLibError object which should be thrown when an run-time error is encountered....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).