circle.cc File Reference
#include "generic.h"
#include "circle.h"

Functions

int main ()
 Driver. More...
 

Function Documentation

◆ main()

int main ( )

Driver.

41 {
42 
43  // X-coordinate of the circle's centre
44  double x_c=0.5;
45 
46  // Y-coordinate of the circle's centre
47  double y_c=1.5;
48 
49  // Radius
50  double R=0.9;
51 
52  // Build circle object with specified (const) parameters
53  //-------------------------------------------------------
54  GeneralCircle circle0(x_c,y_c,R);
55 
56 
57  // Build circle object with Data -- the Data values might be determine
58  //--------------------------------------------------------------------
59  // "somewhere else", e.g. as part of the solution of another problem
60  //------------------------------------------------------------------
61 
62  // The circle's shape is determine by a single Data object whose
63  // three values specify x_c, y_c and R:
64  Data* circle_data_pt=new Data(3);
65 
66  // Set the values
67  circle_data_pt->set_value(0,x_c);
68  circle_data_pt->set_value(1,y_c);
69  circle_data_pt->set_value(2,R);
70 
71  // Build the object
72  GeneralCircle circle1(circle_data_pt);
73 
74  // Number of plot points
75  unsigned npts=100;
76 
77  // Lagrangian coordinate and position vector (both as vectors)
78  Vector<double> xi(1);
79  Vector<double> r(2);
80 
81  // Output circles
82  ofstream some_file0, some_file1;
83  some_file0.open("circle0.dat");
84  some_file1.open("circle1.dat");
85 
86  for (unsigned i=0;i<npts;i++)
87  {
88  xi[0]=2.0*MathematicalConstants::Pi*double(i)/double(npts-1);
89  circle0.position(xi,r);
90  some_file0 << r[0] << " " << r[1] << std::endl;
91  circle1.position(xi,r);
92  some_file1 << r[0] << " " << r[1] << std::endl;
93  }
94  some_file0.close();
95  some_file1.close();
96 
97 
98 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
@ R
Definition: StatisticsVector.h:21
Definition: nodes.h:86
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: circle.h:96
double Pi
Definition: two_d_biharmonic.cc:235
r
Definition: UniformPSDSelfTest.py:20

References i, BiharmonicTestFunctions2::Pi, oomph::GeneralCircle::position(), UniformPSDSelfTest::r, R, and oomph::Data::set_value().