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()",
710 for (
unsigned n = 0;
n <
Ndof; ++
n)
729 error_stream <<
"\nLocal/lobal equation numbers: " << std::endl;
730 for (
unsigned n = 0;
n <
Ndof; ++
n)
736 error_stream << std::endl <<
" element address is " <<
this << std::endl;
740 error_stream <<
"Number of internal data " <<
nint << std::endl;
741 for (
unsigned i = 0;
i <
nint;
i++)
745 for (
unsigned j = 0;
j <
nval;
j++)
758 error_stream <<
"Number of external data " <<
next << std::endl;
759 for (
unsigned i = 0;
i <
next;
i++)
763 for (
unsigned j = 0;
j <
nval;
j++)
775 for (
unsigned ii = 0;
ii < ndim;
ii++)
794 unsigned next =
e_el_pt->nexternal_interaction_field_data();
798 for (
unsigned i = 0;
i <
next;
i++)
801 for (
unsigned j = 0;
j <
nval;
j++)
813 for (
unsigned ii = 0;
ii < ndim;
ii++)
827 unsigned next =
e_el_pt->nexternal_interaction_geometric_data();
831 e_el_pt->external_interaction_geometric_data_pt());
832 for (
unsigned i = 0;
i <
next;
i++)
835 for (
unsigned j = 0;
j <
nval;
j++)
843 <<
"Repeated external element geometric dof: " <<
eqn_no
850 for (
unsigned ii = 0;
ii < ndim;
ii++)
872 for (
unsigned j = 0;
j <
nval;
j++)
881 <<
": Repeated nodal dof: " <<
eqn_no;
895 for (
unsigned j = 0;
j <
nval;
j++)
916 for (
unsigned i = 0;
i <
n_dim;
i++)
930 <<
"---------------------------------------------------------------"
933 <<
"Note: You can suppress this warning by recompiling without"
934 <<
"\n PARANOID or setting the boolean \n"
936 "GeneralisedElement::Suppress_warning_about_any_repeated_data"
937 <<
"\n\n to true." << std::endl
939 <<
"Only do this if you know what you're doing; repeated equation\n"
940 <<
"numbers are usually a sign of trouble...\n"
941 <<
"---------------------------------------------------------------"
1179 const double old_var = *value_pt;
1191 for (
unsigned m = 0;
m <
n_dof;
m++)
1275 const double old_var = *value_pt;
1287 for (
unsigned m = 0;
m <
n_dof;
m++)
1320 std::string error_message =
1321 "Empty fill_in_contribution_to_mass_matrix() has been called.\n";
1323 "This function is called from the default implementation of\n";
1324 error_message +=
"get_mass_matrix();\n";
1325 error_message +=
"and must calculate the residuals vector and mass matrix ";
1326 error_message +=
"without initialising any of their entries.\n\n";
1329 "If you do not wish to use these defaults, you must overload\n";
1330 error_message +=
"get_mass_matrix(), which must initialise the entries\n";
1331 error_message +=
"of the residuals vector and mass matrix to zero.\n";
1335 "GeneralisedElement::fill_in_contribution_to_mass_matrix()",
1352 std::string error_message =
1353 "Empty fill_in_contribution_to_jacobian_and_mass_matrix() has been ";
1354 error_message +=
"called.\n";
1356 "This function is called from the default implementation of\n";
1357 error_message +=
"get_jacobian_and_mass_matrix();\n";
1359 "and must calculate the residuals vector and mass and jacobian matrices ";
1360 error_message +=
"without initialising any of their entries.\n\n";
1363 "If you do not wish to use these defaults, you must overload\n";
1365 "get_jacobian_and_mass_matrix(), which must initialise the entries\n";
1367 "of the residuals vector, jacobian and mass matrix to zero.\n";
1371 "GeneralisedElement::fill_in_contribution_to_jacobian_and_mass_matrix()",
1386 std::string error_message =
1387 "Empty fill_in_contribution_to_dresiduals_dparameter() has been ";
1388 error_message +=
"called.\n";
1390 "This function is called from the default implementation of\n";
1391 error_message +=
"get_dresiduals_dparameter();\n";
1392 error_message +=
"and must calculate the derivatives of the residuals "
1393 "vector with respect\n";
1394 error_message +=
"to the passed parameter ";
1395 error_message +=
"without initialising any values.\n\n";
1398 "If you do not wish to use these defaults, you must overload\n";
1400 "get_dresiduals_dparameter(), which must initialise the entries\n";
1401 error_message +=
"of the returned vector to zero.\n";
1404 "This function is intended for use instead of the default (global) \n";
1406 "finite-difference routine when analytic expressions are to be used\n";
1407 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1408 error_message +=
"This function is only called when the function\n";
1410 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1414 "GeneralisedElement::fill_in_contribution_to_dresiduals_dparameter()",
1432 std::string error_message =
1433 "Empty fill_in_contribution_to_djacobian_dparameter() has been ";
1434 error_message +=
"called.\n";
1436 "This function is called from the default implementation of\n";
1437 error_message +=
"get_djacobian_dparameter();\n";
1439 "and must calculate the derivatives of residuals vector and jacobian ";
1440 error_message +=
"matrix\n";
1441 error_message +=
"with respect to the passed parameter ";
1442 error_message +=
"without initialising any values.\n\n";
1445 "If you do not wish to use these defaults, you must overload\n";
1447 "get_djacobian_dparameter(), which must initialise the entries\n";
1448 error_message +=
"of the returned vector and matrix to zero.\n\n";
1451 "This function is intended for use instead of the default (global) \n";
1453 "finite-difference routine when analytic expressions are to be used\n";
1454 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1455 error_message +=
"This function is only called when the function\n";
1457 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1462 "GeneralisedElement::fill_in_contribution_to_djacobian_dparameter()",
1484 std::string error_message =
1485 "Empty fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter() "
1487 error_message +=
" been called.\n";
1489 "This function is called from the default implementation of\n";
1490 error_message +=
"get_djacobian_and_dmass_matrix_dparameter();\n";
1492 "and must calculate the residuals vector and mass and jacobian matrices ";
1493 error_message +=
"without initialising any of their entries.\n\n";
1496 "If you do not wish to use these defaults, you must overload\n";
1497 error_message +=
"get_djacobian_and_dmass_matrix_dparameter(), which must "
1499 error_message +=
"entries of the returned vector and matrices to zero.\n";
1503 "This function is intended for use instead of the default (global) \n";
1505 "finite-difference routine when analytic expressions are to be used\n";
1506 error_message +=
"in continuation and bifurcation tracking problems.\n\n";
1507 error_message +=
"This function is only called when the function\n";
1509 "Problem::set_analytic_dparameter() has been called in the driver code\n";
1513 "GeneralisedElement::fill_in_contribution_to_djacobian_"
1514 "and_dmass_matrix_dparameter()",
1533 std::string error_message =
1534 "Empty fill_in_contribution_to_hessian_vector_products() has been ";
1535 error_message +=
"called.\n";
1537 "This function is called from the default implementation of\n";
1538 error_message +=
"get_hessian_vector_products(); ";
1539 error_message +=
" and must calculate the products \n";
1540 error_message +=
"of the hessian matrix with the (global) ";
1541 error_message +=
"vectors Y and C\n";
1542 error_message +=
"without initialising any values.\n\n";
1545 "If you do not wish to use these defaults, you must overload\n";
1547 "get_hessian_vector_products(), which must initialise the entries\n";
1548 error_message +=
"of the returned vector to zero.\n\n";
1551 "This function is intended for use instead of the default (global) \n";
1553 "finite-difference routine when analytic expressions are to be used.\n";
1554 error_message +=
"This function is only called when the function\n";
1555 error_message +=
"Problem::set_analytic_hessian_products() has been called "
1556 "in the driver code\n";
1560 "GeneralisedElement::fill_in_contribution_to_hessian_vector_product()",
1572 std::string error_message =
1573 "Empty fill_in_contribution_to_inner_products() has been called.\n";
1575 "This function is called from the default implementation of\n";
1576 error_message +=
"get_inner_products();\n ";
1577 error_message +=
"It must calculate the inner products over the element\n";
1578 error_message +=
"of given pairs of history values\n";
1579 error_message +=
"without initialision of the output vector.\n\n";
1582 "If you do not wish to use these defaults, you must overload\n";
1584 "get_inner_products(), which must initialise the entries\n";
1585 error_message +=
"of the returned vector to zero.\n\n";
1600 std::string error_message =
1601 "Empty fill_in_contribution_to_inner_product_vectors() has been "
1604 "This function is called from the default implementation of\n";
1605 error_message +=
"get_inner_product_vectors(); ";
1606 error_message +=
" and must calculate the vectors \n";
1607 error_message +=
"corresponding to the input history values\n ";
1609 "that when multiplied by other vectors of history values\n";
1610 error_message +=
"return the appropriate dot products.\n\n";
1611 error_message +=
"The output vectors must not be initialised.\n\n";
1614 "If you do not wish to use these defaults, you must overload\n";
1616 "get_inner_products(), which must initialise the entries\n";
1617 error_message +=
"of the returned vector to zero.\n\n";
1639 oomph_info <<
"\n ERROR: Failed GeneralisedElement::self_test()!"
1641 oomph_info <<
"for internal data object number: " <<
i << std::endl;
1651 oomph_info <<
"\n ERROR: Failed GeneralisedElement::self_test()!"
1653 oomph_info <<
"for external data object number: " <<
i << std::endl;
1673 namespace Locate_zeta_helpers
1712 const unsigned&
i)
const
1788 <<
"Determinant of Jacobian matrix is zero --- "
1789 <<
"singular mapping!\nThe determinant of the "
1790 <<
"jacobian is " << std::fabs(jacobian)
1791 <<
" which is smaller than the treshold "
1793 <<
"You can change this treshold, by specifying "
1794 <<
"FiniteElement::Tolerance_for_singular_jacobian \n"
1795 <<
"Here are the nodal coordinates of the inverted element\n"
1796 <<
"in the form \n\n x,y[,z], hang_status\n\n"
1797 <<
"where hang_status = 1 or 2 for non-hanging or hanging\n"
1798 <<
"nodes respectively (useful for automatic sizing of\n"
1799 <<
"tecplot markers to identify the hanging nodes). \n\n";
1803 for (
unsigned j = 0;
j <
n_nod;
j++)
1824 <<
"NOTE: Offending element is associated with a MacroElement\n"
1825 <<
" AND the element has hanging nodes! \n"
1826 <<
" If an element is thin and highly curved, the \n"
1827 <<
" constraints imposed by\n \n"
1828 <<
" (1) inter-element continuity (imposed by the hanging\n"
1829 <<
" node constraints) and \n\n"
1830 <<
" (2) the need to respect curvilinear domain boundaries\n"
1831 <<
" during mesh refinement (imposed by the element's\n"
1832 <<
" macro element mapping)\n\n"
1833 <<
" may be irreconcilable! \n \n"
1834 <<
" You may have to re-design your base mesh to avoid \n"
1835 <<
" the creation of thin, highly curved elements during\n"
1836 <<
" the refinement process.\n"
1856 <<
"local to global coordinates" << std::endl
1857 <<
" You have an inverted coordinate system!"
1861 <<
"Here are the nodal coordinates of the inverted element\n"
1862 <<
"in the form \n\n x,y[,z], hang_status\n\n"
1863 <<
"where hang_status = 1 or 2 for non-hanging or hanging\n"
1864 <<
"nodes respectively (useful for automatic sizing of\n"
1865 <<
"tecplot markers to identify the hanging nodes). \n\n";
1869 for (
unsigned j = 0;
j <
n_nod;
j++)
1890 <<
"NOTE: The inverted element is associated with a MacroElement\n"
1891 <<
" AND the element has hanging nodes! \n"
1892 <<
" If an element is thin and highly curved, the \n"
1893 <<
" constraints imposed by\n \n"
1894 <<
" (1) inter-element continuity (imposed by the hanging\n"
1895 <<
" node constraints) and \n\n"
1896 <<
" (2) the need to respect curvilinear domain boundaries\n"
1897 <<
" during mesh refinement (imposed by the element's\n"
1898 <<
" macro element mapping)\n\n"
1899 <<
" may be irreconcilable! \n \n"
1900 <<
" You may have to re-design your base mesh to avoid \n"
1901 <<
" the creation of thin, highly curved elements during\n"
1902 <<
" the refinement process.\n"
1909 <<
"If you believe that inverted elements do not cause any\n"
1910 <<
"problems in your specific application you can \n "
1911 <<
"suppress this test by: " << std::endl
1912 <<
" i) setting the (static) flag "
1913 <<
"FiniteElement::Accept_negative_jacobian to be true" << std::endl;
1914 error_stream <<
" ii) switching OFF the PARANOID flag" << std::endl
1948 std::ostringstream error_message;
1949 error_message <<
"Dimension mismatch" << std::endl;
1952 <<
" for the jacobian of the mapping to be well-defined"
1967 jacobian(
i,
j) = 0.0;
2006 for (
unsigned i = 0;
i <
n_row;
i++)
2071 double FiniteElement::invert_jacobian<0>(
2076 oomph_info <<
"\nWarning: You are trying to invert the jacobian for "
2077 <<
"a 'point' element" << std::endl
2078 <<
"This makes no sense and is almost certainly an error"
2091 double FiniteElement::invert_jacobian<1>(
2096 const double det = jacobian(0, 0);
2114 double FiniteElement::invert_jacobian<2>(
2120 jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0);
2142 double FiniteElement::invert_jacobian<3>(
2147 const double det = jacobian(0, 0) * jacobian(1, 1) * jacobian(2, 2) +
2148 jacobian(0, 1) * jacobian(1, 2) * jacobian(2, 0) +
2149 jacobian(0, 2) * jacobian(1, 0) * jacobian(2, 1) -
2150 jacobian(0, 0) * jacobian(1, 2) * jacobian(2, 1) -
2151 jacobian(0, 1) * jacobian(1, 0) * jacobian(2, 2) -
2152 jacobian(0, 2) * jacobian(1, 1) * jacobian(2, 0);
2161 (jacobian(1, 1) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 1)) /
det;
2163 -(jacobian(0, 1) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 1)) /
2166 (jacobian(0, 1) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 1)) /
det;
2168 -(jacobian(1, 0) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 0)) /
2171 (jacobian(0, 0) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 0)) /
det;
2173 -(jacobian(0, 0) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 0)) /
2176 (jacobian(1, 0) * jacobian(2, 1) - jacobian(1, 1) * jacobian(2, 0)) /
det;
2178 -(jacobian(0, 0) * jacobian(2, 1) - jacobian(0, 1) * jacobian(2, 0)) /
2181 (jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0)) /
det;
2218 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2233 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<0>(
2239 oomph_info <<
"\nWarning: You are trying to calculate derivatives of "
2240 <<
"a jacobian w.r.t. nodal coordinates for a 'point' "
2241 <<
"element." << std::endl
2242 <<
"This makes no sense and is almost certainly an error."
2252 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<1>(
2272 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<2>(
2298 void FiniteElement::dJ_eulerian_dnodal_coordinates_templated_helper<3>(
2312 (jacobian(1, 1) * jacobian(2, 2) - jacobian(1, 2) * jacobian(2, 1)) +
2314 (jacobian(0, 2) * jacobian(2, 1) - jacobian(0, 1) * jacobian(2, 2)) +
2316 (jacobian(0, 1) * jacobian(1, 2) - jacobian(0, 2) * jacobian(1, 1));
2321 (jacobian(1, 2) * jacobian(2, 0) - jacobian(1, 0) * jacobian(2, 2)) +
2323 (jacobian(0, 0) * jacobian(2, 2) - jacobian(0, 2) * jacobian(2, 0)) +
2325 (jacobian(0, 2) * jacobian(1, 0) - jacobian(0, 0) * jacobian(1, 2));
2330 (jacobian(1, 0) * jacobian(2, 1) - jacobian(1, 1) * jacobian(2, 0)) +
2332 (jacobian(0, 1) * jacobian(2, 0) - jacobian(0, 0) * jacobian(2, 1)) +
2334 (jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0));
2344 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<0>(
2353 oomph_info <<
"\nWarning: You are trying to calculate derivatives of "
2354 <<
"eulerian derivatives of shape functions w.r.t. nodal "
2355 <<
"coordinates for a 'point' element." << std::endl
2356 <<
"This makes no sense and is almost certainly an error."
2367 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<1>(
2382 for (
unsigned q = 0; q <
n_node; q++)
2399 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<2>(
2414 for (
unsigned p = 0;
p < 2;
p++)
2417 for (
unsigned q = 0; q <
n_node; q++)
2456 void FiniteElement::d_dshape_eulerian_dnodal_coordinates_templated_helper<3>(
2471 for (
unsigned p = 0;
p < 3;
p++)
2474 for (
unsigned q = 0; q <
n_node; q++)
2480 for (
unsigned i = 0;
i < 3;
i++)
2493 dpsids(q, 1) * jacobian(2, 2)) *
2495 (
dpsids(q, 0) * jacobian(2, 2) -
2496 dpsids(q, 2) * jacobian(0, 2)) *
2498 (
dpsids(q, 1) * jacobian(0, 2) -
2499 dpsids(q, 0) * jacobian(1, 2)) *
2503 dpsids(q, 2) * jacobian(1, 1)) *
2505 (
dpsids(q, 2) * jacobian(0, 1) -
2506 dpsids(q, 0) * jacobian(2, 1)) *
2508 (
dpsids(q, 0) * jacobian(1, 1) -
2509 dpsids(q, 1) * jacobian(0, 1)) *
2516 dpsids(q, 2) * jacobian(1, 2)) *
2518 (
dpsids(q, 2) * jacobian(0, 2) -
2519 dpsids(q, 0) * jacobian(2, 2)) *
2521 (
dpsids(q, 0) * jacobian(1, 2) -
2522 dpsids(q, 1) * jacobian(0, 2)) *
2526 dpsids(q, 1) * jacobian(2, 0)) *
2528 (
dpsids(q, 0) * jacobian(2, 0) -
2529 dpsids(q, 2) * jacobian(0, 0)) *
2531 (
dpsids(q, 1) * jacobian(0, 0) -
2532 dpsids(q, 0) * jacobian(1, 0)) *
2539 dpsids(q, 1) * jacobian(2, 1)) *
2541 (
dpsids(q, 0) * jacobian(2, 1) -
2542 dpsids(q, 2) * jacobian(0, 1)) *
2544 (
dpsids(q, 1) * jacobian(0, 1) -
2545 dpsids(q, 0) * jacobian(1, 1)) *
2549 dpsids(q, 2) * jacobian(1, 0)) *
2551 (
dpsids(q, 2) * jacobian(0, 0) -
2552 dpsids(q, 0) * jacobian(2, 0)) *
2554 (
dpsids(q, 0) * jacobian(1, 0) -
2555 dpsids(q, 1) * jacobian(0, 0)) *
2561 for (
unsigned i = 0;
i < 3;
i++)
2631 std::ostringstream error_message;
2632 error_message <<
"Dimension mismatch" << std::endl;
2635 <<
" for the jacobian of the mapping to be well-defined"
2651 jacobian(
i,
j) = 0.0;
2671 det *= jacobian(
i,
i);
2711 std::ostringstream error_message;
2712 error_message <<
"djacobian_dX must have the same number of rows as the"
2713 <<
"\nspatial dimension of the element.";
2720 std::ostringstream error_message;
2722 <<
"djacobian_dX must have the same number of columns as the"
2723 <<
"\nnumber of nodes in the element.";
2752 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2795 std::ostringstream error_message;
2796 error_message <<
"d_dpsidx_dX must be of the following dimensions:"
2797 <<
"\nd_dpsidx_dX(el_dim,n_node,n_node,el_dim)";
2846 error_stream <<
"Dimension of the element must be 0,1,2 or 3, not "
2879 for (
unsigned j = 0;
j <
n_dim;
j++)
2884 for (
unsigned i = 0;
i <
n_dim;
i++)
2890 for (
unsigned j = 0;
j <
n_dim;
j++)
2920 for (
unsigned j = 0;
j <
n_dim;
j++)
2936 void FiniteElement::transform_second_derivatives_template<1>(
2955 d2basis(
l,
k, 0) / (jacobian(0, 0) * jacobian(0, 0))
2958 (jacobian(0, 0) * jacobian(0, 0) * jacobian(0, 0));
2975 void FiniteElement::transform_second_derivatives_template<2>(
2988 jacobian(0, 0) * jacobian(1, 1) - jacobian(0, 1) * jacobian(1, 0);
3033 for (
unsigned j = 0;
j < 2;
j++)
3056 for (
unsigned j = 0;
j < 3;
j++)
3062 for (
unsigned i = 0;
i < 2;
i++)
3087 void FiniteElement::transform_second_derivatives_diagonal<1>(
3094 FiniteElement::transform_second_derivatives_template<1>(
3105 void FiniteElement::transform_second_derivatives_diagonal<2>(
3126 d2basis(
l,
k, 0) / (jacobian(0, 0) * jacobian(0, 0)) -
3128 (jacobian(0, 0) * jacobian(0, 0) * jacobian(0, 0));
3131 d2basis(
l,
k, 1) / (jacobian(1, 1) * jacobian(1, 1)) -
3133 (jacobian(1, 1) * jacobian(1, 1) * jacobian(1, 1));
3174 throw OomphLibError(
"Not implemented yet ... maybe one day",
3185 error_stream <<
"Dimension of the element must be 1,2 or 3, not "
3418 const unsigned&
ipt,
3731 const double old_var = *value_pt;
3743 for (
unsigned m = 0;
m <
n_dof;
m++)
3778 if (
n_nod == 0)
return;
3795 for (
unsigned j = 0;
j <
n_nod;
j++)
3811 nod_pt->perform_auxiliary_node_update_fct();
3820 for (
unsigned l = 0;
l <
n_dof;
l++)
3831 nod_pt->perform_auxiliary_node_update_fct();
3870 <<
" times in an element." << std::endl
3871 <<
"In positions: ";
3878 error_stream << std::endl <<
"That seems very odd." << std::endl;
3960 for (
unsigned j = 0;
j <
nnod;
j++)
3973 for (
unsigned j = 0;
j <
nnod;
j++)
3990 const unsigned&
i)
const
4022 const unsigned&
i)
const
4167 throw OomphLibError(
"Cannot calculate J_eulerian() for point element\n",
4175 det =
G(0, 0) *
G(1, 1) -
G(0, 1) *
G(1, 0);
4178 det =
G(0, 0) *
G(1, 1) *
G(2, 2) +
G(0, 1) *
G(1, 2) *
G(2, 0) +
4179 G(0, 2) *
G(1, 0) *
G(2, 1) -
G(0, 0) *
G(1, 2) *
G(2, 1) -
4180 G(0, 1) *
G(1, 0) *
G(2, 2) -
G(0, 2) *
G(1, 1) *
G(2, 0);
4183 oomph_info <<
"More than 3 dimensions in J_eulerian()" << std::endl;
4236 throw OomphLibError(
"Cannot calculate J_eulerian() for point element\n",
4244 det =
G(0, 0) *
G(1, 1) -
G(0, 1) *
G(1, 0);
4247 det =
G(0, 0) *
G(1, 1) *
G(2, 2) +
G(0, 1) *
G(1, 2) *
G(2, 0) +
4248 G(0, 2) *
G(1, 0) *
G(2, 1) -
G(0, 0) *
G(1, 2) *
G(2, 1) -
4249 G(0, 1) *
G(1, 0) *
G(2, 2) -
G(0, 2) *
G(1, 1) *
G(2, 0);
4252 oomph_info <<
"More than 3 dimensions in J_eulerian()" << std::endl;
4373 for (
unsigned i = 0;
i <
n_dim;
i++)
4434 for (
unsigned i = 0;
i <
n_dim;
i++)
4482 OomphLibWarning(
"Pointer to spatial integration scheme has not been set.",
4483 "FiniteElement::self_test()",
4570 if (std::fabs(jacobian) < 1.0e-16)
4573 warning_stream <<
"Determinant of Jacobian matrix is zero at ipt "
4574 <<
ipt << std::endl;
4576 "FiniteElement::self_test()",
4588 <<
ipt << std::endl;
4590 <<
"If you think that this is what you want you may: "
4592 <<
"set the (static) flag "
4593 <<
"FiniteElement::Accept_negative_jacobian to be true"
4597 "FiniteElement::self_test()",
4725 for (
unsigned i = 0;
i < ncoord;
i++)
4786 if (
radius > Locate_zeta_helpers::
4787 Radius_multiplier_for_fast_exit_from_locate_zeta *
4871 double maxres = std::fabs(
5016 error.disable_error_message();
5019 <<
"FiniteElement::locate_zeta()" << std::endl;
5020 oomph_info <<
"Should not affect the result!" << std::endl;
5091 geom_object_pt =
this;
5244 for (
unsigned i = 0;
i <
n_dim + 1;
i++)
5252 for (
unsigned i = 0;
i <
n_dim;
i++)
5276 if (n_dim_el == 0)
return 1.0;
5304 for (
unsigned i = 0;
i <
n_dim;
i++)
5322 for (
unsigned k = 0;
k <
n_dim;
k++)
5337 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5341 "FaceElement::J_eulerian()",
5387 for (
unsigned i = 0;
i <
n_dim;
i++)
5406 for (
unsigned k = 0;
k <
n_dim;
k++)
5421 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5425 "FaceElement::J_eulerian_at_knot()",
5476 for (
unsigned i = 0;
i <
n_dim;
i++)
5497 for (
unsigned k = 0;
k <
n_dim;
k++)
5512 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
5516 "FaceElement::J_eulerian_at_knot()",
5557 <<
"Local coordinate s passed to outer_unit_normal() has dimension "
5558 <<
s.
size() << std::endl
5559 <<
"but element dimension is " <<
element_dim << std::endl;
5571 error_stream <<
"Tangent direction vector has dimension "
5573 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
5583 error_stream <<
"Unit normal passed to outer_unit_normal() has dimension "
5585 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
5609 <<
"This is a 0D FaceElement, we need one tangent vector.\n"
5610 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5626 <<
"This is a 1D FaceElement, we need one tangent vector.\n"
5627 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5643 <<
"This is a 2D FaceElement, we need two tangent vectors.\n"
5644 <<
"You have given me " <<
tang_vec.
size() <<
" vector(s).\n";
5655 "Cannot have a FaceElement with dimension higher than 2",
5668 <<
" spatial dimensions.\n"
5669 <<
"But the " <<
vec_i <<
" tangent vector has size "
5687 <<
"It is unclear how to calculate a tangent and normal vectors for "
5688 <<
"a point element.\n";
5729 for (
unsigned j = 0;
j < 2;
j++)
5812 <<
"coordinates at the nodes of this 2D FaceElement,\n"
5813 <<
"which must have come from a 3D Bulk element\n";
5843 for (
unsigned j = 0;
j < 2;
j++)
5846 for (
unsigned i = 0;
i < 3;
i++)
5892 err_stream <<
"The angle between the unit normal and the \n"
5893 <<
"direction vector is less than 10 degrees.";
5946 if (a != 0.0 || b != 0.0)
5948 double a_sq = a * a;
5949 double b_sq = b * b;
5950 double c_sq = c * c;
5971 <<
"I have detected that your normal vector is [0,0,1].\n"
5972 <<
"Since this function compares against 0.0, you may\n"
5973 <<
"get discontinuous tangent vectors.";
6000 "Cannot have a FaceElement with dimension higher than 2",
6014 const unsigned&
ipt,
6049 <<
"Local coordinate s passed to outer_unit_normal() has dimension "
6050 <<
s.
size() << std::endl
6051 <<
"but element dimension is " <<
element_dim << std::endl;
6061 error_stream <<
"Unit normal passed to outer_unit_normal() has dimension "
6063 <<
"but spatial dimension is " <<
spatial_dim << std::endl;
6215 for (
unsigned j = 0;
j < 2;
j++)
6287 <<
"coordinates at the nodes of this 2D FaceElement,\n"
6288 <<
"which must have come from a 3D Bulk element\n";
6318 for (
unsigned j = 0;
j < 2;
j++)
6321 for (
unsigned i = 0;
i < 3;
i++)
6343 "Cannot have a FaceElement with dimension higher than 2",
6393 (*Face_to_bulk_coordinate_fct_pt)(
s,
s_bulk);
6397 throw OomphLibError(
"Face_to_bulk_coordinate mapping not set",
6418 (*Face_to_bulk_coordinate_fct_pt)(
s,
s_bulk);
6423 throw OomphLibError(
"Face_to_bulk_coordinate mapping not set",
6444 (*Bulk_coordinate_derivatives_fct_pt)(
6451 "No function for derivatives of bulk coords wrt face coords set",
6498 for (
unsigned i = 0;
i <
n_dim;
i++)
6570 std::ostringstream error_message;
6571 error_message <<
"Dimension mismatch" << std::endl;
6572 error_message <<
"The elemental dimension: " <<
el_dim
6573 <<
" must equal the nodal Lagrangian dimension: "
6575 <<
" for the jacobian of the mapping to be well-defined"
6589 jacobian(
i,
j) = 0.0;
6629 for (
unsigned i = 0;
i <
n_row;
i++)
6692 jacobian(
i,
j) = 0.0;
6713 det *= jacobian(
i,
i);
7065 const double old_var = *value_pt;
7082 for (
unsigned m = 0;
m <
n_dof;
m++)
7132 const unsigned&
i)
const
7263 error_stream <<
"Can only call fill_in_jacobian_for_newmark_accel()\n"
7264 <<
"With Solve_for_consistent_newmark_accel_flag:"
7308 <<
"Assignment of Newmark accelerations obviously only works\n"
7309 <<
"for Newmark timesteppers. You've called me with "
7406 const unsigned&
flag)
7526 <<
"WARNING: You should really free all Data"
7528 <<
" before setup of initial guess" << std::endl
7529 <<
"ll, kk, ii " <<
ll <<
" " <<
kk <<
" " <<
ii
7538 oomph_info <<
"WARNING: You should really free all Data"
7540 <<
" before setup of initial guess"
7542 <<
"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...