29 #ifndef OOMPH_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
30 #define OOMPH_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
46 #include "../generic/Qelements.h"
47 #include "../generic/mesh.h"
48 #include "../generic/hermite_elements.h"
50 #include "../generic/projection.h"
62 template<
unsigned DIM>
70 const unsigned i)
const
72 return std::complex<unsigned>(
i,
i +
DIM);
80 unsigned n_node =
nnode();
88 for (
unsigned i = 0;
i <
DIM;
i++)
91 std::complex<unsigned> u_nodal_index =
95 disp[
i] = std::complex<double>(0.0, 0.0);
98 for (
unsigned l = 0; l < n_node; l++)
100 const std::complex<double> u_value(
104 disp[
i] += u_value * psi[l];
114 unsigned n_node =
nnode();
123 std::complex<unsigned> u_nodal_index =
127 std::complex<double> interpolated_u(0.0, 0.0);
130 for (
unsigned l = 0; l < n_node; l++)
132 const std::complex<double> u_value(
136 interpolated_u += u_value * psi[l];
139 return (interpolated_u);
167 inline double E(
const unsigned&
i,
170 const unsigned& l)
const
213 Vector<std::complex<double>>&
b)
const
220 for (
unsigned i = 0;
i <
n;
i++)
222 b[
i] = std::complex<double>(0.0, 0.0);
233 (*Body_force_fct_pt)(time,
x,
b);
252 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
256 std::pair<unsigned long, unsigned> dof_lookup;
259 const unsigned n_node = this->
nnode();
262 int local_unknown = 0;
265 for (
unsigned n = 0;
n < n_node;
n++)
268 for (
unsigned i = 0;
i < 2 *
DIM;
i++)
274 if (local_unknown >= 0)
278 dof_lookup.first = this->
eqn_number(local_unknown);
279 dof_lookup.second = 0;
282 dof_lookup_list.push_front(dof_lookup);
313 template<
unsigned DIM>
344 ->fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
345 residuals, jacobian, 1);
355 const unsigned& nplot,
366 void output(std::ostream& outfile,
const unsigned& n_plot);
377 void output(FILE* file_pt,
const unsigned& n_plot);
400 template<
unsigned DIM,
unsigned NNODE_1D>
402 :
public virtual QElement<DIM, NNODE_1D>,
419 void output(std::ostream& outfile,
const unsigned& n_plot)
432 void output(FILE* file_pt,
const unsigned& n_plot)
525 template<
class TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
547 unsigned nnod = this->
nnode();
548 for (
unsigned j = 0;
j < nnod;
j++)
551 data_values.push_back(std::make_pair(this->
node_pt(
j), fld));
562 return 2 * this->
dim();
572 std::stringstream error_stream;
573 error_stream <<
"Elements only store four fields so fld can't be"
574 <<
" " << fld << std::endl;
596 unsigned n_dim = this->
dim();
597 unsigned n_node = this->
nnode();
598 DShape dpsidx(n_node, n_dim);
612 unsigned n_node = this->
nnode();
625 double interpolated_u = 0.0;
628 for (
unsigned l = 0; l < n_node; l++)
632 if (nvalue != 2 * n_dim)
634 std::stringstream error_stream;
636 <<
"Current implementation only works for non-resized nodes\n"
637 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2 * n_dim
644 interpolated_u += this->
nodal_value(t, l, fld) * psi[l];
646 return interpolated_u;
653 return this->
nnode();
663 if (nvalue != 2 * n_dim)
665 std::stringstream error_stream;
667 <<
"Current implementation only works for non-resized nodes\n"
668 <<
"but nvalue= " << nvalue <<
"!= 2 dim = " << 2 * n_dim
683 template<
class ELEMENT>
696 template<
class ELEMENT>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
unsigned ntstorage() const
Definition: nodes.cc:879
Definition: matrices.h:386
FaceGeometry()
Definition: time_harmonic_linear_elasticity_elements.h:702
FaceGeometry()
Definition: time_harmonic_linear_elasticity_elements.h:688
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
Definition: time_harmonic_linear_elasticity_elements.h:448
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: time_harmonic_linear_elasticity_elements.h:462
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: time_harmonic_linear_elasticity_elements.h:475
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: time_harmonic_linear_elasticity_elements.h:488
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: time_harmonic_linear_elasticity_elements.h:501
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: time_harmonic_linear_elasticity_elements.h:514
Definition: elements.h:4998
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void shape(const Vector< double > &s, Shape &psi) const =0
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
unsigned dim() const
Definition: elements.h:2611
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
Definition: oomph_definitions.h:222
Definition: projection.h:183
Time-harmonic linear elasticity upgraded to become projectable.
Definition: time_harmonic_linear_elasticity_elements.h:528
unsigned nfields_for_projection()
Definition: time_harmonic_linear_elasticity_elements.h:560
unsigned nhistory_values_for_projection(const unsigned &fld)
Definition: time_harmonic_linear_elasticity_elements.h:567
unsigned nhistory_values_for_coordinate_projection()
Definition: time_harmonic_linear_elasticity_elements.h:585
ProjectableTimeHarmonicLinearElasticityElement()
Definition: time_harmonic_linear_elasticity_elements.h:532
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
Definition: time_harmonic_linear_elasticity_elements.h:658
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Definition: time_harmonic_linear_elasticity_elements.h:608
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
Definition: time_harmonic_linear_elasticity_elements.h:651
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Definition: time_harmonic_linear_elasticity_elements.h:541
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Definition: time_harmonic_linear_elasticity_elements.h:592
Definition: Qelements.h:459
Definition: time_harmonic_linear_elasticity_elements.h:404
void output(FILE *file_pt)
C-style output function.
Definition: time_harmonic_linear_elasticity_elements.h:426
void output(std::ostream &outfile)
Output function.
Definition: time_harmonic_linear_elasticity_elements.h:413
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
Definition: time_harmonic_linear_elasticity_elements.h:432
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: time_harmonic_linear_elasticity_elements.h:419
QTimeHarmonicLinearElasticityElement()
Constructor.
Definition: time_harmonic_linear_elasticity_elements.h:407
Definition: time_harmonic_elasticity_tensor.h:55
Definition: time_harmonic_linear_elasticity_elements.h:64
TimeHarmonicElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
Definition: time_harmonic_linear_elasticity_elements.h:161
virtual void get_stress(const Vector< double > &s, DenseMatrix< std::complex< double >> &sigma) const =0
double * Omega_sq_pt
Square of nondim frequency.
Definition: time_harmonic_linear_elasticity_elements.h:294
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: time_harmonic_linear_elasticity_elements.h:251
TimeHarmonicElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
Definition: time_harmonic_linear_elasticity_elements.h:291
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
Definition: time_harmonic_linear_elasticity_elements.h:188
static double Default_omega_sq_value
Static default value for square of frequency.
Definition: time_harmonic_linear_elasticity_elements.h:300
unsigned ndof_types() const
Definition: time_harmonic_linear_elasticity_elements.h:240
virtual std::complex< unsigned > u_index_time_harmonic_linear_elasticity(const unsigned i) const
Definition: time_harmonic_linear_elasticity_elements.h:69
double *& omega_sq_pt()
Access function for square of non-dim frequency.
Definition: time_harmonic_linear_elasticity_elements.h:182
TimeHarmonicLinearElasticityEquationsBase()
Definition: time_harmonic_linear_elasticity_elements.h:153
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: time_harmonic_linear_elasticity_elements.h:297
const double & omega_sq() const
Access function for square of non-dim frequency.
Definition: time_harmonic_linear_elasticity_elements.h:176
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.
Definition: time_harmonic_linear_elasticity_elements.h:110
double E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
Definition: time_harmonic_linear_elasticity_elements.h:167
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
Definition: time_harmonic_linear_elasticity_elements.h:194
void body_force(const Vector< double > &x, Vector< std::complex< double >> &b) const
Definition: time_harmonic_linear_elasticity_elements.h:212
void get_strain(const Vector< double > &s, DenseMatrix< std::complex< double >> &strain) const
Return the strain tensor.
Definition: time_harmonic_linear_elasticity_elements.cc:49
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.
Definition: time_harmonic_linear_elasticity_elements.h:76
void(* BodyForceFctPt)(const double &t, const Vector< double > &x, Vector< std::complex< double >> &b)
Definition: time_harmonic_linear_elasticity_elements.h:146
Definition: time_harmonic_linear_elasticity_elements.h:316
virtual void fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: time_harmonic_linear_elasticity_elements.cc:195
void compute_norm(double &norm)
Compute norm of solution: square of the L2 norm.
Definition: time_harmonic_linear_elasticity_elements.cc:605
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: time_harmonic_linear_elasticity_elements.h:339
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
Definition: time_harmonic_linear_elasticity_elements.h:322
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Definition: time_harmonic_linear_elasticity_elements.cc:453
void output(FILE *file_pt)
C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Definition: time_harmonic_linear_elasticity_elements.h:370
void output(std::ostream &outfile)
Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Definition: time_harmonic_linear_elasticity_elements.h:359
void get_stress(const Vector< double > &s, DenseMatrix< std::complex< double >> &sigma) const
Definition: time_harmonic_linear_elasticity_elements.cc:150
TimeHarmonicLinearElasticityEquations()
Constructor.
Definition: time_harmonic_linear_elasticity_elements.h:319
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: time_harmonic_linear_elasticity_elements.h:329
unsigned ntstorage() const
Definition: timesteppers.h:601
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
int sigma
Definition: calibrate.py:179
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2