30 #ifndef OOMPH_BIHARMONIC_ELEMENTS_HEADER 31 #define OOMPH_BIHARMONIC_ELEMENTS_HEADER 35 #include <oomph-lib-config.h> 48 #include "../generic/matrices.h" 49 #include "../generic/elements.h" 50 #include "../generic/hermite_elements.h" 60 template <
unsigned DIM>
79 virtual double u(
const unsigned& n,
const unsigned& k)
const =0;
90 else { (*Source_fct_pt)(x,source); }
115 void output(std::ostream &outfile,
const unsigned &nplot)
126 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
132 for(
unsigned i=0;
i<DIM;
i++)
154 void output(FILE* file_pt,
const unsigned &n_plot)
170 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;
198 unsigned n_node = this->
nnode();
204 Shape psi(n_node,n_value);
205 DShape dpsidx(n_node,n_value,DIM);
216 for (
unsigned n = 0; n < n_node; n++)
218 for (
unsigned k = 0; k < n_value; k++)
220 for (
unsigned d = 0; d < DIM; d++)
250 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
260 (*exact_soln_pt)(x,exact_soln);
263 for(
unsigned i=0;
i<DIM;
i++)
265 outfile << x[
i] <<
" ";
267 outfile << exact_soln[0] << std::endl;
280 void output_fct(std::ostream &outfile,
const unsigned &nplot,
289 exact_soln_pt,
double& error,
double& norm)
303 unsigned n_node = this->
nnode();
320 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
324 for(
unsigned i=0;
i<DIM;
i++)
345 (*exact_soln_pt)(x,exact_soln);
348 for(
unsigned i=0;
i<DIM;
i++)
350 outfile << x[
i] <<
" ";
352 outfile << exact_soln[0] <<
" " << fabs(exact_soln[0]-u_fe)
356 norm+=exact_soln[0]*exact_soln[0]*
W;
357 error+=(exact_soln[0]-u_fe)*(exact_soln[0]-u_fe)*
W;
371 const double& time,
double& error,
double& norm)
381 unsigned n_node=this->
nnode();
387 Shape psi(n_node,n_value);
393 for (
unsigned n = 0; n < n_node; n++)
395 for (
unsigned k = 0; k < n_value; k++)
397 uu +=
u(n,k)*psi(n,k);
416 if (passed) {
return 0; }
444 &dof_lookup_list)
const 448 int n_node = this->
nnode();
454 std::pair<unsigned long,unsigned> dof_lookup;
457 for (
int n = 0; n < n_node; n++)
461 for (
int k = 0; k < n_value; k++)
469 if (local_eqn_number >= 0)
473 dof_lookup.first = this->
eqn_number(local_eqn_number);
474 dof_lookup.second = k;
475 dof_lookup_list.push_front(dof_lookup);
530 template <
unsigned DIM>
539 inline double u(
const unsigned &n,
const unsigned &k)
const 566 void output(std::ostream &outfile,
const unsigned &n_plot)
574 void output(FILE* file_pt,
const unsigned &n_plot)
586 void output_fct(std::ostream &outfile,
const unsigned &nplot,
595 exact_soln_pt,
double& error,
double& norm)
602 const double& time,
double& error,
double& norm)
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
analytic solution wrapper
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 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 void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
unsigned self_test()
self test wrapper
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.
SourceFctPt Source_fct_pt
Pointer to source function:
double interpolated_u_biharmonic(const Vector< double > &s)
calculates interpolated u at s
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
virtual double u(const unsigned &n, const unsigned &k) const =0
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK...
double u(const unsigned &n, const unsigned &k) const
access function for value, kth dof of node n
SourceFctPt & source_fct_pt()
Access functions for the source function pointer.
A general Finite Element class.
void output(std::ostream &outfile, const unsigned &nplot)
output with nplot points
Vector< int > Local_eqn
Array to hold local eqn numbers: Local_eqn[n] (=-1 for BC)
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
void output_fluid_velocity(std::ostream &outfile, const unsigned &nplot)
output fluid velocity field
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
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...
void(* SourceFctPt)(const Vector< double > &x, double &u)
source function type definition
void output(FILE *file_pt)
C-style output.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
unsigned get_d2_dof()
return number of second derivate degrees of freedom
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
computes error
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
computes the error
void fill_in_contribution_to_residuals(Vector< double > &residuals)
wrapper function, adds contribution to residual
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
output analytic solution
unsigned required_nvalue(const unsigned &n) const
Required # of `values' (pinned or dofs) at node n.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
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...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into (for block pre...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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...
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"...
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
void output(FILE *file_pt)
C-style output.
BiharmonicEquations()
Constructor (must initialise the Source_fct_pt to null)
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.
BiharmonicElement()
Constructor: Call constructors for QElement and Poisson equations.
void output(std::ostream &outfile)
Output.
void output(std::ostream &outfile)
Output at default number of plot points.
void output_fct(std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Final override.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
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...
static const unsigned d2_dof[]
void fill_in_contribution_to_jacobian(Vector< double > &residual, DenseMatrix< double > &jacobian)
wrapper function, adds contribution to residual and generic
void interpolated_dudx(const Vector< double > &s, Vector< double > &dudx)
output with nplot points
SourceFctPt source_fct_pt() const
Access functions for the source function pointers (const version)
Biharmonic Equation Class - contains the equations.
virtual void get_source(const unsigned &ipt, const Vector< double > &x, double &source) const
gets source strength
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number...
unsigned nnode() const
Return the number of nodes.
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
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 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 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.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
void output(std::ostream &outfile, const unsigned &n_plot)
output wrapper
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...