30 #ifndef CIRCLE_AS_GEN_ELEMENT_HEADER 31 #define CIRCLE_AS_GEN_ELEMENT_HEADER 105 if (load_pt->nvalue()!=1)
107 std::ostringstream error_stream;
108 error_stream <<
"The data object that stores the load on the " 109 <<
"ElasticallySupportedRingElement\n" 110 <<
"should only contain a single data value\n" 111 <<
"This one contains " << load_pt->nvalue() << std::endl;
113 throw OomphLibError(error_stream.str(),
114 OOMPH_CURRENT_FUNCTION,
115 OOMPH_EXCEPTION_LOCATION);
174 residuals.initialise(0.0);
176 DenseMatrix<double> dummy(1);
184 DenseMatrix<double> &jacobian)
187 residuals.initialise(0.0);
189 jacobian.initialise(0.0);
202 DenseMatrix<double> &jacobian,
206 unsigned n_dof = ndof();
208 if (n_dof==0)
return;
217 int local_eqn_number_for_yc =
229 jacobian(local_eqn_number_for_yc,local_eqn_number_for_yc) = -
K_stiff;
239 int local_eqn_number_for_load =
243 if (local_eqn_number_for_load<0)
246 "Load is pinned and yet n_dof=2?\n This is very fishy!\n",
247 OOMPH_CURRENT_FUNCTION,
248 OOMPH_EXCEPTION_LOCATION);
253 jacobian(local_eqn_number_for_yc,local_eqn_number_for_load) = 1.0;
void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute element residual Vector and element Jacobian matrix (wrapper)
void set_load_pt(Data *load_pt)
Set pointer to Data object that specifies the "load" on the ElasticallySupportedRingElement.
double & k_stiff()
Access function for the spring stiffness.
GeneralCircle in 2D space. The three parameters and are represented by Data and can therefore be ...
bool Load_data_has_been_set
Flag to indicate that load data has been set.
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
bool Must_clean_up
Do I need to clean up?
virtual ~ElasticallySupportedRingElement()
Destructor:
unsigned External_load_index
Index of the location of the load Data in the element's array of external data.
void get_residuals(Vector< double > &residuals)
Compute element residual vector (wrapper)
void pin_yc()
Pin the vertical displacement.
unsigned Internal_geometric_data_index
Index of the location of the geometric Data in the element's array of internal data.
double K_stiff
Stiffness of the ring's "elastic" support.
ElasticallySupportedRingElement(const double &x_c, const double &y_c, const double &r)
Constructor: Build ring from doubles that describe the geometry: x and y positions of centre and the ...
double & x_c()
Access function to x-coordinate of centre of circle.
double & y_c()
Access function to y-coordinate of centre of circle.
void unpin_yc()
Unpin the vertical displacement.
double load()
"Load" acting on the ring
GeneralCircle "upgraded" to a GeneralisedElement: Circular ring whose position is given by The ring...
void fill_in_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Compute element residual Vector (only if flag=0) and also the element Jacobian matrix (if flag=1) ...