31 #ifndef OOMPH_FVK_VOLUME_CONSTRAINT_ELEMENT_HEADER 32 #define OOMPH_FVK_VOLUME_CONSTRAINT_ELEMENT_HEADER 35 #include <oomph-lib-config.h> 38 #include "../generic/elements.h" 39 #include "../meshes/triangle_mesh.h" 56 template <
class ELEMENT,
template<
class>
class MESH>
70 MESH<ELEMENT> *bounding_mesh_pt,
72 const double& pressure = 0.0) :
106 double bounded_volume = 0.0;
110 for(
unsigned r = 0; r < n_contributing_regions; r++)
113 unsigned n_inner_el =
115 for(
unsigned e = 0;
e < n_inner_el;
e++)
118 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
> 120 bounded_volume += el_pt->get_bounded_volume();
123 return bounded_volume;
139 - (*Prescribed_volume_pt);
A Generalised Element class.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
double * Prescribed_volume_pt
Pointer to target volume.
~FoepplvonKarmanVolumeConstraintElement()
unsigned Pressure_data_index
Unsigned indicating which internal Data object stores the pressure.
void set_prescribed_volume(double *volume_pt)
Set pointer to target volume.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in residual: Difference between actual and prescribed bounded volume.
FoepplvonKarmanVolumeConstraintElement(MESH< ELEMENT > *bounding_mesh_pt, const Vector< unsigned > &contributing_region, const double &pressure=0.0)
Constructor. Takes pointer to mesh of Foeppl von Karman elements and a vector of unsigneds which iden...
void operator=(const FoepplvonKarmanVolumeConstraintElement &)
Broken assignment operator.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to elemental residual and Jacobian.
Vector< unsigned > Contributing_region
Region IDs in the bounding mesh that contribute to the prescribed/controlled volume.
Data * pressure_data_pt() const
Access to Data object whose single value contains the pressure that has been "traded" for the volume ...
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
A class that represents a collection of data; each Data object may contain many different individual ...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
double get_bounded_volume()
Returns the volume "under the elements" in the constrained regions.
void assign_additional_local_eqn_numbers()
Assign the equation number for the new equation.
MESH< ELEMENT > * Bounding_mesh_pt
Pointer to mesh of Foeppl von Karman elements that bound the prescribed volume; NULL if the FvK eleme...
FoepplvonKarmanVolumeConstraintElement(const FoepplvonKarmanVolumeConstraintElement &)
Broken copy constructor.
Data * Volume_control_pressure_pt
Data object whose single value contains the pressure that has been "traded" for the volume constraint...
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
int Volume_control_local_eqn
Local equation number of volume constraint.
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...