extra_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// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 //LIC//
8 //LIC// This library is free software; you can redistribute it and/or
9 //LIC// modify it under the terms of the GNU Lesser General Public
10 //LIC// License as published by the Free Software Foundation; either
11 //LIC// version 2.1 of the License, or (at your option) any later version.
12 //LIC//
13 //LIC// This library is distributed in the hope that it will be useful,
14 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 //LIC// Lesser General Public License for more details.
17 //LIC//
18 //LIC// You should have received a copy of the GNU Lesser General Public
19 //LIC// License along with this library; if not, write to the Free Software
20 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 //LIC// 02110-1301 USA.
22 //LIC//
23 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 //LIC//
25 //LIC//====================================================================
26 // Extra elements for the ST problem
27 
28 // C++ includes
29 #include <iostream>
30 #include <fstream>
31 #include <cmath>
32 #include <typeinfo>
33 #include <algorithm>
34 #include <cstdio>
35 #include <complex>
36 #include <set>
37 
38 // The oomphlib headers
39 #include "generic.h"
40 #include "navier_stokes.h"
41 
42 using namespace oomph;
43 
44 //=======================================================================
46 //=======================================================================
47 class FixSpineHeightElement : public virtual SpineElement<PointElement>
48 {
49 private:
50 
52  double *Height_pt;
53 
56  int Ptraded_local_eqn;
57 
59  Data *Ptraded_data_pt;
60 
61 
62  protected:
63 
65  void shape(const Vector<double> &s, Shape &psi) const {psi[0] = 1.0;}
66 
69  void dshape_local(const Vector<double> &s, Shape &psi,
70  DShape &dpsids) const
71  {
72  psi[0] = 1.0;
73  dpsids(0,0) = 0.0;
74  }
75 
76 
77 public:
78 
81  FixSpineHeightElement(SpineNode* const &spine_node_pt) :
83  {
84  // Initialise pointer to prescribed spine height
85  Height_pt=0;
86  // Initialise pointer to "traded" pressure Data.
87  Ptraded_data_pt=0;
88  //Add the node to the element's node pointer
89  //this->set_n_node(1);
90  node_pt(0) = spine_node_pt;
91  //Add the node's spine to the element
92  }
93 
95  double*& height_pt() {return Height_pt;}
96 
98  unsigned dim() const {return 0;}
99 
101  unsigned required_ndim() const {return 1;}
102 
104  unsigned nnode_1d() const {return 1;}
105 
108 
111  DenseMatrix<double> &jacobian);
112 
116 
120  void set_traded_pressure_data(Data* traded_pressure_data_pt)
121  {
122 #ifdef PARANOID
123  if (traded_pressure_data_pt->nvalue()!=1)
124  {
125  std::ostringstream error_stream;
126  error_stream
127  << "Traded pressure Data must only contain a single value!\n"
128  << "This one contains " << traded_pressure_data_pt->nvalue()<< "\n";
129 
130  throw OomphLibError(error_stream.str(),
133  }
134 #endif
135  // Store pointer explicitly
136  Ptraded_data_pt=traded_pressure_data_pt;
137  // Add to the element's external data so it gets included
138  // in the black-box local equation numbering scheme
139  add_external_data(traded_pressure_data_pt);
140  }
141 
143  void output(std::ostream &outfile) { }
144 
146  void output(std::ostream &outfile, const unsigned &Np) { }
147 
149  //unsigned self_test() {return GeneralisedElement::self_test();}
150 };
151 
152 //==========================================================================
154 //==========================================================================
157 {
158 #ifdef PARANOID
159  if (Height_pt==0)
160  {
161  throw OomphLibError(
162  "Please set the pointer to the prescribed height",
165  }
166 #endif
167 
168  //Integer for the local equation number
169  int local_eqn = Ptraded_local_eqn;
170 
171  //Set up the contribution to the global conservation equation,
172  //if we have a degree of freedom to trade for it
173  if(local_eqn >= 0)
174  {
175  residuals[local_eqn] =
176  static_cast<SpineNode*>(node_pt(0))->spine_pt()->height() - *Height_pt;
177  }
178 }
179 
180 //=========================================================================
183 //=========================================================================
186  DenseMatrix<double> &jacobian)
187 {
188  //Get the residuals
190 
191  //Call the generic finite difference routine to handle the spine variables
192  //contributions
193  fill_in_jacobian_from_geometric_data(jacobian);
194 }
195 
196 //==========================================================================
199 //==========================================================================
201 {
202  //If there is no "traded" pressure data assigned, set
203  //Ptraded_local_equation to -1
204  if(Ptraded_data_pt==0)
205  {
206  Ptraded_local_eqn = -1;
207  }
208  //Otherwise, copy its local equation number across from the generic
209  //equation numbering scheme -- here we're relying on the fact that
210  //the relevant external Data item only stores a single value.
211  else
212  {
213 #ifdef PARANOID
214  if (external_data_pt(0)->nvalue()!=1)
215  {
216  std::cout<< "The external Data item that stores the traded pressure in "
217  << std::endl;
218  std::cout<<"SpineVolumeConstraintPointElement should only have a single"<<std::endl;
219  std::cout<<"value but is has "
220  << external_data_pt(0)->nvalue()
221  << std::endl;
222  exit(1);//assert(false);
223  }
224 #endif
225  Ptraded_local_eqn = external_local_eqn(0,0);
226  }
227 
228  //Local equation numbering for the single spine is done automatically
229  //in the underlying SpineElement.
230 
231 }
232 
233 
234 
235 //======================================================================
239 //=======================================================================
240 template <class ELEMENT>
242  public virtual SpineElement<FaceGeometry<ELEMENT> >,
243  public virtual FaceElement
244 {
246  unsigned Dim;
247 
249  double *ReInvFr_pt;
250 
252  Vector<double> *G_pt;
253 
256  double *Viscosity_Ratio_pt;
257 
260  double *Density_Ratio_pt;
261 
262 protected:
263 
266  DenseMatrix<int> U_local_eqn;
267 
270  DenseMatrix<int> External_u_local_eqn;
271 
274  Vector<unsigned> External_node;
275 
276 //BEGIN, bit fo rconsidering Ca as an unknown
277 
281 
284 
285 // Pointer to the BOnd number. This is neccesary because in the equations
286 // the bond number always appears as ReSt
287  double* bond_pt;
288 
289 // Return the equation number corresponding to 1ovCa (which is the fixing of the flow rate)
291 {
292  return external_local_eqn(External_data_number_of_invca,0);
293 
294 }
295 //END, bit fo rconsidering Ca as an unknown
296 
297 
298 public:
299 
300 
304  int face_index) :
305  SpineElement<FaceGeometry<ELEMENT> >(), FaceElement()
306  {
307 
308  //Attach the geometrical information to the element. N.B. This function
309  //also assigns nbulk_data from the required_nvalue of the bulk element
310  element_pt->build_face_element(face_index,this);
311  //Set the dimension from the dimension of the first node
312  Dim = node_pt(0)->ndim();
313 
314  //Initializa pointer
315  invca_data_pt = 0;
316 
317  //Set the Physical values from the bulk elemenet
318  ELEMENT* cast_element_pt = dynamic_cast<ELEMENT*>(element_pt);
319  this->ReInvFr_pt = cast_element_pt->re_invfr_pt();
320  this->G_pt = cast_element_pt->g_pt();
321  this->Viscosity_Ratio_pt = cast_element_pt->viscosity_ratio_pt();
322  this->Density_Ratio_pt = cast_element_pt->density_ratio_pt();
323 
324 
325  //Hijack the nodes in the bulk element in the axial coordinate
326  unsigned n_node = this->nnode();
327 
328  for(unsigned m=0;m<n_node;m++)
329  {
330  delete cast_element_pt->hijack_nodal_value(bulk_node_number(m),1);
331  }
332 
333  //The other nodes of the bulk element must be external data, because
334  //they can affect the derivatives that are used in this element
335  //Loop over the nodes of the parent element
336  unsigned n_node_parent = cast_element_pt->nnode();
337  for(unsigned n=0;n<n_node_parent;n++)
338  {
339  bool external=true;
340  //Loop over the face nodes
341  for(unsigned m=0;m<n_node;m++)
342  {
343  //If the parent's node is one of the face nodes continue
344  if(n == this->bulk_node_number(m)) {external=false;}
345  }
346 
347  //If it's external data add it
348  if(external)
349  {
350  this->add_external_data(cast_element_pt->node_pt(n));
351  External_node.push_back(n);
352  }
353  }
354 
355  //Now add the spines of the bulk elemnt as external data, which
356  //we will finite difference
357 
358  //Set of unique geometric data that is used to update the bulk,
359  //but is not used to update the face
360  std::set<Data*> unique_additional_geom_data;
361  //Get all the geometric data for this (bulk) element
362  cast_element_pt->assemble_set_of_all_geometric_data(
363  unique_additional_geom_data);
364 
365  //Now assemble the set of geometric data for the face element
366  std::set<Data*> unique_face_geom_data_pt;
367  this->assemble_set_of_all_geometric_data(unique_face_geom_data_pt);
368  //Erase the face geometric data from the additional data
369  for(std::set<Data*>::iterator it=unique_face_geom_data_pt.begin();
370  it!=unique_face_geom_data_pt.end();++it)
371  {unique_additional_geom_data.erase(*it);}
372 
373  //Finally add all unique additional data as geometric data
374  /*for(std::set<Data*>::iterator it = unique_additional_geom_data.begin();
375  it!= unique_additional_geom_data.end();++it)
376  {
377  this->add_external_data(*it);
378  }*/
379  this->identify_geometric_data(unique_additional_geom_data);
380  }
381 
382 
383  //Overload the function Node Update
384  //so that it all the nodes of the parent element are updated.
385  void node_update()
386  {
387  this->bulk_element_pt()->node_update();
388  }
389 
390 
392  unsigned nexternal_u_data() {return External_node.size();}
393 
396  const double &viscosity_ratio() const {return *Viscosity_Ratio_pt;}
397 
399  double* &viscosity_ratio_pt() {return Viscosity_Ratio_pt;}
400 
403  const double &density_ratio() const {return *Density_Ratio_pt;}
404 
406  double* &density_ratio_pt() {return Density_Ratio_pt;}
407 
409  double* &re_invfr_pt() {return ReInvFr_pt;}
410 
412  const double &re_invfr() const {return *ReInvFr_pt;}
413 
415  const Vector<double> &g() const {return *G_pt;}
416 
418  Vector<double>* &g_pt() {return G_pt;}
419 
421  double flow()
422  {
423  //Storage for the normal flux
424  double flux = 0.0;
425 
426  //Set the value of n_intpt
427  const unsigned n_intpt = integral_pt()->nweight();
428 
429  //Set the Vector to hold local coordinates
430  Vector<double> s(Dim-1);
431 
432  //Set the Vector to hold the local coordinates of the parent element
433  Vector<double> s_parent(Dim);
434 
435  //Get a pointer to the parent element
436  ELEMENT* bulk_el_pt = dynamic_cast<ELEMENT*>(bulk_element_pt());
437 
438  //Loop over the integration points
439  for(unsigned ipt=0;ipt<n_intpt;ipt++)
440  {
441  //Assign values of s and s_parent
442  for(unsigned i=0;i<(Dim-1);i++) {s[i] = integral_pt()->knot(ipt,i);}
443 
444  //Get the local coordinate in the bulk
445  this->get_local_coordinate_in_bulk(s,s_parent);
446 
447  //Get the integral weight
448  double w = integral_pt()->weight(ipt);
449 
450  //Get the local jacobian for the FaceElement
451  double J = J_eulerian(s);
452 
453  //Premultiply the weights and the Jacobian
454  double W = w*J;
455 
456  //Get the velocity from the parent
457  Vector<double> interpolated_u(Dim,0.0);
458  bulk_el_pt->interpolated_u_nst(s_parent,interpolated_u);
459 
460  //Get the outer unit normal
462  outer_unit_normal(s,normal);
463 
464  //Find the normal flux
465  double normal_flux = 0.0;
466  for(unsigned i=0;i<Dim;i++) {normal_flux += interpolated_u[i]*normal[i];}
467 
468  //Add to the flux
469  flux += normal_flux*W;
470 
471  } //End of loop over integration points
472  //Return the flux
473  return flux;
474  }
475 
477  double u(const unsigned &l,const unsigned &i)
478  {return this->nodal_value(l,i);}
479 
482  double u(const unsigned &t, const unsigned &l,
483  const unsigned &i) const
484  {return this->nodal_value(t,l,i);}
485 
487  double du_dt(const unsigned &l, const unsigned &i) const
488  {
489  // Get the data's timestepper
490  TimeStepper* time_stepper_pt=node_pt(l)->time_stepper_pt(); // cgj: previously Node_pt[l] -- but (interpreting as FiniteElement::Node_pt as clang does) this is private!
491 
492  // Number of timsteps (past & present)
493  unsigned n_time = time_stepper_pt->ntstorage();
494 
495  double dudt=0.0;
496 
497  //Loop over the timesteps
498  if (time_stepper_pt->type()!="Steady")
499  {
500  for(unsigned t=0;t<n_time;t++)
501  {
502  dudt+=time_stepper_pt->weight(1,t)*u(t,l,i);
503  }
504  }
505 
506  return dudt;
507  }
508 
511  {
512  //Create a dummy matrix
513  DenseMatrix<double> dummy(1);
514  //Call the generic residuals function with flag set to 0
515  add_generic_residual_contribution(residuals,dummy,0);
516  }
517 
520  DenseMatrix<double> &jacobian)
521  {
522  //Call the generic routine with the flag set to 1
523  add_generic_residual_contribution(residuals,jacobian,1);
524  //Add the external data
525  this->fill_in_jacobian_from_external_by_fd(jacobian);
526  //Add the spine contributions
527  this->fill_in_jacobian_from_geometric_data(jacobian);
528  }
529 
530 
531  //----------------------------------------------------------------------
534  //----------------------------------------------------------------------
536  DenseMatrix<double> &jacobian,
537  unsigned flag)
538  {
539  //Find out how many nodes there are
540  unsigned n_node = nnode();
541 
542  //Set the value of n_intpt
543  unsigned n_intpt = integral_pt()->nweight();
544 
545  //Set the Vector to hold local coordinates
546  Vector<double> s(Dim-1);
547 
548  //Set the Vector to hold the local coordinates of the parent element
549  Vector<double> s_parent(Dim);
550 
551  //Get a pointer to the parent element
552  ELEMENT* bulk_el_pt = dynamic_cast<ELEMENT*>(bulk_element_pt());
553 
554  //Find the number of nodes in the parent element
555  unsigned n_node_parent = bulk_el_pt->nnode();
556  //Set up memory for shape functions and their derivatives
557  Shape psif_parent(n_node_parent), testf_parent(n_node_parent);
558  DShape dpsifdx_parent(n_node_parent,Dim),
559  dtestfdx_parent(n_node_parent,Dim);
560 
561  //Storage for the local equation number
562  int local_eqn=0, local_unknown=0;
563 
564  //Get the Physical Variable
565  double ReInvFr = re_invfr()*density_ratio();
566  double Viscosity_Ratio = viscosity_ratio();
567  Vector<double> G = g();
568 
569 
570  unsigned n_external = this->nexternal_u_data();
571 
572  //Loop over the integration points
573  for(unsigned ipt=0;ipt<n_intpt;ipt++)
574  {
575  //Assign values of s and s_parent
576  for(unsigned i=0;i<(Dim-1);i++) {s[i] = integral_pt()->knot(ipt,i);}
577 
578  //Get the local coordinate in the bulk
579  this->get_local_coordinate_in_bulk(s,s_parent);
580 
581  //Get the integral weight
582  double w = integral_pt()->weight(ipt);
583 
584  //Find the shape functions and derivatives of the parent
585  (void)bulk_el_pt->
586  dshape_eulerian(s_parent,psif_parent,dpsifdx_parent);
587 
588  //Get the local jacobian for the FaceElement
589  double J = J_eulerian(s);
590 
591  //Premultiply the weights and the Jacobian
592  double W = w*J;
593 
594  //Need only to find the velocity derivatives
595  DenseMatrix<double> interpolated_dudx(Dim,Dim,0.0);
596 
597  Vector<double> interpolated_u(Dim,0.0);
598 
599  //Calculate velocities and derivatives
600  for(unsigned l=0;l<n_node_parent;l++)
601  {
602  //Loop over velocity components
603  for(unsigned i=0;i<Dim;i++)
604  {
605  for(unsigned j=0;j<Dim;j++)
606  {
607  interpolated_dudx(i,j) +=
608  bulk_el_pt->u_nst(l,i)*dpsifdx_parent(l,j);
609  }
610  dtestfdx_parent(l,i) = dpsifdx_parent(l,i);
611  interpolated_u[i] += bulk_el_pt->u_nst(l,i)*psif_parent(l);
612  }
613  //Set the test functions to be the same as the shape functions
614  testf_parent[l] = psif_parent[l];
615  }
616 
617  //Storage for the outer unit normal
619  outer_unit_normal(s,normal);
620 
621  //Loop over the test functions
622  for(unsigned l=0;l<n_node;l++)
623  {
624  //Do the first (axial) velocity component -- Poisson equation
625  {
626  unsigned i=1;
627 
628  local_eqn = U_local_eqn(l,i);
629  /*IF it's not a boundary condition*/
630  if(local_eqn >= 0)
631  {
632  //Add the gravitational body force term
633  residuals[local_eqn] +=
634  ReInvFr*testf_parent[bulk_node_number(l)]*G[i]*W;
635 
636  //Add in the equation term (equation constant traction in the axial direction d(Tyy+p)/dy =0)
637  residuals[local_eqn] -= Viscosity_Ratio*W* (
638  ( interpolated_dudx(i,0) /*+ interpolated_dudx(0,i)*/ )
639  *dtestfdx_parent(bulk_node_number(l),0) +
640  ( interpolated_dudx(i,2) /*+ interpolated_dudx(2,i) */)
641  *dtestfdx_parent(bulk_node_number(l),2) );
642 
643  //Now add the jacobian terms
644  if(flag)
645  {
646 
647  //Loop over all nodes again
648  for(unsigned l2=0;l2<n_node;l2++)
649  {
650 
651  /* {
652  unsigned i2=0;
653  local_unknown = U_local_eqn(l2,i2);
654  if(local_unknown >= 0)
655  {
656  jacobian(local_eqn,local_unknown) -=
657  Viscosity_Ratio*(dpsifdx_parent(bulk_node_number(l2),i)*
658  dtestfdx_parent(bulk_node_number(l),0))*W;
659  }
660  } */
661 
662  //Poisson equation term
663  {
664  unsigned i2=1;
665  local_unknown = U_local_eqn(l2,i2);
666  if(local_unknown >= 0)
667  {
668  jacobian(local_eqn,local_unknown) -=
669  Viscosity_Ratio*(dpsifdx_parent(bulk_node_number(l2),0)*
670  dtestfdx_parent(bulk_node_number(l),0) +
671  dpsifdx_parent(bulk_node_number(l2),2)*
672  dtestfdx_parent(bulk_node_number(l),2) )*W;
673  }
674  }
675 
676  /* {
677  unsigned i2=2;
678  local_unknown = U_local_eqn(l2,i2);
679  if(local_unknown >= 0)
680  {
681  jacobian(local_eqn,local_unknown) -=
682  Viscosity_Ratio*(dpsifdx_parent(bulk_node_number(l2),i)*
683  dtestfdx_parent(bulk_node_number(l),2))*W;
684  }
685  }*/
686 
687 
688  }
689 
690  //Loop over external data
691  for(unsigned l2=0;l2<n_external;l2++)
692  {
693  /* {
694  unsigned i2=0;
695  local_unknown = External_u_local_eqn(l2,i2);
696  if(local_unknown >= 0)
697  {
698  jacobian(local_eqn,local_unknown) -=
699  Viscosity_Ratio*(dpsifdx_parent(External_node[l2],i)*
700  dtestfdx_parent(bulk_node_number(l),0))*W;
701  }
702  }*/
703 
704  //Poisson equation term
705  {
706  unsigned i2=1;
707  local_unknown = External_u_local_eqn(l2,i2);
708  if(local_unknown >= 0)
709  {
710  jacobian(local_eqn,local_unknown) -=
711  Viscosity_Ratio*(dpsifdx_parent(External_node[l2],0)*
712  dtestfdx_parent(bulk_node_number(l),0) +
713  dpsifdx_parent(External_node[l2],2)*
714  dtestfdx_parent(bulk_node_number(l),2) )*W;
715  }
716  }
717 
718  /*{
719  unsigned i2=2;
720  local_unknown = External_u_local_eqn(l2,i2);
721  if(local_unknown >= 0)
722  {
723  jacobian(local_eqn,local_unknown) -=
724  Viscosity_Ratio*(dpsifdx_parent(External_node[l2],i)*
725  dtestfdx_parent(bulk_node_number(l),2))*W;
726  }
727  }*/
728  }
729  } //End of if flag
730  }
731 
732  }
733 
734  //Now do the other (traction) components
735  /* for(unsigned i =0;i<3;i+=2)
736  {
737  local_eqn = U_local_eqn(l,i);
738  //If it's not a boundary condition
739  if(local_eqn >= 0)
740  {
741  for(unsigned k=0;k<Dim;k++)
742  {
743  residuals[local_eqn] += Viscosity_Ratio*
744  (interpolated_dudx(i,k) + interpolated_dudx(k,i))*normal[k]
745  *testf_parent(bulk_node_number(l))*W;
746  }
747 
748  //Now add the jacobian terms
749  if(flag)
750  {
751  //Loop over all nodes again
752  for(unsigned l2=0;l2<n_node;l2++)
753  {
754  for(unsigned i2=0;i2<Dim;i2++)
755  {
756  if(i2!=i)
757  {
758  // unsigned i2=0;
759  local_unknown = U_local_eqn(l2,i2);
760  if(local_unknown >= 0)
761  {
762  jacobian(local_eqn,local_unknown) +=
763  Viscosity_Ratio*dpsifdx_parent(bulk_node_number(l2),i)*
764  normal[i2]*testf_parent(bulk_node_number(l))*W;
765  }
766  }
767  else
768  {
769  // unsigned i2=1;
770  local_unknown = U_local_eqn(l2,i2);
771  if(local_unknown >= 0)
772  {
773  for(unsigned k=0;k<Dim;k++)
774  {
775  jacobian(local_eqn,local_unknown) +=
776  Viscosity_Ratio*dpsifdx_parent(bulk_node_number(l2),k)*
777  normal[k]*testf_parent(bulk_node_number(l))*W;
778  }
779 
780  jacobian(local_eqn,local_unknown) +=
781  Viscosity_Ratio*dpsifdx_parent(bulk_node_number(l2),i)*
782  normal[i2]*testf_parent(bulk_node_number(l))*W;
783  }
784  }
785  }
786  }
787 
788 
789  //Loop over all external data
790  for(unsigned l2=0;l2<n_external;l2++)
791  {
792  for(unsigned i2=0;i2<Dim;i2++)
793  {
794  if (i2!=i)
795  {
796  //unsigned i2=0;
797  local_unknown = External_u_local_eqn(l2,i2);
798  if(local_unknown >= 0)
799  {
800  jacobian(local_eqn,local_unknown) +=
801  Viscosity_Ratio*dpsifdx_parent(External_node[l2],i)*
802  normal[i2]*testf_parent(bulk_node_number(l))*W;
803  }
804  }
805  else
806  {
807  //unsigned i2=1;
808  local_unknown = External_u_local_eqn(l2,i2);
809  if(local_unknown >= 0)
810  {
811  for(unsigned k=0;k<Dim;k++)
812  {
813  jacobian(local_eqn,local_unknown) +=
814  Viscosity_Ratio*dpsifdx_parent(External_node[l2],k)*
815  normal[k]*testf_parent(bulk_node_number(l))*W;
816  }
817 
818  jacobian(local_eqn,local_unknown) +=
819  Viscosity_Ratio*dpsifdx_parent(External_node[l2],i)*
820  normal[i2]*testf_parent(bulk_node_number(l))*W;
821  }
822  }
823  }
824  }
825  }
826  }
827  } */
828  }
829  }
830 
831  }
832 
833 
836  {
837  //Get number of nodes
838  unsigned n_node = nnode();
839  //Resize the equation counters
840  U_local_eqn.resize(n_node,Dim);
841 
842  //Loop over the nodes
843  for(unsigned i=0;i<n_node;i++)
844  {
845  //Loop over the nodal values
846  for(unsigned j=0;j<Dim;j++)
847  {
848  U_local_eqn(i,j) = this->nodal_local_eqn(i,j);
849  }
850  }
851 
852  //Now sort out the external degrees of freedom
853  //Find the number of external degrees of freedom
854  //ACHTUNG !!!!!!
855 // unsigned n_external = nexternal_data();
856  unsigned n_external = External_node.size();
857 
858  //Resize the external degree of freedom counter
859  External_u_local_eqn.resize(n_external,Dim);
860  //Loop over the external degrees of freedom
861  for(unsigned e=0;e<n_external;e++)
862  {
863  //Loop over the velocity values
864  for(unsigned i=0;i<Dim;i++)
865  {
866  External_u_local_eqn(e,i) = external_local_eqn(e,i);
867  }
868  }
869  }
870 
872  void output(std::ostream &outfile) { }
873 
875 void output(std::ostream &outfile, const unsigned &Np)
876  {
878  }
879 
880 };
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Point element that is used to set the bubble pressure.
Definition: elastic_bretherton.cc:994
void assign_additional_local_eqn_numbers()
void output(std::ostream &outfile, const unsigned &Np)
Output function: x,y,[z],u,v,[w],p in tecplot format.
Definition: extra_elements.h:146
void shape(const Vector< double > &s, Shape &psi) const
Calculate the geometric shape functions at local coordinate s.
Definition: extra_elements.h:65
unsigned dim() const
Return the spatial (Eulerian) dimension of the element.
Definition: extra_elements.h:98
FixSpineHeightElement(SpineNode *const &spine_node_pt)
Definition: extra_elements.h:81
double *& height_pt()
Access function to the prescribed spine height.
Definition: extra_elements.h:95
unsigned required_ndim() const
Return the spatial dimension of local node n.
Definition: extra_elements.h:101
void output(std::ostream &outfile)
Overload the output function.
Definition: extra_elements.h:143
unsigned nnode_1d() const
Return the 'linear order' = number of nodal points along the edge.
Definition: extra_elements.h:104
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the residuals and the jacobian.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the residuals.
void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Definition: extra_elements.h:69
void set_traded_pressure_data(Data *traded_pressure_data_pt)
Definition: extra_elements.h:120
Definition: elastic_bretherton.cc:344
void node_update()
Definition: extra_elements.h:385
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the jacobian.
Definition: extra_elements.h:519
Data * invca_data_pt
Pointer to the Data item that stores the capillary number.
Definition: extra_elements.h:283
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
Definition: extra_elements.h:399
int invca_local_eqn()
Definition: extra_elements.h:290
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
Definition: extra_elements.h:418
SpineGravityTractionElement(FiniteElement *element_pt, int face_index)
Definition: extra_elements.h:303
double u(const unsigned &t, const unsigned &l, const unsigned &i) const
Definition: extra_elements.h:482
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the contribution to the residuals.
Definition: extra_elements.h:510
double *& re_invfr_pt()
Pointer to Reynolds number divided by Froude number.
Definition: extra_elements.h:409
void output(std::ostream &outfile, const unsigned &Np)
Output function: x,y,[z],u,v,[w],p in tecplot format.
Definition: extra_elements.h:875
const double & viscosity_ratio() const
Definition: extra_elements.h:396
const Vector< double > & g() const
Vector of gravitational components.
Definition: extra_elements.h:415
unsigned External_data_number_of_invca
Definition: extra_elements.h:280
const double & density_ratio() const
Definition: extra_elements.h:403
void add_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: extra_elements.h:535
const double & re_invfr() const
Return the value of the Re/Fr number.
Definition: extra_elements.h:412
unsigned nexternal_u_data()
Return the number of external velocity data.
Definition: extra_elements.h:392
double du_dt(const unsigned &l, const unsigned &i) const
i-th component of du/dt at local node l.
Definition: extra_elements.h:487
double u(const unsigned &l, const unsigned &i)
Access function for the velocity. N. B. HEAVY ASSUMPTIONS HERE.
Definition: extra_elements.h:477
void output(std::ostream &outfile)
Overload the output function.
Definition: extra_elements.h:872
double flow()
Calculate the flow across the element.
Definition: extra_elements.h:421
double * bond_pt
Definition: extra_elements.h:287
double *& density_ratio_pt()
Pointer to Density ratio.
Definition: extra_elements.h:406
void assign_additional_local_eqn_numbers()
Define the local equation numbering schemes.
Definition: extra_elements.h:835
Definition: shape.h:278
Definition: nodes.h:86
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
void resize(const unsigned long &n)
Definition: matrices.h:498
Definition: elements.h:4338
Definition: elements.h:4998
Definition: elements.h:1313
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
Definition: oomph_definitions.h:222
Definition: elements.h:3439
Definition: shape.h:76
Definition: spines.h:477
Definition: spines.h:328
Definition: timesteppers.h:231
unsigned ntstorage() const
Definition: timesteppers.h:601
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
std::string type() const
Definition: timesteppers.h:490
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
double ReInvFr
Product of Rynolds number and inverse of Froude number.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:67
double Viscosity_Ratio
Definition: elastic_two_layer_interface_axisym.cc:76
static const unsigned Dim
Problem dimension.
Definition: two_d_tilted_square.cc:62
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
void output(std::ostream &outfile)
Output with default number of plot points.
Definition: gen_axisym_advection_diffusion_elements.h:161
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: gen_axisym_advection_diffusion_elements.h:522
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2