29 #ifndef OOMPH_WAVE_ELEMENTS_HEADER
30 #define OOMPH_WAVE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
38 #include "../generic/nodes.h"
39 #include "../generic/Qelements.h"
40 #include "../generic/oomph_utilities.h"
51 template<
unsigned DIM>
101 for (
unsigned t = 0;
t < n_time;
t++)
129 for (
unsigned t = 0;
t < n_time;
t++)
147 void output(std::ostream& outfile,
const unsigned& nplot);
159 void output(FILE* file_pt,
const unsigned& nplot);
163 const unsigned& nplot,
169 std::ostream& outfile,
170 const unsigned& nplot,
205 double& source)
const
215 (*Source_fct_pt)(
t, x, source);
224 unsigned n_node =
nnode();
231 DShape dpsidx(n_node, DIM);
237 for (
unsigned j = 0; j < DIM; j++)
243 for (
unsigned l = 0; l < n_node; l++)
246 for (
unsigned j = 0; j < DIM; j++)
248 flux[j] +=
nodal_value(l, u_nodal_index) * dpsidx(l, j);
277 unsigned n_node =
nnode();
289 double interpolated_u = 0.0;
292 for (
unsigned l = 0; l < n_node; l++)
294 interpolated_u +=
nodal_value(l, u_nodal_index) * psi[l];
297 return (interpolated_u);
305 unsigned n_node =
nnode();
314 double interpolated_du_dt = 0.0;
317 for (
unsigned l = 0; l < n_node; l++)
322 return (interpolated_du_dt);
329 unsigned n_node =
nnode();
338 double interpolated_d2u_dt2 = 0.0;
341 for (
unsigned l = 0; l < n_node; l++)
346 return (interpolated_d2u_dt2);
362 DShape& dtestdx)
const = 0;
371 DShape& dtestdx)
const = 0;
397 template<
unsigned DIM,
unsigned NNODE_1D>
437 void output(std::ostream& outfile,
const unsigned& n_plot)
451 void output(FILE* file_pt,
const unsigned& n_plot)
460 const unsigned& n_plot,
471 const unsigned& n_plot,
476 outfile, n_plot, time, exact_soln_pt);
509 template<
unsigned DIM,
unsigned NNODE_1D>
518 double J = this->dshape_eulerian(
s, psi, dpsidx);
522 for (
unsigned i = 0;
i < NNODE_1D;
i++)
525 for (
unsigned j = 0; j < DIM; j++)
527 dtestdx(
i, j) = dpsidx(
i, j);
541 template<
unsigned DIM,
unsigned NNODE_1D>
550 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
573 template<
unsigned DIM,
unsigned NNODE_1D>
575 :
public virtual QElement<DIM - 1, NNODE_1D>
591 template<
unsigned NNODE_1D>
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
unsigned nnode() const
Return the number of nodes.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
A class for all isoparametric elements that solve the LinearWave equations.
LinearWaveEquations(const LinearWaveEquations &dummy)=delete
Broken copy constructor.
void get_source_lin_wave(const double &t, const unsigned &ipt, const Vector< double > &x, double &source) const
Get source term at continous time t and (Eulerian) position x. Virtual so it can be overloaded in der...
double du_dt_lin_wave(const unsigned &n) const
du/dt at local node n. Uses suitably interpolated value for hanging nodes.
unsigned self_test()
Self-test: Return 0 for OK.
void operator=(const LinearWaveEquations &)=delete
Broken assignment operator.
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: flux[i] = du/dx_i.
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,u_exact or x,y,z,u_exact at nplot^DIM plot points.
LinearWaveEquations()
Constructor (must initialise the Source_fct_pt to null)
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute element residual Vector and element Jacobian matrix (wrapper)
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute element residual Vector (wrapper)
virtual double dshape_and_dtest_eulerian_lin_wave(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Shape/test functions and derivs w.r.t. to global coords at local coord. s; return Jacobian of mapping...
LinearWaveSourceFctPt source_fct_pt() const
Access function: Pointer to source function. Const version.
double interpolated_du_dt_lin_wave(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
void output(FILE *file_pt)
Output with default number of plot points.
virtual double dshape_and_dtest_eulerian_at_knot_lin_wave(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
double interpolated_d2u_dt2_lin_wave(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
void(* LinearWaveSourceFctPt)(const double &time, const Vector< double > &x, double &u)
Function pointer to source function fct(x,f(x)) – x is a Vector!
virtual unsigned u_index_lin_wave() const
Return the index at which the unknown value is stored. The default value, 0, is appropriate for singl...
LinearWaveSourceFctPt Source_fct_pt
Pointer to source function:
double interpolated_u_lin_wave(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
double d2u_dt2_lin_wave(const unsigned &n) const
d^2u/dt^2 at local node n. Uses suitably interpolated value for hanging nodes.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
void output(std::ostream &outfile)
Output with default number of plot points.
virtual void fill_in_generic_residual_contribution_lin_wave(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Compute element residual Vector only (if flag=and/or element Jacobian matrix.
LinearWaveSourceFctPt & source_fct_pt()
Access function: Pointer to source function.
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: x,y,u or x,y,z,u at n_plot^DIM plot points.
void output(FILE *file_pt, const unsigned &n_plot)
Output function: x,y,u or x,y,z,u at n_plot^DIM plot points.
unsigned required_nvalue(const unsigned &n) const
Required # of ‘values’ (pinned or dofs) at node n.
double dshape_and_dtest_eulerian_at_knot_lin_wave(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. at integration point ipt....
double dshape_and_dtest_eulerian_lin_wave(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. Return Jacobian.
void output(FILE *file_pt)
Output function: x,y,u or x,y,z,u.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at nodes: Initial_Nvalue[n].
QLinearWaveElement()
Constructor: Call constructors for QElement and LinearWave equations.
QLinearWaveElement(const QLinearWaveElement< DIM, NNODE_1D > &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
void operator=(const QLinearWaveElement< DIM, NNODE_1D > &)=delete
Broken assignment operator.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: x,y,u_exact or x,y,z,u_exact at n_plot^DIM plot points.
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output function for a time-dependent exact solution. x,y,u_exact or x,y,z,u_exact at n_plot^DIM plot ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...