oomph::DiskLikeGeomObjectWithBoundaries Class Reference

#include <geom_obj_with_boundary.h>

+ Inheritance diagram for oomph::DiskLikeGeomObjectWithBoundaries:

Public Member Functions

 DiskLikeGeomObjectWithBoundaries ()
 Constructor. More...
 
unsigned nboundary () const
 How many boundaries do we have? More...
 
void position_on_boundary (const unsigned &b, const double &zeta_bound, Vector< double > &r) const
 
void zeta_on_boundary (const unsigned &b, const double &zeta_bound, Vector< double > &zeta) const
 
GeomObjectboundary_parametrising_geom_object_pt (const unsigned &b) const
 
double zeta_boundary_start (const unsigned &b) const
 
double zeta_boundary_end (const unsigned &b) const
 
virtual void boundary_triad (const unsigned &b, const double &zeta_bound, Vector< double > &r, Vector< double > &tangent, Vector< double > &normal, Vector< double > &binormal)
 
void output_boundaries (const unsigned &nplot, std::ofstream &two_d_boundaries_file, std::ofstream &three_d_boundaries_file)
 
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)
 
void add_region_coordinates (const unsigned &r, Vector< double > &zeta_in_region)
 
std::map< unsigned, Vector< double > > zeta_in_region () const
 Return map that stores zeta coordinates of points that identify regions. More...
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual unsigned ngeom_data () const
 
virtual Datageom_data_pt (const unsigned &j)
 
virtual void position (const Vector< double > &zeta, Vector< double > &r) const =0
 Parametrised position on object at current time: r(zeta). More...
 
virtual void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition_dt (const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 

Protected Attributes

Vector< doubleZeta_boundary_start
 
Vector< doubleZeta_boundary_end
 
Vector< GeomObject * > Boundary_parametrising_geom_object_pt
 
std::map< unsigned, Vector< double > > Zeta_in_region
 Map to store zeta coordinates of points that identify regions. More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Detailed Description

Base class for upgraded disk-like GeomObject (i.e. 2D surface in 3D space) with specification of boundaries. The GeomObject's position(...) function computes the 3D (Eulerian) position vector r as a function of the 2D intrinsic (Lagrangian) coordinates, zeta, without reference to any boundaries. This class specifies the boundaries by specifying a mapping from a 1D intrinsic boundary coordinate, zeta_bound, to the 2D intrinsic (Lagrangian) coordinates, zeta.

The class is made functional by provision (in the derived class!) of:

  • a pointer to a GeomObject<1,2> that parametrises the 2D intrinisic coordinates zeta along boundary b in terms of the 1D boundary coordinate, zeta_bound,
  • the initial value of the 1D boundary coordinate zeta_bound on boundary b,
  • the final value of the 1D boundary coordinate zeta_bound on boundary b

for each of these boundaries. All three containers for these must be resized (consistently) and populated in the derived class. Number of boundaries is inferred from their size.

Class also provides broken virtual function to specify boundary triads, and various output functions.

Constructor & Destructor Documentation

◆ DiskLikeGeomObjectWithBoundaries()

oomph::DiskLikeGeomObjectWithBoundaries::DiskLikeGeomObjectWithBoundaries ( )
inline

Constructor.

70 : GeomObject(2, 3) {}
GeomObject()
Default constructor.
Definition: geom_objects.h:104

Member Function Documentation

◆ add_region_coordinates()

void oomph::DiskLikeGeomObjectWithBoundaries::add_region_coordinates ( const unsigned r,
Vector< double > &  zeta_in_region 
)
inline

Specify intrinsic coordinates of a point within a specified region – region ID, r, should be positive.

258  {
259  // Verify if not using the default region number (zero)
260  if (r == 0)
261  {
262  std::ostringstream error_message;
263  error_message
264  << "Please use another region id different from zero.\n"
265  << "It is internally used as the default region number.\n";
266  throw OomphLibError(error_message.str(),
269  }
270  // Need two coordinates
271  unsigned n = zeta_in_region.size();
272  if (n != 2)
273  {
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
277  << std::endl;
278  throw OomphLibError(error_message.str(),
281  }
282 
283  // First check if the region with the specified id does not already exist
284  std::map<unsigned, Vector<double>>::iterator it;
285  it = Zeta_in_region.find(r);
286 
287  // If it is already a region defined with that id throw an error
288  if (it != Zeta_in_region.end())
289  {
290  std::ostringstream error_message;
291  error_message << "The region id (" << r << ") that you are using for"
292  << "defining\n"
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"
296  << std::endl;
297  OomphLibWarning(error_message.str(),
300  }
301 
302  // If it does not exist then create the map
304  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
std::map< unsigned, Vector< double > > zeta_in_region() const
Return map that stores zeta coordinates of points that identify regions.
Definition: geom_obj_with_boundary.h:307
std::map< unsigned, Vector< double > > Zeta_in_region
Map to store zeta coordinates of points that identify regions.
Definition: geom_obj_with_boundary.h:327
r
Definition: UniformPSDSelfTest.py:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References n, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, UniformPSDSelfTest::r, zeta_in_region(), and Zeta_in_region.

Referenced by oomph::WarpedCircularDiskWithAnnularInternalBoundary::WarpedCircularDiskWithAnnularInternalBoundary().

◆ boundary_parametrising_geom_object_pt()

GeomObject* oomph::DiskLikeGeomObjectWithBoundaries::boundary_parametrising_geom_object_pt ( const unsigned b) const
inline

Pointer to GeomObject<1,2> that parametrises intrinisc coordinates along boundary b

138  {
140  }
Scalar * b
Definition: benchVecAdd.cpp:17
Vector< GeomObject * > Boundary_parametrising_geom_object_pt
Definition: geom_obj_with_boundary.h:324

References b, and Boundary_parametrising_geom_object_pt.

◆ boundary_triad()

virtual void oomph::DiskLikeGeomObjectWithBoundaries::boundary_triad ( const unsigned b,
const double zeta_bound,
Vector< double > &  r,
Vector< double > &  tangent,
Vector< double > &  normal,
Vector< double > &  binormal 
)
inlinevirtual

Boundary triad on boundary b at boundary coordinate zeta_bound. Broken virtual.

Reimplemented in oomph::WarpedCircularDisk.

165  {
166  std::ostringstream error_message;
167  error_message << "Broken virtual function; please implement for your\n"
168  << "derived version of this class!" << std::endl;
169  throw OomphLibError(
170  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
171  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::DiskWithTorusAroundEdgeTetMeshFacetedSurface::DiskWithTorusAroundEdgeTetMeshFacetedSurface(), and output_boundaries_and_triads().

◆ nboundary()

unsigned oomph::DiskLikeGeomObjectWithBoundaries::nboundary ( ) const
inline

◆ output_boundaries()

void oomph::DiskLikeGeomObjectWithBoundaries::output_boundaries ( const unsigned nplot,
std::ofstream &  two_d_boundaries_file,
std::ofstream &  three_d_boundaries_file 
)
inline

Output boundaries at nplot plot points. Streams:

  • two_d_boundaries_file: zeta_0, zeta_1, zeta_bound
  • three_d_boundaries_file : x, y, z, zeta_0, zeta_1, zeta_bound
179  {
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);
189  }
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)
Definition: geom_obj_with_boundary.h:198

References output_boundaries_and_triads().

◆ output_boundaries_and_triads()

void oomph::DiskLikeGeomObjectWithBoundaries::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 
)
inline

Output boundaries and triad at nplot plot points. Streams:

  • two_d_boundaries_file: zeta_0, zeta_1, zeta_bound
  • three_d_boundaries_file : x, y, z, zeta_0, zeta_1, zeta_bound
  • boundaries_tangent_file : x, y, z, t_x, t_y, t_z
  • boundaries_normal_file : x, y, z, n_x, n_y, n_z
  • boundaries_binormal_file: x, y, z, N_x, N_y, N_z
204  {
205  Vector<double> r(3);
206  Vector<double> zeta(2);
207  double zeta_bound = 0.0;
208  Vector<double> tangent(3);
209  Vector<double> normal(3);
210  Vector<double> binormal(3);
211  unsigned nb = nboundary();
212  for (unsigned b = 0; b < nb; b++)
213  {
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;
219 
220  double zeta_min = zeta_boundary_start(b);
221  double zeta_max = zeta_boundary_end(b);
222  unsigned n = 100;
223  for (unsigned i = 0; i < n; i++)
224  {
225  zeta_bound =
226  zeta_min + (zeta_max - zeta_min) * double(i) / double(n - 1);
227  position_on_boundary(b, zeta_bound, r);
228  zeta_on_boundary(b, zeta_bound, zeta);
229  boundary_triad(b, zeta_bound, r, tangent, normal, binormal);
230 
231  two_d_boundaries_file << zeta[0] << " " << zeta[1] << " "
232  << zeta_bound << " " << std::endl;
233 
234  three_d_boundaries_file << r[0] << " " << r[1] << " " << r[2] << " "
235  << zeta[0] << " " << zeta[1] << " "
236  << zeta_bound << " " << std::endl;
237 
238  boundaries_tangent_file << r[0] << " " << r[1] << " " << r[2] << " "
239  << tangent[0] << " " << tangent[1] << " "
240  << tangent[2] << " " << std::endl;
241 
242  boundaries_normal_file << r[0] << " " << r[1] << " " << r[2] << " "
243  << normal[0] << " " << normal[1] << " "
244  << normal[2] << " " << std::endl;
245 
246  boundaries_binormal_file << r[0] << " " << r[1] << " " << r[2] << " "
247  << binormal[0] << " " << binormal[1] << " "
248  << binormal[2] << " " << std::endl;
249  }
250  }
251  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void position_on_boundary(const unsigned &b, const double &zeta_bound, Vector< double > &r) const
Definition: geom_obj_with_boundary.h:80
double zeta_boundary_end(const unsigned &b) const
Definition: geom_obj_with_boundary.h:151
virtual void boundary_triad(const unsigned &b, const double &zeta_bound, Vector< double > &r, Vector< double > &tangent, Vector< double > &normal, Vector< double > &binormal)
Definition: geom_obj_with_boundary.h:159
unsigned nboundary() const
How many boundaries do we have?
Definition: geom_obj_with_boundary.h:73
void zeta_on_boundary(const unsigned &b, const double &zeta_bound, Vector< double > &zeta) const
Definition: geom_obj_with_boundary.h:91
double zeta_boundary_start(const unsigned &b) const
Definition: geom_obj_with_boundary.h:144
int nb
Definition: level2_impl.h:286
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65

References b, boundary_triad(), i, n, nb, nboundary(), WallFunction::normal(), position_on_boundary(), UniformPSDSelfTest::r, Eigen::zeta(), zeta_boundary_end(), zeta_boundary_start(), and zeta_on_boundary().

Referenced by main(), and output_boundaries().

◆ position_on_boundary()

void oomph::DiskLikeGeomObjectWithBoundaries::position_on_boundary ( const unsigned b,
const double zeta_bound,
Vector< double > &  r 
) const
inline

Compute 3D vector of Eulerian coordinates at 1D boundary coordinate zeta_bound on boundary b:

83  {
84  Vector<double> zeta(2);
85  zeta_on_boundary(b, zeta_bound, zeta);
86  position(zeta, r);
87  }
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).

References b, oomph::GeomObject::position(), UniformPSDSelfTest::r, Eigen::zeta(), and zeta_on_boundary().

Referenced by output_boundaries_and_triads().

◆ zeta_boundary_end()

double oomph::DiskLikeGeomObjectWithBoundaries::zeta_boundary_end ( const unsigned b) const
inline

Final value of 1D boundary coordinate zeta_bound on boundary b:

152  {
153  return Zeta_boundary_end[b];
154  }
Vector< double > Zeta_boundary_end
Definition: geom_obj_with_boundary.h:319

References b, and Zeta_boundary_end.

Referenced by oomph::DiskWithTorusAroundEdgeTetMeshFacetedSurface::DiskWithTorusAroundEdgeTetMeshFacetedSurface(), and output_boundaries_and_triads().

◆ zeta_boundary_start()

double oomph::DiskLikeGeomObjectWithBoundaries::zeta_boundary_start ( const unsigned b) const
inline

Initial value of 1D boundary coordinate zeta_bound on boundary b:

145  {
146  return Zeta_boundary_start[b];
147  }
Vector< double > Zeta_boundary_start
Definition: geom_obj_with_boundary.h:315

References b, and Zeta_boundary_start.

Referenced by output_boundaries_and_triads().

◆ zeta_in_region()

std::map<unsigned, Vector<double> > oomph::DiskLikeGeomObjectWithBoundaries::zeta_in_region ( ) const
inline

◆ zeta_on_boundary()

void oomph::DiskLikeGeomObjectWithBoundaries::zeta_on_boundary ( const unsigned b,
const double zeta_bound,
Vector< double > &  zeta 
) const
inline

Compute 2D vector of intrinsic coordinates at 1D boundary coordinate zeta_bound on boundary b:

94  {
95 #ifdef PARANOID
97  {
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"
102  << std::endl;
103  throw OomphLibError(error_message.str(),
106  }
108  {
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 "
112  << Boundary_parametrising_geom_object_pt[b]->nlagrangian()
113  << std::endl;
114  throw OomphLibError(error_message.str(),
117  }
119  {
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 "
124  << std::endl;
125  throw OomphLibError(error_message.str(),
128  }
129 #endif
130  Vector<double> zeta_bound_vector(1, zeta_bound);
131  Boundary_parametrising_geom_object_pt[b]->position(zeta_bound_vector,
132  zeta);
133  }
unsigned ndim() const
Access function to # of Eulerian coordinates.
Definition: geom_objects.h:177
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
Definition: geom_objects.h:171

References b, Boundary_parametrising_geom_object_pt, oomph::GeomObject::ndim(), oomph::GeomObject::nlagrangian(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Eigen::zeta().

Referenced by oomph::DiskTetMeshFacetedSurface::boundary_zeta01(), output_boundaries_and_triads(), and position_on_boundary().

Member Data Documentation

◆ Boundary_parametrising_geom_object_pt

Vector<GeomObject*> oomph::DiskLikeGeomObjectWithBoundaries::Boundary_parametrising_geom_object_pt
protected

◆ Zeta_boundary_end

Vector<double> oomph::DiskLikeGeomObjectWithBoundaries::Zeta_boundary_end
protected

◆ Zeta_boundary_start

Vector<double> oomph::DiskLikeGeomObjectWithBoundaries::Zeta_boundary_start
protected

◆ Zeta_in_region

std::map<unsigned, Vector<double> > oomph::DiskLikeGeomObjectWithBoundaries::Zeta_in_region
protected

Map to store zeta coordinates of points that identify regions.

Referenced by add_region_coordinates(), and zeta_in_region().


The documentation for this class was generated from the following file: