26 #ifndef OOMPH_GEOM_OBJ_WITH_BOUNDARY_HEADER
27 #define OOMPH_GEOM_OBJ_WITH_BOUNDARY_HEADER
32 #include <oomph-lib-config.h>
81 const double& zeta_bound,
92 const double& zeta_bound,
98 std::ostringstream error_message;
99 error_message <<
"You must create a <1,2> Geom Object that provides a\n"
100 <<
"mapping from the 1D boundary coordinate to the 2D\n"
101 <<
"intrinsic Lagrangian coordinate of disk-like object\n"
104 OOMPH_CURRENT_FUNCTION,
105 OOMPH_EXCEPTION_LOCATION);
109 std::ostringstream error_message;
110 error_message <<
"Boundary_parametrising_geom_object_pt must point to\n"
111 <<
"GeomObject with one Lagrangian coordinate. Yours has "
115 OOMPH_CURRENT_FUNCTION,
116 OOMPH_EXCEPTION_LOCATION);
120 std::ostringstream error_message;
121 error_message <<
"Boundary_parametrising_geom_object_pt must point to\n"
122 <<
"GeomObject with two Eulerian coordinates. Yours has "
126 OOMPH_CURRENT_FUNCTION,
127 OOMPH_EXCEPTION_LOCATION);
160 const double& zeta_bound,
166 std::ostringstream error_message;
167 error_message <<
"Broken virtual function; please implement for your\n"
168 <<
"derived version of this class!" << std::endl;
170 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
177 std::ofstream& two_d_boundaries_file,
178 std::ofstream& three_d_boundaries_file)
180 std::ofstream boundaries_tangent_file;
181 std::ofstream boundaries_normal_file;
182 std::ofstream boundaries_binormal_file;
184 two_d_boundaries_file,
185 three_d_boundaries_file,
186 boundaries_tangent_file,
187 boundaries_normal_file,
188 boundaries_binormal_file);
199 std::ofstream& two_d_boundaries_file,
200 std::ofstream& three_d_boundaries_file,
201 std::ofstream& boundaries_tangent_file,
202 std::ofstream& boundaries_normal_file,
203 std::ofstream& boundaries_binormal_file)
207 double zeta_bound = 0.0;
212 for (
unsigned b = 0; b < nb; b++)
214 two_d_boundaries_file <<
"ZONE" << std::endl;
215 three_d_boundaries_file <<
"ZONE" << std::endl;
216 boundaries_tangent_file <<
"ZONE" << std::endl;
217 boundaries_normal_file <<
"ZONE" << std::endl;
218 boundaries_binormal_file <<
"ZONE" << std::endl;
223 for (
unsigned i = 0;
i < n;
i++)
226 zeta_min + (zeta_max - zeta_min) *
double(
i) / double(n - 1);
231 two_d_boundaries_file << zeta[0] <<
" " << zeta[1] <<
" "
232 << zeta_bound <<
" " << std::endl;
234 three_d_boundaries_file << r[0] <<
" " << r[1] <<
" " << r[2] <<
" "
235 << zeta[0] <<
" " << zeta[1] <<
" "
236 << zeta_bound <<
" " << std::endl;
238 boundaries_tangent_file << r[0] <<
" " << r[1] <<
" " << r[2] <<
" "
239 << tangent[0] <<
" " << tangent[1] <<
" "
240 << tangent[2] <<
" " << std::endl;
242 boundaries_normal_file << r[0] <<
" " << r[1] <<
" " << r[2] <<
" "
243 << normal[0] <<
" " << normal[1] <<
" "
244 << normal[2] <<
" " << std::endl;
246 boundaries_binormal_file << r[0] <<
" " << r[1] <<
" " << r[2] <<
" "
247 << binormal[0] <<
" " << binormal[1] <<
" "
248 << binormal[2] <<
" " << std::endl;
262 std::ostringstream error_message;
264 <<
"Please use another region id different from zero.\n"
265 <<
"It is internally used as the default region number.\n";
267 OOMPH_CURRENT_FUNCTION,
268 OOMPH_EXCEPTION_LOCATION);
274 std::ostringstream error_message;
275 error_message <<
"Vector specifying zeta coordinates of point in\n"
276 <<
"region has be length 2; yours has length " << n
279 OOMPH_CURRENT_FUNCTION,
280 OOMPH_EXCEPTION_LOCATION);
284 std::map<unsigned, Vector<double>>::iterator it;
290 std::ostringstream error_message;
291 error_message <<
"The region id (" << r <<
") that you are using for"
293 <<
"your region is already in use. Use another\n"
294 <<
"region id and verify that you are not re-using\n"
295 <<
" previously defined regions ids.\n"
298 OOMPH_CURRENT_FUNCTION,
299 OOMPH_EXCEPTION_LOCATION);
349 const double& z_offset = 0.0)
373 OOMPH_CURRENT_FUNCTION,
374 OOMPH_EXCEPTION_LOCATION);
388 for (
unsigned b = 0; b < n; b++)
407 double radius = sqrt(r[0] * r[0] + r[1] * r[1]);
408 double phi = atan2(r[1], r[0]);
426 const double& zeta_bound,
432 double phi = zeta_bound;
442 dr_dr[2] =
dwdr(1.0, phi);
443 double inv_norm = 1.0 / sqrt(dr_dr[0] * dr_dr[0] + dr_dr[1] * dr_dr[1] +
444 dr_dr[2] * dr_dr[2]);
446 normal[0] = dr_dr[0] * inv_norm;
447 normal[1] = dr_dr[1] * inv_norm;
448 normal[2] = dr_dr[2] * inv_norm;
451 dr_dphi[0] = -sin(phi);
452 dr_dphi[1] = cos(phi);
453 dr_dphi[2] =
dwdphi(1.0, phi);
455 inv_norm = 1.0 / sqrt(dr_dphi[0] * dr_dphi[0] + dr_dphi[1] * dr_dphi[1] +
456 dr_dphi[2] * dr_dphi[2]);
458 tangent[0] = dr_dphi[0] * inv_norm;
459 tangent[1] = dr_dphi[1] * inv_norm;
460 tangent[2] = dr_dphi[2] * inv_norm;
462 binormal[0] = tangent[1] * normal[2] - tangent[2] * normal[1];
463 binormal[1] = tangent[2] * normal[0] - tangent[0] * normal[2];
464 binormal[2] = tangent[0] * normal[1] - tangent[1] * normal[0];
469 double w(
const double& r,
const double& phi)
const
471 return Epsilon * cos(
double(
N) * phi) * pow(r, 2);
475 double dwdr(
const double& r,
const double& phi)
const
477 return Epsilon * cos(
double(
N) * phi) * 2.0 * r;
481 double dwdphi(
const double& r,
const double& phi)
const
483 return -
Epsilon * double(
N) * sin(
double(
N) * phi) * pow(r, 2);
518 const double& z_offset = 0.0)
531 new Ellipse(r_annulus, r_annulus);
537 new Ellipse(r_annulus, r_annulus);
Base class for upgraded disk-like GeomObject (i.e. 2D surface in 3D space) with specification of boun...
void add_region_coordinates(const unsigned &r, Vector< double > &zeta_in_region)
Specify intrinsic coordinates of a point within a specified region – region ID, r,...
GeomObject * boundary_parametrising_geom_object_pt(const unsigned &b) const
Pointer to GeomObject<1,2> that parametrises intrinisc coordinates along boundary b.
Vector< double > Zeta_boundary_start
Storage for initial value of 1D boundary coordinate on boundary b:
void position_on_boundary(const unsigned &b, const double &zeta_bound, Vector< double > &r) const
Compute 3D vector of Eulerian coordinates at 1D boundary coordinate zeta_bound on boundary b:
std::map< unsigned, Vector< double > > zeta_in_region() const
Return map that stores zeta coordinates of points that identify regions.
void output_boundaries_and_triads(const unsigned &nplot, std::ofstream &two_d_boundaries_file, std::ofstream &three_d_boundaries_file, std::ofstream &boundaries_tangent_file, std::ofstream &boundaries_normal_file, std::ofstream &boundaries_binormal_file)
Output boundaries and triad at nplot plot points. Streams:
std::map< unsigned, Vector< double > > Zeta_in_region
Map to store zeta coordinates of points that identify regions.
Vector< GeomObject * > Boundary_parametrising_geom_object_pt
Pointer to GeomObject<1,2> that parametrises intrinisc coordinates along boundary b; essentially prov...
DiskLikeGeomObjectWithBoundaries()
Constructor.
double zeta_boundary_end(const unsigned &b) const
Final value of 1D boundary coordinate zeta_bound on boundary b:
virtual void boundary_triad(const unsigned &b, const double &zeta_bound, Vector< double > &r, Vector< double > &tangent, Vector< double > &normal, Vector< double > &binormal)
Boundary triad on boundary b at boundary coordinate zeta_bound. Broken virtual.
unsigned nboundary() const
How many boundaries do we have?
void zeta_on_boundary(const unsigned &b, const double &zeta_bound, Vector< double > &zeta) const
Compute 2D vector of intrinsic coordinates at 1D boundary coordinate zeta_bound on boundary b:
void output_boundaries(const unsigned &nplot, std::ofstream &two_d_boundaries_file, std::ofstream &three_d_boundaries_file)
Output boundaries at nplot plot points. Streams:
double zeta_boundary_start(const unsigned &b) const
Initial value of 1D boundary coordinate zeta_bound on boundary b:
Vector< double > Zeta_boundary_end
Storage for final value of 1D boundary coordinate on boundary b:
////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
unsigned ndim() const
Access function to # of Eulerian coordinates.
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
virtual ~WarpedCircularDiskWithAnnularInternalBoundary()
Destructor (empty; cleanup happens in base class)
double H_annulus
Thickness of annular region (distance of internal boundary from outer edge of unit circle)
WarpedCircularDiskWithAnnularInternalBoundary(const WarpedCircularDiskWithAnnularInternalBoundary &dummy)=delete
Broken copy constructor.
void operator=(const WarpedCircularDiskWithAnnularInternalBoundary &)=delete
Broken assignment operator.
WarpedCircularDiskWithAnnularInternalBoundary(const double &h_annulus, const double &epsilon, const unsigned &n, const double &z_offset=0.0)
Constructor. Pass amplitude and azimuthal wavenumber of warping as arguments. Can specify vertical of...
double h_annulus() const
Thickness of annular region (distance of internal boundary from outer edge of unit circle)
////////////////////////////////////////////////////////////////// //////////////////////////////////...
double dwdphi(const double &r, const double &phi) const
Deriv of vertical deflection w.r.t. angle.
void operator=(const WarpedCircularDisk &)=delete
Broken assignment operator.
double Epsilon
Amplitude of non-axisymmetric deformation.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
double & epsilon()
Access fct to amplitude of disk warping.
WarpedCircularDisk(const WarpedCircularDisk &dummy)=delete
Broken copy constructor.
WarpedCircularDisk()
Empty default constructor.
WarpedCircularDisk(const double &epsilon, const unsigned &n, const double &z_offset=0.0)
Constructor. Pass amplitude and azimuthal wavenumber of warping as arguments. Can specify vertical of...
double Z_offset
Vertical offset.
void boundary_triad(const unsigned &b, const double &zeta_bound, Vector< double > &r, Vector< double > &tangent, Vector< double > &normal, Vector< double > &binormal)
Boundary triad on boundary b at boundary coordinate zeta_bound.
unsigned N
Wavenumber of non-axisymmetric deformation.
double w(const double &r, const double &phi) const
Vertical deflection.
virtual ~WarpedCircularDisk()
Destructor.
double dwdr(const double &r, const double &phi) const
Deriv of vertical deflection w.r.t. radius.
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Parametrised position on object: r(zeta). Evaluated at previous timestep. t=0: current time; t>0: pre...
const double Pi
50 digits from maple
//////////////////////////////////////////////////////////////////// ////////////////////////////////...