33 #ifndef OOMPH_WAVE_ELEMENTS_HEADER 34 #define OOMPH_WAVE_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 42 #include "../generic/nodes.h" 43 #include "../generic/Qelements.h" 44 #include "../generic/oomph_utilities.h" 59 template <
unsigned DIM>
111 const unsigned n_time = time_stepper_pt->
ntstorage();
114 for(
unsigned t=0;
t<n_time;
t++)
138 const unsigned n_time = time_stepper_pt->
ntstorage();
141 for(
unsigned t=0;
t<n_time;
t++)
158 void output(std::ostream &outfile,
const unsigned &nplot);
170 void output(FILE* file_pt,
const unsigned &nplot);
173 void output_fct(std::ostream &outfile,
const unsigned &nplot,
180 void output_fct(std::ostream &outfile,
const unsigned &nplot,
189 double& error,
double& norm);
195 const double& time,
double& error,
double& norm);
209 double& source)
const 216 (*Source_fct_pt)(
t,x,source);
225 unsigned n_node =
nnode();
232 DShape dpsidx(n_node,DIM);
238 for(
unsigned j=0;j<DIM;j++) {flux[j] = 0.0;}
241 for(
unsigned l=0;l<n_node;l++)
244 for(
unsigned j=0;j<DIM;j++)
246 flux[j] +=
nodal_value(l,u_nodal_index)*dpsidx(l,j);
275 unsigned n_node =
nnode();
287 double interpolated_u = 0.0;
290 for(
unsigned l=0;l<n_node;l++)
292 interpolated_u +=
nodal_value(l,u_nodal_index)*psi[l];
295 return(interpolated_u);
303 unsigned n_node =
nnode();
312 double interpolated_du_dt = 0.0;
315 for(
unsigned l=0;l<n_node;l++)
320 return(interpolated_du_dt);
327 unsigned n_node =
nnode();
336 double interpolated_d2u_dt2 = 0.0;
339 for(
unsigned l=0;l<n_node;l++)
344 return(interpolated_d2u_dt2);
404 template <
unsigned DIM,
unsigned NNODE_1D>
413 static const unsigned Initial_Nvalue[];
439 {
return Initial_Nvalue[n];}
448 void output(std::ostream &outfile,
const unsigned &n_plot)
458 void output(FILE* file_pt,
const unsigned &n_plot)
464 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
474 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
511 template<
unsigned DIM,
unsigned NNODE_1D>
524 for(
unsigned i=0;
i<NNODE_1D;
i++)
527 for(
unsigned j=0;j<DIM;j++)
529 dtestdx(
i,j) = dpsidx(
i,j);
543 template<
unsigned DIM,
unsigned NNODE_1D>
577 template<
unsigned DIM,
unsigned NNODE_1D>
597 template<
unsigned NNODE_1D>
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()
Access function: Pointer to source function.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement. ...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
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.
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
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.
QLinearWaveElement()
Constructor: Call constructors for QElement and LinearWave equations.
unsigned required_nvalue(const unsigned &n) const
Required # of `values' (pinned or dofs) at node n.
LinearWaveSourceFctPt source_fct_pt() const
Access function: Pointer to source function. Const version.
A general Finite Element class.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
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...
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:
void output(FILE *file_pt)
Output function: x,y,u or x,y,z,u.
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.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: flux[i] = du/dx_i.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement. ...
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...
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. Return Jacobian.
QLinearWaveElement(const QLinearWaveElement< DIM, NNODE_1D > &dummy)
Broken copy constructor.
void output(std::ostream &outfile)
Output with default number of plot points.
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 fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute element residual Vector and element Jacobian matrix (wrapper)
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
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 ...
void operator=(const LinearWaveEquations &)
Broken assignment operator.
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.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void(* LinearWaveSourceFctPt)(const double &time, const Vector< double > &x, double &u)
Function pointer to source function fct(x,f(x)) – x is a Vector!
unsigned self_test()
Self-test: Return 0 for OK.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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 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...
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 operator=(const QLinearWaveElement< DIM, NNODE_1D > &)
Broken assignment operator.
double interpolated_u_lin_wave(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
LinearWaveEquations()
Constructor (must initialise the Source_fct_pt to null)
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
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 ...
LinearWaveEquations(const LinearWaveEquations &dummy)
Broken copy constructor.
double interpolated_d2u_dt2_lin_wave(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
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 function: x,y,u or x,y,z,u.
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute element residual Vector (wrapper)
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...
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.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
double du_dt_lin_wave(const unsigned &n) const
du/dt at local node n. Uses suitably interpolated value for hanging nodes.