31#include "time_harmonic_linear_elasticity.h"
44 template<
class ELASTICITY_BULK_ELEMENT,
class HELMHOLTZ_BULK_ELEMENT>
99 throw OomphLibError(
"This flux element will not work correctly "
100 "if nodes are hanging\n",
121 for (
unsigned i = 0;
i <
n_dim;
i++)
124 cast_element_pt->u_index_time_harmonic_linear_elasticity(
i);
152 const double&
q()
const
195 for (
unsigned i = 0;
i <
n_dim - 1;
i++)
222 << traction[0].real() <<
" " << traction[1].real() <<
" "
223 << traction[0].imag() <<
" " << traction[1].imag() <<
" "
235 <<
" " <<
zeta[0] << std::endl;
261 template<
class ELASTICITY_BULK_ELEMENT,
class HELMHOLTZ_BULK_ELEMENT>
262 double TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement<
263 ELASTICITY_BULK_ELEMENT,
264 HELMHOLTZ_BULK_ELEMENT>::Default_Q_Value = 1.0;
270 template<
class ELASTICITY_BULK_ELEMENT,
class HELMHOLTZ_BULK_ELEMENT>
271 void TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement<
272 ELASTICITY_BULK_ELEMENT,
274 fill_in_contribution_to_residuals_helmholtz_traction(
278 unsigned n_node = nnode();
285 throw OomphLibError(
"LinearElasticity is not yet implemented for more "
286 "than one position type.",
293 const unsigned n_dim = this->nodal_dimension();
297 for (
unsigned i = 0;
i <
n_dim;
i++)
300 this->U_index_time_harmonic_linear_elasticity_helmholtz_traction[
i];
317 unsigned n_intpt = integral_pt()->nweight();
323 double w = integral_pt()->weight(
ipt);
338 for (
unsigned i = 0;
i <
n_dim;
i++)
341 const double x_local = nodal_position(
l,
i);
345 for (
unsigned j = 0;
j <
n_dim - 1;
j++)
354 for (
unsigned i = 0;
i <
n_dim - 1;
i++)
356 for (
unsigned j = 0;
j <
n_dim - 1;
j++)
362 for (
unsigned k = 0;
k <
n_dim;
k++)
381 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
385 "Wrong dimension in TimeHarmonicLinElastLoadedByPressureElement",
386 "TimeHarmonicLinElastLoadedByPressureElement::fill_in_contribution_"
410 for (
unsigned i = 0;
i <
n_dim;
i++)
448 template<
class HELMHOLTZ_BULK_ELEMENT,
class ELASTICITY_BULK_ELEMENT>
520 for (
unsigned i = 0;
i < (
Dim - 1);
i++)
553 <<
" " << flux.real() <<
" " << flux.imag() <<
" "
562 <<
" " <<
zeta[0] << std::endl;
636 const unsigned&
flag);
655 template<
class HELMHOLTZ_BULK_ELEMENT,
class ELASTICITY_BULK_ELEMENT>
658 HelmholtzFluxFromNormalDisplacementBCElement(
682 throw OomphLibError(
"This flux element will not work correctly if "
683 "nodes are hanging\n",
722 "Bulk element must inherit from HelmholtzEquations.";
724 "Nodes are one dimensional, but cannot cast the bulk element to\n";
726 error_string +=
"If you desire this functionality, you must "
727 "implement it yourself\n";
750 "Bulk element must inherit from HelmholtzEquations.";
752 "Nodes are two dimensional, but cannot cast the bulk element to\n";
754 error_string +=
"If you desire this functionality, you must "
755 "implement it yourself\n";
777 "Bulk element must inherit from HelmholtzEquations.";
778 error_string +=
"Nodes are three dimensional, but cannot cast the "
781 error_string +=
"If you desire this functionality, you must "
782 "implement it yourself\n";
799 <<
". It should be 1,2, or 3!" << std::endl;
812 template<
class HELMHOLTZ_BULK_ELEMENT,
class ELASTICITY_BULK_ELEMENT>
815 fill_in_generic_residual_contribution_helmholtz_flux_from_displacement(
818 const unsigned&
flag)
821 const unsigned n_node = nnode();
827 const unsigned n_intpt = integral_pt()->nweight();
836 const std::complex<unsigned> u_index_helmholtz =
837 U_index_helmholtz_from_displacement;
844 for (
unsigned i = 0;
i < (Dim - 1);
i++)
846 s[
i] = integral_pt()->knot(
ipt,
i);
850 double w = integral_pt()->weight(
ipt);
866 for (
unsigned i = 0;
i < Dim;
i++)
868 interpolated_x[
i] += nodal_position(
l,
i) *
psif[
l];
886 std::complex<double> flux =
894 local_eqn = nodal_local_eqn(
l, u_index_helmholtz.real());
906 local_eqn = nodal_local_eqn(
l, u_index_helmholtz.imag());
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems ...
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Access function to get source element's local coords for specified interaction index at specified int...
void set_ninteraction(const unsigned &n_interaction)
Set the number of interactions in the element This function is usually called in the specific element...
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from all external interaction degrees of freedom (geometr...
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Access function to source element for specified interaction index at specified integration point.
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 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 J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
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...
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)
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
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...
unsigned nnode() const
Return the number of nodes.
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....
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
A class for elements that allow the imposition of an prescribed flux (determined from the normal disp...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the element's contribution to its residual vector and its Jacobian matrix.
void fill_in_generic_residual_contribution_helmholtz_flux_from_displacement(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Add the element's contribution to its residual vector. flag=1(or 0): do (or don't) compute the contri...
unsigned Dim
The spatial dimension of the problem.
void output(std::ostream &outfile)
Output function.
std::complex< unsigned > U_index_helmholtz_from_displacement
The index at which the unknown is stored at the nodes.
double shape_and_test(const Vector< double > &s, Shape &psi, Shape &test) const
Function to compute the shape and test functions and to return the Jacobian of mapping between local ...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Broken assignment operator.
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 between local ...
HelmholtzFluxFromNormalDisplacementBCElement(const HelmholtzFluxFromNormalDisplacementBCElement &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt)
C-style output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: flux etc at Gauss points; n_plot is ignored.
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.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
A class for elements that allow the imposition of an applied traction in the equations of time-harmon...
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.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: Plot traction etc at Gauss points nplot is ignored.
void fill_in_contribution_to_residuals_helmholtz_traction(Vector< double > &residuals)
Helper function that actually calculates the residuals.
const double & q() const
Return the ratio of the stress scales used to non-dimensionalise the fluid and elasticity equations....
Vector< std::complex< unsigned > > U_index_time_harmonic_linear_elasticity_helmholtz_traction
Index at which the i-th displacement component is stored.
double *& q_pt()
Return a pointer the ratio of stress scales used to non-dimensionalise the fluid and solid equations.
void output(FILE *file_pt)
C_style output function.
static double Default_Q_Value
Static default value for the ratio of stress scales used in the fluid and solid equations (default is...
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...
TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).