AxisymOscillatingDisk Class Reference
+ Inheritance diagram for AxisymOscillatingDisk:

Public Member Functions

 AxisymOscillatingDisk (const double &ampl, const double &nu, TimeStepper *time_stepper_pt)
 
 ~AxisymOscillatingDisk ()
 Destructor (empty) More...
 
void position (const Vector< double > &xi, Vector< double > &r) const
 
void veloc (const Vector< double > &xi, Vector< double > &veloc)
 Parametrised velocity on object at current time: veloc = d r(xi)/dt. More...
 
void accel (const Vector< double > &xi, Vector< double > &accel)
 
void dposition_dt (const Vector< double > &xi, const unsigned &j, Vector< double > &drdt)
 
- 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 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 (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
 

Static Public Member Functions

static void residual_for_dispersion (const Vector< double > &param, const Vector< double > &omega, Vector< double > &residual)
 

Private Attributes

double Ampl
 Amplitude of oscillation. More...
 
double T
 Period of oscillation. More...
 
double Nu
 Poisson ratio nu. More...
 
double Omega
 Eigenfrequency. More...
 

Additional Inherited Members

- 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

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Axisymmetrially oscillating disk with displacement field according to linear elasticity.

Constructor & Destructor Documentation

◆ AxisymOscillatingDisk()

AxisymOscillatingDisk::AxisymOscillatingDisk ( const double ampl,
const double nu,
TimeStepper time_stepper_pt 
)

Constructor: 2 Lagrangian coordinate, 2 Eulerian coords. Pass amplitude of oscillation, Poisson ratio nu, and pointer to global timestepper.

Constructor: 2 Lagrangian coordinates, 2 Eulerian coords. Pass amplitude of oscillation, Poisson ratio nu, and pointer to global timestepper.

175  :
176  GeomObject(2,2,time_stepper_pt), Ampl(ampl), Nu(nu)
177 {
178  // Parameters for dispersion relation
179  Vector<double> param(1);
180  param[0]=Nu;
181 
182  // Initial guess for eigenfrequency
184  omega[0]=2.0;
185 
186  // Find eigenfrequency from black box Newton solver
188  param,omega);
189 
190  // Assign eigenfrequency
191  Omega=omega[0];
192 
193  // Assign/doc period of oscillation
195 
196  std::cout << "Period of oscillation: " << T << std::endl;
197 
198 }
double Ampl
Amplitude of oscillation.
Definition: disk_oscillation.cc:152
double Omega
Eigenfrequency.
Definition: disk_oscillation.cc:161
double Nu
Poisson ratio nu.
Definition: disk_oscillation.cc:158
static void residual_for_dispersion(const Vector< double > &param, const Vector< double > &omega, Vector< double > &residual)
Definition: disk_oscillation.cc:323
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
GeomObject()
Default constructor.
Definition: geom_objects.h:104
double Pi
Definition: two_d_biharmonic.cc:235
Vector::Scalar omega(const Vector &t, const Vector &s, RealScalar angle)
Definition: IDRS.h:36
void black_box_fd_newton_solve(ResidualFctPt residual_fct, const Vector< double > &params, Vector< double > &unknowns, JacobianFctPt jacobian_fct)
Definition: black_box_newton_solver.cc:67

References oomph::BlackBoxFDNewtonSolver::black_box_fd_newton_solve(), Nu, Eigen::internal::omega(), Omega, BiharmonicTestFunctions2::Pi, and residual_for_dispersion().

◆ ~AxisymOscillatingDisk()

AxisymOscillatingDisk::~AxisymOscillatingDisk ( )
inline

Destructor (empty)

96 {}

Member Function Documentation

◆ accel()

void AxisymOscillatingDisk::accel ( const Vector< double > &  xi,
Vector< double > &  accel 
)

Parametrised acceleration on object at current time: accel = d^2 r(xi)/dt^2.

285 {
286  // Parameter values at present time
287  double time=Geom_object_time_stepper_pt->time_pt()->time();
288 
289  // Radius in Lagrangian coordinates
290  double lagr_radius=sqrt(pow(xi[0],2)+pow(xi[1],2));
291 
292 
293  if (lagr_radius<1.0e-12)
294  {
295  // Veloc vector
296  accel[0]=0.0;
297  accel[1]=0.0;
298  }
299  else
300  {
301  // Bessel fcts J_0(x), J_1(x), Y_0(x), Y_1(x) and their derivatives
302  double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
303  CRBond_Bessel::bessjy01a(Omega*lagr_radius,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
304 
305  // Deriv of displacement field
306  double udotdot=-pow(2.0*MathematicalConstants::Pi/T,2)*Ampl*j1*
307  sin(2.0*MathematicalConstants::Pi*time/T);
308 
309  // Veloc
310  accel[0]=(xi[0]/lagr_radius*udotdot);
311  accel[1]=(xi[1]/lagr_radius*udotdot);
312 
313  }
314 }
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
void accel(const Vector< double > &xi, Vector< double > &accel)
Definition: disk_oscillation.cc:283
TimeStepper * Geom_object_time_stepper_pt
Definition: geom_objects.h:435
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
int bessjy01a(double x, double &j0, double &j1, double &y0, double &y1, double &j0p, double &j1p, double &y0p, double &y1p)
Definition: crbond_bessel.cc:551
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625

References Ampl, CRBond_Bessel::bessjy01a(), oomph::GeomObject::Geom_object_time_stepper_pt, Omega, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::pow(), sin(), sqrt(), oomph::Time::time(), and oomph::TimeStepper::time_pt().

◆ dposition_dt()

void AxisymOscillatingDisk::dposition_dt ( const Vector< double > &  xi,
const unsigned j,
Vector< double > &  drdt 
)
inlinevirtual

Parametrised j-th time-derivative on object at current time: \( \frac{d^{j} r(\zeta)}{dt^j} \).

Reimplemented from oomph::GeomObject.

113  {
114  switch (j)
115  {
116  // Current position
117  case 0:
118  position(xi,drdt);
119  break;
120 
121  // Velocity:
122  case 1:
123  veloc(xi,drdt);
124  break;
125 
126  // Acceleration:
127  case 2:
128  accel(xi,drdt);
129  break;
130 
131  default:
132  std::ostringstream error_message;
133  error_message << j << "th derivative not implemented\n";
134 
135  throw OomphLibError(error_message.str(),
138  }
139  }
void veloc(const Vector< double > &xi, Vector< double > &veloc)
Parametrised velocity on object at current time: veloc = d r(xi)/dt.
Definition: disk_oscillation.cc:244
void position(const Vector< double > &xi, Vector< double > &r) const
Definition: disk_oscillation.cc:206
Definition: oomph_definitions.h:222
#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

References j, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ position()

void AxisymOscillatingDisk::position ( const Vector< double > &  xi,
Vector< double > &  r 
) const
virtual

Position vector at Lagrangian coordinate xi at present time

Position Vector at Lagrangian coordinate xi at present time

Implements oomph::GeomObject.

208 {
209  // Parameter values at present time
210  double time=Geom_object_time_stepper_pt->time_pt()->time();
211 
212  // Radius in Lagrangian coordinates
213  double lagr_radius=sqrt( pow(xi[0],2) + pow(xi[1],2) );
214 
215  if (lagr_radius<1.0e-12)
216  {
217  // Position Vector
218  r[0]=0.0;
219  r[1]=0.0;
220  }
221  else
222  {
223  // Bessel fcts J_0(x), J_1(x), Y_0(x), Y_1(x) and their derivatives
224  double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
225  CRBond_Bessel::bessjy01a(Omega*lagr_radius,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
226 
227  // Displacement field
228  double u=Ampl*j1*sin(2.0*MathematicalConstants::Pi*time/T);
229 
230  // Position Vector
231  r[0]=(xi[0]+xi[0]/lagr_radius*u);
232  r[1]=(xi[1]+xi[1]/lagr_radius*u);
233  }
234 
235 } //end position
r
Definition: UniformPSDSelfTest.py:20

References Ampl, CRBond_Bessel::bessjy01a(), oomph::GeomObject::Geom_object_time_stepper_pt, Omega, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::pow(), UniformPSDSelfTest::r, sin(), sqrt(), oomph::Time::time(), and oomph::TimeStepper::time_pt().

◆ residual_for_dispersion()

void AxisymOscillatingDisk::residual_for_dispersion ( const Vector< double > &  param,
const Vector< double > &  omega,
Vector< double > &  residual 
)
static

Residual of dispersion relation for use in black-box Newton method which requires global (or static) functions. Poisson's ratio is passed as parameter.

Residual of dispersion relation for use in black box Newton method which requires global (or static) functions. Poisson's ratio is passed as parameter.

326 {
327  // Extract parameters
328  double nu=param[0];
329 
330  // Argument of various Bessel functions
331  double arg=omega[0];
332 
333  // Bessel fcts J_0(x), J_1(x), Y_0(x), Y_1(x) and their derivatives
334  double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
335  CRBond_Bessel::bessjy01a(arg,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
336 
337  // Residual of dispersion relation
338  residual[0]=nu/(1.0-2.0*nu)*(j1+(j0-j1/omega[0])*omega[0])+
339  (j0-j1/omega[0])*omega[0];
340 
341 }

References CRBond_Bessel::bessjy01a(), and Eigen::internal::omega().

Referenced by AxisymOscillatingDisk().

◆ veloc()

void AxisymOscillatingDisk::veloc ( const Vector< double > &  xi,
Vector< double > &  veloc 
)

Parametrised velocity on object at current time: veloc = d r(xi)/dt.

Parametrised velocity on object at current time: veloc = d r(xi)/dt.

246 {
247  // Parameter values at present time
248  double time=Geom_object_time_stepper_pt->time_pt()->time();
249 
250  // Radius in Lagrangian coordinates
251  double lagr_radius=sqrt(pow(xi[0],2)+pow(xi[1],2));
252 
253  if (lagr_radius<1.0e-12)
254  {
255  // Veloc vector
256  veloc[0]=0.0;
257  veloc[1]=0.0;
258  }
259  else
260  {
261  // Bessel fcts J_0(x), J_1(x), Y_0(x), Y_1(x) and their derivatives
262  double j0,j1,y0,y1,j0p,j1p,y0p,y1p;
263  CRBond_Bessel::bessjy01a(Omega*lagr_radius,j0,j1,y0,y1,j0p,j1p,y0p,y1p);
264 
265  // Deriv of displacement field
266  double udot=2.0*MathematicalConstants::Pi/T*Ampl*j1*
267  cos(2.0*MathematicalConstants::Pi*time/T);
268 
269  // Veloc
270  veloc[0]=(xi[0]/lagr_radius*udot);
271  veloc[1]=(xi[1]/lagr_radius*udot);
272  }
273 }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136

References Ampl, CRBond_Bessel::bessjy01a(), cos(), oomph::GeomObject::Geom_object_time_stepper_pt, Omega, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::pow(), sqrt(), oomph::Time::time(), and oomph::TimeStepper::time_pt().

Member Data Documentation

◆ Ampl

double AxisymOscillatingDisk::Ampl
private

Amplitude of oscillation.

Referenced by accel(), position(), and veloc().

◆ Nu

double AxisymOscillatingDisk::Nu
private

Poisson ratio nu.

Referenced by AxisymOscillatingDisk().

◆ Omega

double AxisymOscillatingDisk::Omega
private

Eigenfrequency.

Referenced by accel(), AxisymOscillatingDisk(), position(), and veloc().

◆ T

double AxisymOscillatingDisk::T
private

Period of oscillation.


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