30 #ifndef CONSTRAINED_FLUID_VOLUME_ELEMENTS_HEADER
31 #define CONSTRAINED_FLUID_VOLUME_ELEMENTS_HEADER
35 #include <oomph-lib-config.h>
39 #include "../generic/Qelements.h"
40 #include "../generic/spines.h"
41 #include "../axisym_navier_stokes/axisym_navier_stokes_elements.h"
90 External_or_internal_data_index_of_traded_pressure,
96 External_or_internal_data_index_of_traded_pressure,
263 const bool& check_nodal_data =
true)
267 if (check_nodal_data)
271 long* global_eqn_number =
278 const unsigned n_node = this->
nnode();
279 for (
unsigned n = 0; n < n_node; n++)
284 unsigned n_value = nod_pt->
nvalue();
287 for (
unsigned i = 0;
i < n_value;
i++)
368 template<
class ELEMENT>
396 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
404 const unsigned&
i)
const
420 template<
class ELEMENT>
457 const unsigned&
i)
const
513 const unsigned n_node = this->
nnode();
517 DShape dpsifds(n_node, 1);
526 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
542 for (
unsigned l = 0; l < n_node; l++)
545 for (
unsigned i = 0;
i < 2;
i++)
552 ->u_index_axi_nst(
i)) *
559 double tlength = interpolated_t1[0] * interpolated_t1[0] +
560 interpolated_t1[1] * interpolated_t1[1];
571 for (
unsigned k = 0; k < 2; k++)
573 dot += interpolated_u[k] * interpolated_n[k];
601 template<
class ELEMENT>
629 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
637 const unsigned&
i)
const
654 template<
class ELEMENT>
691 const unsigned&
i)
const
752 template<
class ELEMENT>
781 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
790 const unsigned&
i)
const
812 template<
class ELEMENT>
850 const unsigned&
i)
const
A class for elements that solve the unsteady axisymmetric Navier–Stokes equations in cylindrical pola...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void fill_in_generic_residual_contribution_volume_constraint(Vector< double > &residuals)
Helper function to fill in contributions to residuals (remember that part of the residual is added by...
double contribution_to_enclosed_volume()
Return this element's contribution to the total volume enclosed.
AxisymmetricVolumeConstraintBoundingElement()
Empty Contructor.
double contribution_to_volume_flux()
Return this element's contribution to the volume flux over the boundary.
~AxisymmetricVolumeConstraintBoundingElement()
Empty Destructor.
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
long * eqn_number_pt(const unsigned &i)
Return the pointer to the equation number of the i-th stored variable.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
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 ...
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
ElasticAxisymmetricVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
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 fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to solid-based elements in which der...
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
ElasticLineVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to solid-based elements in which der...
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 fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to solid-based elements in which der...
ElasticSurfaceVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
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 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...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
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,...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
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....
A Generalised Element class.
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void fill_in_generic_residual_contribution_volume_constraint(Vector< double > &residuals)
Helper function to fill in contributions to residuals (remember that part of the residual is added by...
double contribution_to_enclosed_volume()
Return this element's contribution to the total volume enclosed.
LineVolumeConstraintBoundingElement()
Empty Contructor.
~LineVolumeConstraintBoundingElement()
Empty Destructor.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
The axisymmetric (one-dimensional) interface elements that allow imposition of a volume constraint sp...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to spine based elements in which the...
SpineAxisymmetricVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
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 ...
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
The one-dimensional interface elements that allow imposition of a volume constraint specialised for t...
SpineLineVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to spine based elements in which the...
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 ...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
SpineSurfaceVolumeConstraintBoundingElement(FiniteElement *const &element_pt, const int &face_index)
Contructor: Specify bulk element and index of face to which this face element is to be attached.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to residuals and Jacobian. This is specific to spine based elements in which the...
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 ...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
SurfaceVolumeConstraintBoundingElement()
Empty Contructor.
void fill_in_generic_residual_contribution_volume_constraint(Vector< double > &residuals)
Helper function to fill in contributions to residuals (remember that part of the residual is added by...
~SurfaceVolumeConstraintBoundingElement()
Empty Desctructor.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in contribution to residuals and Jacobian.
void set_volume_constraint_element(VolumeConstraintElement *const &vol_constraint_el_pt, const bool &check_nodal_data=true)
Set the "master" volume constraint element The setup here is a bit more complicated than one might ex...
unsigned Index_of_traded_pressure_value
Index of the value in traded pressure data that corresponds to the traded pressure.
VolumeConstraintBoundingElement()
Constructor initialise the boolean flag We expect the traded pressure data to be stored externally.
~VolumeConstraintBoundingElement()
Empty Destructor.
virtual void fill_in_generic_residual_contribution_volume_constraint(Vector< double > &residuals)=0
Helper function to fill in contributions to residuals (remember that part of the residual is added by...
bool Traded_pressure_stored_at_node
Boolean to indicate whether the traded pressure is stored externally or at a node (this can happen in...
int ptraded_local_eqn()
The local eqn number for the traded pressure.
unsigned Data_number_of_traded_pressure
The Data that contains the traded pressure is usually stored as external Data for this element,...
A class that is used to implement the constraint that the fluid volume in a region bounded by associa...
void fill_in_generic_contribution_to_residuals_volume_constraint(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
~VolumeConstraintElement()
Empty destructor.
unsigned Index_of_traded_pressure_value
Index of the value in traded pressure data that corresponds to the traded pressure.
unsigned External_or_internal_data_index_of_traded_pressure
The Data that contains the traded pressure is stored as external or internal Data for the element....
Data * p_traded_data_pt()
Access to Data that contains the traded pressure.
VolumeConstraintElement(double *prescribed_volume_pt)
Constructor: Pass pointer to target volume. "Pressure" value that "traded" for the volume contraint i...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and jacobian for the volume constraint.
double p_traded()
Return the traded pressure value.
bool Traded_pressure_stored_as_internal_data
The Data that contains the traded pressure is stored as external or internal Data for the element....
int ptraded_local_eqn()
The local eqn number for the traded pressure.
unsigned index_of_traded_pressure()
Return the index of Data object at which the traded pressure is stored.
double * Prescribed_volume_pt
Pointer to the desired value of the volume.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Fill in the residuals, jacobian and mass matrix for the volume constraint.
double dot(const Vector< double > &a, const Vector< double > &b)
Probably not always best/fastest because not optimised for dimension but useful...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...