linear_wave_elements.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Header file for LinearWave elements
31 
32 
33 #ifndef OOMPH_WAVE_ELEMENTS_HEADER
34 #define OOMPH_WAVE_ELEMENTS_HEADER
35 
36 // Config header generated by autoconfig
37 #ifdef HAVE_CONFIG_H
38 #include <oomph-lib-config.h>
39 #endif
40 
41 //OOMPH-LIB headers
42 #include "../generic/nodes.h"
43 #include "../generic/Qelements.h"
44 #include "../generic/oomph_utilities.h"
45 
46 namespace oomph
47 {
48 
49 //=============================================================
50 /// A class for all isoparametric elements that solve the
51 /// LinearWave equations.
52 /// \f[
53 /// \frac{\partial^2 u}{\partial x_i^2}=
54 /// \frac{\partial^2 u}{\partial t^2}+f(t,x_j)
55 /// \f]
56 /// This contains the generic maths. Shape functions, geometric
57 /// mapping etc. must get implemented in derived class.
58 //=============================================================
59 template <unsigned DIM>
60 class LinearWaveEquations : public virtual FiniteElement
61 {
62 
63  public:
64 
65  /// \short Function pointer to source function fct(x,f(x)) --
66  /// x is a Vector!
67  typedef void (*LinearWaveSourceFctPt)(const double& time,
68  const Vector<double>& x,
69  double& u);
70 
71  /// Constructor (must initialise the Source_fct_pt to null)
73 
74  /// Broken copy constructor
76  {
77  BrokenCopy::broken_copy("LinearWaveEquations");
78  }
79 
80  /// Broken assignment operator
82  {
83  BrokenCopy::broken_assign("LinearWaveEquations");
84  }
85 
86  /// \short Return the index at which the unknown value
87  /// is stored. The default value, 0, is appropriate for single-physics
88  /// problems, when there is only one variable, the value that satisfies the
89  /// linear wave equation.
90  /// In derived multi-physics elements, this function should be overloaded
91  /// to reflect the chosen storage scheme. Note that these equations require
92  /// that the unknown is always stored at the same index at each node.
93  virtual inline unsigned u_index_lin_wave() const {return 0;}
94 
95  /// \short du/dt at local node n.
96  /// Uses suitably interpolated value for hanging nodes.
97  double du_dt_lin_wave(const unsigned &n) const
98  {
99  // Get the data's timestepper
101 
102  //Initialise d^2u/dt^2
103  double dudt=0.0;
104  //Loop over the timesteps, if there is a non steady timestepper
105  if (!time_stepper_pt->is_steady())
106  {
107  // Find the index at which the linear wave unknown is stored
108  const unsigned u_nodal_index = u_index_lin_wave();
109 
110  // Number of timsteps (past & present)
111  const unsigned n_time = time_stepper_pt->ntstorage();
112 
113  //Add the contributions to the derivative
114  for(unsigned t=0;t<n_time;t++)
115  {
116  dudt+=time_stepper_pt->weight(1,t)*nodal_value(t,n,u_nodal_index);
117  }
118  }
119  return dudt;
120  }
121 
122  /// \short d^2u/dt^2 at local node n.
123  /// Uses suitably interpolated value for hanging nodes.
124  double d2u_dt2_lin_wave(const unsigned &n) const
125  {
126  // Get the data's timestepper
128 
129  //Initialise d^2u/dt^2
130  double ddudt=0.0;
131  //Loop over the timesteps, if there is a non steady timestepper
132  if (!time_stepper_pt->is_steady())
133  {
134  // Find the index at which the linear wave unknown is stored
135  const unsigned u_nodal_index = u_index_lin_wave();
136 
137  // Number of timsteps (past & present)
138  const unsigned n_time = time_stepper_pt->ntstorage();
139 
140  //Add the contributions to the derivative
141  for(unsigned t=0;t<n_time;t++)
142  {
143  ddudt+=time_stepper_pt->weight(2,t)*nodal_value(t,n,u_nodal_index);
144  }
145  }
146  return ddudt;
147  }
148 
149  /// Output with default number of plot points
150  void output(std::ostream &outfile)
151  {
152  unsigned nplot=5;
153  output(outfile,nplot);
154  }
155 
156  /// \short Output FE representation of soln: x,y,u or x,y,z,u at
157  /// n_plot^DIM plot points
158  void output(std::ostream &outfile, const unsigned &nplot);
159 
160 
161  /// Output with default number of plot points
162  void output(FILE* file_pt)
163  {
164  unsigned nplot=5;
165  output(file_pt,nplot);
166  }
167 
168  /// \short Output FE representation of soln: x,y,u or x,y,z,u at
169  /// n_plot^DIM plot points
170  void output(FILE* file_pt, const unsigned &nplot);
171 
172  /// Output exact soln: x,y,u_exact or x,y,z,u_exact at nplot^DIM plot points
173  void output_fct(std::ostream &outfile, const unsigned &nplot,
175  exact_soln_pt);
176 
177  /// \short Output exact soln: x,y,u_exact or x,y,z,u_exact at
178  /// nplot^DIM plot points (time-dependent version)
179  virtual
180  void output_fct(std::ostream &outfile, const unsigned &nplot,
181  const double& time,
183  exact_soln_pt);
184 
185  /// Get error against and norm of exact solution
186  void compute_error(std::ostream &outfile,
188  exact_soln_pt,
189  double& error, double& norm);
190 
191  /// Get error against and norm of exact solution
192  void compute_error(std::ostream &outfile,
194  exact_soln_pt,
195  const double& time, double& error, double& norm);
196 
197  /// Access function: Pointer to source function
199 
200  /// Access function: Pointer to source function. Const version
202 
203 
204  /// \short Get source term at continous time t and (Eulerian) position x.
205  /// Virtual so it can be overloaded in derived multiphysics elements.
206  inline void get_source_lin_wave(const double& t,
207  const unsigned& ipt,
208  const Vector<double>& x,
209  double& source) const
210  {
211  //If no source function has been set, return zero
212  if(Source_fct_pt==0) {source = 0.0;}
213  else
214  {
215  // Get source strength
216  (*Source_fct_pt)(t,x,source);
217  }
218  }
219 
220 
221  /// Get flux: flux[i] = du/dx_i
222  void get_flux(const Vector<double>& s, Vector<double>& flux) const
223  {
224  //Find out how many nodes there are in the element
225  unsigned n_node = nnode();
226 
227  // Find the index at which the linear wave unknown is stored
228  unsigned u_nodal_index = u_index_lin_wave();
229 
230  //Set up memory for the shape and test functions
231  Shape psi(n_node);
232  DShape dpsidx(n_node,DIM);
233 
234  //Call the derivatives of the shape and test functions
235  dshape_eulerian(s,psi,dpsidx);
236 
237  //Initialise to zero
238  for(unsigned j=0;j<DIM;j++) {flux[j] = 0.0;}
239 
240  // Loop over nodes
241  for(unsigned l=0;l<n_node;l++)
242  {
243  //Loop over derivative directions
244  for(unsigned j=0;j<DIM;j++)
245  {
246  flux[j] += nodal_value(l,u_nodal_index)*dpsidx(l,j);
247  }
248  }
249  }
250 
251 
252  /// Compute element residual Vector (wrapper)
254  {
255  //Call the generic residuals function with flag set to 0
256  //using the dummy matrix argument
259  }
260 
261 
262  /// Compute element residual Vector and element Jacobian matrix (wrapper)
264  DenseMatrix<double> &jacobian)
265  {
266  //Call the generic routine with the flag set to 1
268  }
269 
270 
271  /// Return FE representation of function value u(s) at local coordinate s
272  inline double interpolated_u_lin_wave(const Vector<double> &s) const
273  {
274  //Find number of nodes
275  unsigned n_node = nnode();
276 
277  // Find the index at which the linear wave unknown is stored
278  unsigned u_nodal_index = u_index_lin_wave();
279 
280  //Local shape function
281  Shape psi(n_node);
282 
283  //Find values of shape function
284  shape(s,psi);
285 
286  //Initialise value of u
287  double interpolated_u = 0.0;
288 
289  //Loop over the local nodes and sum
290  for(unsigned l=0;l<n_node;l++)
291  {
292  interpolated_u += nodal_value(l,u_nodal_index)*psi[l];
293  }
294 
295  return(interpolated_u);
296  }
297 
298 
299  /// Return FE representation of function value u(s) at local coordinate s
300  inline double interpolated_du_dt_lin_wave(const Vector<double> &s) const
301  {
302  //Find number of nodes
303  unsigned n_node = nnode();
304 
305  //Local shape function
306  Shape psi(n_node);
307 
308  //Find values of shape function
309  shape(s,psi);
310 
311  //Initialise value of u
312  double interpolated_du_dt = 0.0;
313 
314  //Loop over the local nodes and sum
315  for(unsigned l=0;l<n_node;l++)
316  {
317  interpolated_du_dt += du_dt_lin_wave(l)*psi[l];
318  }
319 
320  return(interpolated_du_dt);
321  }
322 
323  /// Return FE representation of function value u(s) at local coordinate s
324  inline double interpolated_d2u_dt2_lin_wave(const Vector<double> &s) const
325  {
326  //Find number of nodes
327  unsigned n_node = nnode();
328 
329  //Local shape function
330  Shape psi(n_node);
331 
332  //Find values of shape function
333  shape(s,psi);
334 
335  //Initialise value of u
336  double interpolated_d2u_dt2 = 0.0;
337 
338  //Loop over the local nodes and sum
339  for(unsigned l=0;l<n_node;l++)
340  {
341  interpolated_d2u_dt2 += d2u_dt2_lin_wave(l)*psi[l];
342  }
343 
344  return(interpolated_d2u_dt2);
345  }
346 
347 
348 
349  /// \short Self-test: Return 0 for OK
350  unsigned self_test();
351 
352 
353  protected:
354 
355  /// \short Shape/test functions and derivs w.r.t. to global coords at
356  /// local coord. s; return Jacobian of mapping
357  virtual double dshape_and_dtest_eulerian_lin_wave(const Vector<double> &s,
358  Shape &psi,
359  DShape &dpsidx,
360  Shape &test,
361  DShape &dtestdx) const=0;
362 
363  /// \short Shape/test functions and derivs w.r.t. to global coords at
364  /// integration point ipt; return Jacobian of mapping
366  const unsigned &ipt,
367  Shape &psi,
368  DShape &dpsidx,
369  Shape &test,
370  DShape &dtestdx)
371  const=0;
372 
373  /// \short Compute element residual Vector only (if flag=and/or element
374  /// Jacobian matrix
376  Vector<double> &residuals, DenseMatrix<double> &jacobian,
377  unsigned flag);
378 
379 
380  /// Pointer to source function:
382 
383 };
384 
385 
386 
387 
388 
389 
390 ///////////////////////////////////////////////////////////////////////////
391 ///////////////////////////////////////////////////////////////////////////
392 ///////////////////////////////////////////////////////////////////////////
393 
394 
395 
396 //======================================================================
397 /// QLinearWaveElement elements are linear/quadrilateral/brick-shaped
398 /// LinearWave elements with isoparametric interpolation for the function.
399 ///
400 /// Empty, just establishes the template parameters
401 ///
402 ///
403 //======================================================================
404 template <unsigned DIM, unsigned NNODE_1D>
405  class QLinearWaveElement : public virtual QElement<DIM,NNODE_1D>,
406  public virtual LinearWaveEquations<DIM>
407 {
408 
409  private:
410 
411  /// \short Static array of ints to hold number of variables at
412  /// nodes: Initial_Nvalue[n]
413  static const unsigned Initial_Nvalue[];
414 
415 
416  public:
417 
418  ///\short Constructor: Call constructors for QElement and
419  /// LinearWave equations
420  QLinearWaveElement() : QElement<DIM,NNODE_1D>(), LinearWaveEquations<DIM>()
421  { }
422 
423  /// Broken copy constructor
425  {
426  BrokenCopy::broken_copy("QLinearWaveElement");
427  }
428 
429 
430  /// Broken assignment operator
432  {
433  BrokenCopy::broken_assign("QLinearWaveElement");
434  }
435 
436  /// \short Required # of `values' (pinned or dofs)
437  /// at node n
438  inline unsigned required_nvalue(const unsigned &n) const
439  {return Initial_Nvalue[n];}
440 
441  /// \short Output function:
442  /// x,y,u or x,y,z,u
443  void output(std::ostream &outfile)
445 
446  /// \short Output function:
447  /// x,y,u or x,y,z,u at n_plot^DIM plot points
448  void output(std::ostream &outfile, const unsigned &n_plot)
449  {LinearWaveEquations<DIM>::output(outfile,n_plot);}
450 
451  /// \short Output function:
452  /// x,y,u or x,y,z,u
453  void output(FILE* file_pt)
455 
456  /// \short Output function:
457  /// x,y,u or x,y,z,u at n_plot^DIM plot points
458  void output(FILE* file_pt, const unsigned &n_plot)
459  {LinearWaveEquations<DIM>::output(file_pt,n_plot);}
460 
461 
462  /// \short Output function for an exact solution:
463  /// x,y,u_exact or x,y,z,u_exact at n_plot^DIM plot points
464  void output_fct(std::ostream &outfile, const unsigned &n_plot,
466  exact_soln_pt)
467  {LinearWaveEquations<DIM>::output_fct(outfile,n_plot,exact_soln_pt);}
468 
469 
470 
471  /// \short Output function for a time-dependent exact solution.
472  /// x,y,u_exact or x,y,z,u_exact at n_plot^DIM plot points
473  /// (Calls the steady version)
474  void output_fct(std::ostream &outfile, const unsigned &n_plot,
475  const double& time,
477  exact_soln_pt)
478  {LinearWaveEquations<DIM>::output_fct(outfile,n_plot,time,exact_soln_pt);}
479 
480 
481  protected:
482 
483 /// Shape, test functions & derivs. w.r.t. to global coords. Return Jacobian.
485  Shape &psi,
486  DShape &dpsidx,
487  Shape &test,
488  DShape &dtestdx) const;
489 
490 
491  /// \short Shape, test functions & derivs. w.r.t. to global coords. at
492  /// integration point ipt. Return Jacobian.
493  inline double dshape_and_dtest_eulerian_at_knot_lin_wave(const unsigned& ipt,
494  Shape &psi,
495  DShape &dpsidx,
496  Shape &test,
497  DShape &dtestdx)
498  const;
499 
500 };
501 
502 //Inline functions:
503 
504 
505 //======================================================================
506 /// Define the shape functions and test functions and derivatives
507 /// w.r.t. global coordinates and return Jacobian of mapping.
508 ///
509 /// Galerkin: Test functions = shape functions
510 //======================================================================
511 template<unsigned DIM,unsigned NNODE_1D>
514  Shape &psi,
515  DShape &dpsidx,
516  Shape &test,
517  DShape &dtestdx) const
518 {
519  //Call the geometrical shape functions and derivatives
520  double J = this->dshape_eulerian(s,psi,dpsidx);
521 
522  //Loop over the test functions and derivatives and set them equal to the
523  //shape functions
524  for(unsigned i=0;i<NNODE_1D;i++)
525  {
526  test[i] = psi[i];
527  for(unsigned j=0;j<DIM;j++)
528  {
529  dtestdx(i,j) = dpsidx(i,j);
530  }
531  }
532 
533  //Return the jacobian
534  return J;
535 }
536 
537 //======================================================================
538 /// Define the shape functions and test functions and derivatives
539 /// w.r.t. global coordinates and return Jacobian of mapping.
540 ///
541 /// Galerkin: Test functions = shape functions
542 //======================================================================
543 template<unsigned DIM, unsigned NNODE_1D>
546  const unsigned &ipt,
547  Shape &psi,
548  DShape &dpsidx,
549  Shape &test,
550  DShape &dtestdx) const
551 {
552  //Call the geometrical shape functions and derivatives
553  double J = this->dshape_eulerian_at_knot(ipt,psi,dpsidx);
554 
555  //Set the test functions equal to the shape functions
556  //(sets internal pointers)
557  test = psi;
558  dtestdx = dpsidx;
559 
560  //Return the jacobian
561  return J;
562 }
563 
564 
565 ////////////////////////////////////////////////////////////////////////
566 ////////////////////////////////////////////////////////////////////////
567 ////////////////////////////////////////////////////////////////////////
568 
569 
570 
571 //=======================================================================
572 /// Face geometry for the QLinearWaveElement elements: The spatial
573 /// dimension of the face elements is one lower than that of the
574 /// bulk element but they have the same number of points
575 /// along their 1D edges.
576 //=======================================================================
577 template<unsigned DIM, unsigned NNODE_1D>
578 class FaceGeometry<QLinearWaveElement<DIM,NNODE_1D> > : public virtual QElement<DIM-1,NNODE_1D>
579 {
580 
581  public:
582 
583  /// \short Constructor: Call the constructor for the
584  /// appropriate lower-dimensional QElement
585  FaceGeometry() : QElement<DIM-1,NNODE_1D>() {}
586 
587 };
588 
589 ////////////////////////////////////////////////////////////////////////
590 ////////////////////////////////////////////////////////////////////////
591 ////////////////////////////////////////////////////////////////////////
592 
593 
594 //=======================================================================
595 /// Face geometry for the 1D QLinearWaveElement elements: Point elements
596 //=======================================================================
597 template<unsigned NNODE_1D>
598 class FaceGeometry<QLinearWaveElement<1,NNODE_1D> >:
599  public virtual PointElement
600 {
601 
602  public:
603 
604  /// \short Constructor: Call the constructor for the
605  /// appropriate lower-dimensional QElement
607 
608 };
609 
610 }
611 
612 #endif
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-...
Definition: elements.cc:3254
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.
cstr elem_len * i
Definition: cfortran.h:607
QLinearWaveElement()
Constructor: Call constructors for QElement and LinearWave equations.
unsigned required_nvalue(const unsigned &n) const
Required # of `values&#39; (pinned or dofs) at node n.
LinearWaveSourceFctPt source_fct_pt() const
Access function: Pointer to source function. Const version.
A general Finite Element class.
Definition: elements.h:1274
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
Definition: elements.h:1729
char t
Definition: cfortran.h:572
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.
Definition: geom_objects.h:197
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 ...
Definition: elements.h:1723
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...
Definition: elements.cc:3227
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.
static char t char * s
Definition: cfortran.h:572
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.
Definition: elements.h:2109
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...
Definition: elements.h:2470
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)
Definition: timesteppers.h:562
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.
Definition: nodes.h:246
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...
Definition: timesteppers.h:375
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.
Definition: elements.h:2146
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:557
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...
Definition: elements.h:228
double du_dt_lin_wave(const unsigned &n) const
du/dt at local node n. Uses suitably interpolated value for hanging nodes.