29#ifndef OOMPH_REFINEABLE_ELASTICITY_ELEMENTS_HEADER
30#define OOMPH_REFINEABLE_ELASTICITY_ELEMENTS_HEADER
43 template<
unsigned DIM>
62 const unsigned&
flag);
94 std::ostringstream error_message;
95 error_message <<
"The flux vector has the wrong number of entries, "
112 for (
unsigned i = 0;
i <
DIM;
i++)
119 for (
unsigned i = 0;
i <
DIM;
i++)
121 for (
unsigned j =
i + 1;
j <
DIM;
j++)
154 cast_father_element_pt->isotropic_growth_fct_pt();
163 this->
Lambda_sq_pt = cast_father_element_pt->lambda_sq_pt();
166 this->
Unsteady = cast_father_element_pt->is_inertia_enabled();
170 cast_father_element_pt->is_jacobian_evaluated_by_fd();
177 template<
unsigned DIM,
unsigned NNODE_1D>
223 template<
unsigned NNODE_1D>
236 template<
unsigned NNODE_1D>
250 template<
unsigned NNODE_1D>
263 template<
unsigned NNODE_1D>
279 template<
unsigned DIM>
303 const unsigned&
flag);
337 std::ostringstream error_message;
338 error_message <<
"The flux vector has the wrong number of entries, "
355 for (
unsigned i = 0;
i <
DIM;
i++)
362 for (
unsigned i = 0;
i <
DIM;
i++)
364 for (
unsigned j =
i + 1;
j <
DIM;
j++)
397 cast_father_element_pt->isotropic_growth_fct_pt();
406 this->
Lambda_sq_pt = cast_father_element_pt->lambda_sq_pt();
409 this->
Unsteady = cast_father_element_pt->is_inertia_enabled();
412 this->
Incompressible = cast_father_element_pt->is_incompressible();
416 cast_father_element_pt->is_jacobian_evaluated_by_fd();
431 template<
unsigned DIM>
535 using namespace QuadTreeNames;
546 quadtree_pt()->son_pt(
ison)->object_pt())
554 set_solid_p(0, p_value);
570 set_solid_p(1, p_value);
585 set_solid_p(2, p_value);
598 using namespace QuadTreeNames;
601 int son_type = quadtree_pt()->son_type();
617 else if (son_type == SE)
623 else if (son_type == NE)
630 else if (son_type == NW)
642 set_solid_p(0,
press);
657 using namespace OcTreeNames;
660 double centre_solid_p[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
753 using namespace OcTreeNames;
756 int son_type = octree_pt()->son_type();
760 octree_pt()->father_pt()->object_pt());
765 for (
unsigned i = 0;
i < 3;
i++)
778 set_solid_p(0,
press);
781 for (
unsigned i = 1;
i < 4;
i++)
821 template<
unsigned DIM>
1003 for (
unsigned i = 0;
i <
DIM;
i++)
1012 else if (
s[
i] == 1.0)
1035 index[
i] *
static_cast<unsigned>(
pow(
static_cast<float>(
NNODE_1D),
1036 static_cast<int>(
i)));
1077 return static_cast<unsigned>(
pow(2.0,
static_cast<int>(
DIM)));
1081 return this->
nnode();
void pin(const unsigned &i)
Pin the i-th stored variable.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
virtual unsigned nvertex_node() const
Return the number of vertex nodes in this element. Broken virtual function in "pure" finite elements.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
static const double Node_location_tolerance
Default value for the tolerance to be used when locating nodes via local coordinates.
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...
unsigned nnode() const
Return the number of nodes.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
virtual Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element. Broken virtual function in "pure" finite elements.
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
An OomphLibError object which should be thrown when an run-time error is encountered....
bool Unsteady
Flag that switches inertia on/off.
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
ConstitutiveLaw * Constitutive_law_pt
Pointer to the constitutive law.
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
IsotropicGrowthFctPt Isotropic_growth_fct_pt
Pointer to isotropic growth function.
bool Evaluate_jacobian_by_fd
Use FD to evaluate Jacobian.
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
A class for elements that solve the equations of solid mechanics, based on the principle of virtual d...
double interpolated_solid_p(const Vector< double > &s)
Return the interpolated_solid_pressure.
bool Incompressible
Boolean to determine whether the solid is incompressible or not.
A class for elements that solve the equations of solid mechanics, based on the principle of virtual d...
Point element has just a single node and a single shape function which is identically equal to one.
An Element that solves the equations of solid mechanics, based on the discretised principle of virtua...
unsigned npres_solid() const
Return number of pressure values.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Return the pressure shape functions.
int solid_p_nodal_index() const
Set the value at which the solid pressure is stored in the nodes.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
An Element that solves the equations of solid mechanics, using the principle of virtual displacements...
unsigned npres_solid() const
Return number of pressure values.
unsigned P_solid_internal_index
Internal index that indicates at which internal data value the solid presure is stored.
An Element that solves the solid mechanics equations, based on the principle of virtual displacements...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
static void check_value_id(const int &n_continuously_interpolated_values, const int &value_id)
Static helper function that is used to check that the value_id is in range.
Class for Refineable solid mechanics elements in near-incompressible/ incompressible formulation,...
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
No values are interpolated in this element (pure solid)
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 0 (pure solid problem)
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
in strain tensor.
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
No values are interpolated in this element (pure solid)
void fill_in_generic_residual_contribution_pvd_with_pressure(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &flag)
Add element's contribution to elemental residual vector and/or Jacobian matrix flag=1: compute both f...
virtual Node * solid_pressure_node_pt(const unsigned &l)
void further_build()
Pass the generic stuff down to the sons.
void get_mass_matrix_diagonal(Vector< double > &mass_diag)
Compute the diagonal of the displacement mass matrix for LSC preconditioner.
RefineablePVDEquationsWithPressure()
Constructor:
Class for Refineable PVD equations.
RefineablePVDEquations()
Constructor.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
No values are interpolated in this element (pure solid)
virtual Node * solid_pressure_node_pt(const unsigned &l)
void further_build()
Further build function, pass the pointers down to the sons.
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
No values are interpolated in this element (pure solid)
void fill_in_generic_contribution_to_residuals_pvd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Call the residuals including hanging node cases.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 0 (pure solid problem)
Class for refineable solid mechanics elements in near-incompressible/ incompressible formulation,...
double local_one_d_fraction_of_interpolating_node(const unsigned &n1d, const unsigned &i, const int &value_id)
The pressure nodes are the corner nodes, so when value_id==0, the fraction is the same as the 1d node...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void rebuild_from_sons(Mesh *&mesh_pt)
Empty rebuild from sons, empty.
unsigned required_nvalue(const unsigned &n) const
Overload the number of additional solid dofs at each node, we shall always assign 1,...
void interpolating_basis(const Vector< double > &s, Shape &psi, const int &value_id) const
The basis interpolating the pressure is given by pshape(). / The basis interpolating the velocity is ...
unsigned ninterpolating_node(const int &value_id)
The number of pressure nodes is 2^DIM. The number of velocity nodes is the same as the number of geom...
unsigned nvertex_node() const
Number of vertex nodes in the element.
RefineableQPVDElementWithContinuousPressure()
Constructor:
void pin_elemental_redundant_nodal_solid_pressures()
Pin the redundant solid pressure.
Node * interpolating_node_pt(const unsigned &n, const int &value_id)
The pressure "nodes" are a subset of the nodes, so when value_id==0, the n-th pressure node is return...
void unpin_elemental_solid_pressure_dofs()
Unpin all pressure dofs.
unsigned ninterpolating_node_1d(const int &value_id)
The number of 1d pressure nodes is 2, otherwise we have the positional nodes.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
OK, interpolate the solid pressures.
Node * solid_pressure_node_pt(const unsigned &l)
unsigned ncont_interpolated_values() const
Number of continuously interpolated values (1) solid pressure.
Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &value_id)
The velocity nodes are the same as the geometric nodes. The pressure nodes must be calculated by usin...
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes.
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
OK get the time-dependent verion.
Class for refineable solid mechanics elements in near-incompressible/ incompressible formulation,...
void further_setup_hanging_nodes()
No additional hanging node procedures are required for discontinuous solid pressures.
RefineableQPVDElementWithPressure()
Constructor:
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nvertex_node() const
Number of vertex nodes in the element.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 0 (pure solid problem)
void rebuild_from_sons(Mesh *&mesh_pt)
Reconstruct the pressure from the sons Must be specialized for each dimension.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs.
void further_build()
Further build: Interpolate the solid pressure values Again this must be specialised for each dimensio...
Class for refineable QPVDElement elements.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
RefineableQPVDElement()
Constructor:
void further_setup_hanging_nodes()
No additional hanging node procedures are required for the solid elements.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void rebuild_from_sons(Mesh *&mesh_pt)
Empty rebuild from sons, no need to reconstruct anything here.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
RefineableSolidElements are SolidFiniteElements that may be subdivided into children to provide a bet...
virtual void further_build()
Further build: Pass the father's Use_undeformed_macro_element_for_new_lagrangian_coords flag down,...
A class that is used to template the solid refineable Q elements by dimension. It's really nothing mo...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
SolidQElement elements are quadrilateral elements whose derivatives also include those based upon the...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).