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"
42 #include "./elasticity_tensor.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;
664 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
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>
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
A base class that represents the fourth-rank elasticity tensor defined such that.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying element.
FaceGeometry()
Constructor must call the constructor of the underlying element.
FaceGeometry()
Constructor must call the constructor of the underlying element.
FaceGeometry()
Constructor must call the constructor of the underlying element.
FaceGeometry()
Constructor must call the constructor of the underlying element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
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...
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...
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.
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.
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...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
A base class for elements that solve the equations of linear elasticity in Cartesian coordinates....
ElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
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...
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
void disable_inertia()
Switch off solid inertia.
ElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
virtual void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma) const =0
Return the Cauchy stress tensor, as calculated from the elasticity tensor at specified local coordina...
static void pin_redundant_nodal_solid_pressures(const Vector< GeneralisedElement * > &element_pt)
Loop over all elements in Vector (which typically contains all the elements in a refineable solid mes...
double interpolated_u_linear_elasticity(const Vector< double > &s, const unsigned &i) const
Return FE interpolated displacement u[i] at local coordinate s.
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
void body_force(const Vector< double > &x, Vector< double > &b) const
Evaluate body force at Eulerian coordinate x at present time (returns zero vector if no body force fu...
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
bool is_inertia_enabled() const
Access function to flag that switches inertia on/off (const version)
void interpolated_u_linear_elasticity(const Vector< double > &s, Vector< double > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
bool Unsteady
Flag that switches inertia on/off.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
void enable_inertia()
Switch on solid inertia.
double E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
void(* BodyForceFctPt)(const double &t, const Vector< double > &x, Vector< double > &b)
Function pointer to function that specifies the body force as a function of the Cartesian coordinates...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
virtual unsigned u_index_linear_elasticity(const unsigned i) const
Return the index at which the i-th unknown displacement component is stored. The default value,...
virtual void pin_elemental_redundant_nodal_solid_pressures()
Pin the element's redundant solid pressures (needed for refinement)
double d2u_dt2_linear_elasticity(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
LinearElasticityEquationsBase()
Constructor: Set null pointers for constitutive law and for isotropic growth function....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution x,y,[z],u,v,[w].
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Plot at a given number of...
void output(std::ostream &outfile)
Output: x,y,[z],u,v,[w].
void output(FILE *file_pt)
C-style output: x,y,[z],u,v,[w].
void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma) const
Return the Cauchy stress tensor, as calculated from the elasticity tensor at specified local coordina...
virtual void fill_in_generic_contribution_to_residuals_linear_elasticity(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Private helper function to compute residuals and (if requested via flag) also the Jacobian matrix.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
The jacobian is calculated by finite differences by default, We need only to take finite differences ...
LinearElasticityEquations()
Constructor.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the solid equations (the discretised principle of virtual displacements)
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
An OomphLibError object which should be thrown when an run-time error is encountered....
Wrapper class for projectable elements. Adds "projectability" to the underlying ELEMENT.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
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...
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
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.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!)
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
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 ...
ProjectableLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
unsigned nfields_for_projection()
Number of fields to be projected: dim, corresponding to the displacement components.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(FILE *file_pt)
C-style output function.
QLinearElasticityElement()
Constructor.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution x,y,[z],u,v,[w].
void output(std::ostream &outfile)
Output function.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...