88 <<
"---------------------------------------------------------------"
91 <<
"Info: Data is already included in this element's internal "
94 <<
"It's stored as entry " <<
i <<
" and I'm not adding it again."
97 <<
"Note: You can suppress this message by recompiling without"
98 <<
"\n PARANOID or setting the boolean \n"
100 "GeneralisedElement::Suppress_warning_about_repeated_internal_"
102 <<
"\n\n to true." << std::endl
103 <<
"---------------------------------------------------------------"
163 std::deque<double*>
const& global_dof_pt)
181 for (
unsigned i = 0;
i <
n_dof;
i++)
187 unsigned index =
n_dof;
189 for (std::deque<unsigned long>::const_iterator
it =
211 <<
"global_dof_pt is non-empty, yet it does not have the same size\n"
212 <<
"as global_eqn_numbers.\n"
224 for (
unsigned i = 0;
i <
n_dof;
i++)
230 unsigned index =
n_dof;
232 for (std::deque<double*>::const_iterator
it = global_dof_pt.begin();
233 it != global_dof_pt.end();
332 <<
"---------------------------------------------------------------"
335 <<
"Info: Data is already included in this element's external "
338 <<
"It's stored as entry " <<
i <<
" and I'm not adding it again"
341 <<
"Note: You can suppress this message by recompiling without"
342 <<
"\n PARANOID or setting the boolean \n"
344 "GeneralisedElement::Suppress_warning_about_repeated_external_"
346 <<
"\n\n to true." << std::endl
347 <<
"---------------------------------------------------------------"
510 <<
"Data removed from element's external data " << std::endl
511 <<
"You may have to update the indices for remaining data "
513 <<
"This can be achieved by using add_external_data() "
516 "GeneralisedElement::flush_external_data()",
713 for (
unsigned n = 0;
n <
Ndof; ++
n)
732 error_stream <<
"\nLocal/lobal equation numbers: " << std::endl;
733 for (
unsigned n = 0;
n <
Ndof; ++
n)
739 error_stream << std::endl <<
" element address is " <<
this << std::endl;
743 error_stream <<
"Number of internal data " <<
nint << std::endl;
744 for (
unsigned i = 0;
i <
nint;
i++)
748 for (
unsigned j = 0;
j <
nval;
j++)
761 error_stream <<
"Number of external data " <<
next << std::endl;
762 for (
unsigned i = 0;
i <
next;
i++)
766 for (
unsigned j = 0;
j <
nval;
j++)
778 for (
unsigned ii = 0;
ii < ndim;
ii++)
797 unsigned next =
e_el_pt->nexternal_interaction_field_data();
801 for (
unsigned i = 0;
i <
next;
i++)
804 for (
unsigned j = 0;
j <
nval;
j++)
816 for (
unsigned ii = 0;
ii < ndim;
ii++)
830 unsigned next =
e_el_pt->nexternal_interaction_geometric_data();
834 e_el_pt->external_interaction_geometric_data_pt());
835 for (
unsigned i = 0;
i <
next;
i++)
838 for (
unsigned j = 0;
j <
nval;
j++)
846 <<
"Repeated external element geometric dof: " <<
eqn_no
853 for (
unsigned ii = 0;
ii < ndim;
ii++)
875 for (
unsigned j = 0;
j <
nval;
j++)
884 <<
": Repeated nodal dof: " <<
eqn_no;
898 for (
unsigned j = 0;
j <
nval;
j++)
919 for (
unsigned i = 0;
i <
n_dim;
i++)
933 <<
"---------------------------------------------------------------"
936 <<
"Note: You can suppress this warning by recompiling without"
937 <<
"\n PARANOID or setting the boolean \n"
939 "GeneralisedElement::Suppress_warning_about_any_repeated_data"
940 <<
"\n\n to true." << std::endl
942 <<
"Only do this if you know what you're doing; repeated equation\n"
943 <<
"numbers are usually a sign of trouble...\n"
944 <<
"---------------------------------------------------------------"
1182 const double old_var = *value_pt;
1194 for (
unsigned m = 0;
m <
n_dof;
m++)
1278 const double old_var = *value_pt;
1290 for (
unsigned m = 0;
m <
n_dof;
m++)
1323 std::string error_message =
1324 "Empty fill_in_contribution_to_mass_matrix() has been called.\n";
1326 "This function is called from the default implementation of\n";
1327 error_message +=
"get_mass_matrix();\n";
1328 error_message +=
"and must calculate the residuals vector and mass matrix ";
1329 error_message +=
"without initialising any of their entries.\n\n";
1332 "If you do not wish to use these defaults, you must overload\n";
1333 error_message +=
"get_mass_matrix(), which must initialise the entries\n";
1334 error_message +=
"of the residuals vector and mass matrix to zero.\n";
1338 "GeneralisedElement::fill_in_contribution_to_mass_matrix()",
1355 std::string error_message =
1356 "Empty fill_in_contribution_to_jacobian_and_mass_matrix() has been ";
1357 error_message +=
"called.\n";
1359 "This function is called from the default implementation of\n";
1360 error_message +=
"get_jacobian_and_mass_matrix();\n";
1362 "and must calculate the residuals vector and mass and jacobian matrices ";
1363 error_message +=
"without initialising any of their entries.\n\n";
1366 "If you do not wish to use these defaults, you must overload\n";
1368 "get_jacobian_and_mass_matrix(), which must initialise the entries\n";
1370 "of the residuals vector, jacobian and mass matrix to zero.\n";
1374 "GeneralisedElement::fill_in_contribution_to_jacobian_and_mass_matrix()",
1389 std::string error_message =
1390 "Empty fill_in_contribution_to_dresiduals_dparameter() has been ";
1391 error_message +=
"called.\n";
1393 "This function is called from the default implementation of\n";
1394 error_message +=
"get_dresiduals_dparameter();\n";
1395 error_message +=
"and must calculate the derivatives of the residuals "
1396 "vector with respect\n";
1397 error_message +=
"to the passed parameter ";
1398 error_message +=
"without initialising any values.\n\n";
1401 "If you do not wish to use these defaults, you must overload\n";
1403 "get_dresiduals_dparameter(), which must initialise the entries\n";
1404 error_message +=
"of the returned vector to zero.\n";
1407 "This function is intended for use instead of the default (global) \n";
1409 "finite-difference routine when analytic expressions are to be used\n";
1410 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1411 error_message +=
"This function is only called when the function\n";
1413 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1417 "GeneralisedElement::fill_in_contribution_to_dresiduals_dparameter()",
1435 std::string error_message =
1436 "Empty fill_in_contribution_to_djacobian_dparameter() has been ";
1437 error_message +=
"called.\n";
1439 "This function is called from the default implementation of\n";
1440 error_message +=
"get_djacobian_dparameter();\n";
1442 "and must calculate the derivatives of residuals vector and jacobian ";
1443 error_message +=
"matrix\n";
1444 error_message +=
"with respect to the passed parameter ";
1445 error_message +=
"without initialising any values.\n\n";
1448 "If you do not wish to use these defaults, you must overload\n";
1450 "get_djacobian_dparameter(), which must initialise the entries\n";
1451 error_message +=
"of the returned vector and matrix to zero.\n\n";
1454 "This function is intended for use instead of the default (global) \n";
1456 "finite-difference routine when analytic expressions are to be used\n";
1457 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1458 error_message +=
"This function is only called when the function\n";
1460 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1465 "GeneralisedElement::fill_in_contribution_to_djacobian_dparameter()",
1487 std::string error_message =
1488 "Empty fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter() "
1490 error_message +=
" been called.\n";
1492 "This function is called from the default implementation of\n";
1493 error_message +=
"get_djacobian_and_dmass_matrix_dparameter();\n";
1495 "and must calculate the residuals vector and mass and jacobian matrices ";
1496 error_message +=
"without initialising any of their entries.\n\n";
1499 "If you do not wish to use these defaults, you must overload\n";
1500 error_message +=
"get_djacobian_and_dmass_matrix_dparameter(), which must "
1502 error_message +=
"entries of the returned vector and matrices to zero.\n";
1506 "This function is intended for use instead of the default (global) \n";
1508 "finite-difference routine when analytic expressions are to be used\n";
1509 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1510 error_message +=
"This function is only called when the function\n";
1512 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1516 "GeneralisedElement::fill_in_contribution_to_djacobian_"
1517 "and_dmass_matrix_dparameter()",
1536 std::string error_message =
1537 "Empty fill_in_contribution_to_hessian_vector_products() has been ";
1538 error_message +=
"called.\n";
1540 "This function is called from the default implementation of\n";
1541 error_message +=
"get_hessian_vector_products(); ";
1542 error_message +=
" and must calculate the products \n";
1543 error_message +=
"of the hessian matrix with the (global) ";
1544 error_message +=
"vectors Y and C\n";
1545 error_message +=
"without initialising any values.\n\n";
1548 "If you do not wish to use these defaults, you must overload\n";
1550 "get_hessian_vector_products(), which must initialise the entries\n";
1551 error_message +=
"of the returned vector to zero.\n\n";
1554 "This function is intended for use instead of the default (global) \n";
1556 "finite-difference routine when analytic expressions are to be used.\n";
1557 error_message +=
"This function is only called when the function\n";
1558 error_message +=
"Problem::set_analytic_hessian_products() has been called "
1559 "in the driver code\n";
1563 "GeneralisedElement::fill_in_contribution_to_hessian_vector_product()",
1575 std::string error_message =
1576 "Empty fill_in_contribution_to_inner_products() has been called.\n";
1578 "This function is called from the default implementation of\n";
1579 error_message +=
"get_inner_products();\n ";
1580 error_message +=
"It must calculate the inner products over the element\n";
1581 error_message +=
"of given pairs of history values\n";
1582 error_message +=
"without initialision of the output vector.\n\n";
1585 "If you do not wish to use these defaults, you must overload\n";
1587 "get_inner_products(), which must initialise the entries\n";
1588 error_message +=
"of the returned vector to zero.\n\n";
1603 std::string error_message =
1604 "Empty fill_in_contribution_to_inner_product_vectors() has been "
1607 "This function is called from the default implementation of\n";
1608 error_message +=
"get_inner_product_vectors(); ";
1609 error_message +=
" and must calculate the vectors \n";
1610 error_message +=
"corresponding to the input history values\n ";
1612 "that when multiplied by other vectors of history values\n";
1613 error_message +=
"return the appropriate dot products.\n\n";
1614 error_message +=
"The output vectors must not be initialised.\n\n";
1617 "If you do not wish to use these defaults, you must overload\n";
1619 "get_inner_products(), which must initialise the entries\n";
1620 error_message +=
"of the returned vector to zero.\n\n";
1642 oomph_info <<
"\n ERROR: Failed GeneralisedElement::self_test()!"
1644 oomph_info <<
"for internal data object number: " <<
i << std::endl;
1654 oomph_info <<
"\n ERROR: Failed GeneralisedElement::self_test()!"
1656 oomph_info <<
"for external data object number: " <<
i << std::endl;
1676 namespace Locate_zeta_helpers
1715 const unsigned&
i)
const
1791 <<
"Determinant of Jacobian matrix is zero --- "
1792 <<
"singular mapping!\nThe determinant of the "
1793 <<
"jacobian is " << std::fabs(jacobian)
1794 <<
" which is smaller than the treshold "
1796 <<
"You can change this treshold, by specifying "
1797 <<
"FiniteElement::Tolerance_for_singular_jacobian \n"
1798 <<
"Here are the nodal coordinates of the inverted element\n"
1799 <<
"in the form \n\n x,y[,z], hang_status\n\n"
1800 <<
"where hang_status = 1 or 2 for non-hanging or hanging\n"
1801 <<
"nodes respectively (useful for automatic sizing of\n"
1802 <<
"tecplot markers to identify the hanging nodes). \n\n";
1806 for (
unsigned j = 0;
j <
n_nod;
j++)
1827 <<
"NOTE: Offending element is associated with a MacroElement\n"
1828 <<
" AND the element has hanging nodes! \n"
1829 <<
" If an element is thin and highly curved, the \n"
1830 <<
" constraints imposed by\n \n"
1831 <<
" (1) inter-element continuity (imposed by the hanging\n"
1832 <<
" node constraints) and \n\n"
1833 <<
" (2) the need to respect curvilinear domain boundaries\n"
1834 <<
" during mesh refinement (imposed by the element's\n"
1835 <<
" macro element mapping)\n\n"
1836 <<
" may be irreconcilable! \n \n"
1837 <<
" You may have to re-design your base mesh to avoid \n"
1838 <<
" the creation of thin, highly curved elements during\n"
1839 <<
" the refinement process.\n"
1859 <<
"local to global coordinates" << std::endl
1860 <<
" You have an inverted coordinate system!"
1864 <<
"Here are the nodal coordinates of the inverted element\n"
1865 <<
"in the form \n\n x,y[,z], hang_status\n\n"
1866 <<
"where hang_status = 1 or 2 for non-hanging or hanging\n"
1867 <<
"nodes respectively (useful for automatic sizing of\n"
1868 <<
"tecplot markers to identify the hanging nodes). \n\n";
1872 for (
unsigned j = 0;
j <
n_nod;
j++)
1893 <<
"NOTE: The inverted element is associated with a MacroElement\n"
1894 <<
" AND the element has hanging nodes! \n"
1895 <<
" If an element is thin and highly curved, the \n"
1896 <<
" constraints imposed by\n \n"
1897 <<
" (1) inter-element continuity (imposed by the hanging\n"
1898 <<
" node constraints) and \n\n"
1899 <<
" (2) the need to respect curvilinear domain boundaries\n"
1900 <<
" during mesh refinement (imposed by the element's\n"
1901 <<
" macro element mapping)\n\n"
1902 <<
" may be irreconcilable! \n \n"
1903 <<
" You may have to re-design your base mesh to avoid \n"
1904 <<
" the creation of thin, highly curved elements during\n"
1905 <<
" the refinement process.\n"
1912 <<
"If you believe that inverted elements do not cause any\n"
1913 <<
"problems in your specific application you can \n "
1914 <<
"suppress this test by: " << std::endl
1915 <<
" i) setting the (static) flag "
1916 <<
"FiniteElement::Accept_negative_jacobian to be true" << std::endl;
1917 error_stream <<
" ii) switching OFF the PARANOID flag" << std::endl
1951 std::ostringstream error_message;
1952 error_message <<
"Dimension mismatch" << std::endl;
1955 <<
" for the jacobian of the mapping to be well-defined"
1970 jacobian(
i,
j) = 0.0;
2009 for (
unsigned i = 0;
i <
n_row;
i++)
2074 double FiniteElement::invert_jacobian<0>(
2079 oomph_info <<
"\nWarning: You are trying to invert the jacobian for "
2080 <<
"a 'point' element" << std::endl
2081 <<
"This makes no sense and is almost certainly an error"
2094 double FiniteElement::invert_jacobian<1>(
2099 const double det = jacobian(0, 0);
2117 double FiniteElement::invert_jacobian<2>(
2123 jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0);
2145 double FiniteElement::invert_jacobian<3>(
2150 const double det = jacobian(0, 0) * jacobian(1, 1) * jacobian(2, 2) +
2151 jacobian(0, 1) * jacobian(1, 2) * jacobian(2, 0) +
2152 jacobian(0, 2) * jacobian(1, 0) * jacobian(2, 1) -
2153 jacobian(0, 0) * jacobian(1, 2) * jacobian(2, 1) -
2154 jacobian(0, 1) * jacobian(1, 0) * jacobian(2, 2) -
2155 jacobian(0, 2) * jacobian(1, 1) * jacobian(2, 0);
2164 (jacobian(1, 1) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 1)) /
det;
2166 -(jacobian(0, 1) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 1)) /
2169 (jacobian(0, 1) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 1)) /
det;
2171 -(jacobian(1, 0) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 0)) /
2174 (jacobian(0, 0) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 0)) /
det;
2176 -(jacobian(0, 0) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 0)) /
2179 (jacobian(1, 0) * jacobian(2, 1) - jacobian(1, 1) * jacobian(2, 0)) /
det;
2181 -(jacobian(0, 0) * jacobian(2, 1) - jacobian(0, 1) * jacobian(2, 0)) /
2184 (jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0)) /
det;
2221 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2236 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<0>(
2242 oomph_info <<
"\nWarning: You are trying to calculate derivatives of "
2243 <<
"a jacobian w.r.t. nodal coordinates for a 'point' "
2244 <<
"element." << std::endl
2245 <<
"This makes no sense and is almost certainly an error."
2255 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<1>(
2275 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<2>(
2301 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<3>(
2315 (jacobian(1, 1) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 1)) +
2317 (jacobian(0, 2) * jacobian(2, 1) - jacobian(0, 1) * jacobian(2, 2)) +
2319 (jacobian(0, 1) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 1));
2324 (jacobian(1, 2) * jacobian(2, 0) - jacobian(1, 0) * jacobian(2, 2)) +
2326 (jacobian(0, 0) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 0)) +
2328 (jacobian(0, 2) * jacobian(1, 0) - jacobian(0, 0) * jacobian(1, 2));
2333 (jacobian(1, 0) * jacobian(2, 1) - jacobian(1, 1) * jacobian(2, 0)) +
2335 (jacobian(0, 1) * jacobian(2, 0) - jacobian(0, 0) * jacobian(2, 1)) +
2337 (jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0));
2347 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<0>(
2356 oomph_info <<
"\nWarning: You are trying to calculate derivatives of "
2357 <<
"eulerian derivatives of shape functions w.r.t. nodal "
2358 <<
"coordinates for a 'point' element." << std::endl
2359 <<
"This makes no sense and is almost certainly an error."
2370 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<1>(
2385 for (
unsigned q = 0; q <
n_node; q++)
2402 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<2>(
2417 for (
unsigned p = 0;
p < 2;
p++)
2420 for (
unsigned q = 0; q <
n_node; q++)
2459 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<3>(
2474 for (
unsigned p = 0;
p < 3;
p++)
2477 for (
unsigned q = 0; q <
n_node; q++)
2483 for (
unsigned i = 0;
i < 3;
i++)
2496 dpsids(q, 1) * jacobian(2, 2)) *
2498 (
dpsids(q, 0) * jacobian(2, 2) -
2499 dpsids(q, 2) * jacobian(0, 2)) *
2501 (
dpsids(q, 1) * jacobian(0, 2) -
2502 dpsids(q, 0) * jacobian(1, 2)) *
2506 dpsids(q, 2) * jacobian(1, 1)) *
2508 (
dpsids(q, 2) * jacobian(0, 1) -
2509 dpsids(q, 0) * jacobian(2, 1)) *
2511 (
dpsids(q, 0) * jacobian(1, 1) -
2512 dpsids(q, 1) * jacobian(0, 1)) *
2519 dpsids(q, 2) * jacobian(1, 2)) *
2521 (
dpsids(q, 2) * jacobian(0, 2) -
2522 dpsids(q, 0) * jacobian(2, 2)) *
2524 (
dpsids(q, 0) * jacobian(1, 2) -
2525 dpsids(q, 1) * jacobian(0, 2)) *
2529 dpsids(q, 1) * jacobian(2, 0)) *
2531 (
dpsids(q, 0) * jacobian(2, 0) -
2532 dpsids(q, 2) * jacobian(0, 0)) *
2534 (
dpsids(q, 1) * jacobian(0, 0) -
2535 dpsids(q, 0) * jacobian(1, 0)) *
2542 dpsids(q, 1) * jacobian(2, 1)) *
2544 (
dpsids(q, 0) * jacobian(2, 1) -
2545 dpsids(q, 2) * jacobian(0, 1)) *
2547 (
dpsids(q, 1) * jacobian(0, 1) -
2548 dpsids(q, 0) * jacobian(1, 1)) *
2552 dpsids(q, 2) * jacobian(1, 0)) *
2554 (
dpsids(q, 2) * jacobian(0, 0) -
2555 dpsids(q, 0) * jacobian(2, 0)) *
2557 (
dpsids(q, 0) * jacobian(1, 0) -
2558 dpsids(q, 1) * jacobian(0, 0)) *
2564 for (
unsigned i = 0;
i < 3;
i++)
2634 std::ostringstream error_message;
2635 error_message <<
"Dimension mismatch" << std::endl;
2638 <<
" for the jacobian of the mapping to be well-defined"
2654 jacobian(
i,
j) = 0.0;
2674 det *= jacobian(
i,
i);
2714 std::ostringstream error_message;
2715 error_message <<
"djacobian_dX must have the same number of rows as the"
2716 <<
"\nspatial dimension of the element.";
2723 std::ostringstream error_message;
2725 <<
"djacobian_dX must have the same number of columns as the"
2726 <<
"\nnumber of nodes in the element.";
2755 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2798 std::ostringstream error_message;
2799 error_message <<
"d_dpsidx_dX must be of the following dimensions:"
2800 <<
"\nd_dpsidx_dX(el_dim,n_node,n_node,el_dim)";
2849 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2882 for (
unsigned j = 0;
j <
n_dim;
j++)
2887 for (
unsigned i = 0;
i <
n_dim;
i++)
2893 for (
unsigned j = 0;
j <
n_dim;
j++)
2923 for (
unsigned j = 0;
j <
n_dim;
j++)
2939 void FiniteElement::transform_second_derivatives_template<1>(
2958 d2basis(
l,
k, 0) / (jacobian(0, 0) * jacobian(0, 0))
2961 (jacobian(0, 0) * jacobian(0, 0) * jacobian(0, 0));
2978 void FiniteElement::transform_second_derivatives_template<2>(
2991 jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0);
3036 for (
unsigned j = 0;
j < 2;
j++)
3059 for (
unsigned j = 0;
j < 3;
j++)
3065 for (
unsigned i = 0;
i < 2;
i++)
3090 void FiniteElement::transform_second_derivatives_diagonal<1>(
3097 FiniteElement::transform_second_derivatives_template<1>(
3108 void FiniteElement::transform_second_derivatives_diagonal<2>(
3129 d2basis(
l,
k, 0) / (jacobian(0, 0) * jacobian(0, 0)) -
3131 (jacobian(0, 0) * jacobian(0, 0) * jacobian(0, 0));
3134 d2basis(
l,
k, 1) / (jacobian(1, 1) * jacobian(1, 1)) -
3136 (jacobian(1, 1) * jacobian(1, 1) * jacobian(1, 1));
3177 throw OomphLibError(
"Not implemented yet ... maybe one day",
3188 error_stream <<
"Dimension of the element must be 1,2 or 3, not "
3421 const unsigned&
ipt,
3734 const double old_var = *value_pt;
3746 for (
unsigned m = 0;
m <
n_dof;
m++)
3781 if (
n_nod == 0)
return;
3798 for (
unsigned j = 0;
j <
n_nod;
j++)
3814 nod_pt->perform_auxiliary_node_update_fct();
3823 for (
unsigned l = 0;
l <
n_dof;
l++)
3834 nod_pt->perform_auxiliary_node_update_fct();
3873 <<
" times in an element." << std::endl
3874 <<
"In positions: ";
3881 error_stream << std::endl <<
"That seems very odd." << std::endl;
3963 for (
unsigned j = 0;
j <
nnod;
j++)
3976 for (
unsigned j = 0;
j <
nnod;
j++)
3993 const unsigned&
i)
const
4025 const unsigned&
i)
const
4170 throw OomphLibError(
"Cannot calculate J_eulerian() for point element\n",
4178 det =
G(0, 0) *
G(1, 1) -
G(0, 1) *
G(1, 0);
4181 det =
G(0, 0) *
G(1, 1) *
G(2, 2) +
G(0, 1) *
G(1, 2) *
G(2, 0) +
4182 G(0, 2) *
G(1, 0) *
G(2, 1) -
G(0, 0) *
G(1, 2) *
G(2, 1) -
4183 G(0, 1) *
G(1, 0) *
G(2, 2) -
G(0, 2) *
G(1, 1) *
G(2, 0);
4186 oomph_info <<
"More than 3 dimensions in J_eulerian()" << std::endl;
4239 throw OomphLibError(
"Cannot calculate J_eulerian() for point element\n",
4247 det =
G(0, 0) *
G(1, 1) -
G(0, 1) *
G(1, 0);
4250 det =
G(0, 0) *
G(1, 1) *
G(2, 2) +
G(0, 1) *
G(1, 2) *
G(2, 0) +
4251 G(0, 2) *
G(1, 0) *
G(2, 1) -
G(0, 0) *
G(1, 2) *
G(2, 1) -
4252 G(0, 1) *
G(1, 0) *
G(2, 2) -
G(0, 2) *
G(1, 1) *
G(2, 0);
4255 oomph_info <<
"More than 3 dimensions in J_eulerian()" << std::endl;
4376 for (
unsigned i = 0;
i <
n_dim;
i++)
4437 for (
unsigned i = 0;
i <
n_dim;
i++)
4485 OomphLibWarning(
"Pointer to spatial integration scheme has not been set.",
4486 "FiniteElement::self_test()",
4573 if (std::fabs(jacobian) < 1.0e-16)
4576 warning_stream <<
"Determinant of Jacobian matrix is zero at ipt "
4577 <<
ipt << std::endl;
4579 "FiniteElement::self_test()",
4591 <<
ipt << std::endl;
4593 <<
"If you think that this is what you want you may: "
4595 <<
"set the (static) flag "
4596 <<
"FiniteElement::Accept_negative_jacobian to be true"
4600 "FiniteElement::self_test()",
4728 for (
unsigned i = 0;
i < ncoord;
i++)
4789 if (
radius > Locate_zeta_helpers::
4790 Radius_multiplier_for_fast_exit_from_locate_zeta *
4874 double maxres = std::fabs(
5019 error.disable_error_message();
5022 <<
"FiniteElement::locate_zeta()" << std::endl;
5023 oomph_info <<
"Should not affect the result!" << std::endl;
5094 geom_object_pt =
this;
5248 for (
unsigned i = 0;
i <
n_dim + 1;
i++)
5256 for (
unsigned i = 0;
i <
n_dim;
i++)
5280 if (n_dim_el == 0)
return 1.0;
5308 for (
unsigned i = 0;
i <
n_dim;
i++)
5326 for (
unsigned k = 0;
k <
n_dim;
k++)
5341 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5345 "FaceElement::J_eulerian()",
5391 for (
unsigned i = 0;
i <
n_dim;
i++)
5410 for (
unsigned k = 0;
k <
n_dim;
k++)
5425 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5429 "FaceElement::J_eulerian_at_knot()",
5480 for (
unsigned i = 0;
i <
n_dim;
i++)
5501 for (
unsigned k = 0;
k <
n_dim;
k++)
5516 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5520 "FaceElement::J_eulerian_at_knot()",
5561 <<
"Local coordinate s passed to outer_unit_normal() has dimension "
5562 <<
s.
size() << std::endl
5563 <<
"but element dimension is " <<
element_dim << std::endl;
5575 error_stream <<
"Tangent direction vector has dimension "
5577 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
5587 error_stream <<
"Unit normal passed to outer_unit_normal() has dimension "
5589 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
5613 <<
"This is a 0D FaceElement, we need one tangent vector.\n"
5614 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5630 <<
"This is a 1D FaceElement, we need one tangent vector.\n"
5631 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5647 <<
"This is a 2D FaceElement, we need two tangent vectors.\n"
5648 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5659 "Cannot have a FaceElement with dimension higher than 2",
5672 <<
" spatial dimensions.\n"
5673 <<
"But the " <<
vec_i <<
" tangent vector has size "
5691 <<
"It is unclear how to calculate a tangent and normal vectors for "
5692 <<
"a point element.\n";
5733 for (
unsigned j = 0;
j < 2;
j++)
5816 <<
"coordinates at the nodes of this 2D FaceElement,\n"
5817 <<
"which must have come from a 3D Bulk element\n";
5847 for (
unsigned j = 0;
j < 2;
j++)
5850 for (
unsigned i = 0;
i < 3;
i++)
5896 err_stream <<
"The angle between the unit normal and the \n"
5897 <<
"direction vector is less than 10 degrees.";
5950 if (a != 0.0 || b != 0.0)
5952 double a_sq = a * a;
5953 double b_sq = b * b;
5954 double c_sq = c * c;
5975 <<
"I have detected that your normal vector is [0,0,1].\n"
5976 <<
"Since this function compares against 0.0, you may\n"
5977 <<
"get discontinuous tangent vectors.";
6004 "Cannot have a FaceElement with dimension higher than 2",
6018 const unsigned&
ipt,
6053 <<
"Local coordinate s passed to outer_unit_normal() has dimension "
6054 <<
s.
size() << std::endl
6055 <<
"but element dimension is " <<
element_dim << std::endl;
6065 error_stream <<
"Unit normal passed to outer_unit_normal() has dimension "
6067 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
6219 for (
unsigned j = 0;
j < 2;
j++)
6291 <<
"coordinates at the nodes of this 2D FaceElement,\n"
6292 <<
"which must have come from a 3D Bulk element\n";
6322 for (
unsigned j = 0;
j < 2;
j++)
6325 for (
unsigned i = 0;
i < 3;
i++)
6347 "Cannot have a FaceElement with dimension higher than 2",
6397 (*Face_to_bulk_coordinate_fct_pt)(
s,
s_bulk);
6401 throw OomphLibError(
"Face_to_bulk_coordinate mapping not set",
6422 (*Face_to_bulk_coordinate_fct_pt)(
s,
s_bulk);
6427 throw OomphLibError(
"Face_to_bulk_coordinate mapping not set",
6448 (*Bulk_coordinate_derivatives_fct_pt)(
6455 "No function for derivatives of bulk coords wrt face coords set",
6502 for (
unsigned i = 0;
i <
n_dim;
i++)
6574 std::ostringstream error_message;
6575 error_message <<
"Dimension mismatch" << std::endl;
6576 error_message <<
"The elemental dimension: " <<
el_dim
6577 <<
" must equal the nodal Lagrangian dimension: "
6579 <<
" for the jacobian of the mapping to be well-defined"
6593 jacobian(
i,
j) = 0.0;
6633 for (
unsigned i = 0;
i <
n_row;
i++)
6696 jacobian(
i,
j) = 0.0;
6717 det *= jacobian(
i,
i);
7069 const double old_var = *value_pt;
7086 for (
unsigned m = 0;
m <
n_dof;
m++)
7136 const unsigned&
i)
const
7267 error_stream <<
"Can only call fill_in_jacobian_for_newmark_accel()\n"
7268 <<
"With Solve_for_consistent_newmark_accel_flag:"
7312 <<
"Assignment of Newmark accelerations obviously only works\n"
7313 <<
"for Newmark timesteppers. You've called me with "
7410 const unsigned&
flag)
7530 <<
"WARNING: You should really free all Data"
7532 <<
" before setup of initial guess" << std::endl
7533 <<
"ll, kk, ii " <<
ll <<
" " <<
kk <<
" " <<
ii
7542 oomph_info <<
"WARNING: You should really free all Data"
7544 <<
" before setup of initial guess"
7546 <<
"l, k, i " <<
l <<
" " <<
k <<
" " <<
i
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
virtual void add_eqn_numbers_to_vector(Vector< long > &vector_of_eqn_numbers)
Add all equation numbers to the vector in the internal storage order.
virtual void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Node. The ostream specifies the output stream to which the descr...
virtual void add_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Add pointers to all unpinned and unconstrained data to a map indexed by (global) equation number.
static long Is_pinned
Static "Magic number" used in place of the equation number to indicate that the value is pinned.
virtual void read_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all data and time history values from the vector starting from index. On return the index will b...
virtual void add_values_to_vector(Vector< double > &vector_of_values)
Add all data and time history values to the vector in the internal storage order.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual void assign_eqn_numbers(unsigned long &global_ndof, Vector< double * > &dof_pt)
Assign global equation numbers; increment global number of unknowns, global_ndof; and add any new dof...
static long Is_unclassified
Static "Magic number" used in place of the equation number to denote a value that hasn't been classif...
virtual void read_eqn_numbers_from_vector(const Vector< long > &vector_of_eqn_numbers, unsigned &index)
Read all equation numbers from the vector starting from index. On return the index will be set to the...
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
void solve(DoubleVector &rhs)
Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution)....
This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems ...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
int & normal_sign()
Sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding "bulk" ...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void continuous_tangent_and_outer_unit_normal(const Vector< double > &s, Vector< Vector< double > > &tang_vec, Vector< double > &unit_normal) const
Compute the tangent vector(s) and the outer unit normal vector at the specified local coordinate....
FiniteElement * Bulk_element_pt
Pointer to the associated higher-dimensional "bulk" element.
void bulk_node_number_resize(const unsigned &i)
Resize the storage for the bulk node numbers.
BulkCoordinateDerivativesFctPt & bulk_coordinate_derivatives_fct_pt()
Return the pointer to the function that returns the derivatives of the bulk coordinates wrt the face ...
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
int Normal_sign
Sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding "bulk" ...
BulkCoordinateDerivativesFctPt Bulk_coordinate_derivatives_fct_pt
Pointer to a function that returns the derivatives of the local "bulk" coordinates with respect to th...
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Return vector of local coordinates in bulk element, given the local coordinates in this FaceElement.
Vector< double > * Tangent_direction_pt
A general direction pointer for the tangent vectors. This is used in the function continuous_tangent_...
unsigned & nbulk_value(const unsigned &n)
Return the number of values originally stored at local node n (before the FaceElement added additiona...
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
unsigned & bulk_node_number(const unsigned &n)
Return the bulk node number that corresponds to the n-th local node number.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
static bool Ignore_discontinuous_tangent_warning
Ignores the warning when the tangent vectors from continuous_tangent_and_outer_unit_normal may not be...
double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point O...
void check_J_eulerian_at_knots(bool &passed) const
Check that Jacobian of mapping between local and Eulerian coordinates at all integration points is po...
unsigned & bulk_position_type(const unsigned &i)
Return the position type in the "bulk" element that corresponds to position type i on the FaceElement...
void get_ds_bulk_ds_face(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction) const
Calculate the derivatives of the local coordinates in the bulk element with respect to the local coor...
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Calculate the vector of local coordinate in the bulk element given the local coordinates in this Face...
CoordinateMappingFctPt Face_to_bulk_coordinate_fct_pt
Pointer to a function that translates the face coordinate to the coordinate in the bulk element.
CoordinateMappingFctPt & face_to_bulk_coordinate_fct_pt()
Return the pointer to the function that maps the face coordinate to the bulk coordinate.
void output_zeta(std::ostream &outfile, const unsigned &nplot)
Output boundary coordinate zeta.
void nbulk_value_resize(const unsigned &i)
Resize the storage for the number of values originally stored at the local nodes to i entries.
A general Finite Element class.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
virtual 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.
double d2shape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Compute the geometric shape functions and also first and second derivatives w.r.t....
virtual void update_before_nodal_fd()
Function that is called before the finite differencing of any nodal data. This may be overloaded to u...
double dJ_eulerian_at_knot(const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
Compute the geometric shape functions (psi) at integration point ipt. Return the determinant of the j...
void set_nodal_dimension(const unsigned &nodal_dim)
Set the dimension of the nodes in the element. This will typically only be required when constructing...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
virtual 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 (broken virtual)
Integral * Integral_pt
Pointer to the spatial integration scheme.
virtual void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t.local coordinates to derivatives w.r.t the coordinates used to assemble the ...
virtual unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
Get the number of the ith node on face face_index (in the bulk node vector).
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.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual double s_min() const
Min value of local coordinate.
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
virtual void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for Data stored at the nodes Virtual so that it can be overloaded b...
virtual void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get the local fraction of the node j in the element A dumb, but correct default implementation is pro...
virtual double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
A template-free interface that takes the matrix passed as jacobian and return its inverse in inverse_...
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
virtual void update_in_nodal_fd(const unsigned &i)
Function called within the finite difference loop for nodal data after a change in the i-th nodal val...
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n....
virtual double local_to_eulerian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates given the derivatives of the shape functions...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
static double Tolerance_for_singular_jacobian
Tolerance below which the jacobian is considered singular.
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the nodal degrees of freedom using finite difference...
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
For a given value of zeta, the "global" intrinsic coordinate of a mesh of FiniteElements represented ...
void check_jacobian(const double &jacobian) const
Helper function used to check for singular or negative Jacobians in the transform from local to globa...
virtual void d2shape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
Return the geometric shape function and its first and second derivatives w.r.t. the local coordinates...
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....
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0,...
static const double Node_location_tolerance
Default value for the tolerance to be used when locating nodes via local coordinates.
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...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
MacroElement * Macro_elem_pt
Pointer to the element's macro element (NULL by default)
virtual void assemble_local_to_eulerian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Assemble the jacobian matrix for the mapping from local to Eulerian coordinates, given the derivative...
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n.
unsigned nnode() const
Return the number of nodes.
virtual double s_max() const
Max. value of local coordinate.
unsigned Nodal_dimension
The spatial dimension of the nodes in the element. We assume that nodes have the same spatial dimensi...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void reset_in_nodal_fd(const unsigned &i)
Function called within the finite difference loop for nodal data after the i-th nodal values is reset...
virtual double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Return t-th time-derivative of the i-th FE-interpolated Eulerian coordinate at local coordinate s.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the values of the "global" intrinsic coordinate, zeta, of a compound geometric object (a mesh...
Node ** Node_pt
Storage for pointers to the nodes in the element.
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt(const int &face_index) const
Get a pointer to the derivative of the mapping from face to bulk coordinates.
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta(Vector< double > &cog, double &max_radius) const
Compute centre of gravity of all nodes and radius of node that is furthest from it....
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
virtual void reset_after_nodal_fd()
Function that is call after the finite differencing of the nodal data. This may be overloaded to rese...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
unsigned Elemental_dimension
The spatial dimension of the element, i.e. the number of local coordinates used to parametrize it.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual bool local_coord_is_valid(const Vector< double > &s)
Broken assignment operator.
void check_J_eulerian_at_knots(bool &passed) const
Check that Jacobian of mapping between local and Eulerian coordinates at all integration points is po...
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 void move_local_coord_back_into_element(Vector< double > &s) const
Adjust local coordinates so that they're located inside the element.
virtual void assemble_eulerian_base_vectors(const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
Assemble the covariant Eulerian base vectors, assuming that the derivatives of the shape functions wi...
virtual void assemble_local_to_eulerian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Assemble the the "jacobian" matrix of second derivatives of the mapping from local to Eulerian coordi...
virtual void d_dshape_eulerian_dnodal_coordinates(const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
A template-free interface that calculates the derivative w.r.t. the nodal coordinates of the derivat...
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
void integrate_fct(FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
Evaluate integral of a Vector-valued function over the element.
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
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....
virtual void transform_second_derivatives(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Convert derivatives and second derivatives w.r.t. local coordiantes to derivatives and second derivat...
virtual void describe_nodal_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
int ** Nodal_local_eqn
Storage for the local equation numbers associated with the values stored at the nodes.
virtual ~FiniteElement()
The destructor cleans up the static memory allocated for shape function storage. Internal and externa...
virtual void get_x_from_macro_element(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates using macro element representation....
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
unsigned Nnode
Number of nodes in the element.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
static const unsigned N2deriv[]
Static array that holds the number of second derivatives as a function of the dimension of the elemen...
static bool Accept_negative_jacobian
Boolean that if set to true allows a negative jacobian in the transform between global and local coor...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
virtual unsigned nnode_on_face() const
void transform_derivatives_diagonal(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t local coordinates to derivatives w.r.t the coordinates used to assemble the ...
double raw_nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n....
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
static bool Suppress_output_while_checking_for_inverted_elements
Static boolean to suppress output while checking for inverted elements.
int get_node_number(Node *const &node_pt) const
Return the number of the node *node_pt if this node is in the element, else return -1;.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual double d2shape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Return the geometric shape functions and also first and second derivatives w.r.t. global coordinates ...
virtual void identify_field_data_for_interactions(std::set< std::pair< Data *, unsigned > > &paired_field_data)
The purpose of this function is to identify all possible Data that can affect the fields interpolated...
virtual void dJ_eulerian_dnodal_coordinates(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
A template-free interface that calculates the derivative of the jacobian of a mapping with respect to...
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.
static const unsigned Default_Initial_Nvalue
Default return value for required_nvalue(n) which gives the number of "data" values required by the e...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
unsigned nexternal_data() const
Return the number of external data objects.
virtual void reset_in_external_fd(const unsigned &i)
Function called within the finite difference loop for external data after the values in the i-th exte...
virtual void fill_in_contribution_to_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Add the elemental contribution to the mass matrix matrix. and the residuals vector....
virtual void update_in_internal_fd(const unsigned &i)
Function called within the finite difference loop for internal data after a change in any values in t...
bool is_halo() const
Is this element a halo?
virtual void reset_after_external_fd()
Function that is call after the finite differencing of the external data. This may be overloaded to r...
virtual void update_before_external_fd()
Function that is called before the finite differencing of any external data. This may be overloaded t...
void assign_internal_eqn_numbers(unsigned long &global_number, Vector< double * > &Dof_pt)
Assign the global equation numbers to the internal Data. The arguments are the current highest global...
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
static bool Suppress_warning_about_repeated_external_data
Static boolean to suppress warnings about repeated external data. Defaults to true.
bool internal_data_fd(const unsigned &i) const
Return the status of the boolean flag indicating whether the internal data is included in the finite ...
unsigned long * Eqn_number
Storage for the global equation numbers represented by the degrees of freedom in the element.
void read_internal_eqn_numbers_from_vector(const Vector< long > &vector_of_eqn_numbers, unsigned &index)
Read all equation numbers associated with internal data from the vector starting from index....
virtual void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the elemental contribution to the jacobian matrix, mass matrix and the residuals vector....
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Add the elemental contribution to the derivative of the jacobian matrix, mass matrix and the residual...
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
bool external_data_fd(const unsigned &i) const
Return the status of the boolean flag indicating whether the external data is included in the finite ...
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Assign all the local equation numbering schemes that can be applied generically for the element....
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int ** Data_local_eqn
Pointer to array storage for local equation numbers associated with internal and external data....
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
void add_internal_data_values_to_vector(Vector< double > &vector_of_values)
Add all internal data and time history values to the vector in the internal storage order.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
virtual void assign_additional_local_eqn_numbers()
Setup any additional look-up schemes for local equation numbers. Examples of use include using local ...
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
virtual void fill_in_contribution_to_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Add the elemental contribution to the derivatives of the residuals with respect to a parameter....
static bool Suppress_warning_about_any_repeated_data
Static boolean to suppress warnings about repeated data. Defaults to false.
virtual ~GeneralisedElement()
Virtual destructor to clean up any memory allocated by the object.
unsigned ninternal_data() const
Return the number of internal data objects.
int Non_halo_proc_ID
Non-halo processor ID for Data; -1 if it's not a halo.
void clear_global_eqn_numbers()
Clear the storage for the global equation numbers and pointers to dofs (if stored)
unsigned Ninternal_data
Number of internal data.
unsigned Nexternal_data
Number of external data.
void add_internal_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Add pointers to the internal data values to map indexed by the global equation number.
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
Add the contents of the queue global_eqn_numbers to the local storage for the local-to-global transla...
virtual void update_before_internal_fd()
Function that is called before the finite differencing of any internal data. This may be overloaded t...
virtual void reset_in_internal_fd(const unsigned &i)
Function called within the finite difference loop for internal data after the values in the i-th exte...
virtual void fill_in_contribution_to_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Add the elemental contribution to the derivatives of the elemental Jacobian matrix and residuals with...
virtual void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Fill in contribution to the product of the Hessian (derivative of Jacobian with respect to all variab...
unsigned Ndof
Number of degrees of freedom.
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
static std::deque< double * > Dof_pt_deque
Static storage for deque used to add_global_equation_numbers when pointers to the dofs in each elemen...
virtual void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for the internal and external Data This must be called after the gl...
virtual void fill_in_contribution_to_inner_products(Vector< std::pair< unsigned, unsigned > > const &history_index, Vector< double > &inner_product)
Fill in the contribution to the inner products between given pairs of history values.
virtual void fill_in_contribution_to_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double > > &inner_product_vector)
Fill in the contributions to the vectors that when taken as dot product with other history values giv...
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
void add_internal_eqn_numbers_to_vector(Vector< long > &vector_of_eqn_numbers)
Add all equation numbers associated with internal data to the vector in the internal storage order.
virtual void reset_after_internal_fd()
Function that is call after the finite differencing of the internal data. This may be overloaded to r...
virtual unsigned self_test()
Self-test: Have all internal values been classified as pinned/unpinned? Return 0 if OK.
virtual void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Setup the arrays of local equation numbers for the element. If the optional boolean argument is true,...
Data ** Data_pt
Storage for pointers to internal and external data. The data is of the same type and so can be addres...
static bool Suppress_warning_about_repeated_internal_data
Static boolean to suppress warnings about repeated internal data. Defaults to false.
double ** Dof_pt
Storage for array of pointers to degrees of freedom ordered by local equation number....
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data.
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the element. The ostream specifies the output stream to which the de...
std::vector< bool > Data_fd
Storage for boolean flags of size Ninternal_data + Nexternal_data that correspond to the data used in...
void flush_external_data()
Flush all external data.
void read_internal_data_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all internal data and time history values from the vector starting from index....
virtual void update_in_external_fd(const unsigned &i)
Function called within the finite difference loop for external data after a change in any values in t...
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
A geometric object is an object that provides a parametrised description of its shape via the functio...
unsigned ndim() const
Access function to # of Eulerian coordinates.
virtual void dposition_dt(const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
j-th time-derivative on object at current time: .
Generic class for numerical integration schemes:
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
A class to specify when the error is caused by an inverted element.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following th...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual void node_update(const bool &update_all_time_levels_for_new_node=false)
Interface for functions that update the nodal position using algebraic remeshing strategies....
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
An OomphLibError object which should be thrown when an run-time error is encountered....
===================================================================== A class for handling oomph-lib ...
An OomphLibWarning object which should be created as a temporary object to issue a warning....
void shape(const Vector< double > &s, Shape &psi) const
Broken assignment operator.
static PointIntegral Default_integration_scheme
Return spatial dimension of element (=number of local coordinates needed to parametrise the element)
Broken pseudo-integration scheme for points elements: Iit's not clear in general what this integratio...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
unsigned lagrangian_dimension() const
Return the number of Lagrangian coordinates that the element requires at all nodes....
void describe_solid_local_dofs(std::ostream &out, const std::string ¤t_string) const
Classifies dofs locally for solid specific aspects.
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. ‘Direction’ i, ‘Type’ k.
double raw_lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. ‘Direction’ i, ‘Type’ k....
int * Position_local_eqn
Array to hold the local equation number information for the solid equations, whatever they may be.
virtual void assemble_local_to_lagrangian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Assemble the the "jacobian" matrix of second derivatives, given the second derivatives of the shape f...
virtual void assign_solid_local_eqn_numbers(const bool &store_local_dof)
Assigns local equation numbers for the generic solid local equation numbering schemes....
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Calculate shape functions and derivatives w.r.t. Lagrangian coordinates at local coordinate s....
unsigned nnodal_lagrangian_type() const
Return the number of types of (generalised) nodal Lagrangian coordinates required to interpolate the ...
unsigned Lagrangian_dimension
The Lagrangian dimension of the nodes stored in the element, / i.e. the number of Lagrangian coordina...
virtual void update_before_solid_position_fd()
Function that is called before the finite differencing of any solid position data....
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
virtual double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Return the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordina...
void fill_in_generic_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to fill in the residuals and (if flag==1) the Jacobian for the setup of an initial co...
virtual double local_to_lagrangian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Lagrangian coordinates given the derivatives of the shape functio...
virtual void update_in_solid_position_fd(const unsigned &i)
Function called within the finite difference loop for the solid position dat after a change in any va...
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Access function that returns the local equation number that corresponds to the j-th coordinate of the...
virtual double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to lagrangian coordinates, given the derivatives of the shape functi...
virtual void assemble_local_to_lagrangian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Assemble the jacobian matrix for the mapping from local to lagrangian coordinates,...
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s.
virtual void reset_in_solid_position_fd(const unsigned &i)
Function called within the finite difference loop for solid position data after the values in the i-t...
virtual void interpolated_dxids(const Vector< double > &s, DenseMatrix< double > &dxids) const
Compute derivatives of FE-interpolated Lagrangian coordinates xi with respect to local coordinates: d...
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions....
double multiplier(const Vector< double > &xi)
Access to the "multiplier" for the inertia terms in the consistent determination of the initial condi...
double d2shape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Compute the geometric shape functions and also first and second derivatives w.r.t....
void compute_norm(double &el_norm)
Calculate the L2 norm of the displacement u=R-r to overload the compute_norm function in the Generali...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
virtual ~SolidFiniteElement()
Destructor to clean up any allocated memory.
void fill_in_jacobian_for_newmark_accel(DenseMatrix< double > &jacobian)
Fill in the contributions of the Jacobian matrix for the consistent assignment of the initial "accele...
virtual void reset_after_solid_position_fd()
Function that is call after the finite differencing of the solid position data. This may be overloade...
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
GeomObject *& geom_object_pt()
(Reference to) pointer to geom object that specifies the initial condition
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
unsigned required_nvalue(const unsigned &n) const
Access function for Nvalue: # of ‘values’ (pinned or dofs) at node n (always returns the same value a...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
unsigned Max_newton_iterations
Maximum number of newton iterations.
double Newton_tolerance
Convergence tolerance for the newton solver.
unsigned N_local_points
Number of points along one dimension of each element used to create coordinates within the element in...
double Radius_multiplier_for_fast_exit_from_locate_zeta
Multiplier for (zeta-based) outer radius of element used for deciding that point is outside element....
const double Pi
50 digits from maple
double dot(const Vector< double > &a, const Vector< double > &b)
Probably not always best/fastest because not optimised for dimension but useful...
void cross(const Vector< double > &A, const Vector< double > &B, Vector< double > &C)
Cross product using "proper" output (move semantics means this is ok nowadays).
double angle(const Vector< double > &a, const Vector< double > &b)
Get the angle between two vector.
double magnitude(const Vector< double > &a)
Get the magnitude of a vector.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...