fish_domain.cc File Reference
#include "generic.h"
#include "meshes/fish_domain.h"

Classes

class  UnitCircle
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Driver code for mucking around with GeomObjects, MacroElements and domains

89 {
90 
91 
92  // Play around with a GeomObject
93  //------------------------------
94 
95  // Create a unit circle
96  UnitCircle unit_circle;
97 
98  // Plot:
99  ofstream circle_file("unit_circle.dat");
100 
101  // Number of plot points
102  unsigned nplot=50;
103 
104  // 1D vector for the Lagrangian coordinate
105  Vector<double> s(1);
106 
107  // 2D vector for the Eulerian position
108  Vector<double> r(2);
109 
110  for (unsigned i=0;i<nplot;i++)
111  {
112  // Lagrangian coordinate at plot point
113  s[0]=2.0*MathematicalConstants::Pi*double(i)/double(nplot-1);
114 
115  // Get Eulerian position vector from GeomObject:
116  unit_circle.position(s,r);
117 
118  // Plot
119  circle_file << r[0] << " " << r[1] << std::endl;
120  }
121 
122 
123  // Close output file
124  circle_file.close();
125 
126 
127 
128 
129 
130  // Build a FishDomain and plot it
131  //-------------------------------
132 
133 
134  // Create the fish's back as a circle of radius 1, centred at (0.5,0.0)
135  double x_c=0.5;
136  double y_c=0.0;
137  double r_back=1.0;
138  GeomObject* back_pt=new Circle(x_c,y_c,r_back);
139 
140 
141  // Start and end coordinates of the fish back
142  double s_nose=2.6;
143  double s_tail=0.4;
144 
145  // Create the domain
146  Domain* domain_pt=new FishDomain(back_pt,s_nose,s_tail);
147 
148 
149  // Plot the domain
150 
151  // Number of plot points in each coordinate direction.
152  unsigned npts=10;
153 
154  // Output domain (= plot its macro elements) and the macro element boundaries
155  ofstream domain_file("fish_domain.dat");
156  domain_pt->output(domain_file,npts);
157  domain_pt->output_macro_element_boundaries(domain_file,npts);
158  domain_file.close();
159 
160 
161 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: fish_domain.cc:44
void position(const Vector< double > &xi, Vector< double > &r) const
Definition: fish_domain.cc:58
Definition: geom_objects.h:873
Definition: domain.h:67
void output(const std::string &filename, const unsigned &nplot)
Output macro elements.
Definition: domain.h:129
void output_macro_element_boundaries(const std::string &filename, const unsigned &nplot)
Output all macro element boundaries as tecplot zones.
Definition: domain.h:187
Definition: fish_domain.h:43
Definition: geom_objects.h:101
RealScalar s
Definition: level1_cplx_impl.h:130
double Pi
Definition: two_d_biharmonic.cc:235
r
Definition: UniformPSDSelfTest.py:20

References i, oomph::Domain::output(), oomph::Domain::output_macro_element_boundaries(), BiharmonicTestFunctions2::Pi, UnitCircle::position(), UniformPSDSelfTest::r, and s.