29#ifndef OOMPH_PSEUDO_SOLID_REMESH_ELEMENTS_HEADER
30#define OOMPH_PSEUDO_SOLID_REMESH_ELEMENTS_HEADER
39 namespace PseudoSolidHelper
54 template<
class BASIC,
class SOLID>
96 return BASIC::required_nvalue(
n) + SOLID::required_nvalue(
n);
106 if (SOLID::solid_p_nodal_index() >= 0)
108 throw OomphLibError(
"Cannot handle (non-refineable) continuous solid "
109 "pressure interpolation",
114 return SOLID::solid_p_nodal_index();
122 BASIC::fill_in_contribution_to_residuals(
residuals);
124 SOLID::fill_in_contribution_to_residuals(
residuals);
133 BASIC::fill_in_contribution_to_jacobian(
residuals, jacobian);
135 SOLID::fill_in_contribution_to_jacobian(
residuals, jacobian);
149 BASIC::fill_in_contribution_to_jacobian_and_mass_matrix(
152 SOLID::fill_in_contribution_to_jacobian_and_mass_matrix(
186 const unsigned n_dof = this->ndof();
187 const unsigned n_node = this->nnode();
188 const unsigned nodal_dim = this->nodal_dimension();
197 if (this->nnodal_position_type() != 1)
199 throw OomphLibError(
"Shape derivatives do not (yet) allow for "
200 "generalised position dofs\n",
218 for (
unsigned l = 0;
l <
n_dof;
l++)
252 const unsigned n_node = this->nnode();
262 this->update_before_solid_position_fd();
266 const unsigned nodal_dim = this->nodal_dimension();
269 const unsigned n_dof = this->ndof();
280 for (
unsigned m = 0;
m <
n_dof;
m++)
284 BASIC::fill_in_contribution_to_residuals(
residuals);
325 const double fd_step = this->Default_fd_jacobian_step;
341 double*
const value_pt = &(this->node_pt(
n)->x_gen(
k,
i));
344 const double old_var = *value_pt;
350 this->node_pt(
n)->perform_auxiliary_node_update_fct();
356 for (
unsigned m = 0;
m <
n_dof;
m++)
360 BASIC::fill_in_contribution_to_residuals(
newres);
365 for (
unsigned m = 0;
m <
n_dof;
m++)
399 this->node_pt(
n)->perform_auxiliary_node_update_fct();
407 this->reset_after_solid_position_fd();
418 const unsigned n_node = this->nnode();
422 dynamic_cast<SolidNode*
>(this->node_pt(
j))->variable_position_pt());
456 return BASIC::num_Z2_flux_terms();
476 BASIC::get_Z2_flux(
s, flux);
482 return BASIC::nvertex_node();
488 return BASIC::vertex_node_pt(
j);
495 return BASIC::nrecovery_order();
503 return BASIC::ndof_types() + SOLID::ndof_types();
510 return BASIC::ndof_types();
517 return SOLID::ndof_types();
532 std::list<std::pair<unsigned long, unsigned>>
solid_list;
533 SOLID::get_dof_numbers_for_unknowns(
solid_list);
543 typedef std::list<std::pair<unsigned long, unsigned>>::iterator
IT;
546 std::pair<unsigned long, unsigned>
new_pair;
555 template<
class BASIC,
class SOLID>
566 template<
class BASIC,
class SOLID>
582 template<
class BASIC,
class SOLID>
613 return BASIC::required_nvalue(
n) + SOLID::required_nvalue(
n);
620 return BASIC::ncont_interpolated_values() +
621 SOLID::ncont_interpolated_values();
635 return BASIC::ncont_interpolated_values() +
636 SOLID::solid_p_nodal_index();
649 BASIC::fill_in_contribution_to_residuals(
residuals);
651 SOLID::fill_in_contribution_to_residuals(
residuals);
660 BASIC::fill_in_contribution_to_jacobian(
residuals, jacobian);
663 SOLID::fill_in_contribution_to_jacobian(
residuals, jacobian);
677 BASIC::fill_in_contribution_to_jacobian_and_mass_matrix(
680 SOLID::fill_in_contribution_to_jacobian_and_mass_matrix(
694 const unsigned n_node = this->nnode();
704 this->update_before_solid_position_fd();
710 const unsigned nodal_dim = this->nodal_dimension();
713 const unsigned n_dof = this->ndof();
724 for (
unsigned m = 0;
m <
n_dof;
m++)
728 BASIC::fill_in_contribution_to_residuals(
residuals);
770 this->local_position_hang_eqn(
hang_info_pt->master_node_pt(
m));
854 const double fd_step = this->Default_fd_jacobian_step;
883 const double old_var = *value_pt;
895 for (
unsigned m = 0;
m <
n_dof;
m++)
899 BASIC::fill_in_contribution_to_residuals(
newres);
905 for (
unsigned m = 0;
m <
n_dof;
m++)
958 this->local_position_hang_eqn(master_node_pt);
972 double*
const value_pt = &(master_node_pt->
x_gen(
k,
i));
976 const double old_var = *value_pt;
988 for (
unsigned m = 0;
m <
n_dof;
m++)
992 BASIC::fill_in_contribution_to_residuals(
newres);
997 for (
unsigned m = 0;
m <
n_dof;
m++)
1046 this->reset_after_solid_position_fd();
1057 const unsigned n_node = this->nnode();
1061 if (this->node_pt(
j)->is_hanging())
1085 dynamic_cast<SolidNode*
>(this->node_pt(
j))->variable_position_pt());
1095 BASIC::assign_additional_local_eqn_numbers();
1096 SOLID::assign_additional_local_eqn_numbers();
1102 BASIC::rebuild_from_sons(mesh_pt);
1103 SOLID::rebuild_from_sons(mesh_pt);
1122 values.push_back(*
it);
1129 values.push_back(*
it);
1149 values.push_back(*
it);
1156 values.push_back(*
it);
1169 return BASIC::interpolating_node_pt(
n,
value_id);
1190 return BASIC::local_one_d_fraction_of_interpolating_node(
1197 return SOLID::local_one_d_fraction_of_interpolating_node(
1215 return BASIC::get_interpolating_node_at_local_coordinate(
s,
value_id);
1221 return SOLID::get_interpolating_node_at_local_coordinate(
1235 return BASIC::ninterpolating_node_1d(
value_id);
1254 return BASIC::ninterpolating_node(
value_id);
1290 return BASIC::num_Z2_flux_terms();
1297 BASIC::get_Z2_flux(
s, flux);
1305 BASIC::further_setup_hanging_nodes();
1306 SOLID::further_setup_hanging_nodes();
1334 BASIC::further_build();
1335 SOLID::further_build();
1342 return BASIC::nvertex_node();
1348 return BASIC::vertex_node_pt(
j);
1354 BASIC::compute_norm(norm);
1373 return BASIC::nrecovery_order();
1404 return BASIC::ndof_types() + SOLID::ndof_types();
1411 return BASIC::ndof_types();
1418 return SOLID::ndof_types();
1433 std::list<std::pair<unsigned long, unsigned>>
solid_list;
1434 SOLID::get_dof_numbers_for_unknowns(
solid_list);
1444 typedef std::list<std::pair<unsigned long, unsigned>>::iterator
IT;
1447 std::pair<unsigned long, unsigned>
new_pair;
1457 template<
class BASIC,
class SOLID>
1470 template<
class BASIC,
class SOLID>
FaceGeometry()
Constuctor calls the constructor of the SolidQElement (Only the Intel compiler seems to need this!...
FaceGeometry()
Constuctor calls the constructor of the SolidQElement (Only the Intel compiler seems to need this!...
FaceGeometry()
Constuctor calls the constructor of the SolidQElement (Only the Intel compiler seems to need this!...
FaceGeometry()
Constructor calls the constructor of the SolidQElement (Only the Intel compiler seems to need this!...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Class that contains data for hanging nodes.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following th...
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
An OomphLibError object which should be thrown when an run-time error is encountered....
A templated class that permits combination two different element types, for the solution of problems ...
bool Shape_derivs_by_direct_fd
Boolean flag to indicate shape derivative method.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Final override for the residuals function. Contributions are added from both underlying element types...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
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 compute_exact_Z2_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_flux_pt, double &error, double &norm)
Plot the error when compared against a given exact flux. Also calculates the norm of the error and th...
unsigned required_nvalue(const unsigned &n) const
The required number of values is the sum of the two.
unsigned nsolid_dof_types() const
return the number of DOF types associated with the SOLID elements in this combined element
void fill_in_shape_derivatives(DenseMatrix< double > &jacobian)
Fill in the shape derivatives of the BASIC equations w.r.t. the solid position dofs.
void output(std::ostream &outfile, const unsigned &n_p)
Output function: Plot at n_p plot points using the basic element's output function.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void output(std::ostream &outfile)
Overload the output function: Call that of the basic element.
void compute_norm(double &el_norm)
Compute norm of solution: use the version in the BASIC class if there's any ambiguity.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Done for BASIC element since it determines...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
'Flux' vector for Z2 error estimation: Error estimation is based on error in BASIC element
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Final override for jacobian function: Contributions are included from both the underlying element typ...
void fill_in_shape_derivatives_by_fd(DenseMatrix< double > &jacobian)
Fill in the derivatives of the BASIC equations w.r.t. the solid position dofs.
unsigned nbasic_dof_types() const
return the number of DOF types associated with the BASIC elements in this combined element
unsigned nvertex_node() const
Number of vertex nodes in the element.
void evaluate_shape_derivs_by_chain_rule()
Evaluate shape derivatives by chain rule.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Final override for mass matrix function: contributions are included from both the underlying element ...
void output(FILE *file_pt, const unsigned &n_p)
Output function is just the same as the basic equations.
void evaluate_shape_derivs_by_direct_fd()
Evaluate shape derivatives by direct finite differencing.
int solid_p_nodal_index() const
We assume that the solid stuff is stored at the end of the nodes, i.e. its index is the number of con...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation: Error estimation is based on error in BASIC element.
void output(FILE *file_pt)
Overload the output function: Call that of the basic element.
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Specify Data that affects the geometry of the element by adding the position Data to the set that's p...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into.
PseudoSolidNodeUpdateElement()
Constructor, call the BASIC and SOLID elements' constructors and set the "density" parameter for soli...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
Refineable version of the PseudoSolidNodeUpdateELement.
unsigned nbasic_dof_types() const
return the number of DOF types associated with the BASIC elements in this combined element
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Call get_interpolated_values(...) for both of the underlying element types.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into.
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Call get_interpolated_values(...) for both of the underlying element types.
void further_build()
Further build: Done for both of the underlying element types.
void output(FILE *file_pt)
Overload the output function: Use that of the BASIC element.
void compute_norm(double &norm)
Compute norm of solution. Use version in BASIC element.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Final override for residuals function: adds contributions from both underlying element types.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Done for BASIC element since it determines...
void output(std::ostream &outfile, const unsigned &n_p)
Output function, plotting at n_p points: Use that of the BASIC element.
unsigned ncont_interpolated_values() const
The number of continuously interpolated values is the sum of the SOLID and BASIC values.
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...
int solid_p_nodal_index() const
We assume that the solid stuff is stored at the end of the nodes, i.e. its index is the number of con...
unsigned nsolid_dof_types() const
return the number of DOF types associated with the SOLID elements in this combined element
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 ...
void compute_exact_Z2_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_flux_pt, double &error, double &norm)
Plot the error when compared against a given exact flux. Also calculates the norm of the error and th...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Final override for jacobian function: Calls get_jacobian() for both of the underlying element types.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation: Error estimation is based on error in BASIC element.
RefineablePseudoSolidNodeUpdateElement()
Constructor, call the BASIC and SOLID elements' constructors and set the "density" parameter for soli...
void build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built)
Build function: Call the one for the SOLID element since it calls the one basic build function automa...
unsigned ninterpolating_node_1d(const int &value_id)
The number of 1d pressure nodes is 2, otherwise we have the positional nodes.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Final override for mass matrix function: contributions are included from both the underlying element ...
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
void output(std::ostream &outfile)
Overload the output function: Use that of the BASIC element.
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...
void output(FILE *file_pt, const unsigned &n_p)
Output function: Use that of the BASIC element.
Node * interpolating_node_pt(const unsigned &n, const int &value_id)
We must compose the underlying interpolating nodes from the BASIC and SOLID equations,...
void build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)
Build function: Call the one for the SOLID element since it calls the one basic build function automa...
void assign_additional_local_eqn_numbers()
Final override for the assign__additional_local_eqn_numbers(): Call the version for the BASIC element...
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...
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...
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)
Call rebuild_from_sons() for both of the underlying element types.
void fill_in_shape_derivatives_by_fd(DenseMatrix< double > &jacobian)
Fill in the derivatives of the BASIC equations w.r.t. to the solid position dofs, taking hanging node...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
'Flux' vector for Z2 error estimation: Error estimation is based on error in BASIC element
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
unsigned required_nvalue(const unsigned &n) const
The required number of values is the sum of the two.
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Specify Data that affects the geometry of the element by adding the position Data to the set that's p...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
double Zero
Static variable to hold the default value for the pseudo-solid's inertia parameter Lambda^2.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).