29 #ifndef OOMPH_SPECIFIC_NODE_UPDATE_INTERFACE_ELEMENTS_HEADER
30 #define OOMPH_SPECIFIC_NODE_UPDATE_INTERFACE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
38 #include "../generic/Qelements.h"
39 #include "../generic/spines.h"
40 #include "../generic/hijacked_elements.h"
53 template<
class ELEMENT>
70 template<
class ELEMENT>
79 <<
"The generic FluidInterfaceAdditionalValues<ELEMENT> class has "
81 <<
"called. This should never happen. If you are creating your own\n"
82 <<
"surface equations you must overload the policy class to specify\n"
83 <<
"how many additional values are required at the surface nodes.\n"
84 <<
"For an example, see "
85 "src/fluid_interface/surfactant_transport_elements.h\n"
88 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
151 template<
class EQUATION_CLASS,
class DERIVATIVE_CLASS,
class ELEMENT>
153 :
public virtual Hijacked<SpineElement<FaceGeometry<ELEMENT>>>,
154 public virtual EQUATION_CLASS,
155 public DERIVATIVE_CLASS
172 it != bulk_node_number.end();
189 DShape& surface_divergence)
191 return DERIVATIVE_CLASS::compute_surface_derivatives(psi,
204 const int& face_index,
205 const unsigned&
id = 0)
222 throw OomphLibError(
"This interface element will not work correctly "
223 "if nodes are hanging\n",
224 OOMPH_CURRENT_FUNCTION,
225 OOMPH_EXCEPTION_LOCATION);
232 ELEMENT* cast_element_pt =
dynamic_cast<ELEMENT*
>(element_pt);
234 const unsigned n_u_index = cast_element_pt->n_u_nst();
235 this->U_index_interface.resize(n_u_index);
236 for (
unsigned i = 0;
i < n_u_index;
i++)
238 this->U_index_interface[
i] = cast_element_pt->u_index_nst(
i);
242 unsigned n_node_face = this->
nnode();
246 interface_additional_values_pt =
251 bool add_values =
false;
255 for (
unsigned i = 0;
i < n_node_face; ++
i)
258 additional_data_values[
i] =
261 add_values |= additional_data_values[
i];
268 this->add_additional_values(additional_data_values,
id);
274 delete interface_additional_values_pt;
275 interface_additional_values_pt = 0;
283 EQUATION_CLASS::fill_in_generic_residual_contribution_interface(
284 residuals, jacobian, 1);
296 const unsigned& flag,
300 const DShape& dpsifdS_div,
307 EQUATION_CLASS::add_additional_residual_contributions_interface(
329 void output(std::ostream& outfile,
const unsigned& n_plot)
341 void output(FILE* file_pt,
const unsigned& n_plot)
353 const int& face_index)
369 face_el_pt->u_index_interface_boundary() = this->U_index_interface;
378 const unsigned n_node_bounding = face_el_pt->nnode();
379 for (
unsigned n = 0; n < n_node_bounding; n++)
381 face_el_pt->nbulk_value(n) = face_el_pt->node_pt(n)->nvalue();
386 std::set<Data*> unique_additional_geom_data;
392 std::set<Data*> unique_face_geom_data_pt;
393 face_el_pt->assemble_set_of_all_geometric_data(unique_face_geom_data_pt);
396 for (std::set<Data*>::iterator it = unique_face_geom_data_pt.begin();
397 it != unique_face_geom_data_pt.end();
400 unique_additional_geom_data.erase(*it);
404 for (std::set<Data*>::iterator it = unique_additional_geom_data.begin();
405 it != unique_additional_geom_data.end();
408 face_el_pt->add_external_data(*it);
420 template<
class ELEMENT>
422 :
public Hijacked<SpineElement<FaceGeometry<FaceGeometry<ELEMENT>>>>,
441 void output(std::ostream& outfile,
const unsigned& n_plot)
453 void output(FILE* file_pt,
const unsigned& n_plot)
464 residuals, jacobian, 1);
484 template<
class ELEMENT>
486 :
public Hijacked<SpineElement<FaceGeometry<FaceGeometry<ELEMENT>>>>,
505 void output(std::ostream& outfile,
const unsigned& n_plot)
517 void output(FILE* file_pt,
const unsigned& n_plot)
529 residuals, jacobian, 1);
551 template<
class ELEMENT>
569 template<
class ELEMENT>
587 template<
class ELEMENT>
590 AxisymmetricDerivatives,
605 template<
class ELEMENT>
623 template<
class ELEMENT>
640 template<
class ELEMENT>
671 template<
class EQUATION_CLASS,
class DERIVATIVE_CLASS,
class ELEMENT>
673 :
public virtual Hijacked<FaceGeometry<ELEMENT>>,
674 public EQUATION_CLASS,
675 public DERIVATIVE_CLASS
687 return this->Lagrange_index[n];
705 it != bulk_node_number.end();
722 DShape& surface_divergence)
724 return DERIVATIVE_CLASS::compute_surface_derivatives(psi,
740 const int& face_index,
741 const unsigned&
id = 0)
742 :
FaceGeometry<ELEMENT>(), EQUATION_CLASS(), DERIVATIVE_CLASS()
755 if (this->has_hanging_nodes())
758 "This flux element will not work correctly if nodes are hanging\n",
759 OOMPH_CURRENT_FUNCTION,
760 OOMPH_EXCEPTION_LOCATION);
767 ELEMENT* cast_element_pt =
dynamic_cast<ELEMENT*
>(element_pt);
768 const unsigned n_u_index = cast_element_pt->n_u_nst();
769 this->U_index_interface.resize(n_u_index);
770 for (
unsigned i = 0;
i < n_u_index;
i++)
772 this->U_index_interface[
i] = cast_element_pt->u_index_nst(
i);
776 unsigned n_node_face = this->nnode();
781 interface_additional_values_pt =
788 for (
unsigned n = 0; n < n_node_face; n++)
791 additional_data_values[n] =
798 this->add_additional_values(additional_data_values,
id);
803 for (
unsigned n = 0; n < n_node_face; ++n)
806 additional_data_values[n] - 1 +
808 ->index_of_first_value_assigned_by_face_element(
id);
815 delete interface_additional_values_pt;
816 interface_additional_values_pt = 0;
824 const unsigned&
i)
const
841 EQUATION_CLASS::fill_in_generic_residual_contribution_interface(
842 residuals, jacobian, 1);
845 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
855 void output(std::ostream& outfile,
const unsigned& n_plot)
867 void output(FILE* file_pt,
const unsigned& n_plot)
880 const unsigned& flag,
884 const DShape& dpsifdS_div,
891 EQUATION_CLASS::add_additional_residual_contributions_interface(
906 const unsigned n_node = this->nnode();
908 const unsigned nodal_dimension = this->nodal_dimension();
910 double interpolated_lagrange = 0.0;
911 for (
unsigned l = 0; l < n_node; l++)
914 interpolated_lagrange +=
lagrange(l) * psif(l);
917 int local_eqn = 0, local_unknown = 0;
920 for (
unsigned l = 0; l < n_node; l++)
923 for (
unsigned i = 0;
i < nodal_dimension;
i++)
927 local_eqn = this->position_local_eqn(l, 0,
i);
931 residuals[local_eqn] -=
932 interpolated_lagrange * interpolated_n[
i] * psif(l) * J *
W;
938 for (
unsigned l2 = 0; l2 < n_node; l2++)
943 if (local_unknown >= 0)
945 jacobian(local_eqn, local_unknown) -=
946 psif(l2) * interpolated_n[
i] * psif(l) * J *
W;
961 const int& face_index)
973 this->build_face_element(face_index, face_el_pt);
976 face_el_pt->u_index_interface_boundary() = this->U_index_interface;
982 const unsigned n_node_bounding = face_el_pt->nnode();
985 for (
unsigned n = 0; n < n_node_bounding; n++)
987 face_el_pt->nbulk_value(n) = face_el_pt->node_pt(n)->nvalue();
990 local_lagrange_index[n] =
991 this->Lagrange_index[face_el_pt->bulk_node_number(n)];
995 face_el_pt->set_lagrange_index(local_lagrange_index);
998 std::set<SolidNode*> set_of_solid_nodes;
999 const unsigned n_node = this->nnode();
1000 for (
unsigned n = 0; n < n_node; n++)
1002 set_of_solid_nodes.insert(
static_cast<SolidNode*
>(this->node_pt(n)));
1007 for (
unsigned n = 0; n < n_node_bounding; n++)
1010 face_el_pt->nbulk_value(n) =
1011 this->nbulk_value(face_el_pt->bulk_node_number(n));
1014 set_of_solid_nodes.erase(
1015 static_cast<SolidNode*
>(face_el_pt->node_pt(n)));
1019 for (std::set<SolidNode*>::iterator it = set_of_solid_nodes.begin();
1020 it != set_of_solid_nodes.end();
1023 face_el_pt->add_external_data((*it)->variable_position_pt());
1036 template<
class ELEMENT>
1062 const unsigned&
i)
const
1082 void output(std::ostream& outfile,
const unsigned& n_plot)
1094 void output(FILE* file_pt,
const unsigned& n_plot)
1105 residuals, jacobian, 1);
1125 template<
class ELEMENT>
1155 const unsigned&
i)
const
1168 void output(std::ostream& outfile,
const unsigned& n_plot)
1180 void output(FILE* file_pt,
const unsigned& n_plot)
1191 residuals, jacobian, 1);
1215 template<
class ELEMENT>
1224 const unsigned&
id = 0)
1233 template<
class ELEMENT>
1252 template<
class ELEMENT>
1255 AxisymmetricDerivatives,
1261 const unsigned&
id = 0)
1271 template<
class ELEMENT>
1290 template<
class ELEMENT>
1299 const unsigned&
id = 0)
1309 template<
class ELEMENT>
Class that establishes the surface derivative functions for AxisymmetricInterfaceElements....
A class that contains the information required by Nodes that are located on Mesh boundaries....
This policy class is used to associate specific bounding elements with specific FluidInterface elemen...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Specialise the Elastic update case to axisymmetric equations.
ElasticAxisymmetricFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Pseudo-elasticity version of the LineFluidInterfaceBoundingElement.
void output(FILE *file_pt)
Overload the C-style output function.
int kinematic_local_eqn(const unsigned &n)
Local eqn number of kinematic bc associated with local node n.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
void output(std::ostream &outfile)
Overload the output function.
void set_lagrange_index(const Vector< unsigned > &lagrange_index)
Set the Id.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental residual vector and Jacobian.
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
Vector< unsigned > Lagrange_index
Short Storage for the index of Lagrange multiplier.
ElasticLineFluidInterfaceBoundingElement()
Constructor.
Specialise the elastic update template class to concrete 1D case.
ElasticLineFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Pseudo-elasticity version of the PointFluidInterfaceBoundingElement.
ElasticPointFluidInterfaceBoundingElement()
Constructor.
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
void output(std::ostream &outfile)
Overload the output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
void output(FILE *file_pt)
Overload the C-style output function.
Vector< unsigned > Lagrange_index
Short Storage for the index of the Lagrange multiplier at the chosen nodes.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the element's residual vector and Jacobian.
void set_lagrange_index(const Vector< unsigned > &lagrange_index)
Set the Id and offset.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
int kinematic_local_eqn(const unsigned &n)
Set the kinematic local equation.
Specialise Elastic update case to the concrete 2D case.
ElasticSurfaceFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
void add_additional_residual_contributions_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const DShape &dpsifdS, const DShape &dpsifdS_div, const Vector< double > &s, const Vector< double > &interpolated_x, const Vector< double > &interpolated_n, const double &W, const double &J)
Helper function to calculate the additional contributions to be added at each integration point....
unsigned lagrange_index(const unsigned &n)
Return the index at which the lagrange multiplier is stored at the n-th node.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
void output(std::ostream &outfile)
Overload the output function.
ElasticUpdateFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor, pass a pointer to the bulk element and the face index of the bulk element to which the e...
Vector< unsigned > Lagrange_index
Storage for the location of the Lagrange multiplier (If other additional values have been added we ne...
double & lagrange(const unsigned &n)
Return the lagrange multiplier at local node n.
void output(FILE *file_pt)
Overload the C-style output function.
virtual FluidInterfaceBoundingElement * make_bounding_element(const int &face_index)
Create an "bounding" element (here actually a 2D line element of type ElasticLineFluidInterfaceBoundi...
int kinematic_local_eqn(const unsigned &n)
Equation number of the kinematic BC associated with node j. (This is the equation for the Lagrange mu...
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian.
void hijack_kinematic_conditions(const Vector< unsigned > &bulk_node_number)
Hijacking the kinematic condition corresponds to hijacking the variables associated with the Lagrange...
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations by calling the appropriate function from the der...
void assemble_set_of_all_geometric_data(std::set< Data * > &unique_geom_data_pt)
Return a set of all geometric data associated with the element.
void fill_in_jacobian_from_geometric_data(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the Jacobian matrix from the geometric data. This version assumes that...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
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 nnode() const
Return the number of nodes.
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement....
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
Specific policy class for the FluidInterfaceElemetnts, which do not require any additional values at ...
void setup_equation_indices(FluidInterfaceElement *const &element_pt, const unsigned &id)
Specify any additional index setup information that is required; i.e. the look-up schemes for the add...
unsigned nadditional_values(const unsigned &n)
Specific interface that states how many additional values are required for the n-th node....
This policy class is used to allow additional values to be added to the nodes from new surface equati...
unsigned nadditional_values(const unsigned &n)
Specific interface that states how many additional values are required for the n-th node....
void setup_equation_indices(ELEMENT *const &element_pt, const unsigned &id)
Specify any additional index setup information that is required; i.e. the look-up schemes for the add...
Base class for elements at the boundary of free surfaces or interfaces, used typically to impose cont...
void output(std::ostream &outfile)
Overload the output function.
Base class establishing common interfaces and functions for all Navier-Stokes-like fluid interface el...
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
Hijacked elements are elements in which one or more Data values that affect the element's residuals,...
Data * hijack_nodal_spine_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at the spine that affects local node n. Optionally return a custom-made ...
Data * hijack_nodal_value(const unsigned &n, const unsigned &i, const bool &return_data=true)
Hijack the i-th value stored at node n. Optionally return a custom-made (copied) data object that con...
Class that establishes the surface derivative functions for LineElements. These are defined in a sepa...
Specialisation of the interface boundary constraint to a line.
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==true) the Jacobian – this funct...
An OomphLibError object which should be thrown when an run-time error is encountered....
Specialisation of the interface boundary constraint to a point.
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==1) the Jacobian – this function...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions....
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
SpineAxisymmetricFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
int spine_local_eqn(const unsigned &n)
Return the local equation number corresponding to the height of the spine at the n-th node.
Spine version of the LineFluidInterfaceBoundingElement.
int kinematic_local_eqn(const unsigned &n)
Local eqn number of the kinematic bc associated with local node n.
SpineLineFluidInterfaceBoundingElement()
Constructor.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the jacobian.
void output(std::ostream &outfile)
Overload the output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
void output(FILE *file_pt)
Overload the C-style output function.
SpineLineFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Spine version of the PointFluidInterfaceBoundingElement.
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
void output(FILE *file_pt)
Overload the C-style output function.
SpinePointFluidInterfaceBoundingElement()
Constructor.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
int kinematic_local_eqn(const unsigned &n)
Return local equation number associated with the kinematic constraint for local node n.
void output(std::ostream &outfile)
Overload the output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental residual vector and the Jacobian.
SpineSurfaceFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Generic Spine node update interface template class that can be combined with a given surface equation...
SpineUpdateFluidInterfaceElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor, the arguments are a pointer to the "bulk" element and the index of the face to be create...
void add_additional_residual_contributions_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const DShape &dpsifdS, const DShape &dpsifdS_div, const Vector< double > &s, const Vector< double > &interpolated_x, const Vector< double > &interpolated_n, const double &W, const double &J)
Helper function to calculate the additional contributions These are those filled in by the particular...
void output(std::ostream &outfile, const unsigned &n_plot)
Output the element.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contribution to the residuals and the jacobian.
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations by calling the appropriate class function.
virtual FluidInterfaceBoundingElement * make_bounding_element(const int &face_index)
Create an "bounding" element of the type specified by the BoundingElementType policy class Here,...
int kinematic_local_eqn(const unsigned &n)
In spine elements, the kinematic condition is the equation used to determine the unknown spine height...
void output(FILE *file_pt)
Overload the C-style output function.
void hijack_kinematic_conditions(const Vector< unsigned > &bulk_node_number)
Hijacking the kinematic condition corresponds to hijacking the variables associated with the spine he...
void output(std::ostream &outfile)
Overload the output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
Class that establishes the surface derivative functions for SurfaceInterfaceElements (2D surfaces in ...
void output()
Doc the command line arguments.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...