42 using namespace oomph;
56 int Ptraded_local_eqn;
59 Data *Ptraded_data_pt;
90 node_pt(0) = spine_node_pt;
98 unsigned dim()
const {
return 0;}
123 if (traded_pressure_data_pt->
nvalue()!=1)
125 std::ostringstream error_stream;
127 <<
"Traded pressure Data must only contain a single value!\n"
128 <<
"This one contains " << traded_pressure_data_pt->
nvalue()<<
"\n";
136 Ptraded_data_pt=traded_pressure_data_pt;
139 add_external_data(traded_pressure_data_pt);
146 void output(std::ostream &outfile,
const unsigned &Np) { }
162 "Please set the pointer to the prescribed height",
169 int local_eqn = Ptraded_local_eqn;
175 residuals[local_eqn] =
176 static_cast<SpineNode*
>(node_pt(0))->spine_pt()->height() - *Height_pt;
193 fill_in_jacobian_from_geometric_data(jacobian);
204 if(Ptraded_data_pt==0)
206 Ptraded_local_eqn = -1;
214 if (external_data_pt(0)->nvalue()!=1)
216 std::cout<<
"The external Data item that stores the traded pressure in "
218 std::cout<<
"SpineVolumeConstraintPointElement should only have a single"<<std::endl;
219 std::cout<<
"value but is has "
220 << external_data_pt(0)->nvalue()
225 Ptraded_local_eqn = external_local_eqn(0,0);
240 template <
class ELEMENT>
256 double *Viscosity_Ratio_pt;
260 double *Density_Ratio_pt;
292 return external_local_eqn(External_data_number_of_invca,0);
312 Dim = node_pt(0)->ndim();
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();
326 unsigned n_node = this->nnode();
328 for(
unsigned m=0;
m<n_node;
m++)
330 delete cast_element_pt->hijack_nodal_value(bulk_node_number(
m),1);
336 unsigned n_node_parent = cast_element_pt->nnode();
337 for(
unsigned n=0;
n<n_node_parent;
n++)
341 for(
unsigned m=0;
m<n_node;
m++)
344 if(
n == this->bulk_node_number(
m)) {external=
false;}
350 this->add_external_data(cast_element_pt->node_pt(
n));
351 External_node.push_back(
n);
360 std::set<Data*> unique_additional_geom_data;
362 cast_element_pt->assemble_set_of_all_geometric_data(
363 unique_additional_geom_data);
366 std::set<Data*> unique_face_geom_data_pt;
367 this->assemble_set_of_all_geometric_data(unique_face_geom_data_pt);
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);}
379 this->identify_geometric_data(unique_additional_geom_data);
387 this->bulk_element_pt()->node_update();
412 const double &
re_invfr()
const {
return *ReInvFr_pt;}
427 const unsigned n_intpt = integral_pt()->nweight();
436 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(bulk_element_pt());
439 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
442 for(
unsigned i=0;
i<(
Dim-1);
i++) {
s[
i] = integral_pt()->knot(ipt,
i);}
445 this->get_local_coordinate_in_bulk(
s,s_parent);
448 double w = integral_pt()->weight(ipt);
451 double J = J_eulerian(
s);
458 bulk_el_pt->interpolated_u_nst(s_parent,interpolated_u);
465 double normal_flux = 0.0;
466 for(
unsigned i=0;
i<
Dim;
i++) {normal_flux += interpolated_u[
i]*
normal[
i];}
469 flux += normal_flux*
W;
477 double u(
const unsigned &l,
const unsigned &
i)
478 {
return this->nodal_value(l,
i);}
482 double u(
const unsigned &
t,
const unsigned &l,
483 const unsigned &
i)
const
484 {
return this->nodal_value(
t,l,
i);}
487 double du_dt(
const unsigned &l,
const unsigned &
i)
const
490 TimeStepper* time_stepper_pt=node_pt(l)->time_stepper_pt();
493 unsigned n_time = time_stepper_pt->
ntstorage();
498 if (time_stepper_pt->
type()!=
"Steady")
500 for(
unsigned t=0;
t<n_time;
t++)
502 dudt+=time_stepper_pt->
weight(1,
t)*u(
t,l,
i);
515 add_generic_residual_contribution(residuals,dummy,0);
523 add_generic_residual_contribution(residuals,jacobian,1);
525 this->fill_in_jacobian_from_external_by_fd(jacobian);
527 this->fill_in_jacobian_from_geometric_data(jacobian);
540 unsigned n_node = nnode();
543 unsigned n_intpt = integral_pt()->nweight();
552 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(bulk_element_pt());
555 unsigned n_node_parent = bulk_el_pt->nnode();
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);
562 int local_eqn=0, local_unknown=0;
565 double ReInvFr = re_invfr()*density_ratio();
570 unsigned n_external = this->nexternal_u_data();
573 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
576 for(
unsigned i=0;
i<(
Dim-1);
i++) {
s[
i] = integral_pt()->knot(ipt,
i);}
579 this->get_local_coordinate_in_bulk(
s,s_parent);
582 double w = integral_pt()->weight(ipt);
586 dshape_eulerian(s_parent,psif_parent,dpsifdx_parent);
589 double J = J_eulerian(
s);
600 for(
unsigned l=0;l<n_node_parent;l++)
603 for(
unsigned i=0;
i<
Dim;
i++)
605 for(
unsigned j=0;
j<
Dim;
j++)
607 interpolated_dudx(
i,
j) +=
608 bulk_el_pt->u_nst(l,
i)*dpsifdx_parent(l,
j);
610 dtestfdx_parent(l,
i) = dpsifdx_parent(l,
i);
611 interpolated_u[
i] += bulk_el_pt->u_nst(l,
i)*psif_parent(l);
614 testf_parent[l] = psif_parent[l];
622 for(
unsigned l=0;l<n_node;l++)
628 local_eqn = U_local_eqn(l,
i);
633 residuals[local_eqn] +=
634 ReInvFr*testf_parent[bulk_node_number(l)]*
G[
i]*
W;
638 ( interpolated_dudx(
i,0) )
639 *dtestfdx_parent(bulk_node_number(l),0) +
640 ( interpolated_dudx(
i,2) )
641 *dtestfdx_parent(bulk_node_number(l),2) );
648 for(
unsigned l2=0;l2<n_node;l2++)
665 local_unknown = U_local_eqn(l2,i2);
666 if(local_unknown >= 0)
668 jacobian(local_eqn,local_unknown) -=
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;
691 for(
unsigned l2=0;l2<n_external;l2++)
707 local_unknown = External_u_local_eqn(l2,i2);
708 if(local_unknown >= 0)
710 jacobian(local_eqn,local_unknown) -=
712 dtestfdx_parent(bulk_node_number(l),0) +
713 dpsifdx_parent(External_node[l2],2)*
714 dtestfdx_parent(bulk_node_number(l),2) )*
W;
838 unsigned n_node = nnode();
843 for(
unsigned i=0;
i<n_node;
i++)
846 for(
unsigned j=0;
j<
Dim;
j++)
848 U_local_eqn(
i,
j) = this->nodal_local_eqn(
i,
j);
856 unsigned n_external = External_node.size();
859 External_u_local_eqn.
resize(n_external,
Dim);
861 for(
unsigned e=0;
e<n_external;
e++)
864 for(
unsigned i=0;
i<
Dim;
i++)
866 External_u_local_eqn(
e,
i) = external_local_eqn(
e,
i);
875 void output(std::ostream &outfile,
const unsigned &Np)
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
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: 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