29 #ifndef OOMPH_GENERIC_ELEMENTS_HEADER
30 #define OOMPH_GENERIC_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
148 #ifdef RANGE_CHECKING
151 std::ostringstream error_message;
152 error_message <<
"Range Error: Internal data " <<
i
156 OOMPH_CURRENT_FUNCTION,
157 OOMPH_EXCEPTION_LOCATION);
169 #ifdef RANGE_CHECKING
172 std::ostringstream error_message;
173 error_message <<
"Range Error: Internal data " <<
i
177 OOMPH_CURRENT_FUNCTION,
178 OOMPH_EXCEPTION_LOCATION);
189 #ifdef RANGE_CHECKING
192 std::ostringstream error_message;
193 error_message <<
"Range Error: Internal data " <<
i
197 OOMPH_CURRENT_FUNCTION,
198 OOMPH_EXCEPTION_LOCATION);
221 std::deque<unsigned long>
const& global_eqn_numbers,
222 std::deque<double*>
const& global_dof_pt);
242 const bool& store_local_dof_pt);
254 const bool& store_local_dof_pt)
269 #ifdef RANGE_CHECKING
272 std::ostringstream error_message;
273 error_message <<
"Range Error: Internal data " <<
i
277 OOMPH_CURRENT_FUNCTION,
278 OOMPH_EXCEPTION_LOCATION);
285 std::ostringstream error_message;
286 error_message <<
"Range Error: value " << j <<
" at internal data "
287 <<
i <<
" is not in the range (0," << n_value - 1
290 OOMPH_CURRENT_FUNCTION,
291 OOMPH_EXCEPTION_LOCATION);
300 "Internal local equation numbers have not been allocated",
301 OOMPH_CURRENT_FUNCTION,
302 OOMPH_EXCEPTION_LOCATION);
314 #ifdef RANGE_CHECKING
317 std::ostringstream error_message;
318 error_message <<
"Range Error: External data " <<
i
322 OOMPH_CURRENT_FUNCTION,
323 OOMPH_EXCEPTION_LOCATION);
330 std::ostringstream error_message;
331 error_message <<
"Range Error: value " << j <<
" at internal data "
332 <<
i <<
" is not in the range (0," << n_value - 1
335 OOMPH_CURRENT_FUNCTION,
336 OOMPH_EXCEPTION_LOCATION);
344 "External local equation numbers have not been allocated",
345 OOMPH_CURRENT_FUNCTION,
346 OOMPH_EXCEPTION_LOCATION);
360 "Empty fill_in_contribution_to_residuals() has been called.\n";
362 "This function is called from the default implementations of\n";
363 error_message +=
"get_residuals() and get_jacobian();\n";
365 "and must calculate the residuals vector without initialising any of ";
366 error_message +=
"its entries.\n\n";
369 "If you do not wish to use these defaults, you must overload both\n";
370 error_message +=
"get_residuals() and get_jacobian(), which must "
371 "initialise the entries\n";
372 error_message +=
"of the residuals vector and jacobian matrix to zero.\n";
374 error_message +=
"N.B. the default get_jacobian() function employs "
375 "finite differencing\n";
378 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
391 const bool& fd_all_data =
false);
402 const bool& fd_all_data =
false)
424 const bool& fd_all_data =
false);
436 const bool& fd_all_data =
false)
553 double*
const& parameter_pt,
565 double*
const& parameter_pt,
584 Vector<std::pair<unsigned, unsigned>>
const& history_index,
624 #ifdef RANGE_CHECKING
627 std::ostringstream error_message;
628 error_message <<
"Range Error: Internal data " <<
i
632 OOMPH_CURRENT_FUNCTION,
633 OOMPH_EXCEPTION_LOCATION);
642 #ifdef RANGE_CHECKING
645 std::ostringstream error_message;
646 error_message <<
"Range Error: Internal data " <<
i
650 OOMPH_CURRENT_FUNCTION,
651 OOMPH_EXCEPTION_LOCATION);
661 #ifdef RANGE_CHECKING
664 std::ostringstream error_message;
665 error_message <<
"Range Error: External data " <<
i
669 OOMPH_CURRENT_FUNCTION,
670 OOMPH_EXCEPTION_LOCATION);
679 #ifdef RANGE_CHECKING
682 std::ostringstream error_message;
683 error_message <<
"Range Error: External data " <<
i
687 OOMPH_CURRENT_FUNCTION,
688 OOMPH_EXCEPTION_LOCATION);
710 #ifdef RANGE_CHECKING
711 if (ieqn_local >=
Ndof)
713 std::ostringstream error_message;
714 error_message <<
"Range Error: Equation number " << ieqn_local
715 <<
" is not in the range (0," <<
Ndof - 1 <<
")";
717 OOMPH_CURRENT_FUNCTION,
718 OOMPH_EXCEPTION_LOCATION);
733 const unsigned n_dof = this->
Ndof;
735 for (
unsigned n = 0; n < n_dof; n++)
763 #ifdef RANGE_CHECKING
766 std::ostringstream error_message;
767 error_message <<
"Range Error: Internal data " <<
i
771 OOMPH_CURRENT_FUNCTION,
772 OOMPH_EXCEPTION_LOCATION);
784 #ifdef RANGE_CHECKING
787 std::ostringstream error_message;
788 error_message <<
"Range Error: External data " <<
i
792 OOMPH_CURRENT_FUNCTION,
793 OOMPH_EXCEPTION_LOCATION);
804 #ifdef RANGE_CHECKING
807 std::ostringstream error_message;
808 error_message <<
"Range Error: External data " <<
i
812 OOMPH_CURRENT_FUNCTION,
813 OOMPH_EXCEPTION_LOCATION);
851 std::stringstream error_stream;
852 error_stream <<
"Internal dof array not set up in element.\n"
853 <<
"In order to set it up you must call\n"
854 <<
" Problem::enable_store_local_dof_in_elements()\n"
855 <<
"before the call to Problem::assign_eqn_numbers()\n";
857 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
861 dof.resize(this->Ndof);
863 for (
unsigned i = 0;
i < this->
Ndof; ++
i)
876 std::stringstream error_stream;
877 error_stream <<
"Internal dof array not set up in element.\n"
878 <<
"In order to set it up you must call\n"
879 <<
" Problem::enable_store_local_dof_in_elements()\n"
880 <<
"before the call to Problem::assign_eqn_numbers()\n";
882 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
886 dof_pt.resize(this->Ndof);
888 for (
unsigned i = 0;
i < this->
Ndof; ++
i)
899 const bool& preserve_existing_data)
902 preserve_existing_data);
938 std::map<unsigned, double*>& map_of_value_pt);
961 const Vector<long>& vector_of_eqn_numbers,
unsigned& index);
1032 residuals, jacobian, mass_matrix);
1060 parameter_pt, dres_dparam, djac_dparam);
1066 double*
const& parameter_pt,
1079 parameter_pt, dres_dparam, djac_dparam, dmass_matrix_dparam);
1100 Vector<std::pair<unsigned, unsigned>>
const& history_index,
1114 const unsigned n_inner_product = inner_product_vector.size();
1115 for (
unsigned i = 0;
i < n_inner_product; ++
i)
1117 inner_product_vector[
i].initialise(0.0);
1120 inner_product_vector);
1135 "compute_norm(...) undefined for this element\n";
1137 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1146 std::string error_message =
"compute_norm undefined for this element \n";
1148 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1151 #ifdef OOMPH_HAS_MPI
1209 std::ostringstream error_message;
1210 error_message <<
"ndof_types() const has not been implemented for this \n"
1215 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1226 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
1229 std::ostringstream error_message;
1230 error_message <<
"get_dof_numbers_for_unknowns() const has not been \n"
1231 <<
" implemented for this element\n"
1235 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1262 namespace Locate_zeta_helpers
1297 unsigned& interior_direction);
1428 for (
unsigned i = 0;
i < n;
i++)
1438 #ifdef RANGE_CHECKING
1441 std::ostringstream error_message;
1442 error_message <<
"Range Error: Node number " << n
1443 <<
" is not in the range (0," <<
Nnode - 1 <<
")";
1445 OOMPH_CURRENT_FUNCTION,
1446 OOMPH_EXCEPTION_LOCATION);
1453 std::ostringstream error_message;
1454 error_message <<
"Range Error: value " <<
i <<
" at node " << n
1455 <<
" is not in the range (0," << n_value - 1 <<
")";
1457 OOMPH_CURRENT_FUNCTION,
1458 OOMPH_EXCEPTION_LOCATION);
1467 "Nodal local equation numbers have not been allocated",
1468 OOMPH_CURRENT_FUNCTION,
1469 OOMPH_EXCEPTION_LOCATION);
1493 template<
unsigned DIM>
1532 const unsigned el_dim =
dim();
1568 template<
unsigned DIM>
1590 const double& det_jacobian,
1607 template<
unsigned DIM>
1609 const double& det_jacobian,
1662 template<
unsigned DIM>
1678 template<
unsigned DIM>
1702 unsigned n_dof =
ndof();
1745 unsigned n_dof =
ndof();
1820 "local_coord_is_valid is not implemented for this element\n",
1821 OOMPH_CURRENT_FUNCTION,
1822 OOMPH_EXCEPTION_LOCATION);
1830 throw OomphLibError(
"move_local_coords_back_into_element() is not "
1831 "implemented for this element\n",
1832 OOMPH_CURRENT_FUNCTION,
1833 OOMPH_EXCEPTION_LOCATION);
1850 "local_coordinate_of_node(...) is not implemented for this element\n",
1851 OOMPH_CURRENT_FUNCTION,
1852 OOMPH_EXCEPTION_LOCATION);
1866 "local one_d_fraction_of_node is not implemented for this element\n";
1868 "It only makes sense for elements that use tensor-product expansions\n";
1871 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1942 "get_x_from_macro_element(...) is not implemented for this element\n",
1943 OOMPH_CURRENT_FUNCTION,
1944 OOMPH_EXCEPTION_LOCATION);
1957 "get_x_from_macro_element(...) is not implemented for this element\n",
1958 OOMPH_CURRENT_FUNCTION,
1959 OOMPH_EXCEPTION_LOCATION);
1990 "dshape_local() is not implemented for this element\n",
1991 OOMPH_CURRENT_FUNCTION,
1992 OOMPH_EXCEPTION_LOCATION);
2026 "d2shape_local() is not implemented for this element\n",
2027 OOMPH_CURRENT_FUNCTION,
2028 OOMPH_EXCEPTION_LOCATION);
2089 const unsigned& ipt,
2162 std::ostream& out,
const std::string& current_string)
const;
2169 const bool& store_local_dof_pt)
2173 store_local_dof_pt);
2181 #ifdef RANGE_CHECKING
2184 std::ostringstream error_message;
2185 error_message <<
"Range Error: " << n <<
" is not in the range (0,"
2186 <<
Nnode - 1 <<
")";
2188 OOMPH_CURRENT_FUNCTION,
2189 OOMPH_EXCEPTION_LOCATION);
2198 #ifdef RANGE_CHECKING
2201 std::ostringstream error_message;
2202 error_message <<
"Range Error: " << n <<
" is not in the range (0,"
2203 <<
Nnode - 1 <<
")";
2205 OOMPH_CURRENT_FUNCTION,
2206 OOMPH_EXCEPTION_LOCATION);
2253 const unsigned&
i)
const
2269 const unsigned&
i)
const
2278 const unsigned&
i)
const
2289 const unsigned&
i)
const
2300 const unsigned&
i)
const
2312 const unsigned&
i)
const
2331 const unsigned&
i)
const
2346 const unsigned&
i)
const
2355 const unsigned&
i)
const
2365 const unsigned&
i)
const
2375 const unsigned&
i)
const
2386 const unsigned&
i)
const
2414 std::ostringstream warn_message;
2416 <<
"Warning: You have just called the default (empty) function \n\n"
2417 <<
" FiniteElement::disable_ALE() \n\n"
2418 <<
"This suggests that you've either tried to call it for an element\n"
2420 <<
"(1) does not involve time-derivatives (e.g. a Poisson element) \n"
2421 <<
"(2) an element for which the time-derivatives aren't implemented \n"
2422 <<
" in ALE form \n"
2423 <<
"(3) an element for which the ALE form of the equations can't be \n"
2424 <<
" be disabled (yet).\n";
2426 warn_message.str(),
"Problem::disable_ALE()", OOMPH_EXCEPTION_LOCATION);
2436 std::ostringstream warn_message;
2438 <<
"Warning: You have just called the default (empty) function \n\n"
2439 <<
" FiniteElement::enable_ALE() \n\n"
2440 <<
"This suggests that you've either tried to call it for an element\n"
2442 <<
"(1) does not involve time-derivatives (e.g. a Poisson element) \n"
2443 <<
"(2) an element for which the time-derivatives aren't implemented \n"
2444 <<
" in ALE form \n"
2445 <<
"(3) an element for which the ALE form of the equations can't be \n"
2446 <<
" be disabled (yet)\n"
2447 <<
"(4) an element for which this function has not been (properly) \n "
2448 <<
" implemented. This is likely to be a bug!\n ";
2450 warn_message.str(),
"Problem::enable_ALE()", OOMPH_EXCEPTION_LOCATION);
2476 unsigned nnod =
nnode();
2477 for (
unsigned j = 0; j < nnod; j++)
2497 std::string error_msg =
"Not implemented for FiniteElement.";
2499 error_msg, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2506 std::string error_msg =
"Not implemented for FiniteElement.";
2508 error_msg, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2590 const unsigned&
i)
const
2607 const unsigned&
i)
const
2625 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2630 const unsigned&
i)
const;
2636 const unsigned&
i)
const;
2728 const unsigned&
i)
const
2760 const bool& use_coordinate_as_initial_guess =
false);
2784 std::set<std::pair<Data*, unsigned>>& paired_field_data);
2799 throw OomphLibError(
"s_min() isn't implemented for this element\n",
2800 OOMPH_CURRENT_FUNCTION,
2801 OOMPH_EXCEPTION_LOCATION);
2809 throw OomphLibError(
"s_max() isn't implemented for this element\n",
2810 OOMPH_CURRENT_FUNCTION,
2811 OOMPH_EXCEPTION_LOCATION);
2822 double size()
const;
2832 "compute_physical_size() isn't implemented for this element\n",
2833 OOMPH_CURRENT_FUNCTION,
2834 OOMPH_EXCEPTION_LOCATION);
2856 unsigned n = data.size();
2857 for (
unsigned i = 0;
i < n;
i++)
2859 outfile << data[
i] <<
" ";
2869 "This function hasn't been implemented for this element",
2870 OOMPH_CURRENT_FUNCTION,
2871 OOMPH_EXCEPTION_LOCATION);
2883 "This function hasn't been implemented for this element",
2884 OOMPH_CURRENT_FUNCTION,
2885 OOMPH_EXCEPTION_LOCATION);
2896 unsigned nnod =
nnode();
2897 if (nnod == 0)
return;
2910 for (
unsigned j = 0; j < plot; j++)
2920 for (
unsigned i = 0;
i < n - 1;
i++)
2922 file_out << x[
i] <<
" ";
2924 file_out << x[n - 1];
2932 <<
" 0" << std::endl;
2936 file_out <<
" 0" << std::endl;
2940 file_out << std::endl;
2946 "Printing PlotPoint to .vtu failed; it has >3 dimensions.",
2947 OOMPH_CURRENT_FUNCTION,
2948 OOMPH_EXCEPTION_LOCATION);
2957 std::ofstream& file_out,
const unsigned& nplot,
unsigned& counter)
const
2960 "This function hasn't been implemented for this element",
2961 OOMPH_CURRENT_FUNCTION,
2962 OOMPH_EXCEPTION_LOCATION);
2969 const unsigned& nplot)
const
2972 "This function hasn't been implemented for this element",
2973 OOMPH_CURRENT_FUNCTION,
2974 OOMPH_EXCEPTION_LOCATION);
2981 const unsigned& nplot,
2982 unsigned& offset_sum)
const
2985 "This function hasn't been implemented for this element",
2986 OOMPH_CURRENT_FUNCTION,
2987 OOMPH_EXCEPTION_LOCATION);
2995 "This function hasn't been implemented for this element",
2996 OOMPH_CURRENT_FUNCTION,
2997 OOMPH_EXCEPTION_LOCATION);
3007 const unsigned& nplot)
const
3010 "This function hasn't been implemented for this element",
3011 OOMPH_CURRENT_FUNCTION,
3012 OOMPH_EXCEPTION_LOCATION);
3018 std::ofstream& file_out,
3020 const unsigned& nplot,
3024 "This function hasn't been implemented for this element",
3025 OOMPH_CURRENT_FUNCTION,
3026 OOMPH_EXCEPTION_LOCATION);
3032 std::ofstream& file_out,
3034 const unsigned& nplot,
3039 "This function hasn't been implemented for this element",
3040 OOMPH_CURRENT_FUNCTION,
3041 OOMPH_EXCEPTION_LOCATION);
3057 "Output function function hasn't been implemented for this element",
3058 OOMPH_CURRENT_FUNCTION,
3059 OOMPH_EXCEPTION_LOCATION);
3064 virtual void output(std::ostream& outfile,
const unsigned& n_plot)
3067 "Output function function hasn't been implemented for this element",
3068 OOMPH_CURRENT_FUNCTION,
3069 OOMPH_EXCEPTION_LOCATION);
3076 std::ostream& outfile,
3077 const unsigned& n_plot)
const
3080 "Output function function hasn't been implemented for this element",
3081 OOMPH_CURRENT_FUNCTION,
3082 OOMPH_EXCEPTION_LOCATION);
3090 throw OomphLibError(
"C-style otput function function hasn't been "
3091 "implemented for this element",
3092 OOMPH_CURRENT_FUNCTION,
3093 OOMPH_EXCEPTION_LOCATION);
3099 virtual void output(FILE* file_pt,
const unsigned& n_plot)
3101 throw OomphLibError(
"C-style output function function hasn't been "
3102 "implemented for this element",
3103 OOMPH_CURRENT_FUNCTION,
3104 OOMPH_EXCEPTION_LOCATION);
3109 std::ostream& outfile,
3110 const unsigned& n_plot,
3114 "Output function function hasn't been implemented for exact solution",
3115 OOMPH_CURRENT_FUNCTION,
3116 OOMPH_EXCEPTION_LOCATION);
3122 std::ostream& outfile,
3123 const unsigned& n_plot,
3128 "Output function function hasn't been implemented for exact solution",
3129 OOMPH_CURRENT_FUNCTION,
3130 OOMPH_EXCEPTION_LOCATION);
3135 const unsigned& n_plot,
3140 "Output function function hasn't been implemented for exact solution",
3141 OOMPH_CURRENT_FUNCTION,
3142 OOMPH_EXCEPTION_LOCATION);
3153 const unsigned& nplot,
3155 const bool& shifted_to_interior =
false)
const
3158 "get_s_plot(...) is not implemented for this element\n",
3159 OOMPH_CURRENT_FUNCTION,
3160 OOMPH_EXCEPTION_LOCATION);
3168 "tecplot_zone_string(...) is not implemented for this element\n",
3169 OOMPH_CURRENT_FUNCTION,
3170 OOMPH_EXCEPTION_LOCATION);
3171 return "dummy return";
3179 const unsigned& nplot)
const {};
3186 const unsigned& nplot)
const {};
3193 "nplot_points(...) is not implemented for this element",
3194 OOMPH_CURRENT_FUNCTION,
3195 OOMPH_EXCEPTION_LOCATION);
3207 std::string error_message =
"compute_error undefined for this element \n";
3209 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3219 std::string error_message =
"time-dependent compute_error ";
3220 error_message +=
"undefined for this element \n";
3222 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3234 std::string error_message =
"compute_error undefined for this element \n";
3236 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3249 std::string error_message =
"time-dependent compute_error ";
3250 error_message +=
"undefined for this element \n";
3252 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3261 std::ostream& outfile,
3266 std::string error_message =
"compute_error undefined for this element \n";
3267 outfile << error_message;
3270 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3277 std::ostream& outfile,
3284 "time-dependent compute_error undefined for this element \n";
3285 outfile << error_message;
3288 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3297 std::ostream& outfile,
3302 std::string error_message =
"compute_error undefined for this element \n";
3303 outfile << error_message;
3306 "FiniteElement::compute_error()",
3307 OOMPH_EXCEPTION_LOCATION);
3316 std::ostream& outfile,
3323 "time-dependent compute_error undefined for this element \n";
3324 outfile << error_message;
3327 "FiniteElement::compute_error()",
3328 OOMPH_EXCEPTION_LOCATION);
3335 std::ostream& outfile,
3340 "compute_abs_error undefined for this element \n";
3341 outfile << error_message;
3344 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3376 const unsigned&
i)
const
3378 std::string err =
"Not implemented for this element.";
3380 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3386 std::string err =
"Not implemented for this element.";
3388 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3393 std::string err =
"Not implemented for this element.";
3395 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3401 #ifdef RANGE_CHECKING
3404 std::string err =
"Face node index i out of range on face.";
3406 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3414 const int& face_index)
const
3416 std::string err =
"Not implemented for this element.";
3418 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3424 const int& face_index)
const
3426 std::string err =
"Not implemented for this element.";
3428 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3631 const unsigned n_node = this->
nnode();
3632 for (
unsigned n = 0; n < n_node; n++)
3634 geometric_data_pt.insert(
3648 const unsigned&
i)
const
3670 "get_x_and_xi(...) is not implemented for this element\n",
3671 OOMPH_CURRENT_FUNCTION,
3672 OOMPH_EXCEPTION_LOCATION);
3872 const bool& store_local_dof_pt)
3903 const unsigned&
i)
const
3918 const unsigned&
i)
const
3926 const unsigned&
i)
const;
3944 OOMPH_CURRENT_FUNCTION,
3945 OOMPH_EXCEPTION_LOCATION);
3954 OOMPH_CURRENT_FUNCTION,
3955 OOMPH_EXCEPTION_LOCATION);
4070 const unsigned& flag);
4105 unsigned el_dim =
dim();
4143 const unsigned& j)
const
4145 #ifdef RANGE_CHECKING
4146 std::ostringstream error_message;
4151 error_message <<
"Range Error: Nodal number " << n
4152 <<
" is not in the range (0," <<
nnode() <<
")";
4158 error_message <<
"Range Error: Position type " << k
4166 error_message <<
"Range Error: Nodal coordinate " << j
4174 OOMPH_CURRENT_FUNCTION,
4175 OOMPH_EXCEPTION_LOCATION);
4203 unsigned n_dof =
ndof();
4233 unsigned n_dof =
ndof();
4356 unsigned& interior_direction);
4436 const unsigned n_node =
nnode();
4439 for (
unsigned n = 0; n < n_node; n++)
4443 ->assign_additional_values_with_face_id(nadditional_values[n],
id);
4503 const unsigned&
i)
const
4547 const unsigned&
i)
const
4655 std::ostringstream error_message;
4656 error_message <<
"The pointer tangent_direction_pt is null.\n";
4658 OOMPH_CURRENT_FUNCTION,
4659 OOMPH_EXCEPTION_LOCATION);
4666 if (tang_dir_size != spatial_dimension)
4668 std::ostringstream error_message;
4669 error_message <<
"The tangent direction vector has size "
4670 << tang_dir_size <<
"\n"
4671 <<
"but this element has spatial dimension "
4672 << spatial_dimension <<
".\n";
4674 OOMPH_CURRENT_FUNCTION,
4675 OOMPH_EXCEPTION_LOCATION);
4678 if (tang_dir_size == 2)
4680 std::ostringstream warning_message;
4682 <<
"The spatial dimension is " << spatial_dimension <<
".\n"
4683 <<
"I do not need a tangent direction vector to create \n"
4684 <<
"continuous tangent vectors in two spatial dimensions.";
4686 OOMPH_CURRENT_FUNCTION,
4687 OOMPH_EXCEPTION_LOCATION);
4726 const unsigned& ipt,
4753 #pragma clang diagnostic push
4754 #pragma clang diagnostic ignored "-Woverloaded-virtual"
4787 #pragma clang diagnostic pop
4805 unsigned& interior_direction)
const;
4889 unsigned n_node =
nnode();
4891 for (
unsigned l = 0; l < n_node; l++)
4896 unsigned Nadditional = nadditional_data_values[l];
4898 if ((Initial_Nvalue ==
Nbulk_value[l]) && (Nadditional > 0))
4907 void output_zeta(std::ostream& outfile,
const unsigned& nplot);
4927 const unsigned&
i)
const
5000 template<
class ELEMENT>
5015 template<
class ELEMENT>
5040 const unsigned&
i)
const
5048 outfile <<
"ZONE" << std::endl;
5049 unsigned nnod =
nnode();
5050 for (
unsigned j = 0; j < nnod; j++)
5053 unsigned dim = nod_pt->
ndim();
5054 for (
unsigned i = 0;
i <
dim;
i++)
5056 outfile << nod_pt->
x(
i) <<
" ";
5058 outfile << std::endl;
5063 void output(std::ostream& outfile,
const unsigned& n_plot)
5075 void output(FILE* file_pt,
const unsigned& n_plot)
5121 template<
class ELEMENT>
5160 const unsigned&
i)
const
5166 this->node_pt(n)->get_coordinates_on_boundary(
5257 const unsigned& which_one = 0) = 0;
5274 const char* location)
A class that contains the information required by Nodes that are located on Mesh boundaries....
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh....
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 ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
void set_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set a new timestepper by resizing the appropriate storage. If already assigned the equation numbering...
void initialise(const T &val)
Initialize all values in the matrix to val.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
DummyFaceElement()
Constructor.
void output(std::ostream &outfile)
Output nodal coordinates.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
void output(std::ostream &outfile, const unsigned &n_plot)
Output at n_plot points.
DummyFaceElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the face index.
void output(FILE *file_pt)
C-style output.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual void get_drag_and_torque(Vector< double > &drag_force, Vector< double > &drag_torque)=0
Function that specifies the drag force and the torque about the origin.
virtual ~ElementWithDragFunction()
Empty virtual destructor.
ElementWithDragFunction()
Empty constructor.
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
void interpolated_x(const Vector< double > &s, Vector< double > &x) const
Return FE interpolated position x[] at local coordinate s as Vector Overloaded to get information fro...
void turn_on_warning_for_discontinuous_tangent()
Turn on warning for when there may be discontinuous tangent vectors from continuous_tangent_and_outer...
unsigned & bulk_position_type(const unsigned &i)
Return the position type in the "bulk" element that corresponds to position type i on the FaceElement...
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....
unsigned nbulk_value(const unsigned &n) const
Return the number of values originally stored at local node n (before the FaceElement added additiona...
bool Boundary_number_in_bulk_mesh_has_been_set
Has the Boundary_number_in_bulk_mesh been set? Only included if compiled with PARANOID switched on.
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt() const
Return the pointer to the function that maps the face coordinate to the bulk coordinate (const versio...
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
CoordinateMappingFctPt & face_to_bulk_coordinate_fct_pt()
Return the pointer to the function that maps the face coordinate to the bulk 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.
const Vector< double > * tangent_direction_pt() const
Public access function for the tangent direction pointer.
int face_index() const
Index of the face (a number that uniquely identifies the face in the element) (const version)
BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt() const
Return the pointer to the function that returns the derivatives of the bulk coordinates wrt the face ...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
void turn_off_warning_for_discontinuous_tangent()
Turn off warning for when there may be discontinuous tangent vectors from continuous_tangent_and_oute...
int Face_index
Index of the face.
unsigned & nbulk_value(const unsigned &n)
Return the number of values originally stored at local node n (before the FaceElement added additiona...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
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.
FaceElement()
Constructor: Initialise all appropriate member data.
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Helper function adding additional values for the unknowns associated with the FaceElement....
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Typedef for the function that returns the partial derivative of the local coordinates in the bulk ele...
Vector< double > * Tangent_direction_pt
A general direction pointer for the tangent vectors. This is used in the function continuous_tangent_...
void interpolated_x(const unsigned &t, const Vector< double > &s, Vector< double > &x) const
Return FE interpolated position x[] at local coordinate s at previous timestep t as Vector (t=0: pres...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
const unsigned & boundary_number_in_bulk_mesh() const
Broken assignment operator.
int normal_sign() const
Return sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding ...
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...
void bulk_position_type_resize(const unsigned &i)
Resize the storage for bulk_position_type to i entries.
FiniteElement * bulk_element_pt() const
Pointer to higher-dimensional "bulk" element (const version)
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
Vector< unsigned > Bulk_position_type
Vector holding integers to translate additional position types to those of the "bulk" element; e....
static bool Ignore_discontinuous_tangent_warning
Ignores the warning when the tangent vectors from continuous_tangent_and_outer_unit_normal may not be...
void set_tangent_direction(Vector< double > *tangent_direction_pt)
Set the tangent direction vector.
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...
const unsigned & bulk_position_type(const unsigned &i) const
Return the position type in the "bulk" element that corresponds to the position type i on the FaceEle...
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Typedef for the function that translates the face coordinate to the coordinate in the bulk element.
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
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...
BulkCoordinateDerivativesFctPt & bulk_coordinate_derivatives_fct_pt()
Return the pointer to the function that returns the derivatives of the bulk coordinates wrt the face ...
Vector< unsigned > Nbulk_value
A vector that will hold the number of data values at the nodes that are associated with the "bulk" el...
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...
double interpolated_x(const unsigned &t, const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s at previous timestep t (t=0: present; t>...
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....
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...
const unsigned & bulk_node_number(const unsigned &n) const
Return the bulk node number that corresponds to the n-th local node number (const version)
CoordinateMappingFctPt Face_to_bulk_coordinate_fct_pt
Pointer to a function that translates the face coordinate to the coordinate in the bulk element.
int & normal_sign()
Sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding "bulk" ...
void output_zeta(std::ostream &outfile, const unsigned &nplot)
Output boundary coordinate zeta.
unsigned & bulk_node_number(const unsigned &n)
Return the bulk node number that corresponds to the n-th local node number.
void resize_nodes(Vector< unsigned > &nadditional_data_values)
Provide additional storage for a specified number of values at the nodes of the FaceElement....
void interpolated_dxdt(const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
Compte t-th time-derivative of the FE-interpolated Eulerian coordinate vector at local coordinate s....
FaceElement(const FaceElement &)=delete
Broken copy constructor.
virtual ~FaceElement()
Empty virtual destructor.
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 void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual void write_tecplot_zone_footer(FILE *file_pt, const unsigned &nplot) const
Add tecplot zone "footer" to C-style output. (when plotting nplot points in each "coordinate directio...
virtual void output(const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
Output the element data at time step t. This is const because it is newly added and so can be done ea...
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, const SolutionFunctorBase &exact_soln) const
Output a time-dependent exact solution over the element.
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....
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
virtual void update_before_nodal_fd()
Function that is called before the finite differencing of any nodal data. This may be overloaded to u...
virtual void identify_geometric_data(std::set< Data * > &geometric_data_pt)
The purpose of this function is to identify all Data objects that affect the elements' geometry....
void get_x(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Global coordinates as function of local coordinates at previous time "level" t (t=0: present; t>0: pr...
double 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...
double raw_dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of j-th time derivative of the generalised position, dx(k,i)/dt at local node n....
void dposition_dt(const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
Return the t-th time derivative of the parametrised position of the FiniteElement in its GeomObject i...
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
double dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Return the i-th component of j-th derivative of nodal position: d^jx/dt^j at node n.
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 output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
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)
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
double raw_nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n, at time level t (t=0: present; t>0: previous time level)....
void d_dshape_eulerian_dnodal_coordinates_templated_helper(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
Calculate the derivative w.r.t. the nodal coordinates of the derivative of the shape functions w....
Integral * Integral_pt
Pointer to the spatial integration scheme.
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output a time-dependent exact solution over the element.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
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 compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Given the exact solution this function calculates the norm of the error and that of the exact soluti...
double nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n, at time level t (t=0: present; t>0 previous timesteps)....
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...
virtual unsigned nvertex_node() const
Return the number of vertex nodes in this element. Broken virtual function in "pure" finite elements.
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....
virtual std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
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 void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Overloaded version of the calculation of the local equation numbers. If the boolean argument is true ...
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.
void point_output(std::ostream &outfile, const Vector< double > &s)
Output solution (as defined by point_output_data()) at local cordinates s.
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...
void set_dimension(const unsigned &dim)
Set the dimension of the element and initially set the dimension of the nodes to be the same as the d...
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 void disable_ALE()
This is an empty function that establishes a uniform interface for all (derived) elements that involv...
virtual double s_max() const
Max. value of local coordinate.
virtual ElementGeometry::ElementGeometry element_geometry() const
Return the geometry type of the element (either Q or T usually).
void face_node_number_error_check(const unsigned &i) const
Range check for face node numbers.
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
unsigned Nodal_dimension
The spatial dimension of the nodes in the element. We assume that nodes have the same spatial dimensi...
virtual void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Broken virtual. Needs to be implemented for each new geometric elem...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Plot the error when compared against a given time-dependent exact solution . Also calculates the norm...
double nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Return the generalised nodal position (type k, i-th variable) at previous timesteps at local node n.
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...
void transform_second_derivatives_template(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 coordinates to derivatives and second derivat...
void dJ_eulerian_dnodal_coordinates_templated_helper(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
Calculate the derivative of the jacobian of a mapping with respect to the nodal coordinates X_ij usin...
double dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of j-th time derivative of the generalised position, dx(k,i)/dt at local node n....
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
virtual void output(FILE *file_pt)
Output the element data — typically the values at the nodes in a format suitable for post-processing....
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Given the exact solution this function calculates the norm of the error and that of the exact soluti...
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual double compute_physical_size() const
Broken virtual function to compute the actual size (taking into account factors such as 2pi or radii ...
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.
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Plot the error when compared against a given time-dependent exact solution . Also calculates the norm...
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 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...
virtual Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element. Broken virtual function in "pure" finite elements.
virtual unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
Node ** Node_pt
Storage for pointers to the nodes in the element.
virtual void compute_abs_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
Plot the error when compared against a given exact solution . Also calculates the maximum absolute er...
double raw_dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Return the i-th component of j-th derivative of nodal position: d^jx/dt^j at node n....
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.
virtual void point_output_data(const Vector< double > &s, Vector< double > &data)
Virtual function to write the double precision numbers that appear in a single line of output into th...
unsigned Nnodal_position_type
The number of coordinate types required to interpolate the element's geometry between the nodes....
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...
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
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...
virtual void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative....
unsigned Elemental_dimension
The spatial dimension of the element, i.e. the number of local coordinates used to parametrize it.
Node *const & node_pt(const unsigned &n) const
Return a pointer to the local node n (const version)
void transform_second_derivatives_diagonal(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 coordinates to derivatives and second derivat...
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.
Data * geom_data_pt(const unsigned &j)
A standard FiniteElement is fixed, so there are no geometric data when viewed in its GeomObject incar...
double raw_nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n, at time level t (t=0: present; t>0 previous timesteps),...
FiniteElement(const FiniteElement &)=delete
Broken copy constructor.
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot. Broken virtual; can b...
virtual 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...
void set_n_node(const unsigned &n)
Set the number of nodes in the element to n, by resizing the storage for pointers to the Node objects...
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.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
void integrate_fct(FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
Evaluate integral of a Vector-valued function over the element.
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. Do not use the hanging node repre...
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 Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n, including storage for history values required by timestepper,...
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...
double raw_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 void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
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...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
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 get_x_from_macro_element(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Global coordinates as function of local coordinates at previous time "level" t (t=0: present; t>0: pr...
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"...
virtual void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
unsigned Nnode
Number of nodes in the element.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Paraview output – this outputs the coordinates at the plot points (for parameter nplot) to specified ...
static const unsigned N2deriv[]
Static array that holds the number of second derivatives as a function of the dimension of the elemen...
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its GeomObject incarnation: r(zeta)....
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 .
double raw_nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Return the generalised nodal position (type k, i-th variable) at previous timesteps at local node n....
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 ...
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
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 output(FILE *file_pt, const unsigned &n_plot)
Output the element data — pass (some measure of) the number of plot points per element (C style outpu...
FiniteElement()
Constructor.
unsigned ngeom_data() const
A standard FiniteElement is fixed, so there are no geometric data when viewed in its GeomObject incar...
virtual Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n, including storage for history values required by timestepper,...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
double nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n, at time level t (t=0: present; t>0: previous time level) ...
static bool Suppress_output_while_checking_for_inverted_elements
Static boolean to suppress output while checking for inverted elements.
double invert_jacobian(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Take the matrix passed as jacobian and return its inverse in inverse_jacobian. This function is templ...
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 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 void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Broken virtual. Needs to be implemented for each ne...
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...
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
void fill_in_jacobian_from_nodal_by_fd(DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the nodal degrees of freedom using finite difference...
virtual void output(std::ostream &outfile, const unsigned &n_plot)
Output the element data — pass (some measure of) the number of plot points per element.
virtual void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Broken virtual. Needs to be implemented for each ne...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
const unsigned & boundary_number_in_bulk_mesh() const
Access function for the boundary number in bulk mesh.
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
FreeStandingFaceElement()
Constructor.
bool Boundary_number_in_bulk_mesh_has_been_set
Has the Boundary_number_in_bulk_mesh been set? Only included if compiled with PARANOID switched on.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
A Generalised Element class.
void set_nonhalo()
Label the element as not being a halo.
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 unsigned ndof_types() const
The number of types of degrees of freedom in this element are sub-divided into.
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...
bool Must_be_kept_as_halo
Does this element need to be kept as a halo element during a distribute?
void dof_vector(const unsigned &t, Vector< double > &dof)
Return the vector of dof values at time level t.
virtual void get_inner_products(Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
Return the vector of inner product of the given pairs of history values.
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.
void set_internal_data_time_stepper(const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the i-th internal data object.
void operator=(const GeneralisedElement &)=delete
Broken assignment operator.
static bool Suppress_warning_about_repeated_external_data
Static boolean to suppress warnings about repeated external data. Defaults to true.
virtual void get_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Calculate the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenv...
Data *const & internal_data_pt(const unsigned &i) const
Return a pointer to i-th internal data object (const version)
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 get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for the unknowns that this element is "in charge of" – ignore any unknowns ass...
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...
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 fill_in_jacobian_from_internal_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the elemental contribution to the residuals vector. Note that this function will NOT initialise t...
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...
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....
void exclude_internal_data_fd(const unsigned &i)
Set the boolean flag to exclude the internal datum from the finite difference loop when computing the...
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....
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
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.
void fill_in_jacobian_from_external_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
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...
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
Data *const & external_data_pt(const unsigned &i) const
Return a pointer to i-th external data object (const version)
virtual void get_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Calculate the residuals and the elemental "mass" matrix, the matrix that multiplies the time derivati...
void unset_must_be_kept_as_halo()
Do not insist that this element be kept as a halo element during distribution.
virtual void get_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Calculate the derivatives of the residuals with respect to a parameter.
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 void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
unsigned ninternal_data() const
Return the number of internal data objects.
bool must_be_kept_as_halo() const
Test whether the element must be kept as a halo element.
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)
void include_internal_data_fd(const unsigned &i)
Set the boolean flag to include the internal datum in the finite difference loop when computing the j...
void dof_pt_vector(Vector< double * > &dof_pt)
Return the vector of pointers to dof values.
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 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 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 ...
virtual void get_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
Compute the vectors that when taken as a dot product with other history values give the inner product...
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 get_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Calculate the derivatives of the elemental Jacobian matrix mass matrix and residuals with respect to ...
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...
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...
void set_must_be_kept_as_halo()
Insist that this element be kept as a halo element during a distribute?
virtual unsigned self_test()
Self-test: Have all internal values been classified as pinned/unpinned? Return 0 if OK.
virtual void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
virtual void get_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Calculate the derivatives of the elemental Jacobian matrix and residuals with respect to a parameter.
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,...
void include_external_data_fd(const unsigned &i)
Set the boolean flag to include the external datum in the the finite difference loop when computing t...
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.
virtual void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Calculate the residuals and jacobian and elemental "mass" matrix, the matrix that multiplies the time...
virtual void compute_norm(Vector< double > &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever n...
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.
virtual void complete_setup_of_dependencies()
Complete the setup of any additional dependencies that the element may have. Empty virtual function t...
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever n...
GeneralisedElement() GeneralisedElement(const GeneralisedElement &)=delete
Constructor: Initialise all pointers and all values to zero.
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....
void exclude_external_data_fd(const unsigned &i)
Set the boolean flag to exclude the external datum from the the finite difference loop when computing...
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....
/////////////////////////////////////////////////////////////////////
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Generic class for numerical integration schemes:
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
InvertedElementError(const std::string &error_description, const std::string &function_name, const char *location)
Base class for MacroElement s that are used during mesh refinement in domains with curvlinear and/or ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void operator=(const NavierStokesElementWithDiagonalMassMatrices &)=delete
Broken assignment operator.
virtual void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)=0
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
virtual ~NavierStokesElementWithDiagonalMassMatrices()
Virtual destructor.
NavierStokesElementWithDiagonalMassMatrices(const NavierStokesElementWithDiagonalMassMatrices &)=delete
Broken copy constructor.
NavierStokesElementWithDiagonalMassMatrices()
Empty constructor.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double dx_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
double & x(const unsigned &i)
Return the i-th nodal coordinate.
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
void position(Vector< double > &pos) const
Compute Vector of nodal positions either directly or via hanging node representation.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
double position_gen(const unsigned &k, const unsigned &i) const
Return generalised nodal coordinate either directly or via hanging node representation.
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Return the vector of the k-th generalised boundary coordinates on mesh boundary b....
double raw_value(const unsigned &i) const
Return the i-th value stored at the Node. This interface does NOT take the hanging status of the Node...
double dposition_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt, either directly or via hanging node representatio...
double dx_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt.
void resize(const unsigned &n_value)
Resize the number of equations.
double dposition_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
PointElement()
Constructor.
void shape(const Vector< double > &s, Shape &psi) const
Broken assignment operator.
PointElement(const PointElement &)=delete
Broken copy constructor.
static PointIntegral Default_integration_scheme
Return spatial dimension of element (=number of local coordinates needed to parametrise the element)
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
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...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
SolidElementWithDiagonalMassMatrix()
Empty constructor.
void operator=(const SolidElementWithDiagonalMassMatrix &)=delete
Broken assignment operator.
SolidElementWithDiagonalMassMatrix(const SolidElementWithDiagonalMassMatrix &)=delete
Broken copy constructor.
virtual void get_mass_matrix_diagonal(Vector< double > &mass_diag)=0
Get the diagonal of whatever represents the mass matrix in the specific preconditionable element....
virtual ~SolidElementWithDiagonalMassMatrix()
Virtual destructor.
SolidFaceElements combine FaceElements and SolidFiniteElements and overload various functions so they...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s. Overloaded from SolidF...
void interpolated_xi(const Vector< double > &s, Vector< double > &xi) const
Compute FE interpolated Lagrangian coordinate vector xi[] at local coordinate s as Vector....
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned lagrangian_dimension() const
Return the number of Lagrangian coordinates that the element requires at all nodes....
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
Set pointers to "current" and "undeformed" MacroElements. Can be overloaded in derived classes to per...
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to MacroElement – overloads generic version and uses the MacroElement also as the default...
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
void set_undeformed_macro_elem_pt(MacroElement *undeformed_macro_elem_pt)
Set pointer to "undeformed" macro element. Can be overloaded in derived classes to perform additional...
Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to it.
void disable_solve_for_consistent_newmark_accel()
Set to reset the problem being solved to be the standard problem.
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(* MultiplierFctPt)(const Vector< double > &xi)
Pointer to function that computes the "multiplier" for the inertia terms in the consistent determinat...
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....
MacroElement * undeformed_macro_elem_pt()
Access function to pointer to "undeformed" macro element.
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on. (Redirects to the nodes' pos...
virtual void get_x_and_xi(const Vector< double > &s, Vector< double > &x_fe, Vector< double > &x, Vector< double > &xi_fe, Vector< double > &xi) const
Eulerian and Lagrangian coordinates as function of the local coordinates: The Eulerian position is re...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Overload the fill_in_contribution_to_jacobian() function to use finite differences to calculate the s...
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...
void fill_in_jacobian_from_solid_position_by_fd(DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions.
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....
double raw_lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n without using the hanging representation.
unsigned nnodal_lagrangian_type() const
Return the number of types of (generalised) nodal Lagrangian coordinates required to interpolate the ...
void enable_solve_for_consistent_newmark_accel()
Set to alter the problem being solved when assigning the initial conditions for time-dependent proble...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a SolidFiniteElement, the "global" intrinsic coordinate of the element when viewed as part of a co...
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...
MacroElement * Undeformed_macro_elem_pt
Pointer to the element's "undeformed" macro element (NULL by default)
MultiplierFctPt & multiplier_fct_pt()
Access function: Pointer to multiplicator function for assignment of consistent assignement of initia...
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
void fill_in_residuals_for_solid_ic(Vector< double > &residuals)
Fill in the residuals for the setup of an initial condition. The global equations are:
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 void J_lagrangian(const Vector< double > &s) const
Return the Jacobian of mapping from local to Lagrangian coordinates at local position s....
unsigned ngeom_data() const
Broken assignment operator.
void set_nnodal_lagrangian_type(const unsigned &nlagrangian_type)
Set the number of types required to interpolate the Lagrangian coordinates.
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...
unsigned Nnodal_lagrangian_type
The number of coordinate types requried to intepolate the Lagrangian coordinates in the element....
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 get_residuals_for_solid_ic(Vector< double > &residuals)
Compute the residuals for the setup of an initial condition. The global equations are:
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.
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n and return a pointer to it, in the case when the node MAY be located on a ...
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Specify Data that affects the geometry of the element by adding the position Data to the set that's p...
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....
SolidFiniteElement()
Constructor: Set defaults.
virtual bool has_internal_solid_data()
Return whether there is internal solid data (e.g. discontinuous solid pressure). At present,...
void fill_in_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and Jacobian for the setup of an initial condition. The global equations are:
double multiplier(const Vector< double > &xi)
Access to the "multiplier" for the inertia terms in the consistent determination of the initial condi...
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Overload assign_all_generic_local_equation numbers to include the data associated with solid dofs....
SolidInitialCondition *& solid_ic_pt()
Pointer to object that describes the initial condition.
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....
Node * construct_boundary_node(const unsigned &n)
Construct the local node n and return a pointer to it. in the case when it is a boundary node; that i...
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...
virtual double J_lagrangian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to Lagrangian coordinates at the ipt-th integration poi...
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 ...
SolidFiniteElement(const SolidFiniteElement &)=delete
Broken copy constructor.
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n and return a pointer to it. Additionally, create storage for ‘history’ val...
MultiplierFctPt Multiplier_fct_pt
Pointer to function that computes the "multiplier" for the inertia terms in the consistent determinat...
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...
double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to lagrangian coordinates, given the derivatives of the shape functi...
virtual void reset_after_solid_position_fd()
Function that is call after the finite differencing of the solid position data. This may be overloade...
void set_lagrangian_dimension(const unsigned &lagrangian_dimension)
Set the lagrangian dimension of the element — the number of lagrangian coordinates stored at the node...
MultiplierFctPt multiplier_fct_pt() const
Access function: Pointer to multiplicator function for assignment of consistent assignement of initia...
A class to specify the initial conditions for a solid body. Solid bodies are often discretised with H...
GeomObject *& geom_object_pt()
(Reference to) pointer to geom object that specifies the initial condition
unsigned IC_time_deriv
Which time derivative (0,1,2) are we currently assigning.
GeomObject * Geom_object_pt
Pointer to the GeomObject that specifies the initial condition (shape, veloc and accel)
void operator=(const SolidInitialCondition &)=delete
Broken assignment operator.
SolidInitialCondition(GeomObject *geom_object_pt)
Constructor: Pass geometric object; initialise time deriv to 0.
SolidInitialCondition(const SolidInitialCondition &)=delete
Broken copy constructor.
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Function base class for exact solutions/initial conditions/boundary conditions. This is needed so tha...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
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....
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types).
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Typedef for the function that returns the partial derivative of the local coordinates in the bulk ele...
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Typedef for the function that translates the face coordinate to the coordinate in the bulk element.