26 #ifndef OOMPH_BIHARMONIC_ELEMENTS_HEADER
27 #define OOMPH_BIHARMONIC_ELEMENTS_HEADER
31 #include <oomph-lib-config.h>
44 #include "../generic/matrices.h"
45 #include "../generic/elements.h"
46 #include "../generic/hermite_elements.h"
54 template<
unsigned DIM>
70 virtual double u(
const unsigned& n,
const unsigned& k)
const = 0;
87 (*Source_fct_pt)(x, source);
113 void output(std::ostream& outfile,
const unsigned& nplot)
123 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
128 for (
unsigned i = 0;
i < DIM;
i++)
154 void output(FILE* file_pt,
const unsigned& n_plot)
171 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
176 for (
unsigned i = 0;
i < DIM;
i++)
184 outfile << dudx[1] <<
" " << -dudx[0] << std::endl;
196 unsigned n_node = this->
nnode();
202 Shape psi(n_node, n_value);
203 DShape dpsidx(n_node, n_value, DIM);
214 for (
unsigned n = 0; n < n_node; n++)
216 for (
unsigned k = 0; k < n_value; k++)
218 for (
unsigned d = 0; d < DIM; d++)
220 dudx[d] += this->
node_pt(n)->
value(k) * dpsidx(n, k, d);
229 const unsigned& nplot,
246 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
255 (*exact_soln_pt)(x, exact_soln);
258 for (
unsigned i = 0;
i < DIM;
i++)
260 outfile << x[
i] <<
" ";
262 outfile << exact_soln[0] << std::endl;
274 const unsigned& nplot,
299 unsigned n_node = this->
nnode();
316 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
319 for (
unsigned i = 0;
i < DIM;
i++)
340 (*exact_soln_pt)(x, exact_soln);
343 for (
unsigned i = 0;
i < DIM;
i++)
345 outfile << x[
i] <<
" ";
347 outfile << exact_soln[0] <<
" " << fabs(exact_soln[0] - u_fe)
351 norm += exact_soln[0] * exact_soln[0] *
W;
352 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) *
W;
378 unsigned n_node = this->
nnode();
384 Shape psi(n_node, n_value);
390 for (
unsigned n = 0; n < n_node; n++)
392 for (
unsigned k = 0; k < n_value; k++)
394 uu +=
u(n, k) * psi(n, k);
448 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
451 int n_node = this->
nnode();
457 std::pair<unsigned long, unsigned> dof_lookup;
460 for (
int n = 0; n < n_node; n++)
463 for (
int k = 0; k < n_value; k++)
473 dof_lookup.first = this->
eqn_number(local_eqn_number);
474 dof_lookup.second = k;
475 dof_lookup_list.push_front(dof_lookup);
517 template<
unsigned DIM>
524 template<
unsigned DIM>
530 inline double u(
const unsigned& n,
const unsigned& k)
const
559 void output(std::ostream& outfile,
const unsigned& n_plot)
571 void output(FILE* file_pt,
const unsigned& n_plot)
579 const unsigned& nplot,
588 const unsigned& nplot,
603 outfile, exact_soln_pt, error, norm);
614 outfile, exact_soln_pt, time, error, norm);
void output(std::ostream &outfile)
Output.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Call the equations-class overloaded unsteady error calculation.
unsigned required_nvalue(const unsigned &n) const
Required # of ‘values’ (pinned or dofs) at node n.
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
analytic solution wrapper
void output(FILE *file_pt)
C-style output.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
computes error
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
void output_fct(std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Final override.
double u(const unsigned &n, const unsigned &k) const
access function for value, kth dof of node n
void output(std::ostream &outfile, const unsigned &n_plot)
output wrapper
BiharmonicElement()
Constructor: Call constructors for QElement and Poisson equations.
Biharmonic Equation Class - contains the equations.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
wrapper function, adds contribution to residual
void output_fluid_velocity(std::ostream &outfile, const unsigned &nplot)
output fluid velocity field
SourceFctPt Source_fct_pt
Pointer to source function:
void output(std::ostream &outfile)
Output at default number of plot points.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Plot the error when compared against a given time-dependent exact solution . Also calculates the norm...
virtual void get_source(const unsigned &ipt, const Vector< double > &x, double &source) const
gets source strength
BiharmonicEquations()
Constructor (must initialise the Source_fct_pt to null)
static const unsigned d2_dof[]
unsigned self_test()
self test wrapper
void output_fct(std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given time and at a given number of plot po...
virtual void fill_in_generic_residual_contribution_biharmonic(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned JFLAG)
Compute element residual Vector only (if JFLAG=and/or element Jacobian matrix.
void output(std::ostream &outfile, const unsigned &nplot)
output with nplot points
void interpolated_dudx(const Vector< double > &s, Vector< double > &dudx)
output with nplot points
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
computes the error
void output(FILE *file_pt)
C-style output.
void(* SourceFctPt)(const Vector< double > &x, double &u)
source function type definition
void fill_in_contribution_to_jacobian(Vector< double > &residual, DenseMatrix< double > &jacobian)
wrapper function, adds contribution to residual and generic
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into (for block pre...
double interpolated_u_biharmonic(const Vector< double > &s)
calculates interpolated u at s
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
output analytic solution
SourceFctPt & source_fct_pt()
Access functions for the source function pointer.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
unsigned get_d2_dof()
return number of second derivate degrees of freedom
virtual double u(const unsigned &n, const unsigned &k) const =0
Access function: Nodal function value at local node n Uses suitably interpolated value for hanging no...
Vector< int > Local_eqn
Array to hold local eqn numbers: Local_eqn[n] (=-1 for BC)
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
SourceFctPt source_fct_pt() const
Access functions for the source function pointers (const version)
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
A general Finite Element class.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0,...
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...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
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...
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...