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";
305 std::ostringstream warning_stream;
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()",
315 unsigned n = drdt.size();
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",
385 const bool& use_coordinate_as_initial_guess =
false)
390 sub_geom_object_pt =
this;
408 if (
zeta.size() !=
s.size())
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 <<
" "
579 ddrdzeta(0, 0, 0) = 0.0;
580 ddrdzeta(0, 0, 1) = 0.0;
604 ddrdzeta(0, 0, 0) = 0.0;
605 ddrdzeta(0, 0, 1) = 0.0;
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 <<
" "
833 ddrdzeta(0, 0, 0) = -
a *
cos(
zeta[0]);
834 ddrdzeta(0, 0, 1) = -
b *
sin(
zeta[0]);
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 <<
" "
1184 ddrdzeta(0, 0, 0) = 0.0;
1185 ddrdzeta(0, 0, 1) = 0.0;
1186 ddrdzeta(0, 0, 2) = 0.0;
1188 ddrdzeta(1, 1, 0) = -
A *
cos(
zeta[1]);
1189 ddrdzeta(1, 1, 1) = -
B *
sin(
zeta[1]);
1190 ddrdzeta(1, 1, 2) = 0.0;
1192 ddrdzeta(0, 1, 0) = ddrdzeta(1, 0, 0) = 0.0;
1193 ddrdzeta(0, 1, 1) = ddrdzeta(1, 0, 1) = 0.0;
1194 ddrdzeta(0, 1, 2) = ddrdzeta(1, 0, 2) = 0.0;
1209 drdzeta(0, 0) = 0.0;
1210 drdzeta(0, 1) = 0.0;
1211 drdzeta(0, 2) = 1.0;
1216 drdzeta(1, 2) = 0.0;
1219 ddrdzeta(0, 0, 0) = 0.0;
1220 ddrdzeta(0, 0, 1) = 0.0;
1221 ddrdzeta(0, 0, 2) = 0.0;
1223 ddrdzeta(1, 1, 0) = -
A *
cos(
zeta[1]);
1224 ddrdzeta(1, 1, 1) = -
B *
sin(
zeta[1]);
1225 ddrdzeta(1, 1, 2) = 0.0;
1228 ddrdzeta(0, 1, 0) = ddrdzeta(1, 0, 0) = 0.0;
1229 ddrdzeta(0, 1, 1) = ddrdzeta(1, 0, 1) = 0.0;
1230 ddrdzeta(0, 1, 2) = ddrdzeta(1, 0, 2) = 0.0;
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Definition: geom_objects.h:873
double & y_c()
Access function to y-coordinate of centre of circle.
Definition: geom_objects.h:1083
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
Definition: geom_objects.h:1040
Circle(const double &x_c, const double &y_c, const double &r, TimeStepper *time_stepper_pt)
Definition: geom_objects.h:915
virtual ~Circle()
Destructor: Clean up if necessary.
Definition: geom_objects.h:1009
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
Definition: geom_objects.h:1109
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
Definition: geom_objects.h:1095
bool Must_clean_up
Do I need to clean up?
Definition: geom_objects.h:1112
double & x_c()
Access function to x-coordinate of centre of circle.
Definition: geom_objects.h:1077
bool Is_time_dependent
Genuine time-dependence?
Definition: geom_objects.h:1115
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:1024
Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:1102
Circle(const Vector< Data * > &geom_data_pt)
Definition: geom_objects.h:964
Circle(const double &x_c, const double &y_c, const double &r)
Constructor: Pass x and y-coords of centre and radius (all pinned)
Definition: geom_objects.h:876
double & R()
Access function to radius of circle.
Definition: geom_objects.h:1089
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
Definition: geom_objects.h:644
void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:804
Ellipse(const double &A, const double &B)
Definition: geom_objects.h:682
Ellipse(const Vector< Data * > &geom_data_pt)
Definition: geom_objects.h:652
void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:817
void operator=(const Ellipse &)=delete
Broken assignment operator.
void set_A_ellips(const double &a)
Set horizontal half axis.
Definition: geom_objects.h:720
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?
Definition: geom_objects.h:839
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Definition: geom_objects.h:756
void set_B_ellips(const double &b)
Set vertical half axis.
Definition: geom_objects.h:726
Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:846
double b_ellips()
Access function for vertical half axis.
Definition: geom_objects.h:738
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:745
~Ellipse()
Destructor: Clean up if necessary.
Definition: geom_objects.h:709
bool Must_clean_up
Do I need to clean up?
Definition: geom_objects.h:856
double a_ellips()
Access function for horizontal half axis.
Definition: geom_objects.h:732
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
Definition: geom_objects.h:853
void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Definition: geom_objects.h:791
Definition: geom_objects.h:1131
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Position vector (dummy unsteady version returns steady version)
Definition: geom_objects.h:1167
double B
x-half axis
Definition: geom_objects.h:1238
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.
Definition: geom_objects.h:1198
double & a()
Access function to x-half axis.
Definition: geom_objects.h:1146
EllipticalTube(const double &a, const double &b)
Constructor: Specify radius.
Definition: geom_objects.h:1134
double A
x-half axis
Definition: geom_objects.h:1235
double & b()
Access function to y-half axis.
Definition: geom_objects.h:1152
void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
Position Vector and 1st and 2nd derivs w.r.t. zeta.
Definition: geom_objects.h:1181
virtual unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
Definition: geom_objects.h:1175
void position(const Vector< double > &zeta, Vector< double > &r) const
Position vector.
Definition: geom_objects.h:1158
Definition: geom_objects.h:101
TimeStepper * time_stepper_pt() const
Definition: geom_objects.h:199
unsigned ndim() const
Access function to # of Eulerian coordinates.
Definition: geom_objects.h:177
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:341
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
unsigned NLagrangian
Number of Lagrangian (intrinsic) coordinates.
Definition: geom_objects.h:428
TimeStepper * Geom_object_time_stepper_pt
Definition: geom_objects.h:435
virtual unsigned ngeom_data() const
Definition: geom_objects.h:209
virtual void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Definition: geom_objects.h:404
void set_nlagrangian_and_ndim(const unsigned &n_lagrangian, const unsigned &n_dim)
Set # of Lagrangian and Eulerian coordinates.
Definition: geom_objects.h:183
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
virtual void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:357
void operator=(const GeomObject &)=delete
Broken assignment operator.
GeomObject(const unsigned &ndim)
Definition: geom_objects.h:108
unsigned Ndim
Number of Eulerian coordinates.
Definition: geom_objects.h:431
GeomObject(const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
Definition: geom_objects.h:139
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: geom_objects.h:381
virtual void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Definition: geom_objects.h:327
virtual void dposition_dt(const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
Definition: geom_objects.h:292
virtual ~GeomObject()
(Empty) destructor
Definition: geom_objects.h:168
virtual void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Definition: geom_objects.h:259
virtual Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:233
GeomObject(const unsigned &nlagrangian, const unsigned &ndim)
Definition: geom_objects.h:116
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
Definition: geom_objects.h:171
virtual void position(const double &t, const Vector< double > &zeta, Vector< double > &r) const
Definition: geom_objects.h:276
GeomObject(const GeomObject &dummy)=delete
Broken copy constructor.
GeomObject()
Default constructor.
Definition: geom_objects.h:104
Definition: matrices.h:74
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
A Rank 3 Tensor class.
Definition: matrices.h:1370
Definition: geom_objects.h:452
virtual void dposition(const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
Definition: geom_objects.h:563
StraightLine(const StraightLine &dummy)=delete
Broken copy constructor.
StraightLine(const Vector< Data * > &geom_data_pt)
Definition: geom_objects.h:458
~StraightLine()
Destructor: Clean up if necessary.
Definition: geom_objects.h:513
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
Definition: geom_objects.h:624
StraightLine(const double &height)
Constructor: Pass height (pinned by default)
Definition: geom_objects.h:486
bool Must_clean_up
Do I need to clean up?
Definition: geom_objects.h:627
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:525
virtual void d2position(const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:590
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
Definition: geom_objects.h:610
Data * geom_data_pt(const unsigned &j)
Definition: geom_objects.h:617
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
Definition: geom_objects.h:575
void operator=(const StraightLine &)=delete
Broken assignment operator.
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Definition: geom_objects.h:536
Definition: timesteppers.h:231
virtual void assign_initial_values_impulsive(Data *const &data_pt)=0
RealScalar s
Definition: level1_cplx_impl.h:130
const Scalar * a
Definition: level2_cplx_impl.h:32
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
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
double Y_c
... OR THESE...
Definition: heated_linear_solid_contact_with_gravity.cc:2846
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2