65 (*exact_soln_pt)(x,exact_soln);
87 for (
unsigned j=0; j<3; j++)
89 r[j]=spine_base[j]+exact_soln[0]*spine[j];
131 for (
unsigned j=0; j<3; j++)
133 r[j]=spine_base[j]+u*spine[j];
149 unsigned n_node =
nnode();
153 DShape dpsidzeta(n_node,2);
162 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
182 for(
unsigned l=0;l<n_node;l++)
184 interpolated_u +=
u(l)*psi(l);
186 for(
unsigned j=0;j<2;j++)
189 interpolated_dudzeta[j] +=
u(l)*dpsidzeta(l,j);
200 double nonlinearterm=1.0;
242 for (
unsigned j=0; j<2; j++)
244 sqnorm += interpolated_dudzeta[j]*interpolated_dudzeta[j];
246 nonlinearterm=1.0/sqrt(1.0+sqnorm);
255 get_spine(interpolated_zeta, spine, dspine);
258 for (
unsigned alpha=0;alpha<2;alpha++)
263 spine,dudzeta_times_spine);
271 d_u_times_spine_dzeta);
274 vector_sum(d_u_times_spine_dzeta,dspine_base[alpha],dRdzeta[alpha]);
288 dRdzeta[1], v_tmp_2);
289 vector_sum(v_tmp_1,v_tmp_2,area_variation_numerator_0);
295 dRdzeta[0], v_tmp_2);
296 vector_sum(v_tmp_1,v_tmp_2,area_variation_numerator_1);
299 for (
unsigned j=0; j<3; j++)
301 r[j]=spine_base[j]+interpolated_u*spine[j];
311 for(
unsigned l=0;l<n_node;l++)
327 for(
unsigned k=0;k<2;k++)
329 residuals[local_eqn] += nonlinearterm*
330 interpolated_dudzeta[k]*dpsidzeta(l,k)*
W;
349 residuals[local_eqn] +=
360 residuals[local_eqn] +=
409 const unsigned &nplot)
421 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
429 for(
unsigned i=0;
i<2;
i++)
450 for(
unsigned i=0;
i<3;
i++)
452 outfile << r[
i] <<
" ";
471 for(
unsigned i=0;
i<3;
i++)
473 outfile << spine_base[
i] <<
" ";
477 for(
unsigned i=0;
i<3;
i++)
479 outfile << spine[
i] <<
" ";
484 for(
unsigned i=0;
i<2;
i++)
486 outfile << xx[
i] <<
" ";
495 outfile << std::endl;
512 const unsigned &nplot,
530 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
544 for(
unsigned i=0;
i<3;
i++)
546 outfile << r_exact[
i] <<
" ";
550 outfile << std::endl;
569 double& error,
double& norm)
586 outfile <<
"ZONE" << std::endl;
592 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
596 for(
unsigned i=0;
i<2;
i++)
619 for(
unsigned i=0;
i<2;
i++)
621 outfile << r[
i] <<
" ";
624 for(
unsigned i=0;
i<2;
i++)
626 outfile << r_exact[
i] <<
" ";
629 outfile << std::endl;
633 for(
unsigned i=0;
i<2;
i++)
635 error+=(r[
i]-r_exact[
i])*(r[
i]-r_exact[
i])*
W;
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 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 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-...
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK...
unsigned self_test()
Self-test: Return 0 for OK.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
const unsigned Initial_Nvalue[16]
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void get_spine(const Vector< double > &x, Vector< double > &spine, Vector< Vector< double > > &dspine) const
Get spine vector field: Defaults to standard cartesian representation if no spine base fct pointers h...
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.
static void allocate_vector_of_vectors(unsigned n_rows, unsigned n_cols, Vector< Vector< double > > &v)
Helper fct: Allocate storage for a vector of vectors of doubles to v(n_rows,n_cols) and initialise ea...
void output(std::ostream &outfile)
Output with default number of plot points.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln at n_plot^2 plot points.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
static void scalar_times_vector(const double &lambda, const Vector< double > &v, Vector< double > &lambda_times_v)
Multiply a vector by a scalar.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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"...
static void cross_product(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &v_cross)
Cross-product: v_cross= v1 x v2.
static double scalar_product(const Vector< double > &v1, const Vector< double > &v2)
Scalar product between two vectors.
virtual double u(const unsigned &n) const
static void vector_sum(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &vs)
Vectorial sum of two vectors.
double interpolated_u(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
bool use_spines() const
Use spines or not? (Based on availability of function pointers to to spine and spine base vector fiel...
double get_kappa() const
Get curvature.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual int u_local_eqn(const unsigned &n)
Get the local equation number of the (one and only) unknown stored at local node n (returns -1 if val...
static double two_norm(const Vector< double > &v)
2-norm of a vector
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector.
void exact_position(const Vector< double > &s, Vector< double > &r, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Get exact position vector to meniscus at local coordinate s.
virtual void get_spine_base(const Vector< double > &x, Vector< double > &spine_base, Vector< Vector< double > > &dspine_base) const
Get spine base vector field: Defaults to standard cartesian representation if no spine base fct point...
unsigned nnode() const
Return the number of nodes.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
void position(const Vector< double > &s, Vector< double > &r) const
Get position vector to meniscus at local coordinate s.