29 #ifndef OOMPH_LINEAR_ELASTICITY_ELEMENTS_HEADER
30 #define OOMPH_LINEAR_ELASTICITY_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
39 #include "../generic/Qelements.h"
40 #include "../generic/mesh.h"
41 #include "../generic/hermite_elements.h"
43 #include "../generic/projection.h"
55 template<
unsigned DIM>
86 for (
unsigned t = 0;
t < n_time;
t++)
102 unsigned n_node =
nnode();
110 for (
unsigned i = 0;
i <
DIM;
i++)
119 for (
unsigned l = 0; l < n_node; l++)
128 const unsigned&
i)
const
131 unsigned n_node =
nnode();
143 double interpolated_u = 0.0;
146 for (
unsigned l = 0; l < n_node; l++)
148 interpolated_u +=
nodal_value(l, u_nodal_index) * psi[l];
151 return (interpolated_u);
180 inline double E(
const unsigned&
i,
183 const unsigned& l)
const
250 unsigned n_element = element_pt.size();
251 for (
unsigned e = 0;
e < n_element;
e++)
277 for (
unsigned i = 0;
i <
n;
i++)
291 (*Body_force_fct_pt)(time,
x,
b);
312 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
316 std::pair<unsigned long, unsigned> dof_lookup;
319 const unsigned n_node = this->
nnode();
322 int local_unknown = 0;
325 for (
unsigned n = 0;
n < n_node;
n++)
328 for (
unsigned i = 0;
i <
DIM;
i++)
334 if (local_unknown >= 0)
338 dof_lookup.first = this->
eqn_number(local_unknown);
339 dof_lookup.second =
i;
343 dof_lookup_list.push_front(dof_lookup);
377 template<
unsigned DIM>
407 residuals, jacobian, 1);
417 const unsigned& nplot,
422 const unsigned& nplot,
434 void output(std::ostream& outfile,
const unsigned& n_plot);
445 void output(FILE* file_pt,
const unsigned& n_plot);
484 template<
unsigned DIM,
unsigned NNODE_1D>
497 const unsigned& nplot,
510 void output(std::ostream& outfile,
const unsigned& n_plot)
523 void output(FILE* file_pt,
const unsigned& n_plot)
614 template<
class LINEAR_ELAST_ELEMENT>
635 unsigned nnod = this->
nnode();
636 for (
unsigned j = 0;
j < nnod;
j++)
639 data_values.push_back(std::make_pair(this->
node_pt(
j), fld));
660 std::stringstream error_stream;
661 error_stream <<
"Elements only store two fields so fld can't be"
662 <<
" " << fld << std::endl;
683 unsigned n_dim = this->
dim();
684 unsigned n_node = this->
nnode();
685 DShape dpsidx(n_node, n_dim);
699 unsigned n_node = this->
nnode();
712 double interpolated_u = 0.0;
715 for (
unsigned l = 0; l < n_node; l++)
735 interpolated_u += this->
nodal_value(t, l, fld) * psi[l];
737 return interpolated_u;
744 return this->
nnode();
779 template<
class ELEMENT>
792 template<
class ELEMENT>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
unsigned ntstorage() const
Definition: nodes.cc:879
Definition: linear_elasticity/elasticity_tensor.h:55
FaceGeometry()
Definition: linear_elasticity_elements.h:797
FaceGeometry()
Definition: linear_elasticity_elements.h:784
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
Definition: linear_elasticity_elements.h:539
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: linear_elasticity_elements.h:552
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: linear_elasticity_elements.h:565
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: linear_elasticity_elements.h:578
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: linear_elasticity_elements.h:590
FaceGeometry()
Constructor must call the constructor of the underlying element.
Definition: linear_elasticity_elements.h:603
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
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
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
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
Definition: linear_elasticity_elements.h:57
ElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
Definition: linear_elasticity_elements.h:352
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
Definition: linear_elasticity_elements.h:195
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: linear_elasticity_elements.h:311
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
Definition: linear_elasticity_elements.h:207
void disable_inertia()
Switch off solid inertia.
Definition: linear_elasticity_elements.h:220
ElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
Definition: linear_elasticity_elements.h:174
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
Definition: linear_elasticity_elements.h:364
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
Definition: linear_elasticity_elements.h:355
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
Definition: linear_elasticity_elements.h:189
virtual void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma) const =0
static void pin_redundant_nodal_solid_pressures(const Vector< GeneralisedElement * > &element_pt)
Definition: linear_elasticity_elements.h:245
double interpolated_u_linear_elasticity(const Vector< double > &s, const unsigned &i) const
Return FE interpolated displacement u[i] at local coordinate s.
Definition: linear_elasticity_elements.h:127
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
Definition: linear_elasticity_elements.cc:47
void body_force(const Vector< double > &x, Vector< double > &b) const
Definition: linear_elasticity_elements.h:270
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: linear_elasticity_elements.h:361
bool is_inertia_enabled() const
Access function to flag that switches inertia on/off (const version)
Definition: linear_elasticity_elements.h:226
void interpolated_u_linear_elasticity(const Vector< double > &s, Vector< double > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
Definition: linear_elasticity_elements.h:98
bool Unsteady
Flag that switches inertia on/off.
Definition: linear_elasticity_elements.h:358
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
Definition: linear_elasticity_elements.h:201
void enable_inertia()
Switch on solid inertia.
Definition: linear_elasticity_elements.h:214
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: linear_elasticity_elements.h:180
void(* BodyForceFctPt)(const double &t, const Vector< double > &x, Vector< double > &b)
Definition: linear_elasticity_elements.h:158
unsigned ndof_types() const
Definition: linear_elasticity_elements.h:299
virtual unsigned u_index_linear_elasticity(const unsigned i) const
Definition: linear_elasticity_elements.h:62
virtual void pin_elemental_redundant_nodal_solid_pressures()
Pin the element's redundant solid pressures (needed for refinement)
Definition: linear_elasticity_elements.h:232
double d2u_dt2_linear_elasticity(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
Definition: linear_elasticity_elements.h:68
LinearElasticityEquationsBase()
Definition: linear_elasticity_elements.h:165
Definition: linear_elasticity_elements.h:380
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution x,y,[z],u,v,[w].
Definition: linear_elasticity_elements.cc:377
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
Definition: linear_elasticity_elements.h:386
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: linear_elasticity_elements.cc:568
void output(std::ostream &outfile)
Output: x,y,[z],u,v,[w].
Definition: linear_elasticity_elements.h:427
void output(FILE *file_pt)
C-style output: x,y,[z],u,v,[w].
Definition: linear_elasticity_elements.h:438
void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma) const
Definition: linear_elasticity_elements.cc:145
virtual void fill_in_generic_contribution_to_residuals_linear_elasticity(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: linear_elasticity_elements.cc:190
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: linear_elasticity_elements.h:402
LinearElasticityEquations()
Constructor.
Definition: linear_elasticity_elements.h:383
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: linear_elasticity_elements.h:393
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
Linear elasticity upgraded to become projectable.
Definition: linear_elasticity_elements.h:617
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Definition: linear_elasticity_elements.h:695
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
Definition: linear_elasticity_elements.h:749
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Definition: linear_elasticity_elements.h:679
unsigned nhistory_values_for_projection(const unsigned &fld)
Definition: linear_elasticity_elements.h:655
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
Definition: linear_elasticity_elements.h:742
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Definition: linear_elasticity_elements.h:629
ProjectableLinearElasticityElement()
Definition: linear_elasticity_elements.h:621
unsigned nfields_for_projection()
Definition: linear_elasticity_elements.h:648
unsigned nhistory_values_for_coordinate_projection()
Definition: linear_elasticity_elements.h:672
Definition: Qelements.h:459
Definition: linear_elasticity_elements.h:487
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
Definition: linear_elasticity_elements.h:523
void output(FILE *file_pt)
C-style output function.
Definition: linear_elasticity_elements.h:517
QLinearElasticityElement()
Constructor.
Definition: linear_elasticity_elements.h:490
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: linear_elasticity_elements.h:510
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution x,y,[z],u,v,[w].
Definition: linear_elasticity_elements.h:496
void output(std::ostream &outfile)
Output function.
Definition: linear_elasticity_elements.h:504
Definition: timesteppers.h:231
unsigned ntstorage() const
Definition: timesteppers.h:601
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
bool is_steady() const
Definition: timesteppers.h:389
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 error
Definition: calibrate.py:297
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