37 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
40 1, 1, 1, 1, 1, 1, 1, 1, 1};
61 (*exact_soln_pt)(x, exact_soln);
83 for (
unsigned j = 0; j < 3; j++)
85 r[j] = spine_base[j] + exact_soln[0] * spine[j];
125 for (
unsigned j = 0; j < 3; j++)
127 r[j] = spine_base[j] +
u * spine[j];
140 unsigned n_node =
nnode();
144 DShape dpsidzeta(n_node, 2);
153 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
173 for (
unsigned l = 0; l < n_node; l++)
177 for (
unsigned j = 0; j < 2; j++)
180 interpolated_dudzeta[j] +=
u(l) * dpsidzeta(l, j);
190 double nonlinearterm = 1.0;
232 for (
unsigned j = 0; j < 2; j++)
234 sqnorm += interpolated_dudzeta[j] * interpolated_dudzeta[j];
236 nonlinearterm = 1.0 / sqrt(1.0 + sqnorm);
248 for (
unsigned alpha = 0; alpha < 2; alpha++)
253 interpolated_dudzeta[alpha], spine, dudzeta_times_spine);
261 dudzeta_times_spine, u_times_dspinedzeta, d_u_times_spine_dzeta);
264 vector_sum(d_u_times_spine_dzeta, dspine_base[alpha], dRdzeta[alpha]);
278 -1 *
scalar_product(dRdzeta[0], dRdzeta[1]), dRdzeta[1], v_tmp_2);
279 vector_sum(v_tmp_1, v_tmp_2, area_variation_numerator_0);
285 -1 *
scalar_product(dRdzeta[0], dRdzeta[1]), dRdzeta[0], v_tmp_2);
286 vector_sum(v_tmp_1, v_tmp_2, area_variation_numerator_1);
289 for (
unsigned j = 0; j < 3; j++)
300 for (
unsigned l = 0; l < n_node; l++)
312 residuals[local_eqn] +=
get_kappa() * psi(l) *
W;
315 for (
unsigned k = 0; k < 2; k++)
317 residuals[local_eqn] +=
318 nonlinearterm * interpolated_dudzeta[k] * dpsidzeta(l, k) *
W;
337 residuals[local_eqn] +=
348 residuals[local_eqn] +=
393 const unsigned& nplot)
403 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
410 for (
unsigned i = 0;
i < 2;
i++)
431 for (
unsigned i = 0;
i < 3;
i++)
433 outfile << r[
i] <<
" ";
452 for (
unsigned i = 0;
i < 3;
i++)
454 outfile << spine_base[
i] <<
" ";
458 for (
unsigned i = 0;
i < 3;
i++)
460 outfile << spine[
i] <<
" ";
465 for (
unsigned i = 0;
i < 2;
i++)
467 outfile << xx[
i] <<
" ";
475 outfile << std::endl;
490 std::ostream& outfile,
491 const unsigned& nplot,
508 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
521 for (
unsigned i = 0;
i < 3;
i++)
523 outfile << r_exact[
i] <<
" ";
527 outfile << std::endl;
543 std::ostream& outfile,
562 outfile <<
"ZONE" << std::endl;
568 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
571 for (
unsigned i = 0;
i < 2;
i++)
594 for (
unsigned i = 0;
i < 2;
i++)
596 outfile << r[
i] <<
" ";
599 for (
unsigned i = 0;
i < 2;
i++)
601 outfile << r_exact[
i] <<
" ";
604 outfile << std::endl;
608 for (
unsigned i = 0;
i < 2;
i++)
610 error += (r[
i] - r_exact[
i]) * (r[
i] - r_exact[
i]) *
W;
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
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 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-...
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...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned nnode() const
Return the number of nodes.
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 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 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"...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
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.
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
static double two_norm(const Vector< double > &v)
2-norm of a vector
static void scalar_times_vector(const double &lambda, const Vector< double > &v, Vector< double > &lambda_times_v)
Multiply a vector by a scalar.
static double scalar_product(const Vector< double > &v1, const Vector< double > &v2)
Scalar product between two vectors.
double interpolated_u(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
unsigned self_test()
Self-test: Return 0 for OK.
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...
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...
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln at n_plot^2 plot points.
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 with default number of plot points.
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.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector.
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...
virtual double u(const unsigned &n) const
Access function: Nodal function value at local node n Uses suitably interpolated value for hanging no...
double get_kappa() const
Get curvature.
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...
bool use_spines() const
Use spines or not? (Based on availability of function pointers to to spine and spine base vector fiel...
void position(const Vector< double > &s, Vector< double > &r) const
Get position vector to meniscus at local coordinate s.
static void cross_product(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &v_cross)
Cross-product: v_cross= v1 x v2.
static void vector_sum(const Vector< double > &v1, const Vector< double > &v2, Vector< double > &vs)
Vectorial sum of two vectors.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...