32 #ifndef OOMPH_QELEMENT_HEADER 33 #define OOMPH_QELEMENT_HEADER 37 #include <oomph-lib-config.h> 130 delete S_macro_ll_pt;
132 delete S_macro_ur_pt;
139 unsigned ncoord =
dim();
140 for(
unsigned i=0;
i<ncoord;
i++)
143 if((s[
i] -
s_max() > 0.0) ||
156 unsigned ncoord =
dim();
157 for(
unsigned i=0;
i<ncoord;
i++)
171 unsigned n_dim=
dim();
181 S_macro_ll_pt->resize(n_dim);
192 S_macro_ur_pt->resize(n_dim);
198 for (
unsigned i=0;
i<n_dim;
i++)
214 if (S_macro_ll_pt==0)
217 OOMPH_CURRENT_FUNCTION,
218 OOMPH_EXCEPTION_LOCATION);
221 return (*S_macro_ll_pt)[
i];
231 if (S_macro_ur_pt==0)
234 OOMPH_CURRENT_FUNCTION,
235 OOMPH_EXCEPTION_LOCATION);
238 return (*S_macro_ur_pt)[
i];
248 if (S_macro_ll_pt==0)
251 OOMPH_CURRENT_FUNCTION,
252 OOMPH_EXCEPTION_LOCATION);
255 return (*S_macro_ll_pt)[
i];
265 if (S_macro_ur_pt==0)
268 OOMPH_CURRENT_FUNCTION,
269 OOMPH_EXCEPTION_LOCATION);
272 return (*S_macro_ur_pt)[
i];
284 "Macro Element pointer not set in this element\n",
285 OOMPH_CURRENT_FUNCTION,
286 OOMPH_EXCEPTION_LOCATION);
290 unsigned el_dim =
dim();
292 for(
unsigned i=0;
i<el_dim;
i++)
294 s_macro[
i]=s_macro_ll(
i)+0.5*(s[
i]+1.0)*(s_macro_ur(
i)-s_macro_ll(
i));
309 "Macro Element pointer not set in this element\n",
310 OOMPH_CURRENT_FUNCTION,
311 OOMPH_EXCEPTION_LOCATION);
315 unsigned el_dim =
dim();
317 for(
unsigned i=0;
i<el_dim;
i++)
319 s_macro[
i]=s_macro_ll(
i)+0.5*(s[
i]+1.0)*(s_macro_ur(
i)-s_macro_ll(
i));
329 return static_cast<unsigned>(std::pow(static_cast<double>(
nnode_1d()),
330 static_cast<double>(
dim()-1)));
393 set_undeformed_macro_elem_pt(macro_elem_pt);
405 set_undeformed_macro_elem_pt(undeformed_macro_elem_pt);
424 unsigned n_xi = xi_fe.size();
425 for(
unsigned i=0;
i<n_xi;
i++) {xi_fe[
i] = interpolated_xi(s,
i);}
428 if(Undeformed_macro_elem_pt==0)
430 unsigned n_xi = xi.size();
431 for(
unsigned i=0;
i<n_xi;
i++) {xi[
i] = xi_fe[
i];}
436 unsigned el_dim =
dim();
438 for(
unsigned i=0;
i<el_dim;
i++)
440 s_macro[
i]=s_macro_ll(
i)+0.5*(s[
i]+1.0)*(s_macro_ur(
i)-s_macro_ll(
i));
442 Undeformed_macro_elem_pt->macro_map(s_macro,xi);
447 unsigned n_x=x_fe.size();
453 for(
unsigned i=0;
i<n_x;
i++) {x[
i] = x_fe[
i];}
458 unsigned el_dim =
dim();
460 for(
unsigned i=0;
i<el_dim;
i++)
462 s_macro[
i]=s_macro_ll(
i)+0.5*(s[
i]+1.0)*(s_macro_ur(
i)-s_macro_ll(
i));
484 template<
unsigned DIM,
unsigned NNODE_1D>
510 template<
unsigned NNODE_1D>
565 {
return FiniteElement::invert_jacobian<1>(jacobian,inverse_jacobian);}
591 std::ostringstream error_message;
592 error_message <<
"Vertex node number is " << j <<
593 " but must be from 0 to 1\n";
596 OOMPH_CURRENT_FUNCTION,
597 OOMPH_EXCEPTION_LOCATION);
606 s[0]=this->
s_min()+double(j)/double(NNODE_1D-1)*
615 s_fraction.resize(1);
616 s_fraction[0] = double(j)/double(NNODE_1D-1);
623 const unsigned &n1d,
const unsigned &
i)
626 return double(n1d)/double(NNODE_1D-1);
653 const unsigned& nplot,
654 unsigned& counter)
const 660 for(
unsigned i=0;
i<plot;
i++)
662 file_out <<
i+counter <<
" " 674 const unsigned& nplot)
const 677 for(
unsigned i=0;
i<local_loop;
i++)
679 file_out <<
"3" << std::endl;
687 const unsigned& nplot,
688 unsigned& offset_sum)
const 692 for(
unsigned i=0;
i<local_loop;
i++)
695 file_out << offset_sum << std::endl;
700 void output(std::ostream &outfile);
703 void output(std::ostream &outfile,
const unsigned &n_plot);
706 void output(FILE* file_pt);
709 void output(FILE* file_pt,
const unsigned &n_plot);
716 const unsigned& nplot,
718 const bool& use_equally_spaced_interior_sample_points=
false)
const 722 s[0]=-1.0+2.0*double(i)/double(nplot-1);
723 if (use_equally_spaced_interior_sample_points)
726 double dx_new=range/double(nplot);
727 double range_new=double(nplot-1)*dx_new;
728 s[0]=-1.0+0.5*dx_new+range_new*(1.0+s[0])/range;
741 std::ostringstream header;
742 header <<
"ZONE I=" << nplot <<
"\n";
752 for (
unsigned i=0;
i<DIM;
i++) {np*=nplot;}
759 const unsigned&
i)
const 763 if(face_index == -1) {
return 0;}
764 else if(face_index == +1) {
return nnode_1d() - 1;}
767 std::string err =
"Face index should be in {-1, +1}.";
769 OOMPH_CURRENT_FUNCTION);
777 if(std::abs(face_index) != 1)
779 std::string err =
"Face index should be in {-1, +1}.";
781 OOMPH_CURRENT_FUNCTION);
789 (
const int& face_index)
const 795 std::string err =
"Face index should be in {-1, +1}.";
797 OOMPH_CURRENT_FUNCTION);
804 (
const int& face_index)
const 810 std::string err =
"Face index should be in {-1, +1}.";
812 OOMPH_CURRENT_FUNCTION);
839 template<
unsigned NNODE_1D>
896 {
return FiniteElement::invert_jacobian<2>(jacobian,inverse_jacobian);}
923 nod_pt=
node_pt(n_node_1d*(n_node_1d-1));
926 nod_pt=
node_pt(n_node_1d*n_node_1d-1);
929 std::ostringstream error_message;
930 error_message <<
"Vertex node number is " << j <<
931 " but must be from 0 to 3\n";
934 OOMPH_CURRENT_FUNCTION,
935 OOMPH_EXCEPTION_LOCATION);
945 unsigned j0=j%NNODE_1D;
946 unsigned j1=j/NNODE_1D;
947 const double S_min = this->
s_min();
948 const double S_range = this->
s_max() - S_min;
949 s[0]=S_min+double(j0)/double(NNODE_1D-1)*S_range;
950 s[1]=S_min+double(j1)/double(NNODE_1D-1)*S_range;
957 s_fraction.resize(2);
958 unsigned j0 = j%NNODE_1D;
959 unsigned j1 = j/NNODE_1D;
960 s_fraction[0] = double(j0)/double(NNODE_1D-1);
961 s_fraction[1] = double(j1)/double(NNODE_1D-1);
970 return double(n1d)/double(NNODE_1D-1);
990 return (nplot-1)*(nplot-1);
997 const unsigned& nplot,
998 unsigned& counter)
const 1004 for(
unsigned i=0;
i<plot;
i++)
1006 unsigned d=(
i-(
i%(nplot-1)))/(nplot-1);
1008 file_out <<
i%(nplot-1)+d*nplot+counter <<
" " 1009 <<
i%(nplot-1)+1+d*nplot+counter <<
" " 1010 <<
i%(nplot-1)+1+(d+1)*nplot+counter <<
" " 1011 <<
i%(nplot-1)+(d+1)*nplot+counter
1022 const unsigned& nplot)
const 1025 for(
unsigned i=0;
i<local_loop;
i++)
1027 file_out <<
"9" << std::endl;
1035 const unsigned& nplot,
1036 unsigned& offset_sum)
const 1040 for(
unsigned i=0;
i<local_loop;
i++)
1043 file_out << offset_sum << std::endl;
1048 void output(std::ostream &outfile);
1051 void output(std::ostream &outfile,
const unsigned &n_plot);
1054 void output(FILE* file_pt);
1057 void output(FILE* file_pt,
const unsigned &n_plot);
1064 const unsigned& nplot,
1066 const bool& use_equally_spaced_interior_sample_points=
false)
const 1070 unsigned i0=i%nplot;
1071 unsigned i1=(i-i0)/nplot;
1073 s[0]=-1.0+2.0*double(i0)/double(nplot-1);
1074 s[1]=-1.0+2.0*double(i1)/double(nplot-1);
1075 if (use_equally_spaced_interior_sample_points)
1078 double dx_new=range/double(nplot);
1079 double range_new=double(nplot-1)*dx_new;
1080 s[0]=-1.0+0.5*dx_new+range_new*(1.0+s[0])/range;
1081 s[1]=-1.0+0.5*dx_new+range_new*(1.0+s[1])/range;
1095 std::ostringstream header;
1096 header <<
"ZONE I=" << nplot <<
", J=" << nplot <<
"\n";
1097 return header.str();
1106 for (
unsigned i=0;
i<DIM;
i++) {np*=nplot;}
1113 const unsigned&
i)
const 1119 if(face_index == -1) {
return i*nn1d;}
1120 else if(face_index == +1) {
return nn1d*i + nn1d-1;}
1121 else if(face_index == -2) {
return i;}
1122 else if(face_index == +2) {
return nn1d*(nn1d-1) + i;}
1125 std::string err =
"Face index should be in {-1, +1, -2, +2}.";
1127 OOMPH_CURRENT_FUNCTION);
1134 if(face_index < 0) {
return 1;}
1135 else if(face_index > 0) {
return -1;}
1138 std::string err =
"Face index should be one of {-1, +1, -2, +2}.";
1140 OOMPH_CURRENT_FUNCTION);
1146 (
const int& face_index)
const 1154 std::string err =
"Face index should be in {-1, +1}.";
1156 OOMPH_CURRENT_FUNCTION);
1163 (
const int& face_index)
const 1171 std::string err =
"Face index should be in {-1, +1}.";
1173 OOMPH_CURRENT_FUNCTION);
1202 template<
unsigned NNODE_1D>
1219 this->
set_n_node(NNODE_1D*NNODE_1D*NNODE_1D);
1264 {
return FiniteElement::invert_jacobian<3>(jacobian,inverse_jacobian);}
1299 nod_pt=
node_pt(N*N*(N-1)+(N-1));
1308 std::ostringstream error_message;
1309 error_message <<
"Vertex node number is " << j <<
1310 " but must be from 0 to 7\n";
1313 OOMPH_CURRENT_FUNCTION,
1314 OOMPH_EXCEPTION_LOCATION);
1323 unsigned j0=j%NNODE_1D;
1324 unsigned j1=(j/NNODE_1D)%NNODE_1D;
1325 unsigned j2=j/(NNODE_1D*NNODE_1D);
1326 const double S_min = this->
s_min();
1327 const double S_range = this->
s_max() - S_min;
1329 s[0]=S_min+double(j0)/double(NNODE_1D-1)*S_range;
1330 s[1]=S_min+double(j1)/double(NNODE_1D-1)*S_range;
1331 s[2]=S_min+double(j2)/double(NNODE_1D-1)*S_range;
1338 s_fraction.resize(3);
1339 unsigned j0 = j%NNODE_1D;
1340 unsigned j1=(j/NNODE_1D)%NNODE_1D;
1341 unsigned j2=j/(NNODE_1D*NNODE_1D);
1342 s_fraction[0]= double(j0)/double(NNODE_1D-1);
1343 s_fraction[1]= double(j1)/double(NNODE_1D-1);
1344 s_fraction[2]= double(j2)/double(NNODE_1D-1);
1353 return double(n1d)/double(NNODE_1D-1);
1366 return nplot*nplot*nplot;
1373 return (nplot-1)*(nplot-1)*(nplot-1);
1380 const unsigned& nplot,
1381 unsigned& counter)
const 1386 for(
unsigned j=0;j<plot;j+=(nplot-1)*(nplot-1)+1)
1389 unsigned r=((j-(j%((nplot-1)*(nplot-1))))/((nplot-1)*(nplot-1)));
1392 unsigned sub_plot=(nplot-1)*(nplot-1);
1395 for(
unsigned i=0;
i<sub_plot;
i++)
1397 unsigned d=((
i-(
i%(nplot-1)))/(nplot-1));
1401 file_out <<
i%(nplot-1)+d*nplot+r*nplot*nplot+counter <<
" " 1402 <<
i%(nplot-1)+1+d*nplot+r*nplot*nplot+counter <<
" " 1403 <<
i%(nplot-1)+1+(d+1)*nplot+r*nplot*nplot+counter <<
" " 1404 <<
i%(nplot-1)+(d+1)*nplot+r*nplot*nplot+counter <<
" " 1407 <<
i%(nplot-1)+d*nplot+(r+1)*nplot*nplot+counter <<
" " 1408 <<
i%(nplot-1)+1+d*nplot+(r+1)*nplot*nplot+counter <<
" " 1409 <<
i%(nplot-1)+1+(d+1)*nplot+(r+1)*nplot*nplot+counter <<
" " 1410 <<
i%(nplot-1)+(d+1)*nplot+(r+1)*nplot*nplot+counter
1422 const unsigned& nplot)
const 1425 for(
unsigned i=0;
i<local_loop;
i++)
1427 file_out <<
"12" << std::endl;
1435 const unsigned& nplot,
1436 unsigned& offset_sum)
const 1439 for(
unsigned i=0;
i<local_loop;
i++)
1442 file_out << offset_sum << std::endl;
1447 void output(std::ostream &outfile);
1450 void output(std::ostream &outfile,
const unsigned &n_plot);
1453 void output(FILE* file_pt);
1456 void output(FILE* file_pt,
const unsigned &n_plot);
1462 const unsigned& nplot,
1464 const bool& use_equally_spaced_interior_sample_points=
false)
const 1468 unsigned i01=i%(nplot*nplot);
1469 unsigned i0=i01%nplot;
1470 unsigned i1=(i01-i0)/nplot;
1471 unsigned i2=(i-i01)/(nplot*nplot);
1473 s[0]=-1.0+2.0*double(i0)/double(nplot-1);
1474 s[1]=-1.0+2.0*double(i1)/double(nplot-1);
1475 s[2]=-1.0+2.0*double(i2)/double(nplot-1);
1476 if (use_equally_spaced_interior_sample_points)
1479 double dx_new=range/double(nplot);
1480 double range_new=double(nplot-1)*dx_new;
1481 s[0]=-1.0+0.5*dx_new+range_new*(1.0+s[0])/range;
1482 s[1]=-1.0+0.5*dx_new+range_new*(1.0+s[1])/range;
1483 s[2]=-1.0+0.5*dx_new+range_new*(1.0+s[2])/range;
1498 std::ostringstream header;
1499 header <<
"ZONE I=" << nplot <<
", J=" << nplot <<
", K=" 1501 return header.str();
1510 for (
unsigned i=0;
i<DIM;
i++) {np*=nplot;}
1517 const unsigned&
i)
const 1523 if(face_index == -1) {
return i*nn1d;}
1524 else if(face_index == +1) {
return i*nn1d + (nn1d-1);}
1525 else if(face_index == -2) {
return i%nn1d + (i/nn1d)*nn1d*nn1d;}
1526 else if(face_index == +2) {
return i%nn1d + (i/nn1d)*nn1d*nn1d + (nn1d*(nn1d-1));}
1527 else if(face_index == -3) {
return i;}
1528 else if(face_index == +3) {
return i+(nn1d*nn1d)*(nn1d-1);}
1531 std::string err =
"Face index should be in {-1, +1, -2, +2, -3, +3}.";
1533 OOMPH_CURRENT_FUNCTION);
1540 if(face_index == -3) {
return -1;}
1541 else if(face_index == +3) {
return 1;}
1542 else if(face_index == -2) {
return 1;}
1543 else if(face_index == 2) {
return -1;}
1544 else if(face_index == -1) {
return -1;}
1545 else if(face_index == 1) {
return 1;}
1548 std::string err =
"Face index should be in {-1, +1, -2, +2, -3, +3}.";
1550 OOMPH_CURRENT_FUNCTION);
1556 (
const int& face_index)
const 1566 std::string err =
"Face index should be in {-1, +1}.";
1568 OOMPH_CURRENT_FUNCTION);
1575 (
const int& face_index)
const 1585 std::string err =
"Face index should be in {-1, +1}.";
1587 OOMPH_CURRENT_FUNCTION);
1599 template <
unsigned DIM,
unsigned NNODE_1D>
1607 template <
unsigned NNODE_1D>
1617 set_lagrangian_dimension(1);
1636 inline void output(std::ostream &outfile,
const unsigned &n_plot);
1642 inline void output(FILE* file_pt,
const unsigned &n_plot);
1673 template <
unsigned NNODE_1D>
1675 const unsigned &n_plot)
1681 outfile <<
"ZONE I=" << n_plot << std::endl;
1690 for(
unsigned l=0;l<n_plot;l++)
1692 s[0] = -1.0 + l*2.0/(n_plot-1);
1695 for(
unsigned i=0;
i<n_dim;
i++)
1697 outfile << QElement<1,NNODE_1D>::interpolated_x(
s,
i) <<
" " ;
1700 for(
unsigned i=0;
i<n_lagr;
i++)
1702 outfile << SolidQElement<1,NNODE_1D>::interpolated_xi(
s,
i) <<
" " ;
1704 outfile << std::endl;
1706 outfile << std::endl;
1713 template <
unsigned NNODE_1D>
1715 const unsigned &n_plot)
1721 fprintf(file_pt,
"ZONE I=%i\n",n_plot);
1730 for(
unsigned l=0;l<n_plot;l++)
1732 s[0] = -1.0 + l*2.0/(n_plot-1);
1735 for(
unsigned i=0;
i<n_dim;
i++)
1740 for(
unsigned i=0;
i<n_lagr;
i++)
1744 fprintf(file_pt,
"\n");
1746 fprintf(file_pt,
"\n");
1755 template<
unsigned NNODE_1D>
1765 set_lagrangian_dimension(static_cast<SolidNode*>(
node_pt(0))->nlagrangian());
1773 template <
unsigned NNODE_1D>
1784 set_lagrangian_dimension(2);
1803 inline void output(std::ostream &outfile,
const unsigned &n_plot);
1809 inline void output(FILE* file_pt,
const unsigned &n_plot);
1835 template <
unsigned NNODE_1D>
1837 const unsigned &n_plot)
1843 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot << std::endl;
1852 for(
unsigned l2=0;l2<n_plot;l2++)
1854 s[1] = -1.0 + l2*2.0/(n_plot-1);
1855 for(
unsigned l1=0;l1<n_plot;l1++)
1857 s[0] = -1.0 + l1*2.0/(n_plot-1);
1860 for(
unsigned i=0;
i<n_dim;
i++)
1862 outfile << QElement<2,NNODE_1D>::interpolated_x(
s,
i) <<
" " ;
1865 for(
unsigned i=0;
i<n_lagr;
i++)
1867 outfile << SolidQElement<2,NNODE_1D>::interpolated_xi(
s,
i) <<
" " ;
1869 outfile << std::endl;
1872 outfile << std::endl;
1881 template <
unsigned NNODE_1D>
1883 const unsigned &n_plot)
1889 fprintf(file_pt,
"ZONE I=%i, J=%i\n",n_plot,n_plot);
1898 for(
unsigned l2=0;l2<n_plot;l2++)
1900 s[1] = -1.0 + l2*2.0/(n_plot-1);
1901 for(
unsigned l1=0;l1<n_plot;l1++)
1903 s[0] = -1.0 + l1*2.0/(n_plot-1);
1906 for(
unsigned i=0;
i<n_dim;
i++)
1911 for(
unsigned i=0;
i<n_lagr;
i++)
1915 fprintf(file_pt,
"\n");
1918 fprintf(file_pt,
"\n");
1926 template<
unsigned NNODE_1D>
1935 set_lagrangian_dimension(static_cast<SolidNode*>(
node_pt(0))->nlagrangian());
1943 template <
unsigned NNODE_1D>
1955 set_lagrangian_dimension(3);
1974 inline void output(std::ostream &outfile,
const unsigned &n_plot);
1980 inline void output(FILE* file_pt,
const unsigned &n_plot);
2009 template <
unsigned NNODE_1D>
2011 const unsigned &n_plot)
2017 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot
2018 <<
", K=" << n_plot << std::endl;
2027 for(
unsigned l3=0;l3<n_plot;l3++)
2029 s[2] = -1.0 + l3*2.0/(n_plot-1);
2030 for(
unsigned l2=0;l2<n_plot;l2++)
2032 s[1] = -1.0 + l2*2.0/(n_plot-1);
2033 for(
unsigned l1=0;l1<n_plot;l1++)
2035 s[0] = -1.0 + l1*2.0/(n_plot-1);
2038 for(
unsigned i=0;
i<n_dim;
i++)
2040 outfile << QElement<3,NNODE_1D>::interpolated_x(
s,
i) <<
" " ;
2043 for(
unsigned i=0;
i<n_lagr;
i++)
2045 outfile << SolidQElement<3,NNODE_1D>::interpolated_xi(
s,
i) <<
" " ;
2047 outfile << std::endl;
2051 outfile << std::endl;
2058 template <
unsigned NNODE_1D>
2060 const unsigned &n_plot)
2066 fprintf(file_pt,
"ZONE I=%i, J=%i, K=%i\n",n_plot,n_plot,n_plot);
2075 for(
unsigned l3=0;l3<n_plot;l3++)
2077 s[2] = -1.0 + l3*2.0/(n_plot-1);
2078 for(
unsigned l2=0;l2<n_plot;l2++)
2080 s[1] = -1.0 + l2*2.0/(n_plot-1);
2081 for(
unsigned l1=0;l1<n_plot;l1++)
2083 s[0] = -1.0 + l1*2.0/(n_plot-1);
2086 for(
unsigned i=0;
i<n_dim;
i++)
2091 for(
unsigned i=0;
i<n_lagr;
i++)
2093 fprintf(file_pt,
"%g ",
2096 fprintf(file_pt,
"\n");
2100 fprintf(file_pt,
"\n");
2108 template<
unsigned NNODE_1D>
2118 set_lagrangian_dimension(static_cast<SolidNode*>(
node_pt(0))->nlagrangian());
2126 template<
unsigned DIM>
2142 template<
unsigned DIM,
unsigned INITIAL_NNODE_1D=2>
2155 template<
unsigned DIM>
void face1(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the south face (s1 = -1.0)
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &use_equally_spaced_interior_sample_points=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Base class for all line elements.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
SolidQElement(const SolidQElement &)
Broken copy constructor.
void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Needs to be implemented for each new geometric elem...
unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
unsigned nvertex_node() const
Number of vertex nodes in the element.
unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot.
void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Needs to be implemented for each new geometric elem...
virtual void d2shape_local(const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
Function to compute the geometric shape functions and also first and second derivatives w...
unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot.
void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Needs to be implemented for each new geometric element type; see ht...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
int face_outer_unit_normal_sign(const int &face_index) const
Get the sign of the outer unit normal on the face given by face_index.
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Needs to be implemented for each new geometric elem...
QElementBase()
Constructor: Initialise pointers to macro element reference coords.
QSolidElementBase()
Constructor: Empty.
void face0(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the face s0 = -1.0.
void face1(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the face s0 = 1.0.
ElementGeometry::ElementGeometry element_geometry() const
It's a Q element!
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
void output(FILE *file_pt)
C-style output.
std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction) ...
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Typedef for the function that translates the face coordinate to the coordinate in the bulk element...
void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get the local fraction of node j in the element.
void face2(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the east face (s0 = 1.0)
double s_max() const
Max. value of local coordinate.
SolidQElement(const SolidQElement &)
Broken copy constructor.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
unsigned nvertex_node() const
Number of vertex nodes in the element.
Base class for all brick elements.
Vector< double > * S_macro_ll_pt
Pointer to vector of lower left vertex coords. in macro element.
unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
void face2(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the back face (s2 = -1.0)
void faces0(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the east and west faces, along which s0 is fixed.
double s_max() const
Max. value of local coordinate.
void faces1(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the up and down faces, along which s1 is fixed.
Vector< double > * S_macro_ur_pt
Pointer to vector of upper right vertex coords. in macro element.
unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
void face4(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the up face (s1 = 1.0)
void move_local_coord_back_into_element(Vector< double > &s) const
Adjust local coordinates so that they're located inside the element.
A general Finite Element class.
PRefineableQElement()
Empty constuctor.
void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Needs to be implemented for each new geometric elem...
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element also sets up storage for the reference coordinates and initialises them...
unsigned nvertex_node() const
Number of vertex nodes in the element.
void output(FILE *file_pt)
C-style output.
unsigned nnode_1d() const
Number of nodes along each element edge.
Base class for Solid Qelements.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned nnode_1d() const
Number of nodes along each element edge.
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
Set pointers to "current" and "undeformed" MacroElements.
SolidQElement()
Constructor.
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Typedef for the function that returns the partial derivative of the local coordinates in the bulk ele...
QuadElementBase()
Constructor. Empty.
void set_n_node(const unsigned &n)
Set the number of nodes in the element to n, by resizing the storage for pointers to the Node objects...
bool local_coord_is_valid(const Vector< double > &s)
Check whether the local coordinate are valid or not.
void set_dimension(const unsigned &dim)
Set the dimension of the element and initially set the dimension of the nodes to be the same as the d...
unsigned nplot_points(const unsigned &nplot) const
virtual double s_min() const
Min value of local coordinate.
double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the template-free interface for the calculation of inverse jacobian matrix. This is a one-dimensional element, so use the 1D version.
Base class for Qelements.
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Broken assignment operator.
double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the template-free interface for the calculation of the inverse jacobian mapping. This is a three-dimensional element, so use the 3d version.
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks...
Base class for all quad elements.
double & s_macro_ur(const unsigned &i)
Access fct to the i-th coordinate of the element's "upper right" vertex in the associated MacroElemen...
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
QElement(const QElement &)
Broken copy constructor.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
void faces1(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the north and south faces, along which s1 is fixed.
unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot.
double s_macro_ur(const unsigned &i) const
Access fct to the i-th coordinate of the element's "upper right" vertex in the associated MacroElemen...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
static Gauss< 2, NNODE_1D > Default_integration_scheme
Default integration rule: Gaussian integration of same 'order' as the element.
QElementGeometricBase()
Empty default constructor.
unsigned nnode_on_face() const
void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Needs to be implemented for each new geometric element type; see ht...
BrickElementBase()
Constructor. Empty.
double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt(const int &face_index) const
void faces0(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the back and front faces, along which s0 is fixed.
std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction) ...
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot. Broken virtual; can b...
virtual unsigned nvertex_node() const
void get_x_from_macro_element(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Global coordinates as function of local coordinates at previous time "level" t (t=0: present; t>0: pr...
double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
double s_min() const
Min. value of local coordinate.
void macro_map(const Vector< double > &s, Vector< double > &r)
The mapping from local to global coordinates at the current time : r(s)
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot.
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
virtual ~QElementBase()
Broken assignment operator.
int face_outer_unit_normal_sign(const int &face_index) const
Get the sign of the outer unit normal on the face given by face_index.
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt(const int &face_index) const
Get a pointer to the function mapping face coordinates to bulk coordinates.
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
void face_node_number_error_check(const unsigned &i) const
Range check for face node numbers.
unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction) ...
virtual double s_max() const
Max. value of local coordinate.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
SolidQElement(const SolidQElement &)
Broken copy constructor.
void output(std::ostream &outfile)
Output with default number of plot points.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot.
void faces0(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for both faces – the bulk coordinate is fixed on both.
void faces2(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction)
Function for the left and right faces, along which s2 is fixed.
void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get the local fraction of node j in the element.
static Gauss< 3, NNODE_1D > Default_integration_scheme
Default integration rule: Gaussian integration of same 'order' as the element.
void face3(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the right face (s0 = 1.0)
unsigned nplot_points(const unsigned &nplot) const
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
double & s_macro_ll(const unsigned &i)
Access fct to the i-th coordinate of the element's "lower left" vertex in the associated MacroElement...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
LineElementBase()
Constructor. Empty.
void face0(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the west face (s0 = -1.0)
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overloa...
void get_x_from_macro_element(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. using the macro element representation.
RefineableSolidQElement()
Empty constuctor.
double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the template-free interface for the calculation of inverse jacobian matrix. This is a two-dimensional element, so use the two-d version.
void output(std::ostream &outfile)
Broken assignment operator.
QSolidElementBase(const QSolidElementBase &)
Broken copy constructor.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void get_x_and_xi(const Vector< double > &s, Vector< double > &x_fe, Vector< double > &x, Vector< double > &xi_fe, Vector< double > &xi) const
Eulerian and Lagrangian coordinates as function of the local coordinates: The Eulerian position is re...
void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Needs to be implemented for each new geometric elem...
void face1(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the down face (s1 = -1.0)
void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Needs to be implemented for each new geometric element type; see ht...
double s_min() const
Min. value of local coordinate.
void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &use_equally_spaced_interior_sample_points=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
QElement(const QElement &)
Broken copy constructor.
void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &use_equally_spaced_interior_sample_points=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get the local fraction of node j in the element.
virtual Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element. Broken virtual function in "pure" finite elements...
void face0(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the left face (s0 = -1.0)
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...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void output(std::ostream &outfile)
Broken assignment operator.
void face5(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the front face (s2 = 1.0)
QElementGeometricBase(const QElementGeometricBase &)
Broken copy constructor.
SolidQElement()
Constructor.
static Gauss< 1, NNODE_1D > Default_integration_scheme
Default integration rule: Gaussian integration of same 'order' as the element.
double s_max() const
Max. value of local coordinate.
double s_min() const
Min. value of local coordinate.
std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction) ...
QElementBase(const QElementBase &)
Broken copy constructor.
void output(std::ostream &outfile)
Broken assignment operator.
void face3(const Vector< double > &s, Vector< double > &s_bulk)
The translation scheme for the north face (s1 = 1.0)
void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Needs to be implemented for each new geometric elem...
RefineableQElement()
Empty constuctor.
unsigned nnode_1d() const
Number of nodes along each element edge.
SolidFiniteElement class.
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
SolidQElement()
Constructor.
void output(FILE *file_pt)
C-style output.
double s_macro_ll(const unsigned &i) const
Access fct to the i-th coordinate of the element's "lower left" vertex in the associated MacroElement...
MacroElement * Macro_elem_pt
Pointer to the element's macro element (NULL by default)
unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot.
int face_outer_unit_normal_sign(const int &face_index) const
Get the sign of the outer unit normal on the face given by face_index.
QElement(const QElement &)
Broken copy constructor.