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"
89 return this->internal_local_eqn(
95 return this->external_local_eqn(
104 Vector<double>& residuals);
128 return internal_data_pt(
133 return external_data_pt(
160 DenseMatrix<double>& jacobian)
170 Vector<double>& residuals,
171 DenseMatrix<double>& jacobian,
172 DenseMatrix<double>& mass_matrix)
234 Vector<double>& residuals) = 0;
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++)
282 Node*
const nod_pt = this->node_pt(n);
284 unsigned n_value = nod_pt->nvalue();
287 for (
unsigned i = 0; i < n_value; i++)
289 if (nod_pt->eqn_number_pt(i) == global_eqn_number)
339 Vector<double>& residuals);
368 template<
class ELEMENT>
371 public virtual FaceGeometry<ELEMENT>
377 const int& face_index)
382 element_pt->build_face_element(face_index,
this);
389 DenseMatrix<double>& jacobian)
396 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
404 const unsigned& i)
const
406 return FaceElement::zeta_nodal(n, k, i);
420 template<
class ELEMENT>
423 public virtual SpineElement<FaceGeometry<ELEMENT>>
429 const int& face_index)
430 : SpineElement<FaceGeometry<ELEMENT>>(),
435 element_pt->build_face_element(face_index,
this);
443 DenseMatrix<double>& jacobian)
449 this->fill_in_jacobian_from_geometric_data(jacobian);
457 const unsigned& i)
const
459 return FaceElement::zeta_nodal(n, k, i);
490 Vector<double>& residuals);
513 const unsigned n_node = this->nnode();
517 DShape dpsifds(n_node, 1);
520 const unsigned n_intpt = this->integral_pt()->nweight();
526 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
529 s[0] = this->integral_pt()->knot(ipt, 0);
532 double W = this->integral_pt()->weight(ipt);
535 this->dshape_local_at_knot(ipt, psif, dpsifds);
539 Vector<double> interpolated_u(2, 0.0);
540 Vector<double> interpolated_t1(2, 0.0);
541 Vector<double> interpolated_x(2, 0.0);
542 for (
unsigned l = 0; l < n_node; l++)
545 for (
unsigned i = 0; i < 2; i++)
547 interpolated_x[i] += this->nodal_position(l, i) * psif(l);
549 this->node_pt(l)->value(
550 dynamic_cast<AxisymmetricNavierStokesEquations*
>(
552 ->u_index_axi_nst(i)) *
554 interpolated_t1[i] += this->nodal_position(l, i) * dpsifds(l, 0);
559 double tlength = interpolated_t1[0] * interpolated_t1[0] +
560 interpolated_t1[1] * interpolated_t1[1];
563 double J = sqrt(tlength) * interpolated_x[0];
566 Vector<double> interpolated_n(2);
567 this->outer_unit_normal(ipt, interpolated_n);
571 for (
unsigned k = 0; k < 2; k++)
573 dot += interpolated_u[k] * interpolated_n[k];
601 template<
class ELEMENT>
604 public virtual FaceGeometry<ELEMENT>
610 FiniteElement*
const& element_pt,
const int& face_index)
615 element_pt->build_face_element(face_index,
this);
622 DenseMatrix<double>& jacobian)
629 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
637 const unsigned& i)
const
639 return FaceElement::zeta_nodal(n, k, i);
654 template<
class ELEMENT>
657 public virtual SpineElement<FaceGeometry<ELEMENT>>
663 FiniteElement*
const& element_pt,
const int& face_index)
664 : SpineElement<FaceGeometry<ELEMENT>>(),
669 element_pt->build_face_element(face_index,
this);
677 DenseMatrix<double>& jacobian)
683 this->fill_in_jacobian_from_geometric_data(jacobian);
691 const unsigned& i)
const
693 return FaceElement::zeta_nodal(n, k, i);
724 Vector<double>& residuals);
752 template<
class ELEMENT>
755 public virtual FaceGeometry<ELEMENT>
761 FiniteElement*
const& element_pt,
const int& face_index)
766 element_pt->build_face_element(face_index,
this);
774 DenseMatrix<double>& jacobian)
781 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
790 const unsigned& i)
const
792 return FaceElement::zeta_nodal(n, k, i);
812 template<
class ELEMENT>
815 public virtual SpineElement<FaceGeometry<ELEMENT>>
821 FiniteElement*
const& element_pt,
const int& face_index)
822 : SpineElement<FaceGeometry<ELEMENT>>(),
827 element_pt->build_face_element(face_index,
this);
835 DenseMatrix<double>& jacobian)
841 this->fill_in_jacobian_from_geometric_data(jacobian);
850 const unsigned& i)
const
852 return FaceElement::zeta_nodal(n, k, i);
////////////////////////////////////////////////////////////////////// //////////////////////////////...
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.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
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_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.
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 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.