26#ifndef OOMPH_GEOM_OBJECTS_HEADER
27#define OOMPH_GEOM_OBJECTS_HEADER
32#include <oomph-lib-config.h>
122 std::ostringstream error_message;
123 error_message <<
"# of Lagrangian coordinates " <<
nlagrangian
124 <<
" cannot be bigger than # of Eulerian ones " <<
ndim
140 const unsigned&
ndim,
149 std::ostringstream error_message;
150 error_message <<
"# of Lagrangian coordinates " <<
nlagrangian
151 <<
" cannot be bigger than # of Eulerian ones " <<
ndim
184 const unsigned&
n_dim)
211 std::ostringstream error_message;
213 <<
"GeomObject::ngeom_data() is a broken virtual function.\n"
214 <<
"Please implement it (and its companion "
215 "GeomObject::geom_data_pt())\n"
216 <<
"for any GeomObject whose shape depends on Data whose values may \n"
217 <<
"be unknowns in the global Problem. \n"
218 <<
"If you have arrived here in a parallel job then it may be the case "
220 <<
"that you have not set the keep_all_elements_as_halos() flag to "
222 <<
"for the MeshAsGeomObject representing the lower-dimensional mesh \n"
223 <<
"in a problem with multiple meshes. \n";
235 std::ostringstream error_message;
237 <<
"GeomObject::geom_data_pt() is a broken virtual function.\n"
238 <<
"Please implement it (and its companion GeomObject::ngeom_data())\n"
239 <<
"for any GeomObject whose shape depends on Data whose values may \n"
240 <<
"be unknowns in the global Problem. \n"
241 <<
"If you have arrived here in a parallel job then it may be the case "
243 <<
"that you have not set the keep_all_elements_as_halos() flag to "
245 <<
"for the MeshAsGeomObject representing the lower-dimensional mesh \n"
246 <<
"in a problem with multiple meshes. \n";
266 "Calling steady position() from discrete unsteady position()",
280 std::ostringstream error_message;
281 error_message <<
"GeomObject::position() is a broken virtual function.\n"
282 <<
"Please implement it for any GeomObject whose shape\n"
283 <<
"is time-dependent and will be used in the extrusion\n"
284 <<
"of a mesh (in the time direction).\n";
307 <<
"Using default (static) assignment " <<
j
308 <<
"-th time derivative in GeomObject::dposition_dt(...) is zero\n"
309 <<
"Overload for your specific geometric object if this is not \n"
310 <<
"appropriate. \n";
312 "GeomObject::dposition_dt()",
316 for (
unsigned i = 0;
i <
n;
i++)
331 "You must specify dposition() for your own object! \n",
345 "You must specify d2position() for your own object! \n",
363 "You must specify d2position() for your own object! \n",
410 std::ostringstream error_message;
411 error_message <<
"You've called the default implementation of "
412 <<
"GeomObject::interpolated_zeta() \n"
413 <<
"but zeta.size()=" <<
zeta.
size()
414 <<
"and s.size()=" <<
s.
size() << std::endl
415 <<
"This doesn't make sense! You probably have to \n"
416 <<
"overload this function in your specific GeomObject\n";
463 std::ostringstream error_message;
464 error_message <<
"geom_data_pt should have size 1, not "
469 error_message <<
"geom_data_pt[0] should have 1 value, not "
543 std::ostringstream error_message;
544 error_message <<
"t > nprev_values() " <<
t <<
" "
657 std::ostringstream error_message;
658 error_message <<
"geom_data_pt should have size 1, not "
663 error_message <<
"geom_data_pt[0] should have 2 values, not "
772 std::ostringstream error_message;
773 error_message <<
"t > nprev_values() " <<
t <<
" "
969 std::ostringstream error_message;
970 error_message <<
"geom_data_pt should have size 1, not "
975 error_message <<
"geom_data_pt[0] should have 3 values, not "
1054 std::ostringstream error_message;
1055 error_message <<
"t > nprev_values() " <<
t <<
" "
double & x_c()
Access function to x-coordinate of centre of circle.
double & y_c()
Access function to y-coordinate of centre of circle.
void operator=(const Circle &)=delete
Broken assignment operator.
Circle(const Circle &dummy)=delete
Broken copy constructor.
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...
Circle(const double &x_c, const double &y_c, const double &r, TimeStepper *time_stepper_pt)
Constructor: Pass x and y-coords of centre and radius (all pinned) Circle is static but can be used i...
virtual ~Circle()
Destructor: Clean up if necessary.
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
bool Must_clean_up
Do I need to clean up?
bool Is_time_dependent
Genuine time-dependence?
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Circle(const Vector< Data * > &geom_data_pt)
Constructor: Pass x and y-coords of centre and radius (all as Data)
Circle(const double &x_c, const double &y_c, const double &r)
Constructor: Pass x and y-coords of centre and radius (all pinned)
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on.
double & R()
Access function to radius of circle.
A class that represents a collection of data; each Data object may contain many different individual ...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Steady ellipse with half axes A and B as geometric object:
void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i)....
Ellipse(const double &A, const double &B)
Constructor: 1 Lagrangian coordinate, 2 Eulerian coords. Pass half axes A and B; both pinned.
Ellipse(const Vector< Data * > &geom_data_pt)
Constructor: 1 Lagrangian coordinate, 2 Eulerian coords. Pass half axes as Data:
void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Position Vector and 1st and 2nd derivs to coordinates: = drdzeta(alpha,i). = ddrdzeta(alpha,...
void operator=(const Ellipse &)=delete
Broken assignment operator.
void set_A_ellips(const double &a)
Set horizontal half axis.
Ellipse(const Ellipse &dummy)=delete
Broken copy constructor.
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
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...
void set_B_ellips(const double &b)
Set vertical half axis.
double b_ellips()
Access function for vertical half axis.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on.
~Ellipse()
Destructor: Clean up if necessary.
bool Must_clean_up
Do I need to clean up?
double a_ellips()
Access function for horizontal half axis.
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Derivative of position Vector w.r.t. to coordinates: = drdzeta(alpha,i).
Elliptical tube with half axes a and b.
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Position vector (dummy unsteady version returns steady version)
EllipticalTube(const EllipticalTube &node)=delete
Broken copy constructor.
void operator=(const EllipticalTube &)=delete
Broken assignment operator.
void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Position Vector and 1st and 2nd derivs w.r.t. zeta.
EllipticalTube(const double &a, const double &b)
Constructor: Specify radius.
void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
Position Vector and 1st and 2nd derivs w.r.t. zeta.
double & a()
Access function to x-half axis.
virtual unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
double & b()
Access function to y-half axis.
void position(const Vector< double > &zeta, Vector< double > &r) const
Position vector.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
A geometric object is an object that provides a parametrised description of its shape via the functio...
unsigned ndim() const
Access function to # of Eulerian coordinates.
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i)....
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned NLagrangian
Number of Lagrangian (intrinsic) coordinates.
TimeStepper * Geom_object_time_stepper_pt
Timestepper (used to handle access to geometry at previous timesteps)
virtual unsigned ngeom_data() const
How many items of Data does the shape of the object depend on? This is implemented as a broken virtua...
virtual void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
A geometric object may be composed of many sub-objects each with their own local coordinate....
void set_nlagrangian_and_ndim(const unsigned &n_lagrangian, const unsigned &n_dim)
Set # of Lagrangian and Eulerian coordinates.
virtual void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: = drdzeta(alpha,...
virtual Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on. This is implemented as a bro...
void operator=(const GeomObject &)=delete
Broken assignment operator.
GeomObject(const unsigned &ndim)
Constructor: Pass dimension of geometric object (# of Eulerian coords = # of Lagrangian coords; no ti...
unsigned Ndim
Number of Eulerian coordinates.
GeomObject(const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
Constructor: pass # of Eulerian and Lagrangian coordinates and pointer to time-stepper which is used ...
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
A geometric object may be composed of may sub-objects (e.g. a finite-element representation of a boun...
TimeStepper * time_stepper_pt() const
Access function for pointer to time stepper: Null if object is not time-dependent....
virtual void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Derivative of position Vector w.r.t. to coordinates: = drdzeta(alpha,i). Evaluated at current time.
virtual void dposition_dt(const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
j-th time-derivative on object at current time: .
virtual ~GeomObject()
(Empty) destructor
virtual 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...
GeomObject(const unsigned &nlagrangian, const unsigned &ndim)
Constructor: pass # of Eulerian and Lagrangian coordinates. No time history available/needed.
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
virtual void position(const double &t, const Vector< double > &zeta, Vector< double > &r) const
Parametrised position on object: r(zeta). Evaluated at the continuous time value, t.
GeomObject(const GeomObject &dummy)=delete
Broken copy constructor.
GeomObject()
Default constructor.
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....
Steady, straight 1D line in 2D space.
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on.
virtual void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Derivative of position Vector w.r.t. to coordinates: = drdzeta(alpha,i). Evaluated at current time.
StraightLine(const StraightLine &dummy)=delete
Broken copy constructor.
StraightLine(const Vector< Data * > &geom_data_pt)
Constructor: One item of geometric data:
~StraightLine()
Destructor: Clean up if necessary.
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
StraightLine(const double &height)
Constructor: Pass height (pinned by default)
bool Must_clean_up
Do I need to clean up?
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
virtual void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: = drdzeta(alpha,...
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i)....
void operator=(const StraightLine &)=delete
Broken assignment operator.
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...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
virtual void assign_initial_values_impulsive(Data *const &data_pt)=0
Initialise the time-history for the Data values corresponding to an impulsive start.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).