29 #ifndef OOMPH_AXISYMM_SOLID_TRACTION_ELEMENTS_HEADER 
   30 #define OOMPH_AXISYMM_SOLID_TRACTION_ELEMENTS_HEADER 
   34 #include <oomph-lib-config.h> 
   38 #include "../generic/Qelements.h" 
   39 #include "../generic/hermite_elements.h" 
   50   template<
class ELEMENT>
 
   73         for (
unsigned i = 0; 
i < 2; 
i++)
 
   81         (*Traction_fct_pt)(time, x, n, result);
 
  129     void output(std::ostream& outfile, 
const unsigned& n_plot)
 
  141     void output(FILE* file_pt, 
const unsigned& n_plot)
 
  156   template<
class ELEMENT>
 
  157   void AxisymmetricSolidTractionElement<
 
  161     unsigned n_node = nnode();
 
  163     unsigned n_position_type = nnodal_position_type();
 
  170     Shape psi(n_node, n_position_type);
 
  171     DShape dpsids(n_node, n_position_type, 1);
 
  174     unsigned n_intpt = integral_pt()->nweight();
 
  177     for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
 
  180       double w = integral_pt()->weight(ipt);
 
  183       dshape_local_at_knot(ipt, psi, dpsids);
 
  189       Vector<double> interpolated_dxds(2, 0.0), interpolated_dxids(2, 0.0);
 
  192       for (
unsigned l = 0; l < n_node; l++)
 
  195         for (
unsigned k = 0; k < n_position_type; k++)
 
  198           for (
unsigned i = 0; 
i < 2; 
i++)
 
  202               nodal_position_gen(l, bulk_position_type(k), 
i) * psi(l, k);
 
  203             interpolated_xi[
i] +=
 
  204               this->lagrangian_position_gen(l, bulk_position_type(k), 
i) *
 
  208             interpolated_dxds[
i] +=
 
  209               nodal_position_gen(l, bulk_position_type(k), 
i) * dpsids(l, k, 0);
 
  210             interpolated_dxids[
i] +=
 
  211               this->lagrangian_position_gen(l, bulk_position_type(k), 
i) *
 
  221       A(0, 1) = A(1, 0) = 0.0;
 
  224         (interpolated_dxds[0] - interpolated_x[1] * interpolated_dxids[1]) *
 
  225           (interpolated_dxds[0] - interpolated_x[1] * interpolated_dxids[1]) +
 
  226         (interpolated_dxds[1] + interpolated_x[0] * interpolated_dxids[1]) *
 
  227           (interpolated_dxds[1] + interpolated_x[0] * interpolated_dxids[1]);
 
  230       A(1, 1) = (interpolated_x[0] * sin(interpolated_xi[1]) +
 
  231                  interpolated_x[1] * cos(interpolated_xi[1])) *
 
  232                 (interpolated_x[0] * sin(interpolated_xi[1]) +
 
  233                  interpolated_x[1] * cos(interpolated_xi[1]));
 
  237       double W = w * sqrt(A(0, 0) * A(1, 1));
 
  246       interpolated_normal[0] =
 
  248         (interpolated_x[0] * sin(interpolated_xi[1]) +
 
  249          interpolated_x[1] * cos(interpolated_xi[1])) *
 
  250         (interpolated_dxds[1] + interpolated_x[0] * interpolated_dxids[1]);
 
  252       interpolated_normal[1] =
 
  254         (interpolated_x[0] * sin(interpolated_xi[1]) +
 
  255          interpolated_x[1] * cos(interpolated_xi[1])) *
 
  256         (interpolated_x[1] * interpolated_dxids[1] - interpolated_dxds[0]);
 
  259       if (s_fixed_value() == -1)
 
  261         interpolated_normal[0] *= -1.0;
 
  262         interpolated_normal[1] *= -1.0;
 
  267       for (
unsigned i = 0; 
i < 2; 
i++)
 
  269         interpolated_normal[
i] *= normal_sign();
 
  270         length += interpolated_normal[
i] * interpolated_normal[
i];
 
  272       for (
unsigned i = 0; 
i < 2; 
i++)
 
  274         interpolated_normal[
i] /= sqrt(length);
 
  281       get_traction(time(), interpolated_x, interpolated_normal, traction);
 
  286       for (
unsigned l = 0; l < n_node; l++)
 
  289         for (
unsigned k = 0; k < n_position_type; k++)
 
  292           for (
unsigned i = 0; 
i < 2; 
i++)
 
  294             local_eqn = this->position_local_eqn(l, bulk_position_type(k), 
i);
 
  299               residuals[local_eqn] -= traction[
i] * psi(l, k) * 
W;
 
A class for elements that allow the imposition of an applied traction in the principle of virtual dis...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
void get_traction(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result) const
Return the surface traction force.
void output(std::ostream &outfile)
Overload the output function.
void output(FILE *file_pt)
Overload the output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Return the jacobian.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
void(*&)(const double &, const Vector< double > &, const Vector< double > &, Vector< double > &) traction_fct_pt()
Return the imposed traction pointer.
void output(FILE *file_pt, const unsigned &n_plot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
AxisymmetricSolidTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
void(* Traction_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Pointer to an imposed traction function.
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
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)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
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....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...