33 #ifndef OOMPH_AXISYMMETRIC_LINEAR_ELASTICITY_TRACTION_ELEMENTS_HEADER 34 #define OOMPH_AXISYMMETRIC_LINEAR_ELASTICITY_TRACTION_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 56 namespace AxisymmetricLinearElasticityTractionElementHelper
67 unsigned n_dim=load.size();
68 for (
unsigned i=0;
i<n_dim;
i++) {load[
i]=0.0;}
81 template <
class ELEMENT>
97 void (*Traction_fct_pt)(
const double& time,
110 const unsigned& intpt,
115 Traction_fct_pt(time,x,n,traction);
123 void fill_in_contribution_to_residuals_axisymmetric_linear_elasticity_traction(
143 ELEMENT* cast_element_pt =
dynamic_cast<ELEMENT*
>(element_pt);
144 this->U_index_axisymmetric_linear_elasticity_traction.resize(n_dim+1);
145 for(
unsigned i=0;
i<n_dim+1;
i++)
148 U_index_axisymmetric_linear_elasticity_traction[
i] =
150 u_index_axisymmetric_linear_elasticity(
i);
165 {
return Traction_fct_pt;}
171 fill_in_contribution_to_residuals_axisymmetric_linear_elasticity_traction
182 fill_in_contribution_to_residuals_axisymmetric_linear_elasticity_traction
192 const unsigned &
i)
const 203 void output(std::ostream &outfile,
const unsigned &n_plot)
206 unsigned n_dim = this->nodal_dimension();
209 const unsigned n_node = nnode();
212 double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
222 outfile << this->tecplot_zone_string(n_plot);
225 unsigned num_plot_points=this->nplot_points(n_plot);
226 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
229 this->get_s_plot(iplot,n_plot,s);
233 outer_unit_normal(s,unit_normal);
239 for(
unsigned i=0;
i<n_dim;
i++)
241 interpolated_x[
i] = 0.0;
245 for(
unsigned l=0;l<n_node;l++)
248 for(
unsigned i=0;
i<n_dim;
i++)
250 interpolated_x[
i] += nodal_position(l,
i)*psi[l];
260 get_traction(time,ipt,interpolated_x,unit_normal,traction);
263 for(
unsigned i=0;
i<n_dim;
i++)
265 outfile << interpolated_x[
i] <<
" ";
269 for(
unsigned i=0;
i<n_dim+1;
i++)
271 outfile << traction[
i] <<
" ";
275 for(
unsigned i=0;
i<n_dim;
i++)
277 outfile << unit_normal[
i] <<
" ";
279 outfile << std::endl;
289 void output(FILE* file_pt,
const unsigned &n_plot)
296 void traction(
const double &time,
311 template<
class ELEMENT>
315 unsigned n_dim = this->nodal_dimension();
323 outer_unit_normal(s,unit_normal);
329 get_traction(time,ipt,x,unit_normal,traction);
338 template<
class ELEMENT>
345 unsigned n_node = nnode();
348 double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
352 unsigned n_position_type = this->nnodal_position_type();
353 if(n_position_type != 1)
356 "AxisymmetricLinearElasticity is not yet implemented for more than one position type",
357 OOMPH_CURRENT_FUNCTION,
358 OOMPH_EXCEPTION_LOCATION);
363 unsigned n_dim = this->nodal_dimension();
366 unsigned u_nodal_index[n_dim+1];
367 for(
unsigned i=0;
i<n_dim+1;
i++)
369 u_nodal_index[
i]=this->U_index_axisymmetric_linear_elasticity_traction[
i];
379 DShape dpsids(n_node,n_dim-1);
382 unsigned n_intpt = integral_pt()->nweight();
385 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
388 double w = integral_pt()->weight(ipt);
391 dshape_local_at_knot(ipt,psi,dpsids);
400 for(
unsigned l=0;l<n_node;l++)
403 for(
unsigned i=0;
i<n_dim;
i++)
406 const double x_local = nodal_position(l,
i);
407 interpolated_x[
i] += x_local*psi(l);
410 for(
unsigned j=0;j<n_dim-1;j++)
412 interpolated_A(j,
i) += x_local*dpsids(l,j);
419 for(
unsigned i=0;
i<n_dim-1;
i++)
421 for(
unsigned j=0;j<n_dim-1;j++)
427 for(
unsigned k=0;k<n_dim;k++)
429 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
436 outer_unit_normal(ipt,interpolated_normal);
446 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
451 "Wrong dimension in AxisymmetricLinearElasticityTractionElement",
452 "AxisymmetricLinearElasticityTractionElement::fill_in_contribution_to_residuals()",
453 OOMPH_EXCEPTION_LOCATION);
458 double W = w*sqrt(Adet);
469 for(
unsigned l=0;l<n_node;l++)
472 for(
unsigned i=0;
i<n_dim+1;
i++)
475 local_eqn = this->nodal_local_eqn(l,u_nodal_index[
i]);
480 residuals[local_eqn] -= traction[
i]*psi(l)*interpolated_x[0]*
W;
503 template <
class ELASTICITY_BULK_ELEMENT,
class NAVIER_STOKES_BULK_ELEMENT>
528 void fill_in_contribution_to_residuals_axisym_fsi_traction(
537 const int &face_index) :
539 Q_pt(&Default_Q_Value)
543 this->set_ninteraction(1);
553 ELASTICITY_BULK_ELEMENT* cast_element_pt =
554 dynamic_cast<ELASTICITY_BULK_ELEMENT*
>(element_pt);
555 this->U_index_axisym_fsi_traction.resize(n_dim+1);
556 for(
unsigned i=0;
i<n_dim+1;
i++)
558 this->U_index_axisym_fsi_traction[
i] =
559 cast_element_pt->u_index_axisymmetric_linear_elasticity(
i);
567 fill_in_contribution_to_residuals_axisym_fsi_traction(residuals);
577 fill_in_contribution_to_residuals_axisym_fsi_traction(residuals);
580 fill_in_jacobian_from_external_interaction_by_fd(residuals,jacobian);
588 const double &
q()
const {
return *Q_pt;}
605 void output(std::ostream &outfile,
const unsigned &n_plot)
608 unsigned n_dim = this->nodal_dimension();
611 const double q_value=q();
619 unsigned n_intpt = integral_pt()->nweight();
622 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
625 s_int[0]=integral_pt()->knot(ipt,0);
629 outer_unit_normal(ipt,interpolated_normal);
633 interpolated_zeta(s_int,zeta);
636 NAVIER_STOKES_BULK_ELEMENT* ext_el_pt=
637 dynamic_cast<NAVIER_STOKES_BULK_ELEMENT*
> 638 (this->external_element_pt(0,ipt));
642 ext_el_pt->traction(s_ext,
646 outfile << ext_el_pt->interpolated_x(s_ext,0) <<
" " 647 << ext_el_pt->interpolated_x(s_ext,1) <<
" " 648 << q_value*traction[0] <<
" " 649 << q_value*traction[1] <<
" " 650 << q_value*traction[2] <<
" " 651 << interpolated_normal[0] <<
" " 652 << interpolated_normal[1] <<
" " 653 << zeta[0] << std::endl;
662 void output(FILE* file_pt,
const unsigned &n_plot)
677 template <
class ELASTICITY_BULK_ELEMENT,
class NAVIER_STOKES_BULK_ELEMENT>
679 ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT>::Default_Q_Value=1.0;
685 template <
class ELASTICITY_BULK_ELEMENT,
class NAVIER_STOKES_BULK_ELEMENT>
687 ELASTICITY_BULK_ELEMENT, NAVIER_STOKES_BULK_ELEMENT>::
688 fill_in_contribution_to_residuals_axisym_fsi_traction(
693 unsigned n_node = nnode();
697 unsigned n_position_type = this->nnodal_position_type();
698 if(n_position_type != 1)
701 "LinearElasticity is not yet implemented for more than one position type.",
702 OOMPH_CURRENT_FUNCTION,
703 OOMPH_EXCEPTION_LOCATION);
708 unsigned n_dim = this->nodal_dimension();
711 unsigned u_nodal_index[n_dim+1];
712 for(
unsigned i=0;
i<n_dim+1;
i++)
714 u_nodal_index[
i] = this->U_index_axisym_fsi_traction[
i];
722 DShape dpsids(n_node,n_dim-1);
725 const double q_value=q();
731 unsigned n_intpt = integral_pt()->nweight();
734 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
737 double w = integral_pt()->weight(ipt);
740 dshape_local_at_knot(ipt,psi,dpsids);
749 for(
unsigned l=0;l<n_node;l++)
752 for(
unsigned i=0;
i<n_dim;
i++)
755 const double x_local = nodal_position(l,
i);
756 interpolated_x[
i] += x_local*psi(l);
759 for(
unsigned j=0;j<n_dim-1;j++)
761 interpolated_A(j,
i) += x_local*dpsids(l,j);
768 for(
unsigned i=0;
i<n_dim-1;
i++)
770 for(
unsigned j=0;j<n_dim-1;j++)
776 for(
unsigned k=0;k<n_dim;k++)
778 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
785 outer_unit_normal(ipt,interpolated_normal);
795 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
800 "Wrong dimension in TimeHarmonicLinElastLoadedByPressureElement",
801 "TimeHarmonicLinElastLoadedByPressureElement::fill_in_contribution_to_residuals()",
802 OOMPH_EXCEPTION_LOCATION);
807 double W = w*sqrt(Adet);
810 NAVIER_STOKES_BULK_ELEMENT* ext_el_pt=
811 dynamic_cast<NAVIER_STOKES_BULK_ELEMENT*
> 812 (this->external_element_pt(0,ipt));
816 ext_el_pt->traction(s_ext,
821 for(
unsigned l=0;l<n_node;l++)
824 for(
unsigned i=0;
i<n_dim+1;
i++)
827 local_eqn = this->nodal_local_eqn(l,u_nodal_index[
i]);
833 residuals[local_eqn] -=
834 q_value*traction[
i]*psi(l)*interpolated_x[0]*
W;
Vector< unsigned > U_index_axisymmetric_linear_elasticity_traction
Index at which the i-th displacement component is stored.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
FSIAxisymmetricLinearElasticityTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
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 get_traction(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Get the traction vector: Pass number of integration point (dummy), Eulerian coordinate and normal vec...
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 ...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
void output(std::ostream &outfile)
Output function.
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.
void fill_in_contribution_to_residuals_axisymmetric_linear_elasticity_traction(Vector< double > &residuals)
Helper function that actually calculates the residuals.
Vector< unsigned > U_index_axisym_fsi_traction
Index at which the i-th displacement component is stored.
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Reference to the traction function pointer.
double *& q_pt()
Return a pointer the ratio of stress scales used to non-dimensionalise the fluid and solid equations...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
void output(FILE *file_pt)
C_style output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
double * Q_pt
Pointer to the ratio, , of the stress used to non-dimensionalise the fluid stresses to the stress us...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
void output(std::ostream &outfile)
Output with default number of plot points.
void traction(const double &time, const Vector< double > &s, Vector< double > &traction)
Compute traction vector at specified local coordinate Should only be used for post-processing; ignore...
const double & q() const
Return the ratio of the stress scales used to non-dimensionalise the fluid and elasticity equations...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
void output(std::ostream &outfile)
Output function.
void output(FILE *file_pt)
C_style output function.
void Zero_traction_fct(const double &time, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: Plot traction etc at Gauss points nplot is ignored.
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...
static double Default_Q_Value
Static default value for the ratio of stress scales used in the fluid and solid equations (default is...