33 #ifndef OOMPH_PML_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER 34 #define OOMPH_PML_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 50 #include "../generic/Qelements.h" 51 #include "../generic/mesh.h" 52 #include "../generic/hermite_elements.h" 54 #include "../generic/projection.h" 55 #include "../generic/nodes.h" 56 #include "../generic/oomph_utilities.h" 57 #include "../generic/pml_meshes.h" 58 #include "../generic/pml_mapping_functions.h" 82 template <
unsigned DIM,
class PML_ELEMENT>
95 this->Pml_mapping_pt =
108 virtual inline std::complex<unsigned>
111 return std::complex<unsigned>(
i,i+DIM);
117 Vector<std::complex<double> >& disp)
121 unsigned n_node =
nnode();
129 for (
unsigned i=0;
i<DIM;
i++)
132 std::complex<unsigned> u_nodal_index =
136 disp[
i] = std::complex<double>(0.0,0.0);
139 for(
unsigned l=0;l<n_node;l++)
141 const std::complex<double> u_value(
145 disp[
i] += u_value*psi[l];
153 const unsigned &
i)
const 156 unsigned n_node =
nnode();
165 std::complex<unsigned> u_nodal_index =
169 std::complex<double> interpolated_u(0.0,0.0);
172 for(
unsigned l=0;l<n_node;l++)
174 const std::complex<double> u_value(
178 interpolated_u += u_value*psi[l];
181 return(interpolated_u);
196 inline std::complex<double>
E(
const unsigned &
i,
const unsigned &j,
197 const unsigned &k,
const unsigned &l)
const 203 inline double nu()
const 217 return std::sqrt(2.0*(1.0+this->
nu()) * this->
omega_sq());
231 DenseMatrix<std::complex<double> > &sigma)
const=0;
240 Vector<std::complex<double> >& b)
const 247 for (
unsigned i=0;
i<n;
i++)
249 b[
i] = std::complex<double>(0.0,0.0);
255 (*Body_force_fct_pt)(x,b);
266 values_to_pin.resize(DIM*2);
267 for (
unsigned j=0;j<DIM*2;j++)
288 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 293 std::pair<unsigned long,unsigned> dof_lookup;
296 const unsigned n_node = this->
nnode();
302 for(
unsigned n=0;n<n_node;n++)
305 for(
unsigned i=0;
i<2*DIM;
i++)
311 if (local_unknown >= 0)
315 dof_lookup.first = this->
eqn_number(local_unknown);
316 dof_lookup.second = 0;
319 dof_lookup_list.push_front(dof_lookup);
356 template <
unsigned DIM,
class PML_ELEMENT>
372 fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
384 fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
385 residuals,jacobian,1);
395 const unsigned &nplot,
406 void output(std::ostream &outfile,
const unsigned &n_plot);
417 void output(FILE* file_pt,
const unsigned &n_plot);
424 void output_total_real(
425 std::ostream &outfile,
428 const unsigned &nplot);
436 void output_real(std::ostream &outfile,
const double& phi,
437 const unsigned &n_plot);
444 void output_imag(std::ostream &outfile,
const double& phi,
445 const unsigned &n_plot);
455 double& error,
double& norm);
461 const double& time,
double& error,
double& norm)
463 std::ostringstream error_stream;
464 error_stream <<
"There is no time-dependent compute_error() " 466 <<
"for pml time harmonic linear elasticity elements" 470 OOMPH_CURRENT_FUNCTION,
471 OOMPH_EXCEPTION_LOCATION);
479 fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
492 template<
unsigned DIM,
unsigned NNODE_1D,
class PML_ELEMENT>
494 public virtual QElement<DIM,NNODE_1D>,
509 void output(std::ostream &outfile,
const unsigned &n_plot)
519 void output(FILE* file_pt,
const unsigned &n_plot)
530 template<
class PML_ELEMENT>
545 template<
class PML_ELEMENT>
560 template<
class PML_ELEMENT>
574 template<
class PML_ELEMENT>
587 template<
class PML_ELEMENT>
601 template<
class PML_ELEMENT>
618 template<
class TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
642 unsigned nnod=this->
nnode();
643 for (
unsigned j=0;j<nnod;j++)
646 data_values.push_back(std::make_pair(this->
node_pt(j),fld));
658 return 2*this->
dim();
668 std::stringstream error_stream;
670 <<
"Elements only store four fields so fld can't be" 671 <<
" " << fld << std::endl;
674 OOMPH_CURRENT_FUNCTION,
675 OOMPH_EXCEPTION_LOCATION);
695 unsigned n_dim=this->
dim();
696 unsigned n_node=this->
nnode();
697 DShape dpsidx(n_node,n_dim);
712 unsigned n_node=this->
nnode();
725 double interpolated_u = 0.0;
728 for(
unsigned l=0;l<n_node;l++)
734 std::stringstream error_stream;
736 <<
"Current implementation only works for non-resized nodes\n" 737 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2*n_dim << std::endl;
740 OOMPH_CURRENT_FUNCTION,
741 OOMPH_EXCEPTION_LOCATION);
744 interpolated_u += this->
nodal_value(t,l,fld)*psi[l];
746 return interpolated_u;
753 return this->
nnode();
766 std::stringstream error_stream;
768 <<
"Current implementation only works for non-resized nodes\n" 769 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2*n_dim << std::endl;
772 OOMPH_CURRENT_FUNCTION,
773 OOMPH_EXCEPTION_LOCATION);
787 template<
class ELEMENT>
801 template<
class ELEMENT>
822 template<
unsigned NNODE_1D,
class PML_ELEMENT>
PMLTimeHarmonicIsotropicElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
void values_to_be_pinned_on_outer_pml_boundary(Vector< unsigned > &values_to_pin)
Pure virtual function in which we specify the values to be pinned (and set to zero) on the outer edge...
PMLTimeHarmonicLinearElasticityEquationsBase()
Constructor: Set null pointers for constitutive law and for isotropic growth function. Set physical parameter values to default values, and set body force to zero.
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
double nu() const
Access function to nu in the elasticity tensor.
static C1BermudezPMLMapping Default_pml_mapping
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
unsigned nfields_for_projection()
Number of fields to be projected: 2*dim, corresponding to real and imag parts of the displacement com...
void(* BodyForceFctPt)(const Vector< double > &x, Vector< std::complex< double > > &b)
Function pointer to function that specifies the body force as a function of the Cartesian coordinates...
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!) ...
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
ProjectablePMLTimeHarmonicLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
A general Finite Element class.
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return Jacobian of mapping and shape functions of field fld at local coordinate s.
void output(FILE *file_pt)
C-style output function.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
FaceGeometry()
Constructor must call the constructor of the underlying element.
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
double * Omega_sq_pt
Square of nondim frequency.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
void operator=(const PMLTimeHarmonicLinearElasticityEquationsBase< DIM, PML_ELEMENT > &)
Broken assignment operator.
virtual void get_stress(const Vector< double > &s, DenseMatrix< std::complex< double > > &sigma) const =0
Return the Cauchy stress tensor, as calculated from the elasticity tensor at specified local coordina...
FaceGeometry()
Constructor must call the constructor of the underlying element.
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever ...
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void interpolated_u_time_harmonic_linear_elasticity(const Vector< double > &s, Vector< std::complex< double > > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
double wavenumber() const
Wavenumber for the PML.
void output(std::ostream &outfile)
Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
FaceGeometry()
Constructor must call the constructor of the underlying element.
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
void output(FILE *file_pt)
C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Time-harmonic linear elasticity upgraded to become projectable.
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
FaceGeometry()
Constructor must call the constructor of the underlying element.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
double nu() const
Poisson's ratio.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
void get_strain(const Vector< double > &s, DenseMatrix< std::complex< double > > &strain) const
Return the strain tensor.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
virtual std::complex< unsigned > u_index_time_harmonic_linear_elasticity(const unsigned i) const
Return the index at which the i-th real or imag unknown displacement component is stored...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the solid equations (the discretised principle of virtual displacements) ...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
std::complex< double > interpolated_u_time_harmonic_linear_elasticity(const Vector< double > &s, const unsigned &i) const
Return FE interpolated displacement u[i] at local coordinate s.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
EquivalentQElement()
Constructor: Call the constructor for the appropriate QElement.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void body_force(const Vector< double > &x, Vector< std::complex< double > > &b) const
Evaluate body force at Eulerian coordinate x (returns zero vector if no body force function pointer h...
static double Default_omega_sq_value
Static default value for square of frequency.
double *& omega_sq_pt()
Access function for square of non-dim frequency.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
PMLTimeHarmonicLinearElasticityEquations()
Constructor.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile)
Output function.
const double & omega_sq() const
Access function for square of non-dim frequency.
std::complex< double > E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
PMLTimeHarmonicIsotropicElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
unsigned nnode() const
Return the number of nodes.
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
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...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
QPMLTimeHarmonicLinearElasticityElement()
Constructor.
FaceGeometry()
Constructor must call the constructor of the underlying element.
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...