33 #ifndef OOMPH_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER 34 #define OOMPH_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" 66 template <
unsigned DIM>
74 virtual inline std::complex<unsigned>
77 return std::complex<unsigned>(
i,i+DIM);
83 Vector<std::complex<double> >& disp)
87 unsigned n_node =
nnode();
95 for (
unsigned i=0;
i<DIM;
i++)
98 std::complex<unsigned> u_nodal_index =
102 disp[
i] = std::complex<double>(0.0,0.0);
105 for(
unsigned l=0;l<n_node;l++)
107 const std::complex<double> u_value(
111 disp[
i] += u_value*psi[l];
119 const unsigned &
i)
const 122 unsigned n_node =
nnode();
131 std::complex<unsigned> u_nodal_index =
135 std::complex<double> interpolated_u(0.0,0.0);
138 for(
unsigned l=0;l<n_node;l++)
140 const std::complex<double> u_value(
144 interpolated_u += u_value*psi[l];
147 return(interpolated_u);
169 inline double E(
const unsigned &
i,
const unsigned &j,
170 const unsigned &k,
const unsigned &l)
const 192 DenseMatrix<std::complex<double> > &sigma)
const=0;
201 Vector<std::complex<double> >& b)
const 208 for (
unsigned i=0;
i<n;
i++)
210 b[
i] = std::complex<double>(0.0,0.0);
221 (*Body_force_fct_pt)(time,x,b);
240 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 245 std::pair<unsigned long,unsigned> dof_lookup;
248 const unsigned n_node = this->
nnode();
254 for(
unsigned n=0;n<n_node;n++)
257 for(
unsigned i=0;
i<2*DIM;
i++)
263 if (local_unknown >= 0)
267 dof_lookup.first = this->
eqn_number(local_unknown);
268 dof_lookup.second = 0;
271 dof_lookup_list.push_front(dof_lookup);
305 template <
unsigned DIM>
321 fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
333 this->fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
334 residuals,jacobian,1);
344 const unsigned &nplot,
355 void output(std::ostream &outfile,
const unsigned &n_plot);
366 void output(FILE* file_pt,
const unsigned &n_plot);
376 virtual void fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
391 template<
unsigned DIM,
unsigned NNODE_1D>
406 void output(std::ostream &outfile,
const unsigned &n_plot)
415 void output(FILE* file_pt,
const unsigned &n_plot)
507 template<
class TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
531 unsigned nnod=this->
nnode();
532 for (
unsigned j=0;j<nnod;j++)
535 data_values.push_back(std::make_pair(this->
node_pt(j),fld));
547 return 2*this->
dim();
557 std::stringstream error_stream;
559 <<
"Elements only store four fields so fld can't be" 560 <<
" " << fld << std::endl;
563 OOMPH_CURRENT_FUNCTION,
564 OOMPH_EXCEPTION_LOCATION);
584 unsigned n_dim=this->
dim();
585 unsigned n_node=this->
nnode();
586 DShape dpsidx(n_node,n_dim);
601 unsigned n_node=this->
nnode();
614 double interpolated_u = 0.0;
617 for(
unsigned l=0;l<n_node;l++)
623 std::stringstream error_stream;
625 <<
"Current implementation only works for non-resized nodes\n" 626 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2*n_dim << std::endl;
629 OOMPH_CURRENT_FUNCTION,
630 OOMPH_EXCEPTION_LOCATION);
633 interpolated_u += this->
nodal_value(t,l,fld)*psi[l];
635 return interpolated_u;
642 return this->
nnode();
655 std::stringstream error_stream;
657 <<
"Current implementation only works for non-resized nodes\n" 658 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2*n_dim << std::endl;
661 OOMPH_CURRENT_FUNCTION,
662 OOMPH_EXCEPTION_LOCATION);
676 template<
class ELEMENT>
689 template<
class ELEMENT>
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
TimeHarmonicElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the solid equations (the discretised principle of virtual displacements) ...
void body_force(const Vector< double > &x, Vector< std::complex< double > > &b) const
Evaluate body force at Eulerian coordinate x at present time (returns zero vector if no body force fu...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
ProjectableTimeHarmonicLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
QTimeHarmonicLinearElasticityElement()
Constructor.
A general Finite Element class.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...
static double Default_omega_sq_value
Static default value for square of frequency.
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.
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
void output(std::ostream &outfile)
Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
const double & omega_sq() const
Access function for square of non-dim frequency.
FaceGeometry()
Constructor must call the constructor of the underlying element.
TimeHarmonicLinearElasticityEquations()
Constructor.
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever ...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
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...
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
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 E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
FaceGeometry()
Constructor must call the constructor of the underlying element.
void(* BodyForceFctPt)(const double &t, 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...
void output(FILE *file_pt)
C-style output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
double *& omega_sq_pt()
Access function for square of non-dim frequency.
unsigned nfields_for_projection()
Number of fields to be projected: 2*dim, corresponding to real and imag parts of the displacement com...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
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.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
double & time()
Return the current value of the continuous time.
double * Omega_sq_pt
Square of nondim frequency.
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 ...
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...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
TimeHarmonicElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
void output(FILE *file_pt)
C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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.
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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...
void get_strain(const Vector< double > &s, DenseMatrix< std::complex< double > > &strain) const
Return the strain tensor.
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
TimeHarmonicLinearElasticityEquationsBase()
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 nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!) ...
void output(std::ostream &outfile)
Output function.
FaceGeometry()
Constructor must call the constructor of the underlying element.
unsigned nnode() const
Return the number of nodes.
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...
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...
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...
Time-harmonic linear elasticity upgraded to become projectable.
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.