34 #ifndef CONSTRAINED_FLUID_VOLUME_ELEMENTS_HEADER 35 #define CONSTRAINED_FLUID_VOLUME_ELEMENTS_HEADER 39 #include <oomph-lib-config.h> 43 #include "../generic/Qelements.h" 44 #include "../generic/spines.h" 45 #include "../axisym_navier_stokes/axisym_navier_stokes_elements.h" 93 if (Traded_pressure_stored_as_internal_data)
97 External_or_internal_data_index_of_traded_pressure,
98 Index_of_traded_pressure_value);
104 External_or_internal_data_index_of_traded_pressure,
105 Index_of_traded_pressure_value);
135 if (Traded_pressure_stored_as_internal_data)
138 External_or_internal_data_index_of_traded_pressure);
143 External_or_internal_data_index_of_traded_pressure);
223 if(Traded_pressure_stored_at_node)
225 return this->nodal_local_eqn(Data_number_of_traded_pressure,
226 Index_of_traded_pressure_value);
231 Index_of_traded_pressure_value);
240 virtual void fill_in_generic_residual_contribution_volume_constraint(
257 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
271 &vol_constraint_el_pt,
272 const bool &check_nodal_data=
true)
287 const unsigned n_node = this->nnode();
288 for(
unsigned n=0;n<n_node;n++)
291 Node*
const nod_pt = this->node_pt(n);
293 unsigned n_value = nod_pt->
nvalue();
296 for(
unsigned i=0;
i<n_value;
i++)
300 Traded_pressure_stored_at_node =
true;
301 Data_number_of_traded_pressure = n;
302 Index_of_traded_pressure_value =
i;
313 Data_number_of_traded_pressure=
317 Index_of_traded_pressure_value=vol_constraint_el_pt->
349 void fill_in_generic_residual_contribution_volume_constraint(
361 double contribution_to_enclosed_volume();
380 template<
class ELEMENT>
391 const int &face_index) :
407 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
411 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
418 const unsigned &
i)
const 432 template<
class ELEMENT>
443 const int &face_index) :
460 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
463 this->fill_in_jacobian_from_geometric_data(jacobian);
470 const unsigned &
i)
const 502 void fill_in_generic_residual_contribution_volume_constraint(
515 double contribution_to_enclosed_volume();
525 const unsigned n_node = this->nnode();
532 const unsigned n_intpt = this->integral_pt()->nweight();
538 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
541 s[0] = this->integral_pt()->knot(ipt,0);
544 double W = this->integral_pt()->weight(ipt);
547 this->dshape_local_at_knot(ipt,psif,dpsifds);
554 for(
unsigned l=0;l<n_node;l++)
557 for(
unsigned i=0;
i<2;
i++)
559 interpolated_x[
i] += this->nodal_position(l,
i)*psif(l);
560 interpolated_u[
i] += this->node_pt(l)->value(
561 dynamic_cast<AxisymmetricNavierStokesEquations*>(bulk_element_pt())
562 ->u_index_axi_nst(
i))*psif(l);
563 interpolated_t1[
i] += this->nodal_position(l,
i)*dpsifds(l,0);
568 double tlength = interpolated_t1[0]*interpolated_t1[0] +
569 interpolated_t1[1]*interpolated_t1[1];
572 double J = sqrt(tlength)*interpolated_x[0];
576 this->outer_unit_normal(ipt,interpolated_n);
580 for(
unsigned k=0;k<2;k++)
582 dot += interpolated_u[k]*interpolated_n[k];
611 template<
class ELEMENT>
623 const int &face_index) :
639 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
643 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
650 const unsigned &
i)
const 666 template<
class ELEMENT>
694 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
697 this->fill_in_jacobian_from_geometric_data(jacobian);
704 const unsigned &
i)
const 738 void fill_in_generic_residual_contribution_volume_constraint(
767 template<
class ELEMENT>
796 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
800 this->fill_in_jacobian_from_solid_position_by_fd(jacobian);
808 const unsigned &
i)
const 828 template<
class ELEMENT>
839 const int &face_index) :
857 this->fill_in_generic_residual_contribution_volume_constraint(residuals);
860 this->fill_in_jacobian_from_geometric_data(jacobian);
868 const unsigned &
i)
const VolumeConstraintBoundingElement()
Constructor initialise the boolean flag We expect the traded pressure data to be stored externally...
A Generalised Element class.
~VolumeConstraintElement()
Empty destructor.
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 ...
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 ...
long * eqn_number_pt(const unsigned &i)
Return the pointer to the equation number of the i-th stored variable.
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...
unsigned Index_of_traded_pressure_value
void fill_in_generic_contribution_to_residuals_volume_constraint(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
A general Finite Element class.
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
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary, when viewed as part of a compound geometric object is specified using the boundary coordinate defined by the mesh. Note: Boundary coordinates will have been set up when creating the underlying mesh, and their values will have been stored at the nodes.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
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)
unsigned Index_of_traded_pressure_value
LineVolumeConstraintBoundingElement()
Empty Contructor.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and jacobian for the volume constraint.
~VolumeConstraintBoundingElement()
Empty Destructor.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
~LineVolumeConstraintBoundingElement()
Empty Destructor.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
bool Traded_pressure_stored_at_node
Boolean to indicate whether the traded pressure is stored externally or at a node (this can happen in...
bool Traded_pressure_stored_as_internal_data
The Data that contains the traded pressure is stored as external or internal Data for the element...
AxisymmetricVolumeConstraintBoundingElement()
Empty Contructor.
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 ...
VolumeConstraintElement(double *prescribed_volume_pt)
Constructor: Pass pointer to target volume. "Pressure" value that "traded" for the volume contraint i...
double contribution_to_volume_flux()
Return this element's contribution to the volume flux over the boundary.
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.
~AxisymmetricVolumeConstraintBoundingElement()
Empty Destructor.
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...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
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 ...
double p_traded()
Return the traded pressure value.
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...
int ptraded_local_eqn()
The local eqn number for the traded pressure.
A class that represents a collection of data; each Data object may contain many different individual ...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
double * Prescribed_volume_pt
Pointer to the desired value of the volume.
unsigned Data_number_of_traded_pressure
The Data that contains the traded pressure is usually stored as external Data for this element...
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
double dot(const Vector< double > &a, const Vector< double > &b)
Probably not always best/fastest because not optimised for dimension but useful...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
The SpineElement<ELEMENT> class takes an existing element as a template parameter and adds the necess...
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 ...
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...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
~SurfaceVolumeConstraintBoundingElement()
Empty Desctructor.
int ptraded_local_eqn()
The local eqn number for 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...
SurfaceVolumeConstraintBoundingElement()
Empty Contructor.
Data * p_traded_data_pt()
Access to Data that contains the traded pressure.
unsigned index_of_traded_pressure()
Return the index of Data object at which the traded pressure is stored.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in contribution to residuals and Jacobian.
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...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
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...
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...