52 const double& r) : GeomObject(1,2),
X_c(x_c),
Y_c(y_c),
R(r)
56 void position(
const Vector<double>& zeta, Vector<double>& r)
const 59 r[0] =
X_c+
R*cos(zeta[0]);
60 r[1] =
Y_c+
R*sin(zeta[0]);
66 void position(
const unsigned& t,
const Vector<double>& zeta,
67 Vector<double>& r)
const 106 const double& r) : GeomObject(1,2)
112 Geom_data_pt.resize(1);
113 Geom_data_pt[0] =
new Data(3);
118 Geom_data_pt[0]->pin(0);
120 Geom_data_pt[0]->set_value(0,x_c);
125 Geom_data_pt[0]->pin(1);
127 Geom_data_pt[0]->set_value(1,y_c);
132 Geom_data_pt[0]->pin(2);
134 Geom_data_pt[0]->set_value(2,r);
150 if (geom_data_pt->nvalue()!=3)
152 std::ostringstream error_stream;
153 error_stream <<
"Geometric Data must have 3 values, not " 154 << geom_data_pt->nvalue() << std::endl;
156 throw OomphLibError(error_stream.str(),
157 OOMPH_CURRENT_FUNCTION,
158 OOMPH_EXCEPTION_LOCATION);
161 Geom_data_pt.resize(1);
162 Geom_data_pt[0]=geom_data_pt;
176 unsigned ngeom_data=Geom_data_pt.size();
177 for (
unsigned i=0;i<ngeom_data;i++)
179 delete Geom_data_pt[i];
187 void position(
const Vector<double>& zeta, Vector<double>& r)
const 190 double X_c= Geom_data_pt[0]->value(0);
191 double Y_c= Geom_data_pt[0]->value(1);
192 double R= Geom_data_pt[0]->value(2);
195 r[0] = X_c+R*cos(zeta[0]);
196 r[1] = Y_c+R*sin(zeta[0]);
204 void position(
const unsigned& t,
const Vector<double>& zeta,
205 Vector<double>& r)
const 209 double&
x_c(){
return *Geom_data_pt[0]->value_pt(0);}
212 double&
y_c(){
return *Geom_data_pt[0]->value_pt(1);}
215 double&
R(){
return *Geom_data_pt[0]->value_pt(2);}
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta at time level t (t=0: present; t>0: previous level)...
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
SimpleCircle(const double &x_c, const double &y_c, const double &r)
Constructor: Pass x and y-coords of centre and radius.
GeneralCircle in 2D space. The three parameters and are represented by Data and can therefore be ...
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
GeneralCircle(const double &x_c, const double &y_c, const double &r)
Constructor: Pass x and y-coords of centre and radius (all pinned)
bool Must_clean_up
Do I need to clean up?
double & R()
Access function to radius of circle.
GeneralCircle(Data *geom_data_pt)
Alternative constructor: Pass x and y-coords of centre and radius (all as part of Data) ...
double X_c
X-coordinate of centre.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
virtual ~GeneralCircle()
Destructor: Clean up if necessary.
double Y_c
Y-coordinate of centre.
double & x_c()
Access function to x-coordinate of centre of circle.
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta at time level t (t=0: present; t>0: previous level)...
double & y_c()
Access function to y-coordinate of centre of circle.
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on.
Simple circle in 2D space. .