33 #ifndef OOMPH_SOLID_TRACTION_ELEMENTS_HEADER 34 #define OOMPH_SOLID_TRACTION_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 43 #include "../generic/Qelements.h" 44 #include "../generic/hermite_elements.h" 53 namespace SolidTractionElementHelper
64 unsigned n_dim=load.size();
65 for (
unsigned i=0;
i<n_dim;
i++) {load[
i]=0.0;}
78 template <
class ELEMENT>
108 Traction_fct_pt(xi,x,n,traction);
116 void fill_in_contribution_to_residuals_solid_traction(
125 const int &face_index,
126 const bool& called_from_refineable_constructor=
false) :
140 if (!called_from_refineable_constructor)
142 if(element_pt->
dim()==3)
149 if (this->has_hanging_nodes())
152 "This face element will not work correctly if nodes are hanging.\nUse the refineable version instead. ",
153 OOMPH_CURRENT_FUNCTION,
154 OOMPH_EXCEPTION_LOCATION);
170 {
return Traction_fct_pt;}
176 fill_in_contribution_to_residuals_solid_traction(residuals);
186 fill_in_contribution_to_residuals_solid_traction(residuals);
192 this->fill_in_jacobian_from_external_by_fd(residuals,jacobian);
204 void output(std::ostream &outfile,
const unsigned &n_plot)
206 unsigned n_dim = this->nodal_dimension();
213 outfile << this->tecplot_zone_string(n_plot);
216 unsigned num_plot_points=this->nplot_points(n_plot);
217 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
220 this->get_s_plot(iplot,n_plot,s);
223 this->interpolated_x(s,x);
224 this->interpolated_xi(s,xi);
228 outer_unit_normal(s,unit_normal);
235 get_traction(ipt,xi,x,unit_normal,traction);
238 for(
unsigned i=0;
i<n_dim;
i++)
239 {outfile << x[
i] <<
" ";}
242 for(
unsigned i=0;
i<n_dim;
i++)
244 outfile << traction[
i] <<
" ";
248 for(
unsigned i=0;
i<n_dim;
i++)
249 {outfile << unit_normal[
i] <<
" ";}
251 outfile << std::endl;
255 this->write_tecplot_zone_footer(outfile,n_plot);
264 void output(FILE* file_pt,
const unsigned &n_plot)
285 template<
class ELEMENT>
289 unsigned n_dim = this->nodal_dimension();
298 this->interpolated_xi(s,xi);
302 outer_unit_normal(s,unit_normal);
308 get_traction(ipt,xi,x,unit_normal,traction);
316 template<
class ELEMENT>
321 unsigned n_node = nnode();
324 unsigned n_position_type = this->nnodal_position_type();
327 unsigned n_dim = this->nodal_dimension();
335 Shape psi(n_node,n_position_type);
336 DShape dpsids(n_node,n_position_type,n_dim-1);
339 unsigned n_intpt = integral_pt()->nweight();
342 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
345 double w = integral_pt()->weight(ipt);
348 dshape_local_at_knot(ipt,psi,dpsids);
358 for(
unsigned l=0;l<n_node;l++)
361 for(
unsigned k=0;k<n_position_type;k++)
364 for(
unsigned i=0;
i<n_dim;
i++)
368 nodal_position_gen(l,bulk_position_type(k),
i)*psi(l,k);
370 interpolated_xi[
i] +=
371 this->lagrangian_position_gen(l,bulk_position_type(k),
i)*psi(l,k);
374 for(
unsigned j=0;j<n_dim-1;j++)
376 interpolated_A(j,
i) +=
377 nodal_position_gen(l,bulk_position_type(k),
i)*dpsids(l,k,j);
385 for(
unsigned i=0;
i<n_dim-1;
i++)
387 for(
unsigned j=0;j<n_dim-1;j++)
392 for(
unsigned k=0;k<n_dim;k++)
394 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
401 outer_unit_normal(ipt,interpolated_normal);
411 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
416 "SolidTractionElement::fill_in_contribution_to_residuals()",
417 OOMPH_EXCEPTION_LOCATION);
422 double W = w*sqrt(Adet);
435 for(
unsigned l=0;l<n_node;l++)
438 for(
unsigned k=0;k<n_position_type;k++)
441 for(
unsigned i=0;
i<n_dim;
i++)
443 local_eqn = this->position_local_eqn(l,bulk_position_type(k),
i);
448 residuals[local_eqn] -= traction[
i]*psi(l,k)*
W;
475 template <
class ELEMENT>
484 const int &face_index) :
496 return dynamic_cast<ELEMENT*
>(this->bulk_element_pt())->
497 ncont_interpolated_values();
504 refineable_fill_in_contribution_to_residuals_solid_traction(residuals);
513 refineable_fill_in_contribution_to_residuals_solid_traction(residuals);
520 this->fill_in_jacobian_from_external_by_fd(residuals,jacobian);
528 void refineable_fill_in_contribution_to_residuals_solid_traction(
544 template<
class ELEMENT>
551 unsigned n_node = nnode();
554 unsigned n_position_type = this->nnodal_position_type();
558 if (n_position_type!=1)
561 "RefineableSolidTractionElement only works for n_position_type=1",
562 OOMPH_CURRENT_FUNCTION,
563 OOMPH_EXCEPTION_LOCATION);
569 unsigned n_dim = this->nodal_dimension();
577 Shape psi(n_node,n_position_type);
578 DShape dpsids(n_node,n_position_type,n_dim-1);
581 unsigned n_intpt = integral_pt()->nweight();
584 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
587 double w = integral_pt()->weight(ipt);
590 dshape_local_at_knot(ipt,psi,dpsids);
600 for(
unsigned l=0;l<n_node;l++)
603 for(
unsigned k=0;k<n_position_type;k++)
606 for(
unsigned i=0;
i<n_dim;
i++)
610 nodal_position_gen(l,this->bulk_position_type(k),
i)*psi(l,k);
612 interpolated_xi[
i] +=
613 this->lagrangian_position_gen(l,this->bulk_position_type(k),
i)*
617 for(
unsigned j=0;j<n_dim-1;j++)
619 interpolated_A(j,
i) +=
620 nodal_position_gen(l,this->bulk_position_type(k),
i)*dpsids(l,k,j);
628 for(
unsigned i=0;
i<n_dim-1;
i++)
630 for(
unsigned j=0;j<n_dim-1;j++)
635 for(
unsigned k=0;k<n_dim;k++)
637 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
644 this->outer_unit_normal(ipt,interpolated_normal);
654 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
658 "Wrong dimension in RefineableSolidTractionElement",
659 OOMPH_CURRENT_FUNCTION,
660 OOMPH_EXCEPTION_LOCATION);
665 double W = w*sqrt(Adet);
669 this->get_traction(ipt,
677 double hang_weight=1.0;
682 for(
unsigned l=0;l<n_node;l++)
686 Node* local_node_pt = node_pt(l);
708 for(
unsigned m=0;m<n_master;m++)
714 position_local_eqn_at_node =
715 local_position_hang_eqn(local_node_pt->
716 hanging_pt()->master_node_pt(m));
724 for(
unsigned k=0;k<n_position_type;k++)
727 for(
unsigned i=0;
i<n_dim;
i++)
729 position_local_eqn_at_node(k,
i) = this->position_local_eqn(l,k,
i);
738 for(
unsigned k=0;k<n_position_type;k++)
741 for(
unsigned i=0;
i<n_dim;
i++)
743 local_eqn = position_local_eqn_at_node(k,
i);
766 residuals[local_eqn] -= traction[
i]*psi(l,k)*W*hang_weight;
788 template<
class ELEMENT,
unsigned DIM>
812 const int &face_index,
813 const bool& called_from_refineable_constructor=
false):
815 called_from_refineable_constructor),
816 Normal_points_into_fluid(true)
818 unsigned n_lagr=DIM-1;
820 setup_fsi_wall_element(n_lagr,n_dim);
841 "Broken -- who calls this? \n",
842 OOMPH_CURRENT_FUNCTION,
843 OOMPH_EXCEPTION_LOCATION);
855 this->fill_in_jacobian_from_external_interaction_by_fd(jacobian);
873 fluid_load_vector(intpt,n,traction);
876 if (!Normal_points_into_fluid)
878 for(
unsigned i=0;
i<DIM;
i++)
890 void output(std::ostream &outfile,
const unsigned &n_plot)
893 outfile <<
"ZONE" << std::endl;
896 unsigned n_intpt = this->integral_pt()->nweight();
899 unsigned el_dim = this->dim();
906 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
910 for(
unsigned i=0;
i<el_dim;
i++)
912 s[
i] = integral_pt()->knot(ipt,
i);
921 this->outer_unit_normal(s,unit_normal);
932 get_traction(ipt,xi,r,unit_normal,traction);
936 for (
unsigned i=0;
i<DIM;
i++)
938 outfile << r[
i] <<
" ";
940 for (
unsigned i=0;
i<DIM;
i++)
942 outfile << traction[
i] <<
" ";
944 for (
unsigned i=0;
i<DIM;
i++)
946 outfile << unit_normal[
i] <<
" ";
948 outfile << std::endl;
961 "It doesn't make sense to specify an external traction in an FSI context",
962 OOMPH_CURRENT_FUNCTION,
963 OOMPH_EXCEPTION_LOCATION);
966 return this->Traction_fct_pt;
982 void get_dof_numbers_for_unknowns(
983 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const;
996 template<
class ELEMENT,
unsigned DIM>
998 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 1002 std::pair<unsigned,unsigned> dof_lookup;
1005 const unsigned n_node = this->nnode();
1008 const unsigned n_position_type = nnodal_position_type();
1009 const unsigned nodal_dim = nodal_dimension();
1012 int local_unknown=0;
1015 for(
unsigned n=0;n<n_node;n++)
1018 for(
unsigned k=0;k<n_position_type;k++)
1021 for(
unsigned i=0;
i<nodal_dim;
i++)
1024 local_unknown = position_local_eqn(n,k,
i);
1027 if (local_unknown >= 0)
1031 dof_lookup.first = this->eqn_number(local_unknown);
1032 dof_lookup.second = 0;
1035 dof_lookup_list.push_front(dof_lookup);
1056 template<
class ELEMENT,
unsigned DIM>
1076 const int &face_index) :
1095 this->fill_in_jacobian_from_external_interaction_by_fd(jacobian);
1122 template <
class ELEMENT>
1137 const int &face_index,
1138 const unsigned &
id=0,
1139 const bool& called_from_refineable_constructor=
false) :
1159 N_assigned_geom_data=0;
1162 if (!called_from_refineable_constructor)
1164 if(element_pt->
dim()==3)
1171 if (this->has_hanging_nodes())
1174 "This face element will not work correctly if nodes are hanging\nUse the refineable version instead. ",
1175 OOMPH_CURRENT_FUNCTION,
1176 OOMPH_EXCEPTION_LOCATION);
1189 "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
1190 OOMPH_CURRENT_FUNCTION,
1191 OOMPH_EXCEPTION_LOCATION);
1197 unsigned dim=element_pt->
dim();
1206 add_additional_values(n_additional_values,
id);
1217 return Boundary_shape_geom_object_pt;
1231 const unsigned& boundary_number_in_bulk_mesh)
1236 Boundary_number_in_bulk_mesh_has_been_set=
true;
1238 Boundary_number_in_bulk_mesh=boundary_number_in_bulk_mesh;
1243 Boundary_shape_geom_object_pt=boundary_shape_geom_object_pt;
1251 unsigned n_geom_data=boundary_shape_geom_object_pt->
ngeom_data();
1254 if ((this->nexternal_data()>0)&&
1255 (N_assigned_geom_data!=this->nexternal_data()))
1257 std::ostringstream error_message;
1258 error_message <<
"About to wipe external data for " 1259 <<
"ImposeDisplacementByLagrangeMultiplierElement.\n" 1260 <<
"I noted that N_assigned_geom_data = " 1261 << N_assigned_geom_data <<
" != nexternal_data() = " 1262 << this->nexternal_data() <<
" \n" 1263 <<
"so we're going to wipe some external data that\n" 1264 <<
"is not geometric Data of the GeomObject that\n" 1265 <<
"specifies the desired boundary shape.\n" 1268 error_message.str(),
1269 OOMPH_CURRENT_FUNCTION,
1270 OOMPH_EXCEPTION_LOCATION);
1273 this->flush_external_data();
1274 for (
unsigned i=0;
i<n_geom_data;
i++)
1276 add_external_data(boundary_shape_geom_object_pt->
geom_data_pt(
i));
1279 N_assigned_geom_data=n_geom_data;
1289 unsigned n_node = nnode();
1292 const unsigned n_position_type = nnodal_position_type();
1295 unsigned dim_el=dim();
1302 if ((this->nexternal_data()>0)&&
1303 (N_assigned_geom_data!=this->nexternal_data()))
1305 std::ostringstream error_message;
1306 error_message <<
"About to wipe external data for " 1307 <<
"ImposeDisplacementByLagrangeMultiplierElement.\n" 1308 <<
"I noted that N_assigned_geom_data = " 1309 << N_assigned_geom_data <<
" != nexternal_data() = " 1310 << this->nexternal_data() <<
" \n" 1311 <<
"so we're going to wipe some external data that\n" 1312 <<
"is not geometric Data of the GeomObject that\n" 1313 <<
"specifies the desired boundary shape.\n" 1316 error_message.str(),
1317 OOMPH_CURRENT_FUNCTION,
1318 OOMPH_EXCEPTION_LOCATION);
1323 this->flush_external_data();
1326 N_assigned_geom_data=0;
1330 unsigned n_intpt = integral_pt()->nweight();
1331 Sub_geom_object_pt.resize(n_intpt);
1332 Zeta_sub_geom_object.resize(n_intpt);
1335 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1339 shape_at_knot(ipt,psi);
1346 for(
unsigned j=0;j<n_node;j++)
1348 for(
unsigned k=0;k<n_position_type;k++)
1351 for(
unsigned i=0;
i<dim_el;
i++)
1353 zeta[
i]+=zeta_nodal(j,k,
i)*psi(j,k);
1360 Zeta_sub_geom_object[ipt].resize(dim_el);
1361 Boundary_shape_geom_object_pt->locate_zeta(zeta,
1362 Sub_geom_object_pt[ipt],
1363 Zeta_sub_geom_object[ipt]);
1365 unsigned n_geom_data=Sub_geom_object_pt[ipt]->ngeom_data();
1366 for (
unsigned i=0;
i<n_geom_data;
i++)
1368 add_external_data(Sub_geom_object_pt[ipt]->geom_data_pt(
i));
1371 N_assigned_geom_data+=n_geom_data;
1382 fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(
1392 fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(
1393 residuals,jacobian,1);
1397 fill_in_jacobian_from_external_by_fd(residuals,jacobian);
1415 const unsigned n_dof = this->ndof();
1416 for(
unsigned i=0;
i<n_dof;
i++)
1418 residuals[
i] *= -1.0;
1419 for(
unsigned j=0;j<n_dof;j++)
1421 jacobian(
i,j) *= -1.0;
1429 void output(std::ostream &outfile,
const unsigned &n_plot)
1432 unsigned dim_el=dim();
1435 unsigned n_position_type = this->nnodal_position_type();
1438 if(n_position_type!=1)
1441 "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
1442 OOMPH_CURRENT_FUNCTION,
1443 OOMPH_EXCEPTION_LOCATION);
1452 unsigned n_node=nnode();
1453 Shape psi(n_node,n_position_type);
1456 outfile << this->tecplot_zone_string(n_plot);
1459 unsigned num_plot_points=this->nplot_points(n_plot);
1460 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
1463 this->get_s_plot(iplot,n_plot,s);
1472 for(
unsigned j=0;j<n_node;j++)
1479 Node* nod_pt = node_pt(j);
1483 unsigned first_index=
1487 for(
unsigned i=0;
i<dim_el+1;
i++)
1489 x[
i]+=nodal_position(j,
i)*psi(j,0);
1493 (first_index+
i)*psi(j,0);
1496 for(
unsigned i=0;
i<dim_el;
i++)
1499 for (
unsigned k=0;k<n_position_type;k++)
1501 zeta[
i]+=zeta_nodal(j,k,
i)*psi(j,k);
1508 Boundary_shape_geom_object_pt->position(zeta,r_prescribed);
1511 for(
unsigned i=0;
i<dim_el+1;
i++)
1513 outfile << x[
i] <<
" ";
1515 for(
unsigned i=0;
i<dim_el+1;
i++)
1517 outfile << -lambda[
i] <<
" ";
1519 for(
unsigned i=0;
i<dim_el+1;
i++)
1521 outfile << r_prescribed[
i] <<
" ";
1527 outfile << std::endl;
1546 unsigned n_position_type = this->nnodal_position_type();
1549 if(n_position_type!=1)
1552 "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
1553 OOMPH_CURRENT_FUNCTION,
1554 OOMPH_EXCEPTION_LOCATION);
1559 unsigned n_node = nnode();
1562 unsigned dim_el=dim();
1566 DShape dpsids(n_node,dim_el);
1569 unsigned n_intpt = integral_pt()->nweight();
1573 double squared_error=0.0;
1576 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1579 double w = integral_pt()->weight(ipt);
1582 dshape_local_at_knot(ipt,psi,dpsids);
1591 for(
unsigned j=0;j<n_node;j++)
1593 Node* nod_pt=node_pt(j);
1601 unsigned first_index=
1605 for(
unsigned i=0;
i<dim_el+1;
i++)
1607 x[
i]+=nodal_position(j,
i)*psi(j);
1608 lambda[
i]+=nod_pt->
value(first_index+
i)*psi(j);
1609 for(
unsigned ii=0;ii<dim_el;ii++)
1611 interpolated_a(ii,
i) +=
1612 lagrangian_position(j,
i)*dpsids(j,ii);
1617 for(
unsigned k=0;k<n_position_type;k++)
1620 for(
unsigned i=0;
i<dim_el;
i++)
1622 zeta[
i]+=zeta_nodal(j,k,
i)*psi(j,k);
1628 if (Sparsify) zeta=Zeta_sub_geom_object[ipt];
1633 for(
unsigned i=0;
i<dim_el;
i++)
1635 for(
unsigned j=0;j<dim_el;j++)
1640 for(
unsigned k=0;k<dim_el+1;k++)
1642 a(
i,j) += interpolated_a(
i,k)*interpolated_a(j,k);
1658 adet = a(0,0)*a(1,1) - a(0,1)*a(1,0);
1664 "Wrong dimension fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
1665 "ImposeDisplacementByLagrangeMultiplierElement::fill_in_generic_contribution_to_residuals_displ_lagr_multiplier()",
1666 OOMPH_EXCEPTION_LOCATION);
1673 Boundary_shape_geom_object_pt->position(zeta,r_prescribed);
1677 Sub_geom_object_pt[ipt]->position(zeta,r_prescribed);
1682 double W = w*sqrt(adet);
1687 for(
unsigned i=0;
i<dim_el+1;
i++)
1689 squared_error+=(x[
i]-r_prescribed[
i])*(x[
i]-r_prescribed[
i])*
W;
1693 return squared_error;
1707 const unsigned& flag)
1710 unsigned n_position_type = this->nnodal_position_type();
1713 if(n_position_type!=1)
1716 "ImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
1717 OOMPH_CURRENT_FUNCTION,
1718 OOMPH_EXCEPTION_LOCATION);
1723 unsigned n_node = nnode();
1726 unsigned dim_el=dim();
1730 DShape dpsids(n_node,dim_el);
1733 unsigned n_intpt = integral_pt()->nweight();
1736 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1739 double w = integral_pt()->weight(ipt);
1742 dshape_local_at_knot(ipt,psi,dpsids);
1751 for(
unsigned j=0;j<n_node;j++)
1753 Node* nod_pt=node_pt(j);
1761 unsigned first_index=
1765 for(
unsigned i=0;
i<dim_el+1;
i++)
1767 x[
i]+=nodal_position(j,
i)*psi(j);
1768 lambda[
i]+=nod_pt->
value(first_index+
i)*psi(j);
1769 for(
unsigned ii=0;ii<dim_el;ii++)
1771 interpolated_a(ii,
i) +=
1772 lagrangian_position(j,
i)*dpsids(j,ii);
1777 for(
unsigned k=0;k<n_position_type;k++)
1780 for(
unsigned i=0;
i<dim_el;
i++)
1782 zeta[
i]+=zeta_nodal(j,k,
i)*psi(j,k);
1788 if (Sparsify) zeta=Zeta_sub_geom_object[ipt];
1793 for(
unsigned i=0;
i<dim_el;
i++)
1795 for(
unsigned j=0;j<dim_el;j++)
1800 for(
unsigned k=0;k<dim_el+1;k++)
1802 a(
i,j) += interpolated_a(
i,k)*interpolated_a(j,k);
1818 adet = a(0,0)*a(1,1) - a(0,1)*a(1,0);
1824 "Wrong dimension fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
1825 "ImposeDisplacementByLagrangeMultiplierElement::fill_in_generic_contribution_to_residuals_displ_lagr_multiplier()",
1826 OOMPH_EXCEPTION_LOCATION);
1833 Boundary_shape_geom_object_pt->position(zeta,r_prescribed);
1837 Sub_geom_object_pt[ipt]->position(zeta,r_prescribed);
1842 double W = w*sqrt(adet);
1847 for(
unsigned i=0;
i<dim_el+1;
i++)
1850 for(
unsigned j=0;j<n_node;j++)
1860 int local_eqn=nodal_local_eqn
1866 residuals[local_eqn]+=(x[
i]-r_prescribed[
i])*psi(j)*
W;
1873 for(
unsigned jj=0;jj<n_node;jj++)
1875 int local_unknown=position_local_eqn(jj,0,
i);
1876 if (local_unknown>=0)
1878 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*
W;
1888 local_eqn=position_local_eqn(j,0,
i);
1892 residuals[local_eqn]+=lambda[
i]*psi(j)*
W;
1899 for(
unsigned jj=0;jj<n_node;jj++)
1905 int local_unknown=nodal_local_eqn
1908 if (local_unknown>=0)
1910 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*
W;
1930 return this->dim()+1;
1941 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 1945 std::pair<unsigned,unsigned> dof_lookup;
1948 const unsigned n_node = this->nnode();
1951 unsigned dim_el = this->dim();
1952 for(
unsigned i=0;
i<dim_el+1;
i++)
1955 for(
unsigned j=0;j<n_node;j++)
1962 int local_eqn=nodal_local_eqn
1968 dof_lookup.first = this->eqn_number(local_eqn);
1969 dof_lookup.second =
i;
1972 dof_lookup_list.push_front(dof_lookup);
2037 template <
class ELEMENT>
2053 const int &face_index,
2054 const unsigned &
id=0) :
2065 return node_pt(0)->nvalue();
2072 refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(
2082 refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(
2083 residuals,jacobian,1);
2087 this->fill_in_jacobian_from_external_by_fd(residuals,jacobian);
2099 const unsigned& flag)
2102 unsigned n_position_type = this->nnodal_position_type();
2105 if(n_position_type!=1)
2108 "RefineableImposeDisplacementByLagrangeMultiplierElement \n cannot (currently) be used with elements that have generalised\n positional dofs. Upgrade should be straightforward though the code is in a \n bit of state, with generalised degrees of freedom sometimes half taken into \n account, sometimes completely ignored...",
2109 OOMPH_CURRENT_FUNCTION,
2110 OOMPH_EXCEPTION_LOCATION);
2115 unsigned n_node = this->nnode();
2118 unsigned dim_el=this->dim();
2122 DShape dpsids(n_node,dim_el);
2125 unsigned n_intpt = this->integral_pt()->nweight();
2130 int local_unknown=0;
2133 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
2136 double w = this->integral_pt()->weight(ipt);
2139 this->dshape_local_at_knot(ipt,psi,dpsids);
2150 for(
unsigned j=0;j<n_node;j++)
2152 Node* nod_pt=this->node_pt(j);
2160 unsigned first_index=
2164 for(
unsigned i=0;
i<dim_el+1;
i++)
2166 x[
i]+=this->nodal_position(j,
i)*psi(j);
2167 lambda[
i]+=nod_pt->
value(first_index+
i)*psi(j);
2168 for(
unsigned ii=0;ii<dim_el;ii++)
2170 interpolated_a(ii,
i) +=
2171 this->lagrangian_position(j,
i)*dpsids(j,ii);
2174 if (!this->Sparsify)
2176 for(
unsigned k=0;k<n_position_type;k++)
2179 for(
unsigned i=0;
i<dim_el;
i++)
2181 zeta[
i]+=this->zeta_nodal(j,k,
i)*psi(j,k);
2187 if (this->Sparsify) zeta=this->Zeta_sub_geom_object[ipt];
2192 for(
unsigned i=0;
i<dim_el;
i++)
2194 for(
unsigned j=0;j<dim_el;j++)
2199 for(
unsigned k=0;k<dim_el+1;k++)
2201 a(
i,j) += interpolated_a(
i,k)*interpolated_a(j,k);
2217 adet = a(0,0)*a(1,1) - a(0,1)*a(1,0);
2223 "Wrong dimension refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
2224 "RefineableImposeDisplacementByLagrangeMultiplierElement::refineablefill_in_generic_contribution_to_residuals_displ_lagr_multiplier()",
2225 OOMPH_EXCEPTION_LOCATION);
2230 if (!this->Sparsify)
2232 this->Boundary_shape_geom_object_pt->position(zeta,r_prescribed);
2236 this->Sub_geom_object_pt[ipt]->position(zeta,r_prescribed);
2241 double W = w*sqrt(adet);
2247 unsigned n_master=1;
2248 unsigned n_master2=1;
2249 double hang_weight=1.0;
2250 double hang_weight2=1.0;
2259 for(
unsigned j=0;j<n_node;j++)
2262 Node* local_node_pt= this->node_pt(j);
2265 bool is_node_hanging = local_node_pt->
is_hanging();
2273 n_master = hang_info_pt->
nmaster();
2282 for(
unsigned m=0;m<n_master;m++)
2285 for(
unsigned i=0;
i<dim_el+1;
i++)
2298 local_eqn = this->local_hang_eqn(
2300 index_of_first_value_assigned_by_face_element(this->Id)+
i);
2313 local_eqn = this->nodal_local_eqn(
2315 index_of_first_value_assigned_by_face_element(this->Id)+
i);
2324 residuals[local_eqn]+=(x[
i]-r_prescribed[
i])*psi(j)*W*hang_weight;
2331 for(
unsigned jj=0;jj<n_node;jj++)
2334 Node* local_node2_pt= this->node_pt(jj);
2337 bool is_node_hanging2 = local_node2_pt->
is_hanging();
2340 if(is_node_hanging2)
2342 hang_info2_pt = local_node2_pt->
hanging_pt();
2345 n_master2 = hang_info2_pt->
nmaster();
2354 for(
unsigned m2=0;m2<n_master2;m2++)
2362 if (is_node_hanging2)
2365 position_local_eqn_at_node2 =
2366 local_position_hang_eqn(local_node2_pt->
2367 hanging_pt()->master_node_pt(m2));
2386 position_local_eqn_at_node2(k2,i2) =
2387 this->position_local_eqn(jj,k2,i2);
2395 local_unknown = position_local_eqn_at_node2(k2,
i);
2396 if (local_unknown>=0)
2398 jacobian(local_eqn,local_unknown)+=
2399 psi(jj)*psi(j)*W*hang_weight*hang_weight2;
2414 if (is_node_hanging)
2417 position_local_eqn_at_node =
2418 local_position_hang_eqn(local_node_pt->
2419 hanging_pt()->master_node_pt(m));
2434 position_local_eqn_at_node(k2,i2) =
2435 this->position_local_eqn(j,k2,i2);
2439 local_eqn = position_local_eqn_at_node(k,
i);
2445 residuals[local_eqn]+=lambda[
i]*psi(j)*W*hang_weight;
2452 for(
unsigned jj=0;jj<n_node;jj++)
2455 Node* local_node2_pt= this->node_pt(jj);
2458 bool is_node_hanging2 = local_node2_pt->
is_hanging();
2461 if(is_node_hanging2)
2463 hang_info2_pt = local_node2_pt->
hanging_pt();
2466 n_master2 = hang_info2_pt->
nmaster();
2475 for(
unsigned m2=0;m2<n_master2;m2++)
2481 if(is_node_hanging2)
2489 local_unknown = this->local_hang_eqn(
2491 index_of_first_value_assigned_by_face_element(
2505 local_unknown = this->nodal_local_eqn(
2507 index_of_first_value_assigned_by_face_element(
2514 if (local_unknown>=0)
2516 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*W*
2517 hang_weight*hang_weight2;
2558 template <
class ELEMENT>
2578 describe_nodal_local_dofs(out,current_string);
2588 const int &face_index,
2589 const unsigned &
id=0,
2590 const bool& called_from_refineable_constructor=
false) :
2594 this->set_ninteraction(1);
2606 if (!called_from_refineable_constructor)
2608 if(element_pt->
dim()==3)
2615 if (this->has_hanging_nodes())
2618 "This face element will not work correctly if nodes are hanging\nUse the refineable version instead. ",
2619 OOMPH_CURRENT_FUNCTION,
2620 OOMPH_EXCEPTION_LOCATION);
2633 "FSIImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
2634 OOMPH_CURRENT_FUNCTION,
2635 OOMPH_EXCEPTION_LOCATION);
2641 unsigned dim=element_pt->
dim();
2650 add_additional_values(n_additional_values,
id);
2658 fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(
2668 fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(
2669 residuals,jacobian,1);
2672 this->fill_in_jacobian_from_external_interaction_by_fd(jacobian);
2689 const unsigned n_dof = this->ndof();
2690 for(
unsigned i=0;
i<n_dof;
i++)
2692 residuals[
i] *= -1.0;
2693 for(
unsigned j=0;j<n_dof;j++)
2695 jacobian(
i,j) *= -1.0;
2703 void output(std::ostream &outfile,
const unsigned &n_plot)
2706 unsigned dim_el=dim();
2709 unsigned n_position_type = this->nnodal_position_type();
2712 if(n_position_type!=1)
2715 "FSIImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
2716 OOMPH_CURRENT_FUNCTION,
2717 OOMPH_EXCEPTION_LOCATION);
2726 unsigned n_node=nnode();
2727 Shape psi(n_node,n_position_type);
2730 outfile << this->tecplot_zone_string(n_plot);
2733 unsigned num_plot_points=this->nplot_points(n_plot);
2734 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
2737 this->get_s_plot(iplot,n_plot,s);
2746 for(
unsigned j=0;j<n_node;j++)
2753 Node* nod_pt = node_pt(j);
2757 unsigned first_index=
2761 for(
unsigned i=0;
i<dim_el+1;
i++)
2763 x[
i]+=nodal_position(j,
i)*psi(j,0);
2767 (first_index+
i)*psi(j,0);
2770 for(
unsigned i=0;
i<dim_el;
i++)
2773 for (
unsigned k=0;k<n_position_type;k++)
2775 zeta[
i]+=zeta_nodal(j,k,
i)*psi(j,k);
2781 for(
unsigned i=0;
i<dim_el+1;
i++)
2783 outfile << x[
i] <<
" ";
2785 for(
unsigned i=0;
i<dim_el+1;
i++)
2787 outfile << -lambda[
i] <<
" ";
2789 outfile << std::endl;
2809 const unsigned& flag)
2814 unsigned n_position_type = this->nnodal_position_type();
2816 if(n_position_type!=1)
2819 "FSIImposeDisplacementByLagrangeMultiplierElement cannot (currently) be used with elements that have generalised positional dofs",
2820 OOMPH_CURRENT_FUNCTION,
2821 OOMPH_EXCEPTION_LOCATION);
2826 unsigned n_node = nnode();
2829 unsigned dim_el=dim();
2833 DShape dpsids(n_node,dim_el);
2836 unsigned n_intpt = integral_pt()->nweight();
2839 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
2842 double w = integral_pt()->weight(ipt);
2845 dshape_local_at_knot(ipt,psi,dpsids);
2854 for(
unsigned j=0;j<n_node;j++)
2856 Node* nod_pt=node_pt(j);
2864 unsigned first_index=
2868 for(
unsigned i=0;
i<dim_el+1;
i++)
2870 x[
i]+=nodal_position(j,
i)*psi(j);
2871 lambda[
i]+=nod_pt->
value(first_index+
i)*psi(j);
2872 for(
unsigned ii=0;ii<dim_el;ii++)
2874 interpolated_a(ii,
i) +=
2875 lagrangian_position(j,
i)*dpsids(j,ii);
2882 for(
unsigned i=0;
i<dim_el;
i++)
2884 for(
unsigned j=0;j<dim_el;j++)
2889 for(
unsigned k=0;k<dim_el+1;k++)
2891 a(
i,j) += interpolated_a(
i,k)*interpolated_a(j,k);
2907 adet = a(0,0)*a(1,1) - a(0,1)*a(1,0);
2913 "Wrong dimension fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
2914 "FSIImposeDisplacementByLagrangeMultiplierElement::fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier()",
2915 OOMPH_EXCEPTION_LOCATION);
2931 double W = w*sqrt(adet);
2936 for(
unsigned i=0;
i<dim_el+1;
i++)
2939 for(
unsigned j=0;j<n_node;j++)
2949 int local_eqn=nodal_local_eqn
2955 residuals[local_eqn]+=(x[
i]-r_prescribed[
i])*psi(j)*
W;
2962 for(
unsigned jj=0;jj<n_node;jj++)
2964 int local_unknown=position_local_eqn(jj,0,
i);
2965 if (local_unknown>=0)
2967 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*
W;
2977 local_eqn=position_local_eqn(j,0,
i);
2981 residuals[local_eqn]+=lambda[
i]*psi(j)*
W;
2988 for(
unsigned jj=0;jj<n_node;jj++)
2994 int local_unknown=nodal_local_eqn
2997 if (local_unknown>=0)
2999 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*
W;
3018 return this->dim()+1;
3029 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 3033 std::pair<unsigned,unsigned> dof_lookup;
3036 const unsigned n_node = this->nnode();
3039 unsigned dim_el = this->dim();
3040 for(
unsigned i=0;
i<dim_el+1;
i++)
3043 for(
unsigned j=0;j<n_node;j++)
3050 int local_eqn=nodal_local_eqn
3056 dof_lookup.first = this->eqn_number(local_eqn);
3057 dof_lookup.second =
i;
3060 dof_lookup_list.push_front(dof_lookup);
3098 template <
class ELEMENT>
3117 describe_local_dofs;
3126 const int &face_index,
3127 const unsigned &
id=0) :
3138 return node_pt(0)->nvalue();
3145 refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(
3155 refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(
3156 residuals,jacobian,1);
3159 this->fill_in_jacobian_from_external_interaction_by_fd(jacobian);
3171 const unsigned& flag)
3174 unsigned n_position_type = this->nnodal_position_type();
3177 if(n_position_type!=1)
3180 "RefineableImposeDisplacementByLagrangeMultiplierElement \n cannot (currently) be used with elements that have generalised\n positional dofs. Upgrade should be straightforward though the code is in a \n bit of state, with generalised degrees of freedom sometimes half taken into \n account, sometimes completely ignored...",
3181 OOMPH_CURRENT_FUNCTION,
3182 OOMPH_EXCEPTION_LOCATION);
3187 unsigned n_node = this->nnode();
3190 unsigned dim_el=this->dim();
3194 DShape dpsids(n_node,dim_el);
3197 unsigned n_intpt = this->integral_pt()->nweight();
3202 int local_unknown=0;
3205 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
3208 double w = this->integral_pt()->weight(ipt);
3211 this->dshape_local_at_knot(ipt,psi,dpsids);
3222 for(
unsigned j=0;j<n_node;j++)
3224 Node* nod_pt=this->node_pt(j);
3232 unsigned first_index=
3236 for(
unsigned i=0;
i<dim_el+1;
i++)
3238 x[
i]+=this->nodal_position(j,
i)*psi(j);
3239 lambda[
i]+=nod_pt->
value(first_index+
i)*psi(j);
3240 for(
unsigned ii=0;ii<dim_el;ii++)
3242 interpolated_a(ii,
i) +=
3243 this->lagrangian_position(j,
i)*dpsids(j,ii);
3251 for(
unsigned i=0;
i<dim_el;
i++)
3253 for(
unsigned j=0;j<dim_el;j++)
3258 for(
unsigned k=0;k<dim_el+1;k++)
3260 a(
i,j) += interpolated_a(
i,k)*interpolated_a(j,k);
3276 adet = a(0,0)*a(1,1) - a(0,1)*a(1,0);
3282 "Wrong dimension refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier",
3283 "RefineableImposeDisplacementByLagrangeMultiplierElement::refineablefill_in_generic_contribution_to_residuals_displ_lagr_multiplier()",
3284 OOMPH_EXCEPTION_LOCATION);
3292 Vector<double> s_adjacent(this->external_element_local_coord(0,ipt));
3301 double W = w*sqrt(adet);
3307 unsigned n_master=1;
3308 unsigned n_master2=1;
3309 double hang_weight=1.0;
3310 double hang_weight2=1.0;
3319 for(
unsigned j=0;j<n_node;j++)
3322 Node* local_node_pt= this->node_pt(j);
3325 bool is_node_hanging = local_node_pt->
is_hanging();
3333 n_master = hang_info_pt->
nmaster();
3342 for(
unsigned m=0;m<n_master;m++)
3345 for(
unsigned i=0;
i<dim_el+1;
i++)
3358 local_eqn = this->local_hang_eqn(
3360 index_of_first_value_assigned_by_face_element(this->Id)+
i);
3373 local_eqn = this->nodal_local_eqn(
3375 index_of_first_value_assigned_by_face_element(this->Id)+
i);
3384 residuals[local_eqn]+=(x[
i]-r_prescribed[
i])*psi(j)*W*hang_weight;
3391 for(
unsigned jj=0;jj<n_node;jj++)
3394 Node* local_node2_pt= this->node_pt(jj);
3397 bool is_node_hanging2 = local_node2_pt->
is_hanging();
3400 if(is_node_hanging2)
3402 hang_info2_pt = local_node2_pt->
hanging_pt();
3405 n_master2 = hang_info2_pt->
nmaster();
3414 for(
unsigned m2=0;m2<n_master2;m2++)
3422 if (is_node_hanging2)
3425 position_local_eqn_at_node2 =
3426 local_position_hang_eqn(local_node2_pt->
3427 hanging_pt()->master_node_pt(m2));
3446 position_local_eqn_at_node2(k2,i2) =
3447 this->position_local_eqn(jj,k2,i2);
3455 local_unknown = position_local_eqn_at_node2(k2,
i);
3456 if (local_unknown>=0)
3458 jacobian(local_eqn,local_unknown)+=
3459 psi(jj)*psi(j)*W*hang_weight*hang_weight2;
3474 if (is_node_hanging)
3477 position_local_eqn_at_node =
3478 local_position_hang_eqn(local_node_pt->
3479 hanging_pt()->master_node_pt(m));
3494 position_local_eqn_at_node(k2,i2) =
3495 this->position_local_eqn(j,k2,i2);
3499 local_eqn = position_local_eqn_at_node(k,
i);
3505 residuals[local_eqn]+=lambda[
i]*psi(j)*W*hang_weight;
3512 for(
unsigned jj=0;jj<n_node;jj++)
3515 Node* local_node2_pt= this->node_pt(jj);
3518 bool is_node_hanging2 = local_node2_pt->
is_hanging();
3521 if(is_node_hanging2)
3523 hang_info2_pt = local_node2_pt->
hanging_pt();
3526 n_master2 = hang_info2_pt->
nmaster();
3535 for(
unsigned m2=0;m2<n_master2;m2++)
3541 if(is_node_hanging2)
3549 local_unknown = this->local_hang_eqn(
3551 index_of_first_value_assigned_by_face_element(
3565 local_unknown = this->nodal_local_eqn(
3567 index_of_first_value_assigned_by_face_element(
3574 if (local_unknown>=0)
3576 jacobian(local_eqn,local_unknown)+=psi(jj)*psi(j)*W*
3577 hang_weight*hang_weight2;
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the Jacobian.
~FSISolidTractionElement()
Destructor: empty.
virtual unsigned ngeom_data() const
How many items of Data does the shape of the object depend on? This is implemented as a broken virtua...
Vector< Vector< double > > Zeta_sub_geom_object
Storage for local coordinates in sub-GeomObjects at integration points.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Just the soli...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: Note we can only output the traction at Gauss points so n_plot is actually ignored...
This is a base class for all SolidFiniteElements that participate in FSI computations. These elements provide interfaces and generic funcionality for the two additional roles that SolidFiniteElements play in FSI problems:They parameterise the domain boundary for the fluid domain. To allow them to play this role, FSIWallElements are derived from the SolidFiniteElement and the GeomObject class, indicating that the every specific FSIWallElement must implement the pure virtual function GeomObject::position(...) which should compute the position vector to a point in the SolidFiniteElement, parametrised by its local coordinates.In FSI problems fluid exerts a traction onto the wall and this traction must be added to any other load terms (such as an external pressure acting on an elastic pipe) that are already applied to the SolidFiniteElements by other means.
Vector< GeomObject * > Sub_geom_object_pt
Storage for sub-GeomObject at the integration points.
virtual void get_traction(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Get the traction vector: Pass number of integration point (dummy), Lagr. coordinate and normal vector...
bool Normal_points_into_fluid
Boolean flag to indicate whether the normal is directed into the fluid.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
virtual void get_traction(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Get the load vector: Pass number of the integration point, Lagr. coordinate, Eulerian coordinate (nei...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Fill in contribution to Mass matrix and Jacobian. There is no contributiont to mass matrix so simply ...
GeomObject * boundary_shape_geom_object_pt() const
Access to GeomObject that specifies the prescribed boundary displacement; GeomObject is assumed to be...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
RefineableSolidTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the face index.
void Zero_traction_fct(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
ImposeDisplacementByLagrangeMultiplierElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0, const bool &called_from_refineable_constructor=false)
Constructor takes a "bulk" element and the index that identifies which face the FaceElement is suppos...
A general Finite Element class.
RefineableFSISolidTractionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor: Create element as FSIWallElement (and thus, by inheritance, a GeomObject) with DIM-1 Lag...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
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...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned nmaster() const
Return the number of master nodes.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void refineable_fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to compute the residuals and, if flag==1, the Jacobian.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
bool is_hanging() const
Test whether the node is geometrically hanging.
GeomObject * Boundary_shape_geom_object_pt
GeomObject that specifies the prescribed boundary displacement; GeomObject is assumed to be parametri...
void fill_in_contribution_to_residuals_solid_traction(Vector< double > &residuals)
Helper function that actually calculates the residuals.
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...
void set_normal_pointing_out_of_fluid()
Set the normal computed by underlying FaceElement to point out of the fluid.
unsigned N_assigned_geom_data
Bool to record the number of geom Data that has been assigned to external data (we're keeping a recor...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: We only label...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
void refineable_fill_in_contribution_to_residuals_solid_traction(Vector< double > &residuals)
This function returns the residuals for the traction function.
virtual void(*&)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Broken overloaded reference to the traction function pointer. It doesn't make sense to specify an ext...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
void output(std::ostream &outfile)
Output function.
A class that contains the information required by Nodes that are located on Mesh boundaries. A BoundaryNode of a particular type is obtained by combining a given Node with this class. By differentiating between Nodes and BoundaryNodes we avoid a lot of un-necessary storage in the bulk Nodes.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values are the same as those in the bulk element.
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Final overload... Forwards to the version in the FSIWallElement.
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the elements. The ostream specifies the output stream to which...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the element's contribution to its residual vector and the element Jacobian matrix (wrapper) ...
~RefineableSolidTractionElement()
Destructor should not delete anything.
bool Sparsify
Boolean flag to indicate if we're using geometric Data of sub-GeomObjects that make up the (possibly ...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
FSIImposeDisplacementByLagrangeMultiplierElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0, const bool &called_from_refineable_constructor=false)
Constructor takes a "bulk" element and the index that identifies which face the FaceElement is suppos...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
void dposition_dlagrangian_at_local_coordinate(const Vector< double > &s, DenseMatrix< double > &drdxi) const
Derivative of position vector w.r.t. the SolidFiniteElement's Lagrangian coordinates; evaluated at cu...
void fill_in_generic_contribution_to_residuals_displ_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to compute the residuals and, if flag==1, the Jacobian.
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
void output(std::ostream &outfile)
Output with default number of plot points.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
RefineableImposeDisplacementByLagrangeMultiplierElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor takes a "bulk" element and the index that identifies which face the FaceElement is suppos...
Class that contains data for hanging nodes.
unsigned index_of_first_value_assigned_by_face_element(const unsigned &face_id=0) const
Return the index of the first value associated with the i-th face element value. If no argument is sp...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: Same for all nodes since it's a refineable element...
void output(std::ostream &outfile)
Output function.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Just the soli...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: Same for all nodes since it's a refineable element...
void(*&)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Reference to the traction function pointer.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
void set_boundary_shape_geom_object_pt(GeomObject *boundary_shape_geom_object_pt, const unsigned &boundary_number_in_bulk_mesh)
Set GeomObject that specifies the prescribed boundary displacement; GeomObject is assumed to be param...
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Fill in contribution to Mass matrix and Jacobian. There is no contributiont to mass matrix so simply ...
void set_normal_pointing_into_fluid()
Set the normal computed by underlying FaceElement to point into the fluid.
void describe_local_dofs(std::ostream &out, const std::string &curr_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
FSISolidTractionElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
Constructor: Create element as FSIWallElement (and thus, by inheritance, a GeomObject) with DIM-1 Lag...
~RefineableFSISolidTractionElement()
Destructor: empty.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
double square_of_l2_norm_of_error()
Compute square of L2 norm of error between prescribed and actual displacement.
RefineableFSIImposeDisplacementByLagrangeMultiplierElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor takes a "bulk" element and the index that identifies which face the FaceElement is suppos...
void output(FILE *file_pt)
C_style output function.
virtual Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on. This is implemented as a bro...
void fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to compute the residuals and, if flag==1, the Jacobian.
SolidTractionElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
Constructor, which takes a "bulk" element and the value of the index and its limit.
void output(std::ostream &outfile)
Output function.
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Final overload. Get contributions from refineable solid traction element and derivatives from externa...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
void refineable_fill_in_generic_contribution_to_residuals_fsi_displ_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to compute the residuals and, if flag==1, the Jacobian.
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...
void traction(const Vector< double > &s, Vector< double > &traction)
Compute traction vector at specified local coordinate Should only be used for post-processing; ignore...